Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ linters:
# should be removed as the referenced deprecated item is removed from the project.
- linters:
- staticcheck
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'
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'
# Deprecations for MHC MaxUnhealthy, UnhealthyRange
- linters:
- staticcheck
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ generate-go-conversions-test-extension: $(CONVERSION_GEN) ## Generate conversion
.PHONY: generate-go-openapi
generate-go-openapi: $(OPENAPI_GEN) ## Generate openapi go code for runtime SDK
@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; \
for pkg in "api/core/v1beta2" "api/core/v1beta1" "api/runtime/hooks/v1alpha1"; do \
for pkg in "api/core/v1beta2" "api/runtime/hooks/v1alpha1"; do \
(cd ../ && $(MAKE) clean-generated-openapi-definitions SRC_DIRS="./$${pkg}"); \
echo "** Generating openapi schema for types in ./$${pkg} **"; \
$(OPENAPI_GEN) \
Expand Down
5,425 changes: 0 additions & 5,425 deletions api/core/v1beta1/zz_generated.openapi.go

This file was deleted.

20 changes: 20 additions & 0 deletions api/runtime/hooks/v1alpha1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,23 @@ const (
// JSONMergePatchType identifies a https://datatracker.ietf.org/doc/html/rfc7386 JSON merge patch.
JSONMergePatchType PatchType = "JSONMergePatch"
)

// ObjectMeta is metadata that all persisted resources must have, which includes all objects
// users must create. This is a copy of customizable fields from metav1.ObjectMeta.
//
// +kubebuilder:validation:MinProperties=1
type ObjectMeta struct {
// labels is a map of string keys and values that can be used to organize and categorize
// (scope and select) objects. May match selectors of replication controllers
// and services.
// More info: http://kubernetes.io/docs/user-guide/labels
// +optional
Labels map[string]string `json:"labels,omitempty"`

// annotations is an unstructured key value map stored with a resource that may be
// set by external tools to store and retrieve arbitrary metadata. They are not
// queryable and should be preserved when modifying objects.
// More info: http://kubernetes.io/docs/user-guide/annotations
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
}
20 changes: 10 additions & 10 deletions api/runtime/hooks/v1alpha1/lifecyclehooks_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
runtimecatalog "sigs.k8s.io/cluster-api/exp/runtime/catalog"
)

Expand All @@ -33,7 +33,7 @@ type BeforeClusterCreateRequest struct {

// cluster is the cluster object the lifecycle hook corresponds to.
// +required
Cluster clusterv1beta1.Cluster `json:"cluster"`
Cluster clusterv1.Cluster `json:"cluster"`
}

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

// cluster is the cluster object the lifecycle hook corresponds to.
// +required
Cluster clusterv1beta1.Cluster `json:"cluster"`
Cluster clusterv1.Cluster `json:"cluster"`
}

var _ ResponseObject = &AfterControlPlaneInitializedResponse{}
Expand Down Expand Up @@ -88,7 +88,7 @@ type BeforeClusterUpgradeRequest struct {

// cluster is the cluster object the lifecycle hook corresponds to.
// +required
Cluster clusterv1beta1.Cluster `json:"cluster"`
Cluster clusterv1.Cluster `json:"cluster"`

// fromKubernetesVersion is the current Kubernetes version of the cluster.
// +required
Expand Down Expand Up @@ -140,7 +140,7 @@ type BeforeControlPlaneUpgradeRequest struct {

// cluster is the cluster object the lifecycle hook corresponds to.
// +required
Cluster clusterv1beta1.Cluster `json:"cluster"`
Cluster clusterv1.Cluster `json:"cluster"`

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

// cluster is the cluster object the lifecycle hook corresponds to.
// +required
Cluster clusterv1beta1.Cluster `json:"cluster"`
Cluster clusterv1.Cluster `json:"cluster"`

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

// cluster is the cluster object the lifecycle hook corresponds to.
// +required
Cluster clusterv1beta1.Cluster `json:"cluster"`
Cluster clusterv1.Cluster `json:"cluster"`

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

// cluster is the cluster object the lifecycle hook corresponds to.
// +required
Cluster clusterv1beta1.Cluster `json:"cluster"`
Cluster clusterv1.Cluster `json:"cluster"`

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

// cluster is the cluster object the lifecycle hook corresponds to.
// +required
Cluster clusterv1beta1.Cluster `json:"cluster"`
Cluster clusterv1.Cluster `json:"cluster"`

// kubernetesVersion is the Kubernetes version after upgrade.
// +required
Expand Down Expand Up @@ -340,7 +340,7 @@ type BeforeClusterDeleteRequest struct {

// cluster is the cluster object the lifecycle hook corresponds to.
// +required
Cluster clusterv1beta1.Cluster `json:"cluster"`
Cluster clusterv1.Cluster `json:"cluster"`
}

var _ RetryResponseObject = &BeforeClusterDeleteResponse{}
Expand Down
4 changes: 2 additions & 2 deletions api/runtime/hooks/v1alpha1/topologymutation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"

clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
runtimecatalog "sigs.k8s.io/cluster-api/exp/runtime/catalog"
)

Expand Down Expand Up @@ -209,7 +209,7 @@ type DiscoverVariablesResponse struct {

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

var _ ResponseObject = &DiscoverVariablesResponse{}
Expand Down
10 changes: 4 additions & 6 deletions api/runtime/hooks/v1alpha1/topologymutation_variable_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ package v1alpha1

import (
"k8s.io/apimachinery/pkg/types"

clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
)

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

// metadata is the metadata set on the Cluster object.
// +optional
Metadata *clusterv1beta1.ObjectMeta `json:"metadata,omitempty"`
Metadata *ObjectMeta `json:"metadata,omitempty"`

// topology represents the cluster topology variables.
// +optional
Expand Down Expand Up @@ -134,7 +132,7 @@ type ControlPlaneBuiltins struct {

// metadata is the metadata set on the ControlPlane object.
// +optional
Metadata *clusterv1beta1.ObjectMeta `json:"metadata,omitempty"`
Metadata *ObjectMeta `json:"metadata,omitempty"`

// name is the name of the ControlPlane,
// to which the current template belongs to.
Expand Down Expand Up @@ -178,7 +176,7 @@ type MachineDeploymentBuiltins struct {

// metadata is the metadata set on the MachineDeployment.
// +optional
Metadata *clusterv1beta1.ObjectMeta `json:"metadata,omitempty"`
Metadata *ObjectMeta `json:"metadata,omitempty"`

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

// metadata is the metadata set on the MachinePool.
// +optional
Metadata *clusterv1beta1.ObjectMeta `json:"metadata,omitempty"`
Metadata *ObjectMeta `json:"metadata,omitempty"`

// class is the class name of the MachinePool,
// to which the current template belongs to.
Expand Down
41 changes: 35 additions & 6 deletions api/runtime/hooks/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading