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

List environment-scoped packages in addition to globally-scoped packages#727

Merged
shomron merged 1 commit intoksonnet:masterfrom
shomron:626-pkg-list-versions
Jul 13, 2018
Merged

List environment-scoped packages in addition to globally-scoped packages#727
shomron merged 1 commit intoksonnet:masterfrom
shomron:626-pkg-list-versions

Conversation

@shomron
Copy link
Collaborator

@shomron shomron commented Jul 11, 2018

Part of #626

  • Add RemotePackages method to package manager
  • pkg list uses PackageManger rather than App
  • Packages from GitHub registry inherit version from the registry,
    rather than that specified in registry.yaml.
  • Rename registry.LibaryConfig -> LibraryConfig

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

Exercising the feature

ksdev init 626-pkg-list && cd 626-pkg-list

# Show remote packages
ksdev pkg list

# Install environment-scoped package
ksdev env add stage
ksdev pkg install --env stage incubator/nginx@58ea0ff91474d488ea50829042b45fe962bd2fa3

# Environment-scoped package is listed:
ksdev pkg install --env stage incubator/nginx@58ea0ff91474d488ea50829042b45fe962bd2fa3

...

incubator nginx     40285d8a14f1ac5787e405e1023cf0c07f6aa28c
incubator nginx     58ea0ff91474d488ea50829042b45fe962bd2fa3 *
...

# Install different version in global scope
ksdev pkg install incubator/nginx

# Both versions (one global, one environment scoped) are listed
ksdev pkg list --installed

...
incubator nginx     40285d8a14f1ac5787e405e1023cf0c07f6aa28c *
incubator nginx     58ea0ff91474d488ea50829042b45fe962bd2fa3 *
...

# Upgrade env-scoped package so both match
# NOTE `ksdev pkg install incubator/nginx` fails due to faulty collision logic!
sed -i -e 's/58ea0ff91474d488ea50829042b45fe962bd2fa3/40285d8a14f1ac5787e405e1023cf0c07f6aa28c/' app.yaml

# Show that only a single instance of this version is listed
ksdev pkg list | grep nginx

...
incubator nginx     40285d8a14f1ac5787e405e1023cf0c07f6aa28c *
...

@shomron shomron requested a review from a team July 11, 2018 23:21
@coveralls
Copy link

coveralls commented Jul 11, 2018

Pull Request Test Coverage Report for Build 1193

  • 61 of 98 (62.24%) changed or added relevant lines in 6 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.06%) to 71.244%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/actions/pkg_list.go 20 22 90.91%
pkg/pkg/pkg.go 0 3 0.0%
pkg/registry/github.go 7 10 70.0%
pkg/registry/package_manager.go 32 61 52.46%
Files with Coverage Reduction New Missed Lines %
pkg/pkg/pkg.go 1 51.92%
pkg/actions/pkg_list.go 2 82.89%
Totals Coverage Status
Change from base Build 1191: -0.06%
Covered Lines: 11887
Relevant Lines: 16685

💛 - Coveralls

Part of ksonnet#626

* Add RemotePackages method to package manager
* pkg list uses PackageManger rather than App
* Packages from GitHub registry inherit version from the registry,
  rather than that specified in registry.yaml.
* Rename registry.LibaryConfig -> LibraryConfig

Signed-off-by: Oren Shomron <shomron@gmail.com>
@shomron shomron force-pushed the 626-pkg-list-versions branch from 1d58288 to a6d9a03 Compare July 13, 2018 03:50
@shomron shomron merged commit 4b1939e into ksonnet:master Jul 13, 2018
@shomron shomron deleted the 626-pkg-list-versions branch July 13, 2018 03:54
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