Skip to content

Commit 5890b05

Browse files
authored
feat: update handler version (#1144)
**What problem does this PR solve?**: Updating the handler version and removing the previous `controlplanevirtualip/providers/kubevip.go` handler implementation. **Which issue(s) this PR fixes**: Fixes # **How Has This Been Tested?**: <!-- Please describe the tests that you ran to verify your changes. Provide output from the tests and any manual steps needed to replicate the tests. --> **Special notes for your reviewer**: <!-- Use this to provide any additional information to the reviewers. This may include: - Best way to review the PR. - Where the author wants the most review attention on. - etc. -->
1 parent 6b5a7c9 commit 5890b05

File tree

28 files changed

+72
-1231
lines changed

28 files changed

+72
-1231
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ When adding a new handler, or modifying an existing one, pay close attention to
1818
when a new version of this extension is deployed in the management cluster,
1919
and avoid rollouts of Machines in those existing clusters.
2020

21+
If a change to a handler is unavoidable, you must:
22+
23+
1. Update the version of the handlers, e.g. from `v4` to `v5`.
24+
This is done by updating the `..ClusterV4ConfigPatch` in the handler files in `pkg/handlers/../mutation/`.
25+
And `..clusterv4configpatch` in `hack/examples/overlays/clusterclasses/../kustomization.yaml.tmpl`
26+
2. Update the version of the handler in the `pkg/handlers/v3` package, e.g. from `v3` to `v4`.
27+
3. Copy the existing implementation of the handler to `pkg/handlers/../v4/`.
28+
2129
During CAPI provider upgrades, and periodically, all managed clusters are reconciled and mutation handler patches
2230
are applied.
2331
Any new handlers that return a new set of patches, or updated handlers that return a different set of patches,

charts/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/aws-cluster-class.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ spec:
2323
patches:
2424
- external:
2525
discoverVariablesExtension: awsclusterconfigvars-dv.cluster-api-runtime-extensions-nutanix
26-
generateExtension: awsclusterv3configpatch-gp.cluster-api-runtime-extensions-nutanix
26+
generateExtension: awsclusterv4configpatch-gp.cluster-api-runtime-extensions-nutanix
2727
name: cluster-config
2828
- external:
2929
discoverVariablesExtension: awsworkerconfigvars-dv.cluster-api-runtime-extensions-nutanix
30-
generateExtension: awsworkerv3configpatch-gp.cluster-api-runtime-extensions-nutanix
30+
generateExtension: awsworkerv4configpatch-gp.cluster-api-runtime-extensions-nutanix
3131
name: worker-config
3232
- definitions:
3333
- jsonPatches:

charts/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/docker-cluster-class.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ spec:
3131
patches:
3232
- external:
3333
discoverVariablesExtension: dockerclusterconfigvars-dv.cluster-api-runtime-extensions-nutanix
34-
generateExtension: dockerclusterv3configpatch-gp.cluster-api-runtime-extensions-nutanix
34+
generateExtension: dockerclusterv4configpatch-gp.cluster-api-runtime-extensions-nutanix
3535
name: cluster-config
3636
- external:
3737
discoverVariablesExtension: dockerworkerconfigvars-dv.cluster-api-runtime-extensions-nutanix
38-
generateExtension: dockerworkerv3configpatch-gp.cluster-api-runtime-extensions-nutanix
38+
generateExtension: dockerworkerv4configpatch-gp.cluster-api-runtime-extensions-nutanix
3939
name: worker-config
4040
workers:
4141
machineDeployments:

charts/cluster-api-runtime-extensions-nutanix/defaultclusterclasses/nutanix-cluster-class.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ spec:
7474
patches:
7575
- external:
7676
discoverVariablesExtension: nutanixclusterconfigvars-dv.cluster-api-runtime-extensions-nutanix
77-
generateExtension: nutanixclusterv3configpatch-gp.cluster-api-runtime-extensions-nutanix
77+
generateExtension: nutanixclusterv4configpatch-gp.cluster-api-runtime-extensions-nutanix
7878
name: cluster-config
7979
- external:
8080
discoverVariablesExtension: nutanixworkerconfigvars-dv.cluster-api-runtime-extensions-nutanix
81-
generateExtension: nutanixworkerv3configpatch-gp.cluster-api-runtime-extensions-nutanix
81+
generateExtension: nutanixworkerv4configpatch-gp.cluster-api-runtime-extensions-nutanix
8282
name: worker-config
8383
workers:
8484
machineDeployments:

docs/content/getting-started/integrating-with-your-clusterclass/_index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ The required values are shown below per provider.
2121
patches:
2222
- external:
2323
discoverVariablesExtension: awsclusterconfigvars.cluster-api-runtime-extensions-nutanix
24-
generateExtension: awsclusterv3configpatch.cluster-api-runtime-extensions-nutanix
24+
generateExtension: awsclusterv4configpatch.cluster-api-runtime-extensions-nutanix
2525
name: cluster-config
2626
- external:
2727
discoverVariablesExtension: awsworkerconfigvars.cluster-api-runtime-extensions-nutanix
28-
generateExtension: awsworkerv3configpatch.cluster-api-runtime-extensions-nutanix
28+
generateExtension: awsworkerv4configpatch.cluster-api-runtime-extensions-nutanix
2929
name: worker-config
3030
```
3131
@@ -35,11 +35,11 @@ The required values are shown below per provider.
3535
patches:
3636
- external:
3737
discoverVariablesExtension: nutanixclusterconfigvars.cluster-api-runtime-extensions-nutanix
38-
generateExtension: nutanixclusterv3configpatch.cluster-api-runtime-extensions-nutanix
38+
generateExtension: nutanixclusterv4configpatch.cluster-api-runtime-extensions-nutanix
3939
name: cluster-config
4040
- external:
4141
discoverVariablesExtension: nutanixworkerconfigvars.cluster-api-runtime-extensions-nutanix
42-
generateExtension: nutanixworkerv3configpatch.cluster-api-runtime-extensions-nutanix
42+
generateExtension: nutanixworkerv4configpatch.cluster-api-runtime-extensions-nutanix
4343
name: worker-config
4444
```
4545
@@ -49,11 +49,11 @@ The required values are shown below per provider.
4949
patches:
5050
- external:
5151
discoverVariablesExtension: dockerclusterconfigvars.cluster-api-runtime-extensions-nutanix
52-
generateExtension: dockerclusterv3configpatch.cluster-api-runtime-extensions-nutanix
52+
generateExtension: dockerclusterv4configpatch.cluster-api-runtime-extensions-nutanix
5353
name: cluster-config
5454
- external:
5555
discoverVariablesExtension: dockerworkerconfigvars.cluster-api-runtime-extensions-nutanix
56-
generateExtension: dockerworkerv3configpatch.cluster-api-runtime-extensions-nutanix
56+
generateExtension: dockerworkerv4configpatch.cluster-api-runtime-extensions-nutanix
5757
name: worker-config
5858
```
5959
@@ -63,7 +63,7 @@ The required values are shown below per provider.
6363
patches:
6464
- external:
6565
discoverVariablesExtension: genericclusterconfigvars.cluster-api-runtime-extensions-nutanix
66-
generateExtension: genericclusterv3configpatch.cluster-api-runtime-extensions-nutanix
66+
generateExtension: genericclusterv4configpatch.cluster-api-runtime-extensions-nutanix
6767
name: cluster-config
6868
```
6969

hack/examples/overlays/clusterclasses/aws/kustomization.yaml.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ patches:
1919
value:
2020
- name: "cluster-config"
2121
external:
22-
generateExtension: "awsclusterv3configpatch-gp.cluster-api-runtime-extensions-nutanix"
22+
generateExtension: "awsclusterv4configpatch-gp.cluster-api-runtime-extensions-nutanix"
2323
discoverVariablesExtension: "awsclusterconfigvars-dv.cluster-api-runtime-extensions-nutanix"
2424
- name: "worker-config"
2525
external:
26-
generateExtension: "awsworkerv3configpatch-gp.cluster-api-runtime-extensions-nutanix"
26+
generateExtension: "awsworkerv4configpatch-gp.cluster-api-runtime-extensions-nutanix"
2727
discoverVariablesExtension: "awsworkerconfigvars-dv.cluster-api-runtime-extensions-nutanix"
2828
- name: identityRef
2929
definitions:

hack/examples/overlays/clusterclasses/docker/kustomization.yaml.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ patches:
1919
value:
2020
- name: "cluster-config"
2121
external:
22-
generateExtension: "dockerclusterv3configpatch-gp.cluster-api-runtime-extensions-nutanix"
22+
generateExtension: "dockerclusterv4configpatch-gp.cluster-api-runtime-extensions-nutanix"
2323
discoverVariablesExtension: "dockerclusterconfigvars-dv.cluster-api-runtime-extensions-nutanix"
2424
- name: "worker-config"
2525
external:
26-
generateExtension: "dockerworkerv3configpatch-gp.cluster-api-runtime-extensions-nutanix"
26+
generateExtension: "dockerworkerv4configpatch-gp.cluster-api-runtime-extensions-nutanix"
2727
discoverVariablesExtension: "dockerworkerconfigvars-dv.cluster-api-runtime-extensions-nutanix"
2828

2929
# BEGIN CIS patches

hack/examples/overlays/clusterclasses/nutanix/kustomization.yaml.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ patches:
1919
value:
2020
- name: "cluster-config"
2121
external:
22-
generateExtension: "nutanixclusterv3configpatch-gp.cluster-api-runtime-extensions-nutanix"
22+
generateExtension: "nutanixclusterv4configpatch-gp.cluster-api-runtime-extensions-nutanix"
2323
discoverVariablesExtension: "nutanixclusterconfigvars-dv.cluster-api-runtime-extensions-nutanix"
2424
- name: "worker-config"
2525
external:
26-
generateExtension: "nutanixworkerv3configpatch-gp.cluster-api-runtime-extensions-nutanix"
26+
generateExtension: "nutanixworkerv4configpatch-gp.cluster-api-runtime-extensions-nutanix"
2727
discoverVariablesExtension: "nutanixworkerconfigvars-dv.cluster-api-runtime-extensions-nutanix"
2828

2929
# BEGIN CIS patches

pkg/handlers/aws/handlers.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
awsmutation "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/mutation"
1313
awsworkerconfig "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/workerconfig"
1414
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/options"
15-
v2awsmutation "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/v2/aws/mutation"
15+
awsmutationvprev "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/v3/aws/mutation"
1616
)
1717

1818
type Handlers struct{}
@@ -28,9 +28,9 @@ func (h *Handlers) AllHandlers(mgr manager.Manager) []handlers.Named {
2828
awsclusterconfig.NewVariable(),
2929
awsworkerconfig.NewVariable(),
3030
awsmutation.MetaPatchHandler(mgr),
31-
v2awsmutation.MetaPatchHandler(mgr),
31+
awsmutationvprev.MetaPatchHandler(mgr),
3232
awsmutation.MetaWorkerPatchHandler(mgr),
33-
v2awsmutation.MetaWorkerPatchHandler(mgr),
33+
awsmutationvprev.MetaWorkerPatchHandler(mgr),
3434
}
3535
}
3636

pkg/handlers/aws/mutation/metapatch_handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func MetaPatchHandler(mgr manager.Manager) handlers.Named {
3535
patchHandlers = append(patchHandlers, genericmutation.ControlPlaneMetaMutators()...)
3636

3737
return mutation.NewMetaGeneratePatchesHandler(
38-
"awsClusterV3ConfigPatch",
38+
"awsClusterV4ConfigPatch",
3939
mgr.GetClient(),
4040
patchHandlers...,
4141
)
@@ -52,7 +52,7 @@ func MetaWorkerPatchHandler(mgr manager.Manager) handlers.Named {
5252
patchHandlers = append(patchHandlers, genericmutation.WorkerMetaMutators()...)
5353

5454
return mutation.NewMetaGeneratePatchesHandler(
55-
"awsWorkerv3ConfigPatch",
55+
"awsWorkerV4ConfigPatch",
5656
mgr.GetClient(),
5757
patchHandlers...,
5858
)

0 commit comments

Comments
 (0)