-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
e2e: support CSI images in -list-images #108458
e2e: support CSI images in -list-images #108458
Conversation
@pohly: GitHub didn't allow me to request PR reviews from the following users: derek-pryor. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@pohly: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
47d6086
to
fafcc92
Compare
I was focusing on just on "our" (= k8s.io/sig-storage) images initially, but then thought some more and decided that list all images that are referenced by our YAML files is the better and probably right solution, because the additional images (like socat and busybox) might also be used. |
New images (from
|
fafcc92
to
39ec153
Compare
/retest |
Manually patched |
@derek-pryor: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign @jsafrane |
test/utils/image/csi_manifest.go
Outdated
// with many dependencies. | ||
items := bytes.Split(data, []byte("\n---")) | ||
for i, item := range items { | ||
// We don't care what the acsictual type is. We just |
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.
typo: acsictual
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.
Urgh. Looks like a cat stepped on my keyboard. I don't have a cat. Fixed.
// We don't care what the acsictual type is. We just | ||
// unmarshal into generic maps and then look up images. | ||
var object interface{} | ||
if err := yaml.Unmarshal(item, &object); err != nil { |
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.
Would it be better to use unstructured parse? Random example:
https://github.com/openshift/azure-disk-csi-driver-operator/blob/master/vendor/github.com/openshift/library-go/pkg/operator/resource/resourceread/unstructured.go#L13
In addition, there are some helpers that can handle interface{}
, would NestedSlice / NestedString help? It would require this code to know what is a slice in "spec", "template", "spec", "containers", "image"
below, not sure if it's worth the effort.
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'm aware of unstructured.Unstructured
. I decided against using it here because it would add another dependency (not a big deal, though) and because I would still need to walk the fields myself. At least that is my understanding of the current helpers: NestedString
returns the first match, but not all of them.
It was possible to patch images in the YAML files via KUBE_TEST_REPO, but it was not possible to know in advance which images might be needed. Now -list-images also includes all images referenced by the test-manifest/storage-csi YAML files.
39ec153
to
df1d1cc
Compare
/lgtm |
/assign @mkumatag For approval. |
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.
/lgtm
/approve
/hold @dims if you have any comments!
if err != nil { | ||
panic(err) | ||
} |
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.
this can be worrisome but UT will make sure this won't happen(especially when yaml.Unmarshal goes wrong)
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.
We control the input, so we know that this cannot go wrong.
/lgtm /hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dims, mkumatag, pohly 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 |
I see some information is located here: https://github.com/kubernetes/kubernetes/tree/master/test/images#testing-images but not sure that's good enough! |
I am not familiar with how people use this and it's not a concept that I came up with. In other words, someone else needs to write better documentation if the current one is not good enough. |
/retest |
1 similar comment
/retest |
The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass. This bot retests PRs for certain kubernetes repos according to the following rules:
You can:
/retest |
1 similar comment
The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass. This bot retests PRs for certain kubernetes repos according to the following rules:
You can:
/retest |
What type of PR is this?
/kind feature
What this PR does / why we need it:
It was possible to patch images in the YAML files via
KUBE_TEST_REPO
, but itwas not possible to know in advance which images might be needed. Now
-list-images
also includes all images referencedby the test-manifest/storage-csi YAML files.
Special notes for your reviewer:
This is an alternative for #108261
Does this PR introduce a user-facing change?
/cc @jsafrane @derek-pryor