Skip to content

Commit

Permalink
Make machinetemplate.spec.ram mutable
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattes83 committed Jan 8, 2024
1 parent cd59855 commit 853a79b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
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

0 comments on commit 853a79b

Please sign in to comment.