Fix parsing of extravars with multiple fields#57
Fix parsing of extravars with multiple fields#57k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
Conversation
|
/cc @Karthik-K-N for the golang bits. Thanks in advance! |
d1ae2c4 to
16c8315
Compare
Rajalakshmi-Girish
left a comment
There was a problem hiding this comment.
@kishen-v What job definitions do you think needs modifications after this?
This search output https://github.com/search?q=repo%3Appc64le-cloud%2Ftest-infra%20extra-vars&type=code is only showing instances where we only variable is passed with --extra-vars flag.
| tasks: | ||
| - set_fact: | ||
| prepull_images: "{{ prepull_images + ['registry.k8s.io/pause:3.10'] }}" | ||
| prepull_images: "{{ (prepull_images | from_json if prepull_images is string else prepull_images) + ['registry.k8s.io/pause:3.10'] }}" |
There was a problem hiding this comment.
Why is this change part of the extravars modification? I might be missing something here. :|
16c8315 to
86cc214
Compare
86cc214 to
d469ed0
Compare
|
Passing image names causes fragmentation on the complete string due to an additional ":" present in the image name. for eg: Will continue to explore more on this. |
|
Awaiting a new release with the fix - urfave/sflags#45 |
| - name: Pre-pull sandbox-images in the test environment. | ||
| shell: crictl pull {{ item }} | ||
| with_items: "{{ prepull_images }}" | ||
| with_items: "{{ (prepull_images | from_yaml if prepull_images is string else prepull_images) }}" |
There was a problem hiding this comment.
A bug was exposed as the string was passed as is, this converts the string to a list and allows operations to be done on it.
04a20af to
fca0aa5
Compare
…o the commit with the fix.
fca0aa5 to
a7d39cc
Compare
| github.com/apenella/go-ansible/v2 v2.1.1 | ||
| github.com/hashicorp/terraform-exec v0.22.0 | ||
| github.com/octago/sflags v0.3.1 | ||
| github.com/urfave/sflags v0.4.2-0.20260106141539-680a267d4b97 |
There was a problem hiding this comment.
Mitigating the module rename:
[root@kubetest2-tf1 kubetest2-tf]# go get github.com/octago/sflags@v0.4.2-0.20260106141539-680a267d4b97
go: github.com/octago/sflags@v0.4.2-0.20260106141539-680a267d4b97 requires github.com/octago/sflags@v0.4.2-0.20260106141539-680a267d4b97: parsing go.mod:
module declares its path as: github.com/urfave/sflags
but was required as: github.com/octago/sflags
[root@kubetest2-tf1 kubetest2-tf]# go get github.com/urfave/sflags@v0.4.2-0.20260106141539-680a267d4b97
go: added github.com/urfave/sflags v0.4.2-0.20260106141539-680a267d4b97
|
/test pull-provider-ibmcloud-test-infra-kubernetes |
|
/unhold |
|
Follow up: fixing this would allow the the pause-image to be pre-pulled and improve the startup latency. - https://github.com/ppc64le-cloud/test-infra/blob/17aba9aab308e3fa0552574ea895e06f8e79a845/config/jobs/periodic/kubernetes/perf-tests/perf-tests-kubernetes-periodics.yaml#L77 |
|
/test pull-provider-ibmcloud-test-infra-kubernetes |
| - hosts: all | ||
| tasks: | ||
| - set_fact: | ||
| prepull_images: "{{ prepull_images + ['registry.k8s.io/pause:3.10'] }}" |
There was a problem hiding this comment.
where are we appending this additional image after this block removal?
There was a problem hiding this comment.
Hi @mkumatag, this image seems to have been added inadvertently. There are no references to this particular version of pause throughout the deployment flow. The only reference I am seeing is 3.10.1 which is used as the sandbox image by the CRI.
There was a problem hiding this comment.
The idea is to pull the proxy image beforehand, if it is done somewhere then it is good.
There was a problem hiding this comment.
Agreed, @mkumatag.
The sandbox image will be pulled. With this change, we can now pass in the extra-var something along the lines of --extra-vars=prepull_images:'["registry.k8s.io/pause:3.9","registry.k8s.io/pause:3.10"]' wherever needed, this leaves the code free from any pinned versions..
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kishen-v, mkumatag The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The current design doesn't parse the complete set of key:value pairs passed to the --extra-vars flag. The implemented approach accepts the vars as a string and performs operations to allow them to be parsed separately.
/hold - Until the PR is approved, as changes need to be done in a few job definitions.