Skip to content

Commit ba72272

Browse files
committed
fix: use a separate workerConfig variable even at the top level
1 parent 9494bcc commit ba72272

File tree

6 files changed

+4
-40
lines changed

6 files changed

+4
-40
lines changed

api/v1alpha1/clusterconfig_types.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ type ClusterConfigSpec struct {
4040

4141
//+optional
4242
ControlPlane *NodeConfigSpec `json:"controlPlane,omitempty"`
43-
44-
//+optional
45-
Workers *NodeConfigSpec `json:"workers,omitempty"`
4643
}
4744

4845
func (s ClusterConfigSpec) VariableSchema() clusterv1.VariableSchema { //nolint:gocritic,lll // Passed by value for no potential side-effect.
@@ -57,9 +54,6 @@ func (s ClusterConfigSpec) VariableSchema() clusterv1.VariableSchema { //nolint:
5754
"controlPlane": NodeConfigSpec{
5855
AWS: &AWSNodeSpec{},
5956
}.VariableSchema().OpenAPIV3Schema,
60-
"workers": NodeConfigSpec{
61-
AWS: &AWSNodeSpec{},
62-
}.VariableSchema().OpenAPIV3Schema,
6357
},
6458
)
6559
case s.Docker != nil:
@@ -70,9 +64,6 @@ func (s ClusterConfigSpec) VariableSchema() clusterv1.VariableSchema { //nolint:
7064
"controlPlane": NodeConfigSpec{
7165
Docker: &DockerNodeSpec{},
7266
}.VariableSchema().OpenAPIV3Schema,
73-
"workers": NodeConfigSpec{
74-
Docker: &DockerNodeSpec{},
75-
}.VariableSchema().OpenAPIV3Schema,
7667
},
7768
)
7869
}
@@ -116,8 +107,6 @@ func (s GenericClusterConfig) VariableSchema() clusterv1.VariableSchema {
116107
).VariableSchema().
117108
OpenAPIV3Schema,
118109
"imageRegistries": ImageRegistries{}.VariableSchema().OpenAPIV3Schema,
119-
"controlPlane": NodeConfigSpec{}.VariableSchema().OpenAPIV3Schema,
120-
"workers": NodeConfigSpec{}.VariableSchema().OpenAPIV3Schema,
121110
},
122111
},
123112
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/content/customization/docker/custom-image.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ spec:
2424
controlPlane:
2525
docker:
2626
customImage: ghcr.io/mesosphere/kind-node:v1.2.3-cp
27-
workers:
28-
docker:
29-
customImage: ghcr.io/mesosphere/kind-node:v1.2.3-worker
27+
- name: workerConfig
28+
value:
29+
docker:
30+
customImage: ghcr.io/mesosphere/kind-node:v1.2.3-worker
3031
```
3132
3233
The configuration above will apply customImage to all workers.

pkg/handlers/docker/mutation/customimage/inject_worker.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ import (
2424
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/variables"
2525
capdv1 "github.com/d2iq-labs/capi-runtime-extensions/common/pkg/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1"
2626
"github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers"
27-
dockerclusterconfig "github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers/docker/clusterconfig"
2827
dockerworkerconfig "github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers/docker/workerconfig"
29-
"github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers/generic/clusterconfig"
3028
"github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers/generic/workerconfig"
3129
)
3230

@@ -50,15 +48,6 @@ func NewWorkerPatch() *customImageWorkerPatchHandler {
5048
return newcustomImageWorkerPatchHandler(VariableName)
5149
}
5250

53-
func NewWorkerInClusterConfigMetaPatch() *customImageControlPlanePatchHandler {
54-
return newCustomImageControlPlanePatchHandler(
55-
clusterconfig.MetaVariableName,
56-
clusterconfig.MetaWorkerConfigName,
57-
dockerclusterconfig.DockerVariableName,
58-
VariableName,
59-
)
60-
}
61-
6251
func NewMetaWorkerPatch() *customImageWorkerPatchHandler {
6352
return newcustomImageWorkerPatchHandler(
6453
workerconfig.MetaVariableName,

pkg/handlers/docker/mutation/metapatch_handler.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func MetaPatchHandler(mgr manager.Manager) handlers.Named {
1818
patchHandlers := append(
1919
[]mutation.MetaMutator{
2020
customimage.NewControlPlaneMetaPatch(),
21-
customimage.NewWorkerInClusterConfigMetaPatch(),
2221
},
2322
genericmutation.MetaMutators(mgr)...,
2423
)

pkg/handlers/docker/mutation/metapatch_handler_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,6 @@ func TestGeneratePatches(t *testing.T) {
6464
customimage.VariableName,
6565
)
6666

67-
customimagetests.TestWorkerGeneratePatches(
68-
t,
69-
metaPatchGeneratorFunc(mgr),
70-
clusterconfig.MetaVariableName,
71-
"workers",
72-
dockerclusterconfig.DockerVariableName,
73-
customimage.VariableName,
74-
)
75-
7667
customimagetests.TestWorkerGeneratePatches(
7768
t,
7869
workerPatchGeneratorFunc(),

0 commit comments

Comments
 (0)