Skip to content
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

(MODULES-8045) Fix apt-get upgrading everything when no version passed and apt is package manager. #92

Merged
merged 1 commit into from
Oct 4, 2018

Conversation

eoinmcq
Copy link
Contributor

@eoinmcq eoinmcq commented Oct 3, 2018

Problem
https://tickets.puppetlabs.com/browse/MODULES-8045
When using apt the current linux package updates all packages instead of the requested package when no version is specified. This is due to "upgrade" being used as the action. This will upgrade everything.

Solution
When updating a specific package using apt the 'install' argument should be used. This will update the package if it exists, or install it if it doesn't.

Testing

  • ad-hoc jenkins pipeline job ran and passed successfully
  • manually tested upgrade with the following permutations:
    • upgrade version with no arguments on yum and apt - latest version installed.
    • upgrade version with arguments on yum and apt - the version which was requested was installed.

Copy link
Contributor

@MikaelSmith MikaelSmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DI-3391 doesn't seem related to this. Also, can we make sure a public ticket is linked to it?

I'm also not immediately sure what the issue was or why this fixes it. Please provide a more detailed commit message.

@davejohnston davejohnston changed the title (DI-3391) Fix apt-get upgrading everything. (DI-2373) Fix apt-get upgrading everything. Oct 3, 2018
@eoinmcq
Copy link
Contributor Author

eoinmcq commented Oct 4, 2018

@MikaelSmith this PR was just raised to show someone an issue It is not a complete fix.

I made a mistake with the issue number in the commit message and will address.

@eoinmcq eoinmcq changed the title (DI-2373) Fix apt-get upgrading everything. (DI-3397) Fix apt-get upgrading everything. Oct 4, 2018
@eoinmcq eoinmcq force-pushed the DI-3397/FixAptGetUpgrade branch 3 times, most recently from f06074b to e17a073 Compare October 4, 2018 10:13
@eoinmcq eoinmcq requested a review from tphoney October 4, 2018 10:52
@eoinmcq eoinmcq changed the title (DI-3397) Fix apt-get upgrading everything. (MODULES-8045) Fix apt-get upgrading everything when no version passed and apt is package manager. Oct 4, 2018
Copy link

@davejohnston davejohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eoinmcq eoinmcq removed the DONOTMERGE label Oct 4, 2018
@eoinmcq
Copy link
Contributor Author

eoinmcq commented Oct 4, 2018

@MikaelSmith I have raised a modules ticket and put more detail in with what the issue was.

tasks/linux.sh Outdated
@@ -28,16 +28,19 @@ do
if [ "${version}" != "" ]; then
name="$name-$version"
fi
# upgrading to a specific version needs to use the install action
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs indented correctly

@tphoney tphoney merged commit 1e36658 into master Oct 4, 2018
@tphoney
Copy link
Contributor

tphoney commented Oct 4, 2018

great work @eoinmcq 👍

@david22swan david22swan deleted the DI-3397/FixAptGetUpgrade branch April 5, 2019 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants