Skip to content
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

Make machinetemplate.spec.ram mutable #60

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion api/v1alpha1/ionoscloudmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ type IONOSCloudMachineSpec struct {
// The memory size for the enterprise server in MB, such as 2048.
// +kubebuilder:validation:Minimum=256
// +kubebuilder:validation:MultipleOf=256
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Ram is immutable"
Ram *int32 `json:"ram"`
BootVolume IONOSVolumeSpec `json:"bootVolume"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ spec:
minimum: 256
multipleOf: 256
type: integer
x-kubernetes-validations:
- message: Ram is immutable
rule: self == oldSelf
required:
- bootVolume
- cores
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ spec:
minimum: 256
multipleOf: 256
type: integer
x-kubernetes-validations:
- message: Ram is immutable
rule: self == oldSelf
required:
- bootVolume
- cores
Expand Down
6 changes: 0 additions & 6 deletions internal/controller/ionoscloudmachine_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,6 @@ var _ = Describe("IONOSCloudMachine controller", func() {
return 0
}, timeout, interval).Should(Equal(1))
})

It("should not be possible to change immutable fields", func() {
capicMachine.Spec.Ram = ionoscloud.ToPtr(int32(256))
err := k8sClient.Update(ctx, capicMachine)
Expect(err).Should(HaveOccurred())
})
})

When("IONOSCloudMachine has been created", func() {
Expand Down
Loading