Remove the deprecated image field#1498
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughDeprecated compute and storage image fields were removed, related generated/client/validation code was updated, and machine and volume flows now use structured ChangesDeprecated API fields and generated plumbing
Runtime wiring and outputs
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related issues
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Volumepoollet
participant Volumebroker
participant StorageAPI
Volumepoollet->>Volumebroker: prepareIRIVolume / CreateVolume
Volumebroker->>Volumebroker: derive osImageDataSource or volumeSnapshotRef
Volumebroker->>StorageAPI: create VolumeSpec with DataSource only
StorageAPI-->>Volumebroker: created Volume
Volumebroker-->>Volumepoollet: iri.VolumeSpec without Image
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
config/samples/e2e/network-policy/README.md (1)
20-45: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the step text to match the nested OS image path.
The sample now uses
dataSource.osImage.image, but the instructions still mentionimageas if it were top-level. That will mislead users following the README.Suggested wording change
-4. Create the below `patch-machine.yaml` in `network-policy` folder with the desired `machineClassRef`, `machinePoolRef`, `volumeClassRef`, `volumePoolRef`, `image` etc. as per your environment +4. Create the below `patch-machine.yaml` in `network-policy` folder with the desired `machineClassRef`, `machinePoolRef`, `volumeClassRef`, `volumePoolRef`, and `dataSource.osImage.image` values as per your environment🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@config/samples/e2e/network-policy/README.md` around lines 20 - 45, Update the README step text for the Machine sample so it references the nested OS image field used in the snippet, not a top-level image key. In the patch-machine.yaml instructions around the Machine example, adjust the wording to point users to dataSource.osImage.image along with the existing machineClassRef, machinePoolRef, volumeClassRef, and volumePoolRef fields so the guidance matches the actual spec structure.
🧹 Nitpick comments (1)
config/samples/e2e/machine-with-non-ephemeral-resources/README.md (1)
48-53: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd a language hint to the fenced code block.
markdownlint flags the fenced block opened here for missing a language annotation.
📝 Proposed fix
-``` +```yaml patches: - path: patch-machine.yaml - path: patch-volume.yaml</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.In
@config/samples/e2e/machine-with-non-ephemeral-resources/README.mdaround
lines 48 - 53, The fenced code block in the README markdown is missing a
language hint, which triggers markdownlint. Update the block under the
kustomization.yaml example to use a YAML fence so the snippet is clearly
annotated, keeping the existing patch list content unchanged.</details> <!-- cr-comment:v1:028360bbc85b24f3dfd8cbcf --> _Source: Linters/SAST tools_ </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.Outside diff comments:
In@config/samples/e2e/network-policy/README.md:
- Around line 20-45: Update the README step text for the Machine sample so it
references the nested OS image field used in the snippet, not a top-level image
key. In the patch-machine.yaml instructions around the Machine example, adjust
the wording to point users to dataSource.osImage.image along with the existing
machineClassRef, machinePoolRef, volumeClassRef, and volumePoolRef fields so the
guidance matches the actual spec structure.
Nitpick comments:
In@config/samples/e2e/machine-with-non-ephemeral-resources/README.md:
- Around line 48-53: The fenced code block in the README markdown is missing a
language hint, which triggers markdownlint. Update the block under the
kustomization.yaml example to use a YAML fence so the snippet is clearly
annotated, keeping the existing patch list content unchanged.</details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Organization UI **Review profile**: CHILL **Plan**: Pro **Run ID**: `ccf67b7d-ff48-4f72-bef8-3e8637a3a99a` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between fd1f73f12ae5b856efaaca60350190ef8e28aff3 and ae3aa64ec1dec4fac8dc1d8e0f7a5070259ef65a. </details> <details> <summary>⛔ Files ignored due to path filters (4)</summary> * `gen/swagger.json` is excluded by `!**/gen/**` * `gen/v3/apis__compute.ironcore.dev__v1alpha1_openapi.json` is excluded by `!**/gen/**` * `gen/v3/apis__storage.ironcore.dev__v1alpha1_openapi.json` is excluded by `!**/gen/**` * `iri/apis/volume/v1alpha1/api.pb.go` is excluded by `!**/*.pb.go` </details> <details> <summary>📒 Files selected for processing (49)</summary> * `api/compute/v1alpha1/machine_types.go` * `api/compute/v1alpha1/util.go` * `api/compute/v1alpha1/zz_generated.deepcopy.go` * `api/storage/v1alpha1/volume_types.go` * `api/storage/v1alpha1/zz_generated.deepcopy.go` * `broker/machinebroker/server/machine_create.go` * `broker/volumebroker/server/volume.go` * `broker/volumebroker/server/volume_create.go` * `broker/volumebroker/server/volume_create_test.go` * `client-go/applyconfigurations/compute/v1alpha1/machinespec.go` * `client-go/applyconfigurations/storage/v1alpha1/volumespec.go` * `client-go/openapi/api_violations.report` * `client-go/openapi/zz_generated.openapi.go` * `config/samples/compute_v1alpha1_machine.yaml` * `config/samples/e2e/bases/loadbalancer-public/machine1.yaml` * `config/samples/e2e/bases/loadbalancer-public/machine2.yaml` * `config/samples/e2e/bases/machine-with-ephemeral-resources/machine.yaml` * `config/samples/e2e/bases/machine-with-nonephemeral-resources/volume.yaml` * `config/samples/e2e/bases/network-peering/machine1.yaml` * `config/samples/e2e/bases/network-peering/machine2.yaml` * `config/samples/e2e/bases/network-policy/machine1.yaml` * `config/samples/e2e/bases/network-policy/machine2.yaml` * `config/samples/e2e/loadbalancer-public/README.md` * `config/samples/e2e/machine-with-ephemeral-resources/README.md` * `config/samples/e2e/machine-with-non-ephemeral-resources/README.md` * `config/samples/e2e/network-peering/README.md` * `config/samples/e2e/network-policy/README.md` * `config/samples/storage_v1alpha1_volume.yaml` * `config/samples/storage_v1alpha1_volume_restore_from_snapshot.yaml` * `docs/usage/compute/machine.md` * `internal/apis/compute/machine_types.go` * `internal/apis/compute/util.go` * `internal/apis/compute/v1alpha1/zz_generated.conversion.go` * `internal/apis/compute/validation/machine.go` * `internal/apis/compute/validation/machine_test.go` * `internal/apis/compute/zz_generated.deepcopy.go` * `internal/apis/storage/v1alpha1/zz_generated.conversion.go` * `internal/apis/storage/validation/volume.go` * `internal/apis/storage/validation/volume_test.go` * `internal/apis/storage/volume_types.go` * `internal/apis/storage/zz_generated.deepcopy.go` * `internal/controllers/compute/machineclass_controller_test.go` * `internal/registry/compute/machine/storage/tableconvertor.go` * `internal/registry/storage/volume/storage/tableconvertor.go` * `iri/apis/volume/v1alpha1/api.proto` * `irictl-volume/tableconverters/volume.go` * `poollet/machinepoollet/controllers/machine_controller.go` * `poollet/volumepoollet/controllers/volume_controller.go` * `poollet/volumepoollet/controllers/volume_controller_test.go` </details> <details> <summary>💤 Files with no reviewable changes (31)</summary> * poollet/machinepoollet/controllers/machine_controller.go * broker/volumebroker/server/volume.go * api/compute/v1alpha1/util.go * internal/apis/storage/zz_generated.deepcopy.go * broker/volumebroker/server/volume_create_test.go * internal/apis/compute/util.go * internal/controllers/compute/machineclass_controller_test.go * config/samples/compute_v1alpha1_machine.yaml * poollet/volumepoollet/controllers/volume_controller_test.go * irictl-volume/tableconverters/volume.go * internal/apis/compute/validation/machine_test.go * broker/machinebroker/server/machine_create.go * client-go/applyconfigurations/storage/v1alpha1/volumespec.go * client-go/openapi/zz_generated.openapi.go * client-go/openapi/api_violations.report * internal/apis/storage/validation/volume.go * api/compute/v1alpha1/machine_types.go * api/storage/v1alpha1/zz_generated.deepcopy.go * internal/registry/compute/machine/storage/tableconvertor.go * poollet/volumepoollet/controllers/volume_controller.go * iri/apis/volume/v1alpha1/api.proto * api/compute/v1alpha1/zz_generated.deepcopy.go * internal/registry/storage/volume/storage/tableconvertor.go * internal/apis/compute/v1alpha1/zz_generated.conversion.go * internal/apis/compute/machine_types.go * client-go/applyconfigurations/compute/v1alpha1/machinespec.go * internal/apis/storage/volume_types.go * internal/apis/compute/zz_generated.deepcopy.go * internal/apis/compute/validation/machine.go * internal/apis/storage/v1alpha1/zz_generated.conversion.go * api/storage/v1alpha1/volume_types.go </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
ae3aa64 to
61e01d3
Compare
61e01d3 to
b38f37c
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@config/samples/e2e/machine-with-non-ephemeral-resources/README.md`:
- Around line 48-54: The fenced example in the README is missing a YAML language
tag, which breaks markdownlint and syntax highlighting. Update the fenced block
under the kustomization example to use the existing README snippet around the
`patches` content, and keep the rest of the example unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4ec4c9c3-226b-4877-bea1-47717b575837
⛔ Files ignored due to path filters (4)
gen/swagger.jsonis excluded by!**/gen/**gen/v3/apis__compute.ironcore.dev__v1alpha1_openapi.jsonis excluded by!**/gen/**gen/v3/apis__storage.ironcore.dev__v1alpha1_openapi.jsonis excluded by!**/gen/**iri/apis/volume/v1alpha1/api.pb.gois excluded by!**/*.pb.go
📒 Files selected for processing (49)
api/compute/v1alpha1/machine_types.goapi/compute/v1alpha1/util.goapi/compute/v1alpha1/zz_generated.deepcopy.goapi/storage/v1alpha1/volume_types.goapi/storage/v1alpha1/zz_generated.deepcopy.gobroker/machinebroker/server/machine_create.gobroker/volumebroker/server/volume.gobroker/volumebroker/server/volume_create.gobroker/volumebroker/server/volume_create_test.goclient-go/applyconfigurations/compute/v1alpha1/machinespec.goclient-go/applyconfigurations/storage/v1alpha1/volumespec.goclient-go/openapi/api_violations.reportclient-go/openapi/zz_generated.openapi.goconfig/samples/compute_v1alpha1_machine.yamlconfig/samples/e2e/bases/loadbalancer-public/machine1.yamlconfig/samples/e2e/bases/loadbalancer-public/machine2.yamlconfig/samples/e2e/bases/machine-with-ephemeral-resources/machine.yamlconfig/samples/e2e/bases/machine-with-nonephemeral-resources/volume.yamlconfig/samples/e2e/bases/network-peering/machine1.yamlconfig/samples/e2e/bases/network-peering/machine2.yamlconfig/samples/e2e/bases/network-policy/machine1.yamlconfig/samples/e2e/bases/network-policy/machine2.yamlconfig/samples/e2e/loadbalancer-public/README.mdconfig/samples/e2e/machine-with-ephemeral-resources/README.mdconfig/samples/e2e/machine-with-non-ephemeral-resources/README.mdconfig/samples/e2e/network-peering/README.mdconfig/samples/e2e/network-policy/README.mdconfig/samples/storage_v1alpha1_volume.yamlconfig/samples/storage_v1alpha1_volume_restore_from_snapshot.yamldocs/usage/compute/machine.mdinternal/apis/compute/machine_types.gointernal/apis/compute/util.gointernal/apis/compute/v1alpha1/zz_generated.conversion.gointernal/apis/compute/validation/machine.gointernal/apis/compute/validation/machine_test.gointernal/apis/compute/zz_generated.deepcopy.gointernal/apis/storage/v1alpha1/zz_generated.conversion.gointernal/apis/storage/validation/volume.gointernal/apis/storage/validation/volume_test.gointernal/apis/storage/volume_types.gointernal/apis/storage/zz_generated.deepcopy.gointernal/controllers/compute/machineclass_controller_test.gointernal/registry/compute/machine/storage/tableconvertor.gointernal/registry/storage/volume/storage/tableconvertor.goiri/apis/volume/v1alpha1/api.protoirictl-volume/tableconverters/volume.gopoollet/machinepoollet/controllers/machine_controller.gopoollet/volumepoollet/controllers/volume_controller.gopoollet/volumepoollet/controllers/volume_controller_test.go
💤 Files with no reviewable changes (30)
- broker/machinebroker/server/machine_create.go
- client-go/openapi/api_violations.report
- broker/volumebroker/server/volume_create_test.go
- api/compute/v1alpha1/util.go
- internal/apis/compute/machine_types.go
- client-go/openapi/zz_generated.openapi.go
- internal/controllers/compute/machineclass_controller_test.go
- irictl-volume/tableconverters/volume.go
- broker/volumebroker/server/volume.go
- config/samples/compute_v1alpha1_machine.yaml
- client-go/applyconfigurations/storage/v1alpha1/volumespec.go
- internal/apis/compute/zz_generated.deepcopy.go
- internal/apis/compute/util.go
- internal/apis/compute/v1alpha1/zz_generated.conversion.go
- poollet/volumepoollet/controllers/volume_controller.go
- internal/apis/storage/v1alpha1/zz_generated.conversion.go
- internal/apis/storage/zz_generated.deepcopy.go
- api/storage/v1alpha1/zz_generated.deepcopy.go
- api/compute/v1alpha1/zz_generated.deepcopy.go
- internal/apis/storage/validation/volume.go
- api/storage/v1alpha1/volume_types.go
- poollet/volumepoollet/controllers/volume_controller_test.go
- internal/registry/compute/machine/storage/tableconvertor.go
- internal/apis/storage/volume_types.go
- api/compute/v1alpha1/machine_types.go
- internal/registry/storage/volume/storage/tableconvertor.go
- client-go/applyconfigurations/compute/v1alpha1/machinespec.go
- internal/apis/compute/validation/machine.go
- internal/apis/compute/validation/machine_test.go
- iri/apis/volume/v1alpha1/api.proto
✅ Files skipped from review due to trivial changes (7)
- config/samples/e2e/bases/machine-with-ephemeral-resources/machine.yaml
- internal/apis/storage/validation/volume_test.go
- config/samples/storage_v1alpha1_volume.yaml
- config/samples/e2e/network-peering/README.md
- config/samples/e2e/loadbalancer-public/README.md
- docs/usage/compute/machine.md
- config/samples/e2e/network-policy/README.md
🚧 Files skipped from review as they are similar to previous changes (11)
- config/samples/storage_v1alpha1_volume_restore_from_snapshot.yaml
- config/samples/e2e/bases/machine-with-nonephemeral-resources/volume.yaml
- config/samples/e2e/bases/network-peering/machine2.yaml
- config/samples/e2e/bases/network-policy/machine1.yaml
- config/samples/e2e/bases/network-peering/machine1.yaml
- config/samples/e2e/bases/loadbalancer-public/machine1.yaml
- config/samples/e2e/machine-with-ephemeral-resources/README.md
- config/samples/e2e/bases/loadbalancer-public/machine2.yaml
- config/samples/e2e/bases/network-policy/machine2.yaml
- poollet/machinepoollet/controllers/machine_controller.go
- broker/volumebroker/server/volume_create.go
b38f37c to
4a7ea64
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/registry/storage/volume/storage/tableconvertor.go`:
- Around line 59-63: The table conversion in volume storage can panic when
accessing the `volume.Spec.DataSource.OSImage` chain without nil checks. Update
the logic in `StorageTableConvertor` to guard `DataSource` and `OSImage` before
reading `Image`, similar to the nil-safe pattern used in the compute table
converter; if either is nil, append "<none>" instead of dereferencing the chain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: aa8bc293-ecdd-48d6-8306-5a9d1c0b671c
⛔ Files ignored due to path filters (1)
iri/apis/volume/v1alpha1/api.pb.gois excluded by!**/*.pb.go
📒 Files selected for processing (3)
internal/registry/compute/machine/storage/tableconvertor.gointernal/registry/storage/volume/storage/tableconvertor.goiri/apis/volume/v1alpha1/api.proto
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/registry/storage/volume/storage/tableconvertor.go`:
- Around line 59-63: The table conversion in volume storage can panic when
accessing the `volume.Spec.DataSource.OSImage` chain without nil checks. Update
the logic in `StorageTableConvertor` to guard `DataSource` and `OSImage` before
reading `Image`, similar to the nil-safe pattern used in the compute table
converter; if either is nil, append "<none>" instead of dereferencing the chain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: aa8bc293-ecdd-48d6-8306-5a9d1c0b671c
⛔ Files ignored due to path filters (1)
iri/apis/volume/v1alpha1/api.pb.gois excluded by!**/*.pb.go
📒 Files selected for processing (3)
internal/registry/compute/machine/storage/tableconvertor.gointernal/registry/storage/volume/storage/tableconvertor.goiri/apis/volume/v1alpha1/api.proto
🛑 Comments failed to post (1)
internal/registry/storage/volume/storage/tableconvertor.go (1)
59-63: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win
Potential nil pointer dereference on
DataSource.OSImagechain.
volume.Spec.DataSource.OSImage.Imagewill panic ifDataSourceorOSImageis nil. Unlike the compute table converter which guards withvolume.LocalDisk != nil, this path has no nil checks. A volume without an OS image data source would crash the table conversion.🛡️ Proposed fix with nil guards
- if image := volume.Spec.DataSource.OSImage.Image; image != "" { + var image string + if volume.Spec.DataSource != nil && volume.Spec.DataSource.OSImage != nil { + image = volume.Spec.DataSource.OSImage.Image + } + if image != "" { cells = append(cells, image) } else { cells = append(cells, "<none>") }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.var image string if volume.Spec.DataSource != nil && volume.Spec.DataSource.OSImage != nil { image = volume.Spec.DataSource.OSImage.Image } if image != "" { cells = append(cells, image) } else { cells = append(cells, "<none>") }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/registry/storage/volume/storage/tableconvertor.go` around lines 59 - 63, The table conversion in volume storage can panic when accessing the `volume.Spec.DataSource.OSImage` chain without nil checks. Update the logic in `StorageTableConvertor` to guard `DataSource` and `OSImage` before reading `Image`, similar to the nil-safe pattern used in the compute table converter; if either is nil, append "<none>" instead of dereferencing the chain.
6295b18 to
ea70f86
Compare
ea70f86 to
b5e3493
Compare
lukasfrank
left a comment
There was a problem hiding this comment.
Please put a validation in place for osImage like it was with image
b5e3493 to
55e6dee
Compare
| @@ -67,6 +67,9 @@ func validateVolumeSpec(spec *storage.VolumeSpec, fldPath *field.Path) field.Err | |||
|
|
|||
| if spec.DataSource.OSImage != nil { | |||
| allErrs = append(allErrs, field.Forbidden(fldPath.Child("osImage"), "must not specify if volume class is empty")) | |||
There was a problem hiding this comment.
Small thing in the validation: the inner if OSImage.Image != "" just duplicates the osImage forbidden error and reports it against spec.image, which no longer exists. Please drop it and use fldPath.Child("dataSource").Child("osImage") for the path.
55e6dee to
45a06d5
Compare
Signed-off-by: Rohit Kumar <rohit.1si09ee045@gmail.com>
Signed-off-by: Rohit Kumar <rohit.1si09ee045@gmail.com>
45a06d5 to
6ed6ace
Compare
Proposed Changes
imageandimagePullSecretReffield fromvolumeSpecandmachineSpec/ref #1495
Summary by CodeRabbit
Summary by CodeRabbit
Breaking Changes
image/imagePullSecretReffields from Machine and Volume specs (including client builders and published schemas).dataSource.osImage.image(and snapshot restores ondataSource).Documentation
dataSource.osImage.image.Tests / UI
imagevalues.New Features