7
7
"testing"
8
8
9
9
"github.com/onsi/gomega"
10
+ runtimehooksv1 "sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1"
10
11
11
12
"github.com/d2iq-labs/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers/mutation"
12
13
"github.com/d2iq-labs/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest"
@@ -46,12 +47,22 @@ func TestGeneratePatches(
46
47
},
47
48
},
48
49
capitest.PatchTestDef {
49
- Name : "restart script and command added to worker node kubeadm config template" ,
50
- RequestItem : request .NewKubeadmControlPlaneTemplateRequestItem ("" ),
50
+ Name : "restart script and command added to worker node kubeadm config template" ,
51
+ Vars : []runtimehooksv1.Variable {
52
+ capitest .VariableWithValue (
53
+ "builtin" ,
54
+ map [string ]any {
55
+ "machineDeployment" : map [string ]any {
56
+ "class" : "*" ,
57
+ },
58
+ },
59
+ ),
60
+ },
61
+ RequestItem : request .NewKubeadmConfigTemplateRequestItem ("" ),
51
62
ExpectedPatchMatchers : []capitest.JSONPatchMatcher {
52
63
{
53
64
Operation : "add" ,
54
- Path : "/spec/template/spec/kubeadmConfigSpec/ files" ,
65
+ Path : "/spec/template/spec/files" ,
55
66
ValueMatcher : gomega .ContainElements (
56
67
gomega .HaveKeyWithValue (
57
68
"path" , containerdrestart .ContainerdRestartScriptOnRemote ,
@@ -60,7 +71,7 @@ func TestGeneratePatches(
60
71
},
61
72
{
62
73
Operation : "add" ,
63
- Path : "/spec/template/spec/kubeadmConfigSpec/ preKubeadmCommands" ,
74
+ Path : "/spec/template/spec/preKubeadmCommands" ,
64
75
ValueMatcher : gomega .ContainElements (
65
76
containerdrestart .ContainerdRestartScriptOnRemoteCommand ,
66
77
),
0 commit comments