Skip to content

Commit 4b48808

Browse files
committed
Bump Runtime Hooks v1alpha1 types to core CAPI v1beta2
Signed-off-by: Stefan Büringer [email protected]
1 parent a2bbc01 commit 4b48808

File tree

22 files changed

+258
-5693
lines changed

22 files changed

+258
-5693
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ linters:
227227
# should be removed as the referenced deprecated item is removed from the project.
228228
- linters:
229229
- staticcheck
230-
text: 'SA1019: (bootstrapv1.ClusterStatus|DockerMachine.Spec.Bootstrapped|machineStatus.Bootstrapped|dockerMachine.Spec.Backend.Docker.Bootstrapped|dockerMachine.Spec.Bootstrapped|devMachine.Spec.Backend.Docker.Bootstrapped|clusterv1.ClusterClassVariableMetadata|clusterv1beta1.ClusterClassVariableMetadata|(variable|currentDefinition|specVar|newVariableDefinition|statusVarDefinition|out).DeprecatedV1Beta1Metadata) is deprecated'
230+
text: 'SA1019: (bootstrapv1.ClusterStatus|DockerMachine.Spec.Bootstrapped|machineStatus.Bootstrapped|dockerMachine.Spec.Backend.Docker.Bootstrapped|dockerMachine.Spec.Bootstrapped|devMachine.Spec.Backend.Docker.Bootstrapped|clusterv1.ClusterClassVariableMetadata|(variable|currentDefinition|specVar|newVariableDefinition|statusVarDefinition|out).DeprecatedV1Beta1Metadata) is deprecated'
231231
# Deprecations for MHC MaxUnhealthy, UnhealthyRange
232232
- linters:
233233
- staticcheck

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ generate-go-conversions-test-extension: $(CONVERSION_GEN) ## Generate conversion
526526
.PHONY: generate-go-openapi
527527
generate-go-openapi: $(OPENAPI_GEN) ## Generate openapi go code for runtime SDK
528528
@mkdir -p ./tmp/sigs.k8s.io; rm -f ./tmp/sigs.k8s.io/cluster-api; ln -s $(ROOT_DIR) ./tmp/sigs.k8s.io/cluster-api; cd ./tmp; \
529-
for pkg in "api/core/v1beta2" "api/core/v1beta1" "api/runtime/hooks/v1alpha1"; do \
529+
for pkg in "api/core/v1beta2" "api/runtime/hooks/v1alpha1"; do \
530530
(cd ../ && $(MAKE) clean-generated-openapi-definitions SRC_DIRS="./$${pkg}"); \
531531
echo "** Generating openapi schema for types in ./$${pkg} **"; \
532532
$(OPENAPI_GEN) \

api/core/v1beta1/zz_generated.openapi.go

Lines changed: 0 additions & 5425 deletions
This file was deleted.

api/runtime/hooks/v1alpha1/common_types.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,23 @@ const (
146146
// JSONMergePatchType identifies a https://datatracker.ietf.org/doc/html/rfc7386 JSON merge patch.
147147
JSONMergePatchType PatchType = "JSONMergePatch"
148148
)
149+
150+
// ObjectMeta is metadata that all persisted resources must have, which includes all objects
151+
// users must create. This is a copy of customizable fields from metav1.ObjectMeta.
152+
//
153+
// +kubebuilder:validation:MinProperties=1
154+
type ObjectMeta struct {
155+
// labels is a map of string keys and values that can be used to organize and categorize
156+
// (scope and select) objects. May match selectors of replication controllers
157+
// and services.
158+
// More info: http://kubernetes.io/docs/user-guide/labels
159+
// +optional
160+
Labels map[string]string `json:"labels,omitempty"`
161+
162+
// annotations is an unstructured key value map stored with a resource that may be
163+
// set by external tools to store and retrieve arbitrary metadata. They are not
164+
// queryable and should be preserved when modifying objects.
165+
// More info: http://kubernetes.io/docs/user-guide/annotations
166+
// +optional
167+
Annotations map[string]string `json:"annotations,omitempty"`
168+
}

api/runtime/hooks/v1alpha1/lifecyclehooks_types.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1alpha1
1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121

22-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
22+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
2323
runtimecatalog "sigs.k8s.io/cluster-api/exp/runtime/catalog"
2424
)
2525

@@ -33,7 +33,7 @@ type BeforeClusterCreateRequest struct {
3333

3434
// cluster is the cluster object the lifecycle hook corresponds to.
3535
// +required
36-
Cluster clusterv1beta1.Cluster `json:"cluster"`
36+
Cluster clusterv1.Cluster `json:"cluster"`
3737
}
3838

3939
var _ RetryResponseObject = &BeforeClusterCreateResponse{}
@@ -60,7 +60,7 @@ type AfterControlPlaneInitializedRequest struct {
6060

6161
// cluster is the cluster object the lifecycle hook corresponds to.
6262
// +required
63-
Cluster clusterv1beta1.Cluster `json:"cluster"`
63+
Cluster clusterv1.Cluster `json:"cluster"`
6464
}
6565

6666
var _ ResponseObject = &AfterControlPlaneInitializedResponse{}
@@ -88,7 +88,7 @@ type BeforeClusterUpgradeRequest struct {
8888

8989
// cluster is the cluster object the lifecycle hook corresponds to.
9090
// +required
91-
Cluster clusterv1beta1.Cluster `json:"cluster"`
91+
Cluster clusterv1.Cluster `json:"cluster"`
9292

9393
// fromKubernetesVersion is the current Kubernetes version of the cluster.
9494
// +required
@@ -140,7 +140,7 @@ type BeforeControlPlaneUpgradeRequest struct {
140140

141141
// cluster is the cluster object the lifecycle hook corresponds to.
142142
// +required
143-
Cluster clusterv1beta1.Cluster `json:"cluster"`
143+
Cluster clusterv1.Cluster `json:"cluster"`
144144

145145
// fromKubernetesVersion is the current Kubernetes version of the control plane for the next upgrade step.
146146
// +required
@@ -184,7 +184,7 @@ type AfterControlPlaneUpgradeRequest struct {
184184

185185
// cluster is the cluster object the lifecycle hook corresponds to.
186186
// +required
187-
Cluster clusterv1beta1.Cluster `json:"cluster"`
187+
Cluster clusterv1.Cluster `json:"cluster"`
188188

189189
// kubernetesVersion is the Kubernetes version of the control plane after an upgrade step.
190190
// +required
@@ -224,7 +224,7 @@ type BeforeWorkersUpgradeRequest struct {
224224

225225
// cluster is the cluster object the lifecycle hook corresponds to.
226226
// +required
227-
Cluster clusterv1beta1.Cluster `json:"cluster"`
227+
Cluster clusterv1.Cluster `json:"cluster"`
228228

229229
// fromKubernetesVersion is the current Kubernetes version of the workers for the next upgrade step.
230230
// +required
@@ -268,7 +268,7 @@ type AfterWorkersUpgradeRequest struct {
268268

269269
// cluster is the cluster object the lifecycle hook corresponds to.
270270
// +required
271-
Cluster clusterv1beta1.Cluster `json:"cluster"`
271+
Cluster clusterv1.Cluster `json:"cluster"`
272272

273273
// kubernetesVersion is the Kubernetes version of the workers after an upgrade step.
274274
// +required
@@ -308,7 +308,7 @@ type AfterClusterUpgradeRequest struct {
308308

309309
// cluster is the cluster object the lifecycle hook corresponds to.
310310
// +required
311-
Cluster clusterv1beta1.Cluster `json:"cluster"`
311+
Cluster clusterv1.Cluster `json:"cluster"`
312312

313313
// kubernetesVersion is the Kubernetes version after upgrade.
314314
// +required
@@ -340,7 +340,7 @@ type BeforeClusterDeleteRequest struct {
340340

341341
// cluster is the cluster object the lifecycle hook corresponds to.
342342
// +required
343-
Cluster clusterv1beta1.Cluster `json:"cluster"`
343+
Cluster clusterv1.Cluster `json:"cluster"`
344344
}
345345

346346
var _ RetryResponseObject = &BeforeClusterDeleteResponse{}

api/runtime/hooks/v1alpha1/topologymutation_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"k8s.io/apimachinery/pkg/runtime"
2323
"k8s.io/apimachinery/pkg/types"
2424

25-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
25+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
2626
runtimecatalog "sigs.k8s.io/cluster-api/exp/runtime/catalog"
2727
)
2828

@@ -209,7 +209,7 @@ type DiscoverVariablesResponse struct {
209209

210210
// variables are variable schemas for variables defined by the DiscoverVariables hook.
211211
// +optional
212-
Variables []clusterv1beta1.ClusterClassVariable `json:"variables,omitempty"`
212+
Variables []clusterv1.ClusterClassVariable `json:"variables,omitempty"`
213213
}
214214

215215
var _ ResponseObject = &DiscoverVariablesResponse{}

api/runtime/hooks/v1alpha1/topologymutation_variable_types.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ package v1alpha1
1818

1919
import (
2020
"k8s.io/apimachinery/pkg/types"
21-
22-
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
2321
)
2422

2523
// BuiltinsName is the name of the builtin variable.
@@ -57,7 +55,7 @@ type ClusterBuiltins struct {
5755

5856
// metadata is the metadata set on the Cluster object.
5957
// +optional
60-
Metadata *clusterv1beta1.ObjectMeta `json:"metadata,omitempty"`
58+
Metadata *ObjectMeta `json:"metadata,omitempty"`
6159

6260
// topology represents the cluster topology variables.
6361
// +optional
@@ -134,7 +132,7 @@ type ControlPlaneBuiltins struct {
134132

135133
// metadata is the metadata set on the ControlPlane object.
136134
// +optional
137-
Metadata *clusterv1beta1.ObjectMeta `json:"metadata,omitempty"`
135+
Metadata *ObjectMeta `json:"metadata,omitempty"`
138136

139137
// name is the name of the ControlPlane,
140138
// to which the current template belongs to.
@@ -178,7 +176,7 @@ type MachineDeploymentBuiltins struct {
178176

179177
// metadata is the metadata set on the MachineDeployment.
180178
// +optional
181-
Metadata *clusterv1beta1.ObjectMeta `json:"metadata,omitempty"`
179+
Metadata *ObjectMeta `json:"metadata,omitempty"`
182180

183181
// class is the class name of the MachineDeployment,
184182
// to which the current template belongs to.
@@ -222,7 +220,7 @@ type MachinePoolBuiltins struct {
222220

223221
// metadata is the metadata set on the MachinePool.
224222
// +optional
225-
Metadata *clusterv1beta1.ObjectMeta `json:"metadata,omitempty"`
223+
Metadata *ObjectMeta `json:"metadata,omitempty"`
226224

227225
// class is the class name of the MachinePool,
228226
// to which the current template belongs to.

api/runtime/hooks/v1alpha1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)