Skip to content

OPERATOR-240 Unable to set image urls when using operator in air gapped environment#319

Merged
haibinxie merged 2 commits intolibopenstorage:masterfrom
haibinxie:op240-imageparser-3
May 27, 2021
Merged

OPERATOR-240 Unable to set image urls when using operator in air gapped environment#319
haibinxie merged 2 commits intolibopenstorage:masterfrom
haibinxie:op240-imageparser-3

Conversation

@haibinxie
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
https://portworx.atlassian.net/browse/OPERATOR-240

Which issue(s) this PR fixes (optional)
Closes #

Special notes for your reviewer:

@haibinxie haibinxie requested review from a team and piyush-nimbalkar May 21, 2021 01:22
@haibinxie haibinxie force-pushed the op240-imageparser-3 branch 2 times, most recently from d08bf2d to 79fbee5 Compare May 21, 2021 01:35
@codecov
Copy link
Copy Markdown

codecov bot commented May 21, 2021

Codecov Report

Merging #319 (3660f68) into master (20a5f49) will decrease coverage by 0.00%.
The diff coverage is 94.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #319      +/-   ##
==========================================
- Coverage   85.24%   85.23%   -0.01%     
==========================================
  Files          44       44              
  Lines        9353     9361       +8     
==========================================
+ Hits         7973     7979       +6     
- Misses        983      984       +1     
- Partials      397      398       +1     
Impacted Files Coverage Δ
pkg/util/util.go 47.77% <80.00%> (+3.33%) ⬆️
drivers/storage/portworx/component/autopilot.go 92.69% <100.00%> (ø)
drivers/storage/portworx/component/csi.go 92.60% <100.00%> (ø)
drivers/storage/portworx/component/lighthouse.go 92.81% <100.00%> (-0.03%) ⬇️
drivers/storage/portworx/component/portworx_api.go 92.20% <100.00%> (ø)
...ivers/storage/portworx/component/portworx_proxy.go 80.64% <100.00%> (ø)
drivers/storage/portworx/component/prometheus.go 85.78% <100.00%> (ø)
...rivers/storage/portworx/component/pvccontroller.go 94.13% <100.00%> (ø)
drivers/storage/portworx/deployment.go 93.98% <100.00%> (ø)
drivers/storage/portworx/uninstall.go 93.87% <100.00%> (ø)
... and 1 more

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 20a5f49...3660f68. Read the comment docs.

@github-actions
Copy link
Copy Markdown

This PR is stale because it has been in review for 3 days with no activity.

require.Equal(t, "registry.io/k8s.gcr.io/pause:3.1", out)

out = GetImageURN("registry.io//", "k8s.gcr.io/pause:3.1")
require.Equal(t, "registry.io/pause:3.1", out)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this have been registry.io/k8s.gcr.io/pause as common registries now only has gcr.io?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

With double slashes as suffix in customRegistry (registry.io//), it always replace the rep, it does not look at common registries, this was old behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh right, I forgot that part.

pkg/util/util.go Outdated
)

// UpdateCommonRegistries add additional registries to common registries.
func UpdateCommonRegistries(additionalRegistries []string) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This function will eventually forget about the original common registries and keep on adding to the list.

I think we should avoid saving such a list in utils package in a variable. It is error prone to keep such a singleton util.
I would suggest that in the GetImageURN function we can just pass the list of additional registries (or the whole cluster object and then get the annotation) and replace the common registry if present in the additional list on top of the common registries.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, I can make it as another parameter of GetImageURN

@haibinxie haibinxie force-pushed the op240-imageparser-3 branch from 5a772ce to bb0b1cc Compare May 26, 2021 20:32
@haibinxie
Copy link
Copy Markdown
Contributor Author

@piyush-nimbalkar I resolved your comments.

require.Equal(t, "registry.io/pause:3.1", out)

// Update it again, now k8s.gcr.io should be deleted from common registries.
out = getImageURN("gcr.io", "registry.io", "k8s.gcr.io/pause:3.1")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add a test for comma-separated multiple registries?

pkg/util/util.go Outdated
}
)

// UpdateCommonRegistries add additional registries to common registries.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Update the comment

@haibinxie haibinxie merged commit 38e8127 into libopenstorage:master May 27, 2021
@haibinxie
Copy link
Copy Markdown
Contributor Author

@piyush-nimbalkar I resolved your last comments and merged the PR.

haibinxie added a commit that referenced this pull request May 27, 2021
…r in air gapped environment (#319)

* OPERATOR-240 [Mastercard] Unable to set image urls when using operator in air gapped environment

* resolve comment
adityadani pushed a commit to adityadani/operator that referenced this pull request Sep 3, 2021
…r in air gapped environment (libopenstorage#319)

* OPERATOR-240 [Mastercard] Unable to set image urls when using operator in air gapped environment

* resolve comment
@piyush-nimbalkar piyush-nimbalkar changed the title OPERATOR-240 [Mastercard] Unable to set image urls when using operator in air gapped environment OPERATOR-240 Unable to set image urls when using operator in air gapped environment Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants