-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package: add :upgrade action #337
base: master
Are you sure you want to change the base?
Conversation
Since there is no generic way of checking whether there is a new version of a given package, the upgrade action just installs the package unconditionally, assuming that the package installation command will install a newer version if it's available (that's the case for e.g. apt-get). Since it's only possible to check whether there was any version change _after_ the action, show_differences needs to be called explicitly when the package version changes for us to get some feedback in the logs.
First, thank you for your pull request. I'm still not sure why this is necessary. For example, If you need to install newer package, you can specify the "version" attribute to the package resource I think. Could you give us a more detailed use case? |
I maintain a platform of 30+ machines, which I'm migrating from chef to itamae. There are 3 packages that are developed for that platform, of which we always want the latest version. Today, those packages are uploaded to repositories that are configured in the machines, and in |
Also, if I add new machines to the platform, using |
On the other hand, I understand your reluctance since my implementation violates a few principles of the itamae design, such as knowing what would happen without doing anything (e.g. --dry-run) |
I understood. In that case, it's useful. And hard to write a spec. (I can't find a way to mock the behavior of the package manager.) I want your opinion @sue445 . I basically agree with this. |
me too. @terceiro Please add test code for this new feature. |
Since there is no generic way of checking whether there is a new version
of a given package, the upgrade action just installs the package
unconditionally, assuming that the package installation command will
install a newer version if it's available (that's the case for e.g.
apt-get).
Since it's only possible to check whether there was any version change
after the action, show_differences needs to be called explicitly when
the package version changes for us to get some feedback in the logs.