Skip to content

Commit

Permalink
Add a unit test for validating insecure property
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderboltsid committed Nov 22, 2022
1 parent 900b3ee commit 97ab715
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/providers/nutanix/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ var nutanixDatacenterConfigSpec string
//go:embed testdata/datacenterConfig_with_trust_bundle.yaml
var nutanixDatacenterConfigSpecWithTrustBundle string

//go:embed testdata/datacenterConfig_with_insecure.yaml
var nutanixDatacenterConfigSpecWithInsecure string

//go:embed testdata/eksa-cluster.json
var nutanixClusterConfigSpecJSON string

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: anywhere.eks.amazonaws.com/v1alpha1
kind: NutanixDatacenterConfig
metadata:
name: eksa-unit-test
namespace: default
spec:
endpoint: "prism.nutanix.com"
port: 9440
insecure: true
4 changes: 4 additions & 0 deletions pkg/providers/nutanix/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ func TestNutanixValidatorValidateDatacenterConfig(t *testing.T) {
name: "valid datacenter config with trust bundle",
dcConfFile: nutanixDatacenterConfigSpecWithTrustBundle,
},
{
name: "valid datacenter config with insecure",
dcConfFile: nutanixDatacenterConfigSpecWithInsecure,
},
}

for _, tt := range tests {
Expand Down

0 comments on commit 97ab715

Please sign in to comment.