From 6a18007d9ece16c129c2c37a5208dfe2b7ceba12 Mon Sep 17 00:00:00 2001 From: Brian Lieberman Date: Tue, 12 Jul 2022 13:14:33 -0400 Subject: [PATCH] let subnetName be mutable --- api/v1beta1/azuremachine_webhook.go | 7 ------- api/v1beta1/azuremachine_webhook_test.go | 14 -------------- 2 files changed, 21 deletions(-) diff --git a/api/v1beta1/azuremachine_webhook.go b/api/v1beta1/azuremachine_webhook.go index fd430f89e70..469a2f74b69 100644 --- a/api/v1beta1/azuremachine_webhook.go +++ b/api/v1beta1/azuremachine_webhook.go @@ -136,13 +136,6 @@ func (m *AzureMachine) ValidateUpdate(oldRaw runtime.Object) error { ) } - if !reflect.DeepEqual(m.Spec.SubnetName, old.Spec.SubnetName) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "subnetName"), - m.Spec.SecurityProfile, "field is immutable"), - ) - } - if !reflect.DeepEqual(m.Spec.NetworkInterfaces, old.Spec.NetworkInterfaces) { allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "networkInterfaces"), diff --git a/api/v1beta1/azuremachine_webhook_test.go b/api/v1beta1/azuremachine_webhook_test.go index 0eebd5555e2..74687eea930 100644 --- a/api/v1beta1/azuremachine_webhook_test.go +++ b/api/v1beta1/azuremachine_webhook_test.go @@ -538,20 +538,6 @@ func TestAzureMachine_ValidateUpdate(t *testing.T) { }, wantErr: true, }, - { - name: "invalidTest: azuremachine.spec.subnetName is immutable", - oldMachine: &AzureMachine{ - Spec: AzureMachineSpec{ - SubnetName: "subnet1", - }, - }, - newMachine: &AzureMachine{ - Spec: AzureMachineSpec{ - SubnetName: "subnet2", - }, - }, - wantErr: true, - }, { name: "validTest: azuremachine.spec.networkInterfaces is immutable", oldMachine: &AzureMachine{