Skip to content

Commit ef5d3f2

Browse files
committed
Adding unit test for providerSpec.userDataSecret.name
1 parent dae7665 commit ef5d3f2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

pkg/webhooks/machine_webhook_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,6 +2382,14 @@ func TestValidateAWSProviderSpec(t *testing.T) {
23822382
expectedOk: false,
23832383
expectedError: "providerSpec.userDataSecret: Required value: expected providerSpec.userDataSecret to be populated",
23842384
},
2385+
{
2386+
testCase: "with no user data secret name it fails",
2387+
modifySpec: func(p *machinev1beta1.AWSMachineProviderConfig) {
2388+
p.UserDataSecret.Name = ""
2389+
},
2390+
expectedOk: false,
2391+
expectedError: "providerSpec.userDataSecret.name: Required value: expected providerSpec.userDataSecret.name name must be provided",
2392+
},
23852393
{
23862394
testCase: "with no credentials secret it fails",
23872395
modifySpec: func(p *machinev1beta1.AWSMachineProviderConfig) {

0 commit comments

Comments
 (0)