-
Notifications
You must be signed in to change notification settings - Fork 581
AGENT-1330: machineconfiguration/v1alpha1: add InternalReleaseImage #2510
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
AGENT-1330: machineconfiguration/v1alpha1: add InternalReleaseImage #2510
Conversation
|
@andfasano: This pull request references AGENT-1330 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
Hello @andfasano! Some important instructions when contributing to openshift/api: |
9ea943a to
9eca225
Compare
0d80867 to
7ea433e
Compare
|
/retest-required |
|
I'm currently experimenting with AI for API review, hopefully some of the content it is generating is helpful for you to improve your API The following code blocks were generated by Claude I think the linting issues are actually not the response I'd like. Instead lets try and make the zero values not valid (required fields or For the comments, it has highlighted that you haven't explained what happens when the optional fields are omitted, though I'm not sure its suggestions are super helpful, please review and think about what you'd actually like to put in. If it has identified something where you can't think of a reason why it wouldn't be present, then maybe the field should actually be required Quizzing specifically about whether all validations were documented, some further output |
7b60a33 to
ab6545c
Compare
|
/api-review |
cf83224 to
c2f669c
Compare
|
/test verify |
f330e2a to
6b6941e
Compare
|
/verified later @andfasano |
|
@andfasano: This PR has been marked to be verified later by 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/retest-required |
|
@andfasano: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
…re adopted for the MCN status field
463ca8c to
7a0d946
Compare
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.
Actionable comments posted: 2
♻️ Duplicate comments (3)
machineconfiguration/v1/types_machineconfignode.go (1)
161-184: Verify zero‑value handling and invariants forInternalReleaseImagestatus
MachineConfigNodeStatus.InternalReleaseImageis a value field withjson:"internalReleaseImage,omitzero,omitempty"and the nested type requires a non‑emptyreleasesslice (+required,MinItems=1,MaxItems=32).This implies two important invariants:
- The codecs you use for status updates must treat
,omitzerothe same way as forConfigImage, i.e. omitinternalReleaseImageentirely when the struct is at its zero value, so we never persistinternalReleaseImage: {}withoutreleases.- All writers of
MachineConfigNodeStatus.InternalReleaseImagemust only populate this field when they also setReleasesto a non‑empty slice that satisfies the CRD constraints; an update with an empty/nilReleaseswould be rejected by the API server.Please double‑check both the serialization behavior and controller logic to ensure these invariants hold in practice.
openapi/generated_openapi/zz_generated.openapi.go (1)
43450-43612: Documented constraints forname,image, andreleasesare not enforced in the schemaThe descriptions declare strict constraints, but the generated OpenAPI does not enforce them:
- Line 43450 (
InternalReleaseImageBundleStatus.name) and line 43530 (InternalReleaseImageRef.name) say the name “must be between 1 and 64 characters long”, but there is nominLength/maxLengthon these string schemas.- Line 43457 (
InternalReleaseImageBundleStatus.image) documents a digest-based pull spec with a 64‑char hex digest and total length 1–447, but the schema is just a plain string with nominLength/maxLengthorpattern.- Line 43551 (
InternalReleaseImageSpec.releases) says the list “must contain at least one entry and must not exceed 16 entries,” but there is nominItems/maxItems.- Line 43589 (
InternalReleaseImageStatus.releases) similarly says the list must have at least 1 and at most 32 entries, but again there is nominItems/maxItems.This mismatch means invalid objects that violate the documented “must” constraints remain schema‑valid, which weakens API guarantees and tooling (validation, CRD UX, etc.).
Because this file is generated, the fix should be in the Go API types:
- Add kubebuilder validation markers for the
namefields, e.g.+kubebuilder:validation:MinLength=1and+kubebuilder:validation:MaxLength=64.- Add
MinLength,MaxLength, and aPatternmarker forimageto enforce the digest pull‑spec shape (e.g.^.+@sha256:[a-f0-9]{64}$with appropriate length bounds).- Add
+kubebuilder:validation:MinItems=1/MaxItems=16forspec.releasesandMinItems=1/MaxItems=32forstatus.releases.Then regenerate the OpenAPI so this schema reflects the documented behavior.
openapi/openapi.json (1)
25041-25186: Add missing schema validation attributes to match documented constraints.The OpenAPI schema includes validation constraints in field documentation (e.g., "between 1 and 64 characters", "must not exceed 16 entries") but these constraints are not reflected as schema validation attributes (
minLength,maxLength,minItems,maxItems). This means API clients using this schema won't discover the enforced constraints.Required additions:
minLength: 1, maxLength: 64for allnamefields (lines 25097, 25140)minLength: 1, maxLength: 447forimagefield (line 25093)minItems: 1, maxItems: 16forspec.releases(line 25153)minItems: 1, maxItems: 32forstatus.releases(line 25174)Since this file is auto-generated from Go types, ensure that
types_internalreleaseimage.gocontains the corresponding+kubebuilder:validationmarkers (e.g.,+kubebuilder:validation:MinLength=1,+kubebuilder:validation:MaxItems=16), then regenerate the OpenAPI schema.
🧹 Nitpick comments (3)
payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml (1)
355-486: Clarify optional vs. required behavior for internalReleaseImage.The
internalReleaseImagefield is omittable from status (not in required fields), but its nestedreleasesarray mandatesminItems: 1(line 479). The description adequately explains "When specified, an internalReleaseImage custom resource exists on the cluster", but it's unclear whether this field should ever be empty. IfinternalReleaseImageis present,releasesmust have at least one entry; if truly optional, this is correct. However, consider adding a note to clarify that the field should only be included when release images are actually tracked on the node.Enhance the description at line 356–359 to explicitly state: "When omitted, no internal release images are tracked on this node. When present, the releases array must contain at least one entry and will reflect the on-disk state."
machineconfiguration/v1alpha1/types_internalreleaseimage.go (2)
44-54: Document the add/remove workflow for releases.The documentation should clarify:
- That releases added to this list must already be mounted on at least one control plane node
- That removing a release from this list triggers removal from the internal registry
- The lifecycle: mounted → added to spec → installed → available for use
Consider expanding the godoc similar to the suggestion in past review comments to make the user workflow clearer.
Based on past review comments requesting clearer workflow documentation.
70-82: Consider clarifying the status.releases lifecycle.While the documentation is clear about when releases can be safely used, consider adding a sentence about when this field is populated. For example: "This field is populated by the controller after discovering mounted releases on control plane nodes."
This would help users understand the flow from spec to status.
Based on past review comments suggesting lifecycle documentation.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (38)
hack/update-payload-crds.sh(1 hunks)machineconfiguration/v1/tests/machineconfignodes.machineconfiguration.openshift.io/NoRegistryClusterInstall.yaml(1 hunks)machineconfiguration/v1/types_machineconfignode.go(1 hunks)machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-Hypershift-CustomNoUpgrade.crd.yaml(1 hunks)machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-Hypershift-Default.crd.yaml(1 hunks)machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-Hypershift-DevPreviewNoUpgrade.crd.yaml(0 hunks)machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-Hypershift-TechPreviewNoUpgrade.crd.yaml(0 hunks)machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-CustomNoUpgrade.crd.yaml(1 hunks)machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-Default.crd.yaml(0 hunks)machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml(1 hunks)machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml(1 hunks)machineconfiguration/v1/zz_generated.deepcopy.go(2 hunks)machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml(1 hunks)machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/NoRegistryClusterInstall.yaml(1 hunks)machineconfiguration/v1/zz_generated.swagger_doc_generated.go(2 hunks)machineconfiguration/v1alpha1/register.go(1 hunks)machineconfiguration/v1alpha1/tests/internalreleaseimages.machineconfiguration.openshift.io/NoRegistryClusterInstall.yaml(1 hunks)machineconfiguration/v1alpha1/types_internalreleaseimage.go(1 hunks)machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-CustomNoUpgrade.crd.yaml(1 hunks)machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-DevPreviewNoUpgrade.crd.yaml(1 hunks)machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-TechPreviewNoUpgrade.crd.yaml(1 hunks)machineconfiguration/v1alpha1/zz_generated.deepcopy.go(1 hunks)machineconfiguration/v1alpha1/zz_generated.featuregated-crd-manifests.yaml(1 hunks)machineconfiguration/v1alpha1/zz_generated.featuregated-crd-manifests/internalreleaseimages.machineconfiguration.openshift.io/NoRegistryClusterInstall.yaml(1 hunks)machineconfiguration/v1alpha1/zz_generated.swagger_doc_generated.go(1 hunks)openapi/generated_openapi/zz_generated.openapi.go(2 hunks)openapi/openapi.json(2 hunks)payload-manifests/crds/0000_80_machine-config_01_internalreleaseimages-CustomNoUpgrade.crd.yaml(1 hunks)payload-manifests/crds/0000_80_machine-config_01_internalreleaseimages-DevPreviewNoUpgrade.crd.yaml(1 hunks)payload-manifests/crds/0000_80_machine-config_01_internalreleaseimages-TechPreviewNoUpgrade.crd.yaml(1 hunks)payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-Hypershift-CustomNoUpgrade.crd.yaml(1 hunks)payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-Hypershift-Default.crd.yaml(1 hunks)payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-Hypershift-DevPreviewNoUpgrade.crd.yaml(0 hunks)payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-Hypershift-TechPreviewNoUpgrade.crd.yaml(0 hunks)payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-CustomNoUpgrade.crd.yaml(1 hunks)payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-Default.crd.yaml(0 hunks)payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml(1 hunks)payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml(1 hunks)
💤 Files with no reviewable changes (6)
- payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-Default.crd.yaml
- machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-Hypershift-TechPreviewNoUpgrade.crd.yaml
- payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-Hypershift-TechPreviewNoUpgrade.crd.yaml
- machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-Default.crd.yaml
- payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-Hypershift-DevPreviewNoUpgrade.crd.yaml
- machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-Hypershift-DevPreviewNoUpgrade.crd.yaml
🚧 Files skipped from review as they are similar to previous changes (5)
- machineconfiguration/v1alpha1/register.go
- hack/update-payload-crds.sh
- machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-TechPreviewNoUpgrade.crd.yaml
- machineconfiguration/v1alpha1/zz_generated.featuregated-crd-manifests.yaml
- payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-Hypershift-Default.crd.yaml
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.
Files:
machineconfiguration/v1alpha1/tests/internalreleaseimages.machineconfiguration.openshift.io/NoRegistryClusterInstall.yamlmachineconfiguration/v1alpha1/types_internalreleaseimage.gopayload-manifests/crds/0000_80_machine-config_01_internalreleaseimages-CustomNoUpgrade.crd.yamlmachineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-CustomNoUpgrade.crd.yamlmachineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-DevPreviewNoUpgrade.crd.yamlmachineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-TechPreviewNoUpgrade.crd.yamlpayload-manifests/crds/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-DevPreviewNoUpgrade.crd.yamlmachineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-Hypershift-Default.crd.yamlmachineconfiguration/v1/types_machineconfignode.gopayload-manifests/crds/0000_80_machine-config_01_machineconfignodes-Hypershift-CustomNoUpgrade.crd.yamlmachineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-Hypershift-CustomNoUpgrade.crd.yamlopenapi/generated_openapi/zz_generated.openapi.gopayload-manifests/crds/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-TechPreviewNoUpgrade.crd.yamlmachineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/NoRegistryClusterInstall.yamlmachineconfiguration/v1alpha1/zz_generated.deepcopy.gopayload-manifests/crds/0000_80_machine-config_01_internalreleaseimages-DevPreviewNoUpgrade.crd.yamlmachineconfiguration/v1alpha1/zz_generated.featuregated-crd-manifests/internalreleaseimages.machineconfiguration.openshift.io/NoRegistryClusterInstall.yamlmachineconfiguration/v1/zz_generated.deepcopy.gomachineconfiguration/v1/zz_generated.swagger_doc_generated.gopayload-manifests/crds/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-CustomNoUpgrade.crd.yamlpayload-manifests/crds/0000_80_machine-config_01_internalreleaseimages-TechPreviewNoUpgrade.crd.yamlmachineconfiguration/v1/zz_generated.featuregated-crd-manifests.yamlmachineconfiguration/v1alpha1/zz_generated.swagger_doc_generated.gomachineconfiguration/v1/tests/machineconfignodes.machineconfiguration.openshift.io/NoRegistryClusterInstall.yamlmachineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-DevPreviewNoUpgrade.crd.yamlmachineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-CustomNoUpgrade.crd.yamlopenapi/openapi.json
🧬 Code graph analysis (5)
machineconfiguration/v1alpha1/types_internalreleaseimage.go (2)
machineconfiguration/v1alpha1/zz_generated.swagger_doc_generated.go (5)
InternalReleaseImageSpec(58-60)InternalReleaseImageStatus(67-69)InternalReleaseImageRef(49-51)InternalReleaseImageBundleStatus(31-33)InternalReleaseImage(21-23)machineconfiguration/v1/types_machineconfignode.go (1)
InternalReleaseImageConditionType(227-227)
machineconfiguration/v1alpha1/zz_generated.deepcopy.go (2)
machineconfiguration/v1alpha1/types_internalreleaseimage.go (6)
InternalReleaseImage(25-40)InternalReleaseImageBundleStatus(84-121)InternalReleaseImageList(152-160)InternalReleaseImageRef(58-66)InternalReleaseImageSpec(43-54)InternalReleaseImageStatus(69-82)machineconfiguration/v1alpha1/zz_generated.swagger_doc_generated.go (6)
InternalReleaseImage(21-23)InternalReleaseImageBundleStatus(31-33)InternalReleaseImageList(40-42)InternalReleaseImageRef(49-51)InternalReleaseImageSpec(58-60)InternalReleaseImageStatus(67-69)
machineconfiguration/v1/zz_generated.deepcopy.go (4)
machineconfiguration/v1alpha1/types_internalreleaseimage.go (1)
InternalReleaseImage(25-40)machineconfiguration/v1alpha1/zz_generated.swagger_doc_generated.go (1)
InternalReleaseImage(21-23)machineconfiguration/v1/types_machineconfignode.go (2)
MachineConfigNodeStatusInternalReleaseImage(171-184)MachineConfigNodeStatusInternalReleaseImageRef(188-222)machineconfiguration/v1/zz_generated.swagger_doc_generated.go (2)
MachineConfigNodeStatusInternalReleaseImage(481-483)MachineConfigNodeStatusInternalReleaseImageRef(492-494)
machineconfiguration/v1/zz_generated.swagger_doc_generated.go (1)
machineconfiguration/v1/types_machineconfignode.go (2)
MachineConfigNodeStatusInternalReleaseImage(171-184)MachineConfigNodeStatusInternalReleaseImageRef(188-222)
machineconfiguration/v1alpha1/zz_generated.swagger_doc_generated.go (1)
machineconfiguration/v1alpha1/types_internalreleaseimage.go (6)
InternalReleaseImage(25-40)InternalReleaseImageBundleStatus(84-121)InternalReleaseImageList(152-160)InternalReleaseImageRef(58-66)InternalReleaseImageSpec(43-54)InternalReleaseImageStatus(69-82)
🔇 Additional comments (33)
payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml (2)
8-8: Verify compatibility level aligns with tech preview feature gate.The CRD has
release.openshift.io/feature-set: TechPreviewNoUpgradebut the description states "Compatibility level 1: Stable". This is contradictory—a tech preview feature cannot carry a stable compatibility guarantee. For a feature behindTechPreviewNoUpgrade, the compatibility statement should indicate alpha/beta status and explain that the API is subject to breaking changes.Confirm whether the compatibility level should be adjusted (e.g., "Compatibility level 4: Tech Preview are at the alpha level and are subject to breaking changes and removal.") or whether the feature gate annotation is incorrect.
Also applies to: 82-83
5-5: Verify API approval annotation.The
api-approved.openshift.ioannotation references PR #2255, not the current PR #2510. Please confirm this is the intended approval source for this new feature-gated CRD variant, or update if approval for this specific change is required.machineconfiguration/v1/zz_generated.featuregated-crd-manifests.yaml (1)
127-127: Feature gate addition looks correct.Line 127 properly adds
NoRegistryClusterInstallto the MachineConfigNode feature gates list, maintaining consistency with existing entries.payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-Hypershift-CustomNoUpgrade.crd.yaml (2)
355-486: Comprehensive internalReleaseImage field implementation with strong validation.The new
internalReleaseImagefield in MachineConfigNode status is well-structured with:
- Proper bounds (1-32 releases)
- Per-release conditions with semantic documentation (Mounted, Installing, Available, Removing, Degraded)
- OCI image reference validation with CEL rules for digest and hostname format
- Release name pattern validation matching expected format
Validations are thorough and align with Kubernetes best practices.
625-627: Good use of CEL validation for referential integrity.The validation rule
self.metadata.name == self.spec.node.nameenforces that MachineConfigNode name must match the referenced node name, preventing configuration drift.machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-Hypershift-CustomNoUpgrade.crd.yaml (1)
1-10: Generated CRD artifact.This file is auto-generated (zz_generated prefix) and mirrors the payload-manifest CRD. No manual edits needed here; generation tooling maintains consistency.
machineconfiguration/v1alpha1/tests/internalreleaseimages.machineconfiguration.openshift.io/NoRegistryClusterInstall.yaml (3)
89-146: Semantic issue in "A new mounted release has been discovered" test case.This test shows a release (
ocp-release-bundle-4.19.0-x86_64) appearing instatus.releaseswith a "Mounted" condition, yet it's never added tospec.releases. Given that spec defines the user-desired releases and status is controller-owned, status should only track releases that are in spec.Either the test should add the release to spec first (showing discovery leads to spec update), or this test case is incorrect. The current semantic suggests the cluster can autonomously add releases to status, which contradicts the API contract.
Can you clarify the intended semantic: should status.releases ever contain a release not listed in spec.releases, or should the test be updated to add the release to spec before it appears in status?
78-87: Good: Invalid release name format test case included.Addresses past feedback requesting additional validation test cases. The regex pattern is properly tested with an invalid format.
270-306: Good: Invalid image reference format test case included.Addresses past feedback requesting validation of image reference format. Test properly validates the CEL rules for OCI image format.
payload-manifests/crds/0000_80_machine-config_01_internalreleaseimages-CustomNoUpgrade.crd.yaml (3)
1-25: Status subresource pattern correctly implemented.The CRD properly enforces the standard Kubernetes pattern:
statusis NOT required at root level (allows object creation without status)status.releaseswhen present requires minItems: 1- Status subresource enabled for controller updates
This aligns with best practices for controller-owned fields.
219-221: Singleton constraint properly enforced.The CEL validation at the root level correctly enforces that
metadata.namemust be'cluster', implementing singleton semantics for this cluster-wide resource.
71-74: Release name format validation is appropriate.The regex pattern
^ocp-release-bundle-[0-9]+\\.[0-9]+\\.[0-9]+-[A-Za-z0-9._-]+$correctly enforces the semantic versioning format for release bundles and prevents malformed names.payload-manifests/crds/0000_80_machine-config_01_internalreleaseimages-DevPreviewNoUpgrade.crd.yaml (1)
214-217: Status field correctly omitted from required list.Following up on prior review feedback,
statusis properly excluded from the required fields, allowing objects to be created without status and populated later by the controller.payload-manifests/crds/0000_80_machine-config_01_internalreleaseimages-TechPreviewNoUpgrade.crd.yaml (1)
1-50: Consistent CRD structure across feature gate variants.This TechPreviewNoUpgrade variant maintains identical schema and validation rules as CustomNoUpgrade and DevPreviewNoUpgrade variants, ensuring consistent API behavior regardless of deployment pathway.
machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-CustomNoUpgrade.crd.yaml (1)
1-10: Generated CRD artifact - auto-maintained.This file is auto-generated in the zz_generated.crd-manifests directory. The content correctly reflects the InternalReleaseImage schema with all validations and constraints properly carried through.
machineconfiguration/v1/zz_generated.deepcopy.go (1)
798-835: DeepCopy forInternalReleaseImagestatus looks correct and consistentThe new DeepCopy implementations for
MachineConfigNodeStatus.InternalReleaseImageand its nested types follow the existing patterns (allocate slices, DeepCopy each element) and avoid nil dereferences for the value‑typed field.Also applies to: 853-897
machineconfiguration/v1alpha1/zz_generated.featuregated-crd-manifests/internalreleaseimages.machineconfiguration.openshift.io/NoRegistryClusterInstall.yaml (1)
1-224: CRD schema and feature‑gating forInternalReleaseImageare coherentSingleton enforcement, spec/status
releasesconstraints, and condition/image validations are all consistent with the v1alpha1 type comments and with the NoRegistryClusterInstall feature‑gate usage. No issues from an API/validation perspective.machineconfiguration/v1/tests/machineconfignodes.machineconfiguration.openshift.io/NoRegistryClusterInstall.yaml (1)
1-87: Status test forinternalReleaseImagematches CRD expectationsThe onUpdate test populates
status.internalReleaseImage.releaseswith a valid entry (conditions, image, name), so it should exercise the new schema correctly and catch regressions in the CRD or type wiring.payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml (1)
355-486:internalReleaseImagestatus schema is consistent with the Go typesThe new
status.internalReleaseImageblock (releases list with per‑release conditions, image, and name) matches theMachineConfigNodeStatusInternalReleaseImage{,Ref}definitions and uses appropriate list‑map annotations and MinItems/MaxItems. Looks correct for the SelfManagedHA DevPreview variant.machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml (1)
355-486: TechPreview CRD mirrors the DevPreviewinternalReleaseImagestatus correctlyThe
status.internalReleaseImagesection here is structurally and semantically aligned with the DevPreview CRD and the Go status types, so behavior should be consistent across feature sets.machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-CustomNoUpgrade.crd.yaml (1)
355-486: CustomNoUpgrade CRD’sinternalReleaseImagestatus matches other variantsThe
internalReleaseImagestatus shape (releases list, conditions, image, name, and associated validations) is consistent with the DevPreview/TechPreview CRDs and the backing Go types, so API behavior should be uniform across SelfManagedHA feature sets.machineconfiguration/v1/types_machineconfignode.go (1)
186-242: Per‑release status struct and condition enum are well‑structured
MachineConfigNodeStatusInternalReleaseImageRefplusInternalReleaseImageConditionTypegive a clear, per‑bundle status surface (conditions, name, image) with strong validation on identifiers and image pull specs. This matches the CRD schemas and should be straightforward for controllers to consume and emit.machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-DevPreviewNoUpgrade.crd.yaml (1)
1-224: DevPreviewNoUpgrade CRD forInternalReleaseImagealigns with the v1alpha1 APIThe DevPreviewNoUpgrade CRD defines the same spec/status shape, validations, and singleton constraint as the feature‑gated variant, wired to the appropriate feature‑set annotations. This looks correct and consistent with the v1alpha1 type definitions.
payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-CustomNoUpgrade.crd.yaml (1)
355-486: Well-structured internalReleaseImage status field.The internalReleaseImage field is well-designed with:
- Clear documentation of when release content can be safely pulled (Available=True, Degraded=False)
- Appropriate validation constraints (1-32 releases, 1-5 conditions per release)
- Comprehensive OCI image format validation
- Proper uniqueness enforcement via list map keying on name
The condition types (Mounted, Installing, Available, Removing, Degraded) provide good visibility into the release lifecycle.
machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-Hypershift-Default.crd.yaml (1)
1-383: Generated CRD manifest looks correct.This Hypershift-Default CRD manifest correctly excludes the internalReleaseImage field (which is behind the NoRegistryClusterInstall feature gate) and maintains the standard MachineConfigNode schema with appropriate validations.
machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml (1)
355-486: Consistent internalReleaseImage implementation.The internalReleaseImage field in this DevPreviewNoUpgrade variant is consistent with the CustomNoUpgrade variant, with identical structure, validations, and documentation.
machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/NoRegistryClusterInstall.yaml (1)
1-516: Correct feature-gated CRD manifest.This manifest correctly applies the NoRegistryClusterInstall feature gate (line 9) and includes the internalReleaseImage field consistently with other feature-gated variants.
openapi/generated_openapi/zz_generated.openapi.go (2)
854-859: New OpenAPI registrations for InternalReleaseImage types look correctThe added entries cleanly register all six
InternalReleaseImage*schemas and match the usual pattern used elsewhere in this map. No issues from a correctness or maintainability standpoint.
43371-43521: Overall schema structure for InternalReleaseImage resources is consistent with Kubernetes patternsThe object/list/spec/status/ref schemas follow the standard Kube API conventions (kind/apiVersion/metadata, required
spec, listitemsreferencing the resource type, and appropriate dependencies). Aside from validation concerns called out separately, the generated OpenAPI wiring here looks sound.machineconfiguration/v1/zz_generated.swagger_doc_generated.go (1)
459-459: LGTM! Auto-generated Swagger documentation is complete and accurate.The generated SwaggerDoc mappings for the new InternalReleaseImage-related types are consistent with the type definitions and follow the established patterns in this file.
Also applies to: 476-494
machineconfiguration/v1alpha1/zz_generated.deepcopy.go (1)
13-155: LGTM! Auto-generated DeepCopy implementations are correct and complete.The generated DeepCopy methods properly handle all nested slices and follow Kubernetes conventions. The InternalReleaseImageBundleStatus correctly performs element-wise deep copying for the Conditions slice, and the InternalReleaseImageStatus properly handles the nested InternalReleaseImageBundleStatus slice.
machineconfiguration/v1alpha1/zz_generated.swagger_doc_generated.go (1)
14-69: LGTM! Auto-generated Swagger documentation for InternalReleaseImage is complete and accurate.The generated SwaggerDoc mappings comprehensively cover all InternalReleaseImage-related types and properly document the v1alpha1 compatibility level (level 4). The documentation strings are clear and match the type definitions.
openapi/openapi.json (1)
30891-30895: Verify this hunk is intentional for this PR.The
closedClientConnectionPolicyaddition to IngressController (line 30891) appears unrelated to the InternalReleaseImage CRD changes described in the PR objectives and AI summary. Confirm whether this change should be included in this PR or if it was inadvertently merged.
|
|
||
| // spec describes the configuration of this internal release image. | ||
| // +required | ||
| Spec InternalReleaseImageSpec `json:"spec,omitempty,omitzero"` |
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.
Critical: Resolve Spec field linter failure.
Per PR comments, kube-apilinter is failing because Spec is a value type with omitzero, but the linter cannot verify that the zero value is invalid. Although Spec.Releases is marked +required with MinItems=1, the linter still requires either:
- Change
Specto a pointer:*InternalReleaseImageSpec, OR - Ensure validation makes
spec: {}invalid (e.g., addMinPropertiesat the Spec level)
This is a blocker that must be resolved before merge.
Based on past review comments flagging this as critical.
🤖 Prompt for AI Agents
In machineconfiguration/v1alpha1/types_internalreleaseimage.go around line 35,
the Spec field uses a value type with `omitzero` which the kube-apilinter flags;
change the field to a pointer type (e.g., Spec *InternalReleaseImageSpec) and
update the JSON tag to `json:"spec,omitempty"` so that an empty spec is clearly
nil, or alternatively add a validation marker on the Spec type such as
`+kubebuilder:validation:MinProperties=1` to make an empty object invalid;
implement one of these fixes consistently and regenerate any generated code if
applicable.
|
|
||
| // status describes the last observed state of this internal release image. | ||
| // +optional | ||
| Status InternalReleaseImageStatus `json:"status,omitempty,omitzero"` |
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.
Critical: Resolve Status field linter failure.
Similar to the Spec field, Status is a value type with omitzero, but contains a required Releases field with MinItems=1. The linter may fail on this as well. Consider:
- Change to pointer:
*InternalReleaseImageStatus, OR - Add validation to make
status: {}invalid
Verify that the linter passes for the Status field, or apply the same fix used for Spec.
Based on similar pattern to the Spec field issue.
🤖 Prompt for AI Agents
In machineconfiguration/v1alpha1/types_internalreleaseimage.go around line 39,
the Status field is currently a value type declared as "Status
InternalReleaseImageStatus `json:\"status,omitempty,omitzero\"`" but contains a
required Releases array (MinItems=1) which causes the linter to fail; fix by
matching the Spec-field solution: change the field to a pointer type
"*InternalReleaseImageStatus" so omitzero behavior is safe, or alternatively add
explicit validation to disallow an empty status object (make "status: {}"
invalid); apply the same change you used for Spec (prefer pointer) and run the
linter to verify the failure is resolved.
|
/lgtm |
|
Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: everettraven 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 |
|
@everettraven: Overrode contexts on behalf of everettraven: ci/prow/lint 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-sigs/prow repository. |
|
/verified later @andfasano |
|
@andfasano: This PR has been marked to be verified later by 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 openshift-eng/jira-lifecycle-plugin repository. |
This patch adds the new
InternalReleaseImageCRD. See openshift/enhancements#1821 for additional details