Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

pkg install honors versions when checking for conflicts#669

Merged
shomron merged 1 commit intoksonnet:masterfrom
shomron:install-multi-version
Jun 28, 2018
Merged

pkg install honors versions when checking for conflicts#669
shomron merged 1 commit intoksonnet:masterfrom
shomron:install-multi-version

Conversation

@shomron
Copy link
Collaborator

@shomron shomron commented Jun 28, 2018

This commit allows installing a package when a different version is
already installed. Currently, if the package is installed globally (the
only option) - it will overwrite the previous version reference.
A followup change will allow installing into environments to work around
this limitation.

Part of #660

Also:

  • Add PackageManager.IsInstalled - fuzzy-match installation check for packages, without parsing their manifests

Signed-off-by: Oren Shomron shomron@gmail.com

@shomron
Copy link
Collaborator Author

shomron commented Jun 28, 2018

Exercising the change:

ks init multi && cd multi

ks --verbose=5 pkg install incubator/mysql
grep -A4 libraries app.yaml
tree vendor

ks --verbose=5 registry set incubator --uri https://github.com/shomron/parts/tree/nested-registry/nested/registry/incubator

# Overwrites global reference, installs new version
ks --verbose=5 pkg install incubator/mysql
grep -A4 libraries app.yaml
tree vendor

# Same version, show conflict
ks --verbose=5 pkg install incubator/mysql

@shomron shomron requested a review from bryanl June 28, 2018 16:04
@coveralls
Copy link

coveralls commented Jun 28, 2018

Pull Request Test Coverage Report for Build 1082

  • 63 of 86 (73.26%) changed or added relevant lines in 3 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.009%) to 70.736%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/registry/cache.go 11 18 61.11%
pkg/registry/package_manager.go 45 61 73.77%
Files with Coverage Reduction New Missed Lines %
pkg/actions/pkg_install.go 2 66.67%
pkg/registry/cache.go 2 71.43%
Totals Coverage Status
Change from base Build 1075: 0.009%
Covered Lines: 10858
Relevant Lines: 15350

💛 - Coveralls

Copy link
Member

@bryanl bryanl left a comment

Choose a reason for hiding this comment

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

Could you removed the commented code if it isn't being used?

a.On("UpdateLib", lib.Name, lib).Return(nil)

var checker installedChecker
// checker.On("IsInstalled", pkg.Descriptor{
Copy link
Member

Choose a reason for hiding this comment

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

Is this coming back in the future, or should it be deleted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The test may become more elaborate in the future - for now I'll take these out. 👍

@bryanl
Copy link
Member

bryanl commented Jun 28, 2018

Will approve after the unused code is deleted.

This commit allows installing a package when a different version is
already installed. Currently, if the package is installed globally (the
only option) - it will overwrite the previous version reference.
A followup change will allow installing into environments to work around
this limitation.

Part of ksonnet#660

Also:

* Add PackageManager.IsInstalled - fuzzy-match installation check for packages, without parsing their manifests

Signed-off-by: Oren Shomron <shomron@gmail.com>
@shomron shomron force-pushed the install-multi-version branch from 0086c51 to d713640 Compare June 28, 2018 18:46
@shomron
Copy link
Collaborator Author

shomron commented Jun 28, 2018

Removed unused code.

@shomron shomron merged commit 4fe1085 into ksonnet:master Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants