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

Refactor image client to not be E2E specific #1057

Merged
merged 1 commit into from
Dec 19, 2019

Conversation

zubron
Copy link
Contributor

@zubron zubron commented Dec 19, 2019

What this PR does / why we need it:
The existing client for handling plugin images assumed that the images
were for the e2e plugin. We are trying to add support for other images
so we need to make the image client more generic. This change refactors
the image client to deal with image names rather than the internal
Kubernetes image Config type.

Signed-off-by: Bridget McErlean bmcerlean@vmware.com

Which issue(s) this PR fixes

Special notes for your reviewer:
Creating this as a Draft PR for now to check coverage/tests

@zubron zubron force-pushed the make-image-client-generic-1028 branch from 29e694f to d1ee549 Compare December 19, 2019 13:06
@codecov-io
Copy link

codecov-io commented Dec 19, 2019

Codecov Report

Merging #1057 into master will increase coverage by 1.7%.
The diff coverage is 40.54%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1057     +/-   ##
=========================================
+ Coverage   48.16%   49.86%   +1.7%     
=========================================
  Files          78       78             
  Lines        5633     5613     -20     
=========================================
+ Hits         2713     2799     +86     
+ Misses       2762     2649    -113     
- Partials      158      165      +7
Impacted Files Coverage Δ
cmd/sonobuoy/app/images.go 32.02% <31.25%> (+6.88%) ⬆️
pkg/image/manifest.go 68.88% <52.94%> (+29.6%) ⬆️
pkg/image/image.go 76.59% <84.21%> (ø) ⬆️
cmd/sonobuoy/app/status.go 57.54% <0%> (-1.89%) ⬇️
pkg/image/v1.17.go 100% <0%> (+100%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f6547e...9520411. Read the comment docs.

@zubron zubron force-pushed the make-image-client-generic-1028 branch 4 times, most recently from 0a01f5d to fcd1f01 Compare December 19, 2019 16:09
@zubron zubron marked this pull request as ready for review December 19, 2019 16:11
AddE2ERegistryConfigFlag(&flags.e2eRegistryConfig, pushCmd.Flags())
AddKubeconfigFlag(&flags.kubeconfig, pushCmd.Flags())
AddPluginFlag(&flags.plugin, pushCmd.Flags())
// TODO(bridget): This won't be required when dealing with other plugins
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets make a follow up issue for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created #1059.

The existing client for handling plugin images assumed that the images
were for the e2e plugin. We are trying to add support for other images
so we need to make the image client more generic. This change refactors
the image client to deal with image names rather than the internal
Kubernetes image `Config` type.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
@zubron zubron force-pushed the make-image-client-generic-1028 branch from fcd1f01 to 9520411 Compare December 19, 2019 17:22
@@ -89,12 +89,12 @@ func NewRegistryList(repoConfig, k8sVersion string) (*RegistryList, error) {

fileContent, err := ioutil.ReadFile(repoConfig)
if err != nil {
panic(fmt.Errorf("Error reading '%v' file contents: %v", repoConfig, err))
return nil, fmt.Errorf("Error reading '%v' file contents: %v", repoConfig, err)
Copy link
Contributor

@johnSchnake johnSchnake Dec 19, 2019

Choose a reason for hiding this comment

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

👍

@zubron zubron merged commit 78b256d into vmware-tanzu:master Dec 19, 2019
@zubron zubron deleted the make-image-client-generic-1028 branch December 19, 2019 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants