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
Update e2e test images url #103724
Update e2e test images url #103724
Conversation
/cc @spiffxp |
@claudiubelu this needs a release note, which I don't have the bandwidth to draft today... If I knew the answer to this before, it's been paged out of my brain, and I'll need time to page back in... what are the implications for people who are used to mirroring/air-gapping /cc @wilsonehusin @dims |
@spiffxp for the air gapped scenarios that i have seen, folks just throw all the necessary images in the same bucket, it's us who have them in different buckets :) |
/retest |
/test pull-kubernetes-integration |
As far as an airgap use case for, say, Sonobuoy, this should be Ok as long as e2e test binary returns the proper repo when queried . |
/test pull-kubernetes-integration |
@@ -12,7 +12,8 @@ spec: | |||
spec: | |||
containers: | |||
- name: netexec | |||
image: gcr.io/kubernetes-e2e-test-images/netexec:1.0 | |||
image: k8s.gcr.io/e2e-test-images/agnhost:2.32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file even used anymore? I couldn't find any references to it (doing a very simple search in the repo), and the interesting part of a lot of these changes is that they aren't used in e2e anymore (but a few are used in the test/cmd
shell scripts). The key point is that these can't be used inside of e2e binaries because they aren't subject to dynamic replacement (there's no code reading these and then looking up the correct value of the image before running it), so it's possible that we should move these out of test/e2e and into test/cmd/ (where appropriate).
For example:
kubectl create -f test/e2e/testing-manifests/kubectl/agnhost-primary-pod.yaml "${kube_flags[@]}"
in test/cmd/core.sh
is the only reference to the file above, so a separate PR moving these is probably appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could have sworn we had code that dynamically substituted to support repo mappings passed in via KUBE_TEST_REPO
kubernetes/test/utils/image/manifest.go
Lines 253 to 255 in 9f47110
if repo := os.Getenv("KUBE_TEST_REPO"); len(repo) > 0 { | |
configs = GetMappedImageConfigs(originalImageConfigs, repo) | |
} |
Maybe it's been removed since I last looked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, here it is
kubernetes/test/utils/image/manifest.go
Lines 352 to 356 in 9f47110
// ReplaceRegistryInImageURL replaces the registry in the image URL with a custom one based | |
// on the configured registries. | |
func ReplaceRegistryInImageURL(imageURL string) (string, error) { | |
return replaceRegistryInImageURLWithList(imageURL, registry) | |
} |
Used by
kubernetes/test/e2e/storage/utils/create.go
Lines 626 to 629 in 9f47110
func patchContainerImages(containers []v1.Container) error { | |
var err error | |
for i, c := range containers { | |
containers[i].Image, err = imageutils.ReplaceRegistryInImageURL(c.Image) |
Which you can get to via
kubernetes/test/e2e/storage/utils/create.go
Line 197 in 9f47110
func CreateFromManifests(f *framework.Framework, driverNamespace *v1.Namespace, patch func(item interface{}) error, files ...string) (func(), error) { |
or
kubernetes/test/e2e/storage/utils/create.go
Line 116 in 9f47110
func PatchItems(f *framework.Framework, driverNamspace *v1.Namespace, items ...interface{}) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tl;dr I don't know if you were talking about the things in this specific file or these manifests in general, but they can have their images dynamically substituted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, indeed, some of these files do not seem to be used anymore, like:
test/e2e/testing-manifests/ingress/http/rc.yaml
test/e2e/testing-manifests/ingress/http2/rc.yaml
test/e2e/testing-manifests/ingress/multiple-certs/rc.yaml
test/e2e/testing-manifests/ingress/pre-shared-cert/rc.yaml
test/e2e/testing-manifests/ingress/static-ip/rc.yaml
test/e2e/testing-manifests/serviceloadbalancer/netexecrc.yaml
Some of them are still being used, like the test/e2e/testing-manifests/ingress/neg*
ones.
test/e2e/testing-manifests/kubectl/agnhost-primary-pod.yaml
seems to be used only in test/cmd/core.sh
, so it could probably be moved out of test/e2e
if needed.
And indeed, for some files the used images are dynamically substituted, which can be useful for airgapped environments (originally, AFAIK, the mechanism was introduced so we can use container images with Windows support for Windows test runs, before all the necessary work merged into k/k test images). But any other cleanup / change can be done in another PRs, specifically targeted towards those purposes. This PR just cleans up the gcr.io references.
/triage accepted |
/milestone v1.23 |
Removes any reference from the registry gcr.io/kubernetes-e2e-test-images in kubernetes/kubernetes, replacing it with k8s.gcr.io/kubernetes-e2e-test-images. In some cases, the images had to be updated since a few things have changed since their original implementation, most notably being the fact that some of the images have been centralized into the agnhost image. Co-Authored-By: Claudiu Belu <cbelu@cloudbasesolutions.com>
/test pull-kubernetes-integration |
1 similar comment
/test pull-kubernetes-integration |
c22e276
to
bbb368b
Compare
/test pull-kubernetes-integration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
/lgtm
@smarterclayton , it seems you're an approver for sample-apiserver. Is there anything else that needs to be addressed for this PR? |
# docker pull k8s.gcr.io/e2e-test-images/sample-apiserver:1.17.4 | ||
# docker tag k8s.gcr.io/e2e-test-images/sample-apiserver:1.17.4 kube-sample-apiserver:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve for comment change |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: claudiubelu, liggitt, spiffxp The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
/sig testing
/priority important-soon
What this PR does / why we need it:
Removes any reference from the registry
gcr.io/kubernetes-e2e-test-images
in kubernetes/kubernetes, replacing them withk8s.gcr.io/kubernetes-e2e-test-images
. In some cases, the images had to be updated since a few things have changed sincetheir original implementation, most notably being the fact that some of the images have been centralized into the agnhost image.
Co-Authored-By: Claudiu Belu cbelu@cloudbasesolutions.com
Which issue(s) this PR fixes:
Fixes #96770
Special notes for your reviewer:
Cherry-picked from: #100470
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: