Skip to content

Commit

Permalink
Merge pull request #4092 from aniruddha2000/ani/issues/3373
Browse files Browse the repository at this point in the history
🌱 Add test for azuremachine_webhook old subnetName is blank
  • Loading branch information
k8s-ci-robot authored Oct 6, 2023
2 parents 83a82b8 + 2fb45bd commit 01ecafb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions api/v1beta1/azuremachine_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,22 @@ func TestAzureMachine_ValidateUpdate(t *testing.T) {
},
wantErr: true,
},
{
name: "invalidtest: updating subnet name from empty to non empty",
oldMachine: &AzureMachine{
Spec: AzureMachineSpec{
NetworkInterfaces: []NetworkInterface{{SubnetName: ""}},
},
},
newMachine: &AzureMachine{
Spec: AzureMachineSpec{
NetworkInterfaces: []NetworkInterface{{SubnetName: "subnet1"}},
},
},
wantErr: true,
},
}

for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
mw := &azureMachineWebhook{}
Expand Down

0 comments on commit 01ecafb

Please sign in to comment.