Fix MachineSet replicas type: int32 instead of string#12
Merged
Conversation
wkulhanek
previously approved these changes
Apr 20, 2026
835ef48 to
56eab93
Compare
…lization
The admission webhook rejects MachineSet creation with:
json: cannot unmarshal string into Go struct field
MachineSetSpec.spec.replicas of type int32
The quoted Jinja expression "{{ item.1 | int }}" renders as a YAML
string in the k8s module's definition block. Removing quotes lets
Ansible's native type handling pass it as an integer.
56eab93 to
c056292
Compare
Contributor
Author
|
Updated the approach — simply removing quotes from the Jinja expression breaks YAML parsing (bare The fix uses definition: >-
{{ _machineset_def | to_json | from_json }}
vars:
_machineset_def:
spec:
replicas: "{{ item.1 | int }}"yamllint and ansible-lint (production profile) both pass locally. |
wkulhanek
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
replicas: "{{ item.1 | int }}"increate_new_machinesets.ymlProblem
When creating new MachineSets with a different instance type, the
replicasfield is serialized as a string ("2") instead of an integer (2). The admission webhook rejects this:Observed on:
summit-2026.lb1216-demystifying-aap-on-ocp-cluster.dev(AWS, m6a.12xlarge workers)Test plan