habitat icon indicating copy to clipboard operation
habitat copied to clipboard

`hab pkg install` doesn't write/run install hooks to /hab/svc if /hab/pkgs already populated

Open themightychris opened this issue 3 years ago • 1 comments

In CI and test environments, it can be helpful to persist /hab/pkgs but not /hab/svc, which seems to be in the spirit of Habitat's architecture -- /hab/pkgs is immutable and /hab/svc is instance state

However, there does not seem to be any way to get hab pkg install to regenerate install hooks under /hab/svc if a package already exists under /hab/pkgs but /hab/svc is starting fresh. The package must be fully uninstalled and then reinstalled to get the install hooks to exist and be run. In this way, /hab/pkgs is being used to indicate the state of an instance which feels like a violation of Habitat's guarantees.

Instead of existence of /hab/pkgs content for a package being the signal for whether a package has already been installed and needs its install hook ran, perhaps the rendered install hook under /hab/svc should be used instead. The expected behavior would be that every time hab pkg install is run, if the rendered install hook doesn't exist under /hab/svc it gets rendered and executed.

themightychris avatar Jun 17 '21 14:06 themightychris

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

stale[bot] avatar Jun 18 '22 21:06 stale[bot]