Skip to content

fix: remap v1alpha2 field paths in instance group set/unset commands#18481

Open
carterpewpew wants to merge 1 commit into
kubernetes:masterfrom
carterpewpew:fix/ig-field-mapping-17622
Open

fix: remap v1alpha2 field paths in instance group set/unset commands#18481
carterpewpew wants to merge 1 commit into
kubernetes:masterfrom
carterpewpew:fix/ig-field-mapping-17622

Conversation

@carterpewpew

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

kops edit instancegroup --set spec.rootVolumeType=gp3 fails with "field not found" because the internal struct uses the nested path spec.rootVolume.type. Users naturally copy field names from the YAML they see in kops edit instancegroup, which uses the v1alpha2 flat names. This adds a field mapping that translates the seven legacy rootVolume* field names to their internal rootVolume.* equivalents in both --set and --unset commands.

Which issue(s) this PR fixes:

Fixes #17622

Special notes for your reviewer:

This mirrors how SetClusterFields already remaps legacy cluster field paths via InternalPathForClusterField.

SetInstancegroupFields and UnsetInstancegroupFields did not translate
legacy v1alpha2 field names (e.g. spec.rootVolumeType) to their internal
equivalents (spec.rootVolume.type). Users who read field names from
`kops edit instancegroup` YAML and pass them via --set or --unset get a
"field not found" error.

Add InternalPathForInstanceGroupField with a mapping table for the seven
rootVolume fields, mirroring InternalPathForClusterField from PR kubernetes#16898.

Signed-off-by: Jathavedhan M <jathavedhan.m@ibm.com>
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 17, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @carterpewpew. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 17, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rifelpet for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minor discrepancy between --set spec.rootVolume.type and InstanceGroup spec.rootVolumeType

2 participants