Skip to content

Run preinstall.sh and postinstall when upgrading via apk#1244

Merged
sean-breen merged 5 commits intomainfrom
alpine-upgrade
Sep 12, 2025
Merged

Run preinstall.sh and postinstall when upgrading via apk#1244
sean-breen merged 5 commits intomainfrom
alpine-upgrade

Conversation

@sean-breen
Copy link
Contributor

@sean-breen sean-breen commented Sep 2, 2025

Proposed changes

In Alpine Linux, the preinstall and postinstall scripts will not be executed during an upgrade scenario. This adds the missing scripts to be executed during the apk upgrade which will handle config migration if coming from an agent version less than 3.*.

Also removes the postupgrade.sh script, as the agent restart is being handled by the postinstall.sh

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@sean-breen sean-breen requested a review from a team as a code owner September 2, 2025 13:03
@dhurley
Copy link
Collaborator

dhurley commented Sep 3, 2025

You need to update the .nfpm.yaml file in the root directory as well.

@dhurley dhurley added the v3.x Issues and Pull Requests related to the major version v3 label Sep 9, 2025
@sean-breen sean-breen merged commit b06c66b into main Sep 12, 2025
52 of 62 checks passed
@sean-breen sean-breen deleted the alpine-upgrade branch September 12, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3.x Issues and Pull Requests related to the major version v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants