@@ -6,12 +6,13 @@ package tests
6
6
import (
7
7
"testing"
8
8
9
+ "github.com/onsi/gomega"
10
+ runtimehooksv1 "sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1"
11
+
9
12
"github.com/d2iq-labs/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
10
13
"github.com/d2iq-labs/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers/mutation"
11
14
"github.com/d2iq-labs/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest"
12
15
"github.com/d2iq-labs/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest/request"
13
- "github.com/onsi/gomega"
14
- runtimehooksv1 "sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1"
15
16
)
16
17
17
18
func TestGeneratePatches (
@@ -29,7 +30,7 @@ func TestGeneratePatches(
29
30
Name : "unset variable" ,
30
31
},
31
32
capitest.PatchTestDef {
32
- Name : "ControlPlaneEndpoint set to valid host" ,
33
+ Name : "ControlPlaneEndpoint set to valid host and port " ,
33
34
Vars : []runtimehooksv1.Variable {
34
35
capitest .VariableWithValue (
35
36
variableName ,
@@ -40,29 +41,13 @@ func TestGeneratePatches(
40
41
variablePath ... ,
41
42
),
42
43
},
43
- RequestItem : request .NewNutanixClusterTemplateRequestItem ("1 " ),
44
+ RequestItem : request .NewNutanixClusterTemplateRequestItem ("" ),
44
45
ExpectedPatchMatchers : []capitest.JSONPatchMatcher {
45
46
{
46
47
Operation : "replace" ,
47
48
Path : "/spec/template/spec/controlPlaneEndpoint/host" ,
48
49
ValueMatcher : gomega .Equal ("10.20.100.10" ),
49
50
},
50
- },
51
- },
52
- capitest.PatchTestDef {
53
- Name : "ControlPlaneEndpoint set to valid host" ,
54
- Vars : []runtimehooksv1.Variable {
55
- capitest .VariableWithValue (
56
- variableName ,
57
- v1alpha1.NutanixControlPlaneEndpointSpec {
58
- Host : "10.20.100.10" ,
59
- Port : 6443 ,
60
- },
61
- variablePath ... ,
62
- ),
63
- },
64
- RequestItem : request .NewNutanixClusterTemplateRequestItem ("2" ),
65
- ExpectedPatchMatchers : []capitest.JSONPatchMatcher {
66
51
{
67
52
Operation : "replace" ,
68
53
Path : "/spec/template/spec/controlPlaneEndpoint/port" ,
0 commit comments