Skip to content

🌱 fix: make installImage.partitions optional, when imageURLCommand gets used. - #2124

Open
guettli wants to merge 5 commits into
mainfrom
fix/partitions-optional-with-imageURLCommand-validation
Open

🌱 fix: make installImage.partitions optional, when imageURLCommand gets used.#2124
guettli wants to merge 5 commits into
mainfrom
fix/partitions-optional-with-imageURLCommand-validation

Conversation

@guettli

@guettli guettli commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • partitions is completely ignored when imageURLCommand is set — the controller takes a different code path that never builds an installimage config. The CRD previously marked the field required in all cases, forcing users to supply dummy partition data for imageURLCommand-based provisioning.
  • Make partitions optional in the API types (omitempty), dropping it from the CRD required list.
  • Add webhook validation: partitions must be non-empty when imageURLCommand is not set (installimage needs at least one partition). When imageURLCommand is set, partitions are optional — they're ignored by the controller, but may still be set if desired.
  • Update tests in both v1beta1 and v1beta2 webhook packages.

…dation with imageURLCommand

partitions is unused when imageURLCommand is set — the controller takes a
completely different code path. The CRD previously marked it required, forcing
users to supply dummy partition data for imageURLCommand-based provisioning.

Changes:
- Add omitempty to Partitions in v1beta1 and v1beta2 types; drop it from
  the CRD required list
- Webhook validation now rejects partitions when imageURLCommand is set,
  and requires partitions when imageURLCommand is not set
- Regenerate CRDs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Committing as: thomas.guettler@syself.com
@github-actions github-actions Bot added size/M Denotes a PR that changes 50-200 lines, ignoring generated files. area/code Changes made in the code directory area/api Changes made in the api directory labels Jun 25, 2026
@guettli
guettli requested a review from janiskemper June 25, 2026 12:30
Partitions are ignored when imageURLCommand is set, but keeping them is
harmless — someone may want them for documentation or future use. Remove
the restriction that banned setting partitions alongside imageURLCommand.
Only the positive rule remains: partitions must be non-empty when
imageURLCommand is not set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Committing as: thomas.guettler@syself.com
@guettli guettli changed the title fix: make installImage.partitions optional, validate mutual exclusion with imageURLCommand 🌱 fix: make installImage.partitions optional, validate mutual exclusion with imageURLCommand Jun 25, 2026
guettli and others added 2 commits June 25, 2026 14:38
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Committing as: thomas.guettler@syself.com
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Committing as: thomas.guettler@syself.com
@guettli guettli changed the title 🌱 fix: make installImage.partitions optional, validate mutual exclusion with imageURLCommand 🌱 fix: make installImage.partitions optional, when imageURLCommand gets used. Jun 26, 2026

@Dhairya-Arora01 Dhairya-Arora01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


// Partitions define the additional Partitions to be created in installimage.
Partitions []Partition `json:"partitions"`
// Must be non-empty when imageURLCommand is not set.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we now call it "customProvisioner". Can you update it everywhere? If this PR is rebased, it should contain already the API changes and the new name.

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

Labels

area/api Changes made in the api directory area/code Changes made in the code directory size/M Denotes a PR that changes 50-200 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants