diff --git a/Makefile b/Makefile index c602fb034369..496c0efafaeb 100644 --- a/Makefile +++ b/Makefile @@ -128,6 +128,16 @@ CONVERSION_GEN_BIN := conversion-gen CONVERSION_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CONVERSION_GEN_BIN)) CONVERSION_GEN_PKG := k8s.io/code-generator/cmd/conversion-gen +CLIENT_GEN_VER := v0.35.0 +CLIENT_GEN_BIN := client-gen +CLIENT_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CLIENT_GEN_BIN)) +CLIENT_GEN_PKG := k8s.io/code-generator/cmd/client-gen + +APPLYCONFIGURATION_GEN_VER := v0.35.0 +APPLYCONFIGURATION_GEN_BIN := applyconfiguration-gen +APPLYCONFIGURATION_GEN := $(abspath $(TOOLS_BIN_DIR)/$(APPLYCONFIGURATION_GEN_BIN)) +APPLYCONFIGURATION_GEN_PKG := k8s.io/code-generator/cmd/applyconfiguration-gen + GO_APIDIFF_VER := v0.8.3 GO_APIDIFF_BIN := go-apidiff GO_APIDIFF := $(abspath $(TOOLS_BIN_DIR)/$(GO_APIDIFF_BIN)-$(GO_APIDIFF_VER)) @@ -276,7 +286,7 @@ ALL_GENERATE_MODULES = core kubeadm-bootstrap kubeadm-control-plane docker-infra .PHONY: generate generate: ## Run all generate-manifests-*, generate-go-deepcopy-*, generate-go-conversions-* and generate-go-openapi targets - $(MAKE) generate-modules generate-manifests generate-go-deepcopy generate-go-conversions generate-go-openapi + $(MAKE) generate-modules generate-manifests generate-go-deepcopy generate-go-conversions generate-go-openapi generate-go-applyconfigurations generate-go-client .PHONY: generate-manifests generate-manifests: $(addprefix generate-manifests-,$(ALL_GENERATE_MODULES)) ## Run all generate-manifests-* targets @@ -538,6 +548,30 @@ generate-go-openapi: $(OPENAPI_GEN) ## Generate openapi go code for runtime SDK done; \ rm sigs.k8s.io/cluster-api +.PHONY: generate-go-applyconfigurations +generate-go-applyconfigurations: $(APPLYCONFIGURATION_GEN) ## Generate apply configurations for Cluster API types + @echo "** Generating apply configurations **" + $(APPLYCONFIGURATION_GEN) \ + --go-header-file=./hack/boilerplate/boilerplate.generatego.txt \ + --output-pkg=sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration \ + --output-dir=./pkg/generated/applyconfiguration \ + sigs.k8s.io/cluster-api/api/core/v1beta2 \ + sigs.k8s.io/cluster-api/api/addons/v1beta2 \ + sigs.k8s.io/cluster-api/api/bootstrap/kubeadm/v1beta2 \ + sigs.k8s.io/cluster-api/api/controlplane/kubeadm/v1beta2 + +.PHONY: generate-go-client +generate-go-client: generate-go-applyconfigurations $(CLIENT_GEN) ## Generate typed client for Cluster API types + @echo "** Generating typed client **" + $(CLIENT_GEN) \ + --go-header-file=./hack/boilerplate/boilerplate.generatego.txt \ + --input=core/v1beta2,addons/v1beta2,bootstrap/kubeadm/v1beta2,controlplane/kubeadm/v1beta2 \ + --input-base=sigs.k8s.io/cluster-api/api \ + --apply-configuration-package=sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration \ + --clientset-name=clientset \ + --output-pkg=sigs.k8s.io/cluster-api/pkg/generated/client \ + --output-dir=./pkg/generated/client + .PHONY: generate-modules generate-modules: ## Run go mod tidy to ensure modules are up to date go mod tidy @@ -1355,6 +1389,14 @@ clean-generated-conversions: ## Remove files generated by conversion-gen from th clean-generated-openapi-definitions: ## Remove files generated by openapi-gen from the mentioned dirs. Example SRC_DIRS="./api/v1alpha4" (IFS=','; for i in $(SRC_DIRS); do find $$i -type f -name 'zz_generated.openapi*' -exec rm -f {} \;; done) +.PHONY: clean-generated-applyconfigurations +clean-generated-applyconfigurations: ## Remove generated applyconfiguration files + rm -rf ./pkg/generated/applyconfiguration + +.PHONY: clean-generated-client +clean-generated-client: ## Remove generated client files + rm -rf ./pkg/generated/client + ## -------------------------------------- ## Hack / Tools ## -------------------------------------- @@ -1424,6 +1466,14 @@ $(CONTROLLER_GEN): # Build controller-gen from tools folder. $(CONVERSION_GEN): # Build conversion-gen from tools folder. GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(CONVERSION_GEN_PKG) $(CONVERSION_GEN_BIN) $(CONVERSION_GEN_VER) +.PHONY: $(CLIENT_GEN) +$(CLIENT_GEN): # Build client-gen from tools folder. + GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(CLIENT_GEN_PKG) $(CLIENT_GEN_BIN) $(CLIENT_GEN_VER) + +.PHONY: $(APPLYCONFIGURATION_GEN) +$(APPLYCONFIGURATION_GEN): # Build applyconfiguration-gen from tools folder. + GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(APPLYCONFIGURATION_GEN_PKG) $(APPLYCONFIGURATION_GEN_BIN) $(APPLYCONFIGURATION_GEN_VER) + $(CONVERSION_VERIFIER): $(TOOLS_DIR)/go.mod # Build conversion-verifier from tools folder. cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/$(CONVERSION_VERIFIER_BIN) sigs.k8s.io/cluster-api/hack/tools/conversion-verifier diff --git a/api/addons/v1beta2/clusterresourceset_types.go b/api/addons/v1beta2/clusterresourceset_types.go index e57c404acfe4..aacba0b0816b 100644 --- a/api/addons/v1beta2/clusterresourceset_types.go +++ b/api/addons/v1beta2/clusterresourceset_types.go @@ -189,6 +189,8 @@ func (m *ClusterResourceSet) SetConditions(conditions []metav1.Condition) { // +kubebuilder:printcolumn:name="Applied",type="string",JSONPath=`.status.conditions[?(@.type=="ResourcesApplied")].status`,description="Resource applied" // +kubebuilder:printcolumn:name="Paused",type="string",JSONPath=`.status.conditions[?(@.type=="Paused")].status`,description="Reconciliation paused",priority=10 // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterResourceSet" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ClusterResourceSet is the Schema for the clusterresourcesets API. // For advanced use cases an add-on provider should be used instead. diff --git a/api/addons/v1beta2/clusterresourcesetbinding_types.go b/api/addons/v1beta2/clusterresourcesetbinding_types.go index ad2e50f7b6cb..5ddb3c57b48d 100644 --- a/api/addons/v1beta2/clusterresourcesetbinding_types.go +++ b/api/addons/v1beta2/clusterresourcesetbinding_types.go @@ -116,6 +116,8 @@ func (c *ClusterResourceSetBinding) RemoveBinding(clusterResourceSet *ClusterRes // +kubebuilder:storageversion // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterResourceSetBinding" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ClusterResourceSetBinding lists all matching ClusterResourceSets with the cluster it belongs to. type ClusterResourceSetBinding struct { diff --git a/api/bootstrap/kubeadm/v1beta2/kubeadmconfig_types.go b/api/bootstrap/kubeadm/v1beta2/kubeadmconfig_types.go index 1f7d6ef4082d..d00b3c8dc817 100644 --- a/api/bootstrap/kubeadm/v1beta2/kubeadmconfig_types.go +++ b/api/bootstrap/kubeadm/v1beta2/kubeadmconfig_types.go @@ -530,6 +530,8 @@ type KubeadmConfigV1Beta1DeprecatedStatus struct { // +kubebuilder:printcolumn:name="Paused",type="string",JSONPath=`.status.conditions[?(@.type=="Paused")].status`,description="Reconciliation paused",priority=10 // +kubebuilder:printcolumn:name="Data secret created",type="string",JSONPath=`.status.initialization.dataSecretCreated`,description="Boostrap secret is created" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of KubeadmConfig" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // KubeadmConfig is the Schema for the kubeadmconfigs API. type KubeadmConfig struct { diff --git a/api/controlplane/kubeadm/v1beta2/kubeadm_control_plane_types.go b/api/controlplane/kubeadm/v1beta2/kubeadm_control_plane_types.go index 6665248903ea..3e528c8ec53e 100644 --- a/api/controlplane/kubeadm/v1beta2/kubeadm_control_plane_types.go +++ b/api/controlplane/kubeadm/v1beta2/kubeadm_control_plane_types.go @@ -829,6 +829,8 @@ type LastRemediationStatus struct { // +kubebuilder:printcolumn:name="Initialized",type=boolean,JSONPath=".status.initialization.controlPlaneInitialized",description="This denotes whether or not the control plane can accept requests" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of KubeadmControlPlane" // +kubebuilder:printcolumn:name="Version",type=string,JSONPath=".spec.version",description="Kubernetes version associated with this control plane" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // KubeadmControlPlane is the Schema for the KubeadmControlPlane API. type KubeadmControlPlane struct { diff --git a/api/core/v1beta2/cluster_types.go b/api/core/v1beta2/cluster_types.go index 9666455e9035..6e3229a3d10f 100644 --- a/api/core/v1beta2/cluster_types.go +++ b/api/core/v1beta2/cluster_types.go @@ -1575,6 +1575,8 @@ func (v APIEndpoint) String() string { // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Cluster status such as Pending/Provisioning/Provisioned/Deleting/Failed" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Cluster" // +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.topology.version",description="Kubernetes version associated with this Cluster" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Cluster is the Schema for the clusters API. type Cluster struct { diff --git a/api/core/v1beta2/clusterclass_types.go b/api/core/v1beta2/clusterclass_types.go index 12e8cc19c5d4..6db4b38cbbb7 100644 --- a/api/core/v1beta2/clusterclass_types.go +++ b/api/core/v1beta2/clusterclass_types.go @@ -72,6 +72,8 @@ const ( // +kubebuilder:printcolumn:name="Paused",type="string",JSONPath=`.status.conditions[?(@.type=="Paused")].status`,description="Reconciliation paused",priority=10 // +kubebuilder:printcolumn:name="Variables Ready",type="string",JSONPath=`.status.conditions[?(@.type=="VariablesReady")].status`,description="Variables ready" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterClass" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ClusterClass is a template which can be used to create managed topologies. // NOTE: This CRD can only be used if the ClusterTopology feature gate is enabled. diff --git a/api/core/v1beta2/machine_types.go b/api/core/v1beta2/machine_types.go index 16f4bf07a707..a5e7d1e48b66 100644 --- a/api/core/v1beta2/machine_types.go +++ b/api/core/v1beta2/machine_types.go @@ -793,6 +793,8 @@ type Bootstrap struct { // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Machine status such as Terminating/Pending/Running/Failed etc" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Machine" // +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version",description="Kubernetes version associated with this Machine" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Machine is the Schema for the machines API. type Machine struct { diff --git a/api/core/v1beta2/machinedeployment_types.go b/api/core/v1beta2/machinedeployment_types.go index b7182c278ef6..1a308d46ae7f 100644 --- a/api/core/v1beta2/machinedeployment_types.go +++ b/api/core/v1beta2/machinedeployment_types.go @@ -584,6 +584,8 @@ func (md *MachineDeploymentStatus) GetTypedPhase() MachineDeploymentPhase { // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="MachineDeployment status such as ScalingUp/ScalingDown/Running/Failed/Unknown" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineDeployment" // +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.template.spec.version",description="Kubernetes version associated with this MachineDeployment" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // MachineDeployment is the Schema for the machinedeployments API. type MachineDeployment struct { diff --git a/api/core/v1beta2/machinehealthcheck_types.go b/api/core/v1beta2/machinehealthcheck_types.go index 9a1f66bc8b07..36f1295141b3 100644 --- a/api/core/v1beta2/machinehealthcheck_types.go +++ b/api/core/v1beta2/machinehealthcheck_types.go @@ -343,6 +343,8 @@ type MachineHealthCheckV1Beta1DeprecatedStatus struct { // +kubebuilder:printcolumn:name="Healthy",type="integer",JSONPath=".status.currentHealthy",description="Current observed healthy machines" // +kubebuilder:printcolumn:name="Paused",type="string",JSONPath=`.status.conditions[?(@.type=="Paused")].status`,description="Reconciliation paused",priority=10 // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineHealthCheck" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // MachineHealthCheck is the Schema for the machinehealthchecks API. type MachineHealthCheck struct { diff --git a/api/core/v1beta2/machinepool_types.go b/api/core/v1beta2/machinepool_types.go index a6d16aff1467..012178ded311 100644 --- a/api/core/v1beta2/machinepool_types.go +++ b/api/core/v1beta2/machinepool_types.go @@ -333,6 +333,8 @@ func (m *MachinePoolStatus) GetTypedPhase() MachinePoolPhase { // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachinePool" // +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.template.spec.version",description="Kubernetes version associated with this MachinePool" // +k8s:conversion-gen=false +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // MachinePool is the Schema for the machinepools API. // NOTE: This CRD can only be used if the MachinePool feature gate is enabled. diff --git a/api/core/v1beta2/machineset_types.go b/api/core/v1beta2/machineset_types.go index 80cb19d36256..95d4a8052da7 100644 --- a/api/core/v1beta2/machineset_types.go +++ b/api/core/v1beta2/machineset_types.go @@ -458,6 +458,8 @@ func (m *MachineSet) Validate() field.ErrorList { // +kubebuilder:printcolumn:name="Paused",type="string",JSONPath=`.status.conditions[?(@.type=="Paused")].status`,description="Reconciliation paused",priority=10 // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineSet" // +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.template.spec.version",description="Kubernetes version associated with this MachineSet" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // MachineSet is the Schema for the machinesets API. type MachineSet struct { diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md index d70c2b41f66a..ca6f2b64ad94 100644 --- a/docs/book/src/SUMMARY.md +++ b/docs/book/src/SUMMARY.md @@ -71,6 +71,7 @@ - [Developing "core" Cluster API](developer/core/overview.md) - [Rapid iterative development with Tilt](developer/core/tilt.md) - [Repository Layout](developer/core/repository-layout.md) + - [Using ApplyConfigurations for Server-Side Apply](./developer/architecture/apply-configurations.md) - [Controllers](./developer/core/controllers/overview.md) - [Cluster](./developer/core/controllers/cluster.md) - [ClusterTopology](./developer/core/controllers/cluster-topology.md) diff --git a/docs/book/src/developer/architecture/apply-configurations.md b/docs/book/src/developer/architecture/apply-configurations.md new file mode 100644 index 000000000000..1d2bc1ddfa7a --- /dev/null +++ b/docs/book/src/developer/architecture/apply-configurations.md @@ -0,0 +1,235 @@ +# Using ApplyConfigurations for Server-Side Apply + +Cluster API provides generated ApplyConfiguration types that enable type-safe Server-Side Apply (SSA) operations in Go. This allows multiple controllers and operators to cooperatively manage Cluster API resources without conflicts. + +## Overview + +ApplyConfigurations provide a builder pattern for constructing partial resource definitions that can be applied using Kubernetes Server-Side Apply. Unlike traditional Update operations, SSA allows multiple actors (controllers, operators, users) to manage different fields of the same resource independently. + +## Benefits of Server-Side Apply + +- **Field Management**: Kubernetes tracks which controller owns which fields +- **Conflict Resolution**: Automatic conflict detection and resolution +- **Cooperative Management**: Multiple controllers can safely update different fields +- **Atomic Operations**: Changes are applied atomically + +## Generated Packages + +The generated code is located in: +- **ApplyConfigurations**: `pkg/generated/applyconfiguration/` +- **Typed Clients**: `pkg/generated/client/` + +Supported API groups: +- `core/v1beta2` - Cluster, Machine, MachineDeployment, MachineSet, MachinePool, ClusterClass, MachineHealthCheck +- `addons/v1beta2` - ClusterResourceSet, ClusterResourceSetBinding +- `bootstrap/kubeadm/v1beta2` - KubeadmConfig +- `controlplane/kubeadm/v1beta2` - KubeadmControlPlane + +## Usage Examples + +### Creating a Cluster with SSA + +```go +package main + +import ( + "context" + + applycorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func createCluster(ctx context.Context, c client.Client) error { + // Build the Cluster apply configuration + clusterApply := applycorev1beta2.Cluster("my-cluster", "default"). + WithSpec(applycorev1beta2.ClusterSpec(). + WithControlPlaneEndpoint(applycorev1beta2.APIEndpoint(). + WithHost("10.0.0.1"). + WithPort(6443)). + WithClusterNetwork(applycorev1beta2.ClusterNetwork(). + WithServiceDomain("cluster.local"))) + + // Apply the configuration + err := c.Apply(ctx, clusterApply, + client.FieldOwner("my-controller"), + client.ForceOwnership) + + return err +} +``` + +### Updating Machine Deployment Replicas + +```go +func scaleDeployment(ctx context.Context, c client.Client, name, namespace string, replicas int32) error { + // Build a partial apply configuration with just the replica count + mdApply := applycorev1beta2.MachineDeployment(name, namespace). + WithSpec(applycorev1beta2.MachineDeploymentSpec(). + WithReplicas(replicas)) + + // Apply only the replica field + return c.Apply(ctx, mdApply, + client.FieldOwner("autoscaler"), + client.ForceOwnership) +} +``` + +### Setting Infrastructure Reference + +```go +func setInfrastructureRef(ctx context.Context, c client.Client, clusterName, namespace string) error { + clusterApply := applycorev1beta2.Cluster(clusterName, namespace). + WithSpec(applycorev1beta2.ClusterSpec(). + WithInfrastructureRef( + &corev1.ObjectReference{ + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", + Kind: "MyInfraCluster", + Name: clusterName + "-infra", + Namespace: namespace, + }, + )) + + return c.Apply(ctx, clusterApply, + client.FieldOwner("infrastructure-controller")) +} +``` + +### Working with Status Subresources + +```go +func updateClusterStatus(ctx context.Context, c client.Client, clusterName, namespace string) error { + statusApply := applycorev1beta2.Cluster(clusterName, namespace). + WithStatus(applycorev1beta2.ClusterStatus(). + WithPhase("Provisioned"). + WithConditions(metav1.Condition{ + Type: "Ready", + Status: metav1.ConditionTrue, + Reason: "ClusterReady", + })) + + // Use Status().Apply() for status subresource + return c.Status().Apply(ctx, statusApply, + client.FieldOwner("cluster-controller")) +} +``` + +## Field Ownership + +Each controller should use a unique `FieldOwner` identifier when calling Apply: + +```go +client.FieldOwner("cluster-topology-controller") +client.FieldOwner("machine-controller") +client.FieldOwner("my-custom-operator") +``` + +This allows Kubernetes to track which controller manages which fields and detect conflicts. + +## Force Ownership + +Use `client.ForceOwnership` to take over fields from other controllers: + +```go +err := c.Apply(ctx, clusterApply, + client.FieldOwner("priority-controller"), + client.ForceOwnership) // Take over conflicting fields +``` + +**Warning**: Use `ForceOwnership` carefully as it can overwrite changes made by other controllers. + +## Using the Typed Client + +The generated typed client provides direct access to Apply methods: + +```go +import ( + "k8s.io/client-go/rest" + clientset "sigs.k8s.io/cluster-api/pkg/generated/client/clientset" +) + +func example(config *rest.Config) error { + // Create the clientset + cs, err := clientset.NewForConfig(config) + if err != nil { + return err + } + + // Use the typed client for core/v1beta2 resources + clusterClient := cs.ClusterV1beta2().Clusters("default") + + // Apply configuration + result, err := clusterClient.Apply(ctx, clusterApply, metav1.ApplyOptions{ + FieldManager: "my-controller", + }) + + return err +} +``` + +## Comparison with controller-runtime + +### Using controller-runtime (existing approach) + +```go +// Convert to Unstructured at runtime +modifiedUnstructured, err := prepareModified(c.Scheme(), modified) +if err != nil { + return err +} + +err = c.Apply(ctx, client.ApplyConfigurationFromUnstructured(modifiedUnstructured), + client.FieldOwner("my-controller")) +``` + +### Using ApplyConfigurations (new approach) + +```go +// Type-safe builder pattern +clusterApply := applycorev1beta2.Cluster("my-cluster", "default"). + WithSpec(applycorev1beta2.ClusterSpec(). + WithControlPlaneEndpoint(...)) + +err := c.Apply(ctx, clusterApply, + client.FieldOwner("my-controller")) +``` + +## Best Practices + +1. **Use Specific Field Owners**: Choose descriptive, unique field owner names +2. **Minimize Force Ownership**: Only use when absolutely necessary +3. **Apply Partial Updates**: Only include fields you want to manage +4. **Handle Conflicts**: Check for and handle ownership conflicts gracefully +5. **Document Field Ownership**: Clearly document which controller owns which fields + +## Limitations + +- Only available for v1beta2 APIs +- Requires controller-runtime v0.18.0 or later +- Not all nested types may have apply configurations generated + +## Troubleshooting + +### Conflict Errors + +If you encounter conflicts: +``` +Apply failed: field managed by another controller +``` + +Solutions: +1. Use a different field or coordinate with the other controller +2. Use `ForceOwnership` if your controller should take precedence +3. Check the field manager using `kubectl get -o yaml` and look for `managedFields` + +### Missing Apply Methods + +If apply methods are missing for a type: +1. Verify the type has `+genclient` tags in its source +2. Run `make generate` to regenerate code +3. Check that the type is in a supported API group + +## Additional Resources + +- [Kubernetes Server-Side Apply Documentation](https://kubernetes.io/docs/reference/using-api/server-side-apply/) +- [Controller-Runtime Apply Documentation](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/client#Client.Apply) +- [Field Management](https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management) diff --git a/go.mod b/go.mod index dfac1f42f171..ca4f1ab96f6d 100644 --- a/go.mod +++ b/go.mod @@ -55,6 +55,8 @@ require ( sigs.k8s.io/yaml v1.6.0 ) +require sigs.k8s.io/structured-merge-diff/v6 v6.3.0 + require ( cel.dev/expr v0.24.0 // indirect dario.cat/mergo v1.0.1 // indirect @@ -157,5 +159,4 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect - sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect ) diff --git a/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourceset.go b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourceset.go new file mode 100644 index 000000000000..138ea5e7f0ed --- /dev/null +++ b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourceset.go @@ -0,0 +1,250 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterResourceSetApplyConfiguration represents a declarative configuration of the ClusterResourceSet type for use +// with apply. +// +// ClusterResourceSet is the Schema for the clusterresourcesets API. +// For advanced use cases an add-on provider should be used instead. +type ClusterResourceSetApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is the desired state of ClusterResourceSet. + Spec *ClusterResourceSetSpecApplyConfiguration `json:"spec,omitempty"` + // status is the observed state of ClusterResourceSet. + Status *ClusterResourceSetStatusApplyConfiguration `json:"status,omitempty"` +} + +// ClusterResourceSet constructs a declarative configuration of the ClusterResourceSet type for use with +// apply. +func ClusterResourceSet(name, namespace string) *ClusterResourceSetApplyConfiguration { + b := &ClusterResourceSetApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ClusterResourceSet") + b.WithAPIVersion("addons.cluster.x-k8s.io/v1beta2") + return b +} + +func (b ClusterResourceSetApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithKind(value string) *ClusterResourceSetApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithAPIVersion(value string) *ClusterResourceSetApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithName(value string) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithGenerateName(value string) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithNamespace(value string) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithUID(value types.UID) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithResourceVersion(value string) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithGeneration(value int64) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ClusterResourceSetApplyConfiguration) WithLabels(entries map[string]string) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ClusterResourceSetApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ClusterResourceSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ClusterResourceSetApplyConfiguration) WithFinalizers(values ...string) *ClusterResourceSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ClusterResourceSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithSpec(value *ClusterResourceSetSpecApplyConfiguration) *ClusterResourceSetApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ClusterResourceSetApplyConfiguration) WithStatus(value *ClusterResourceSetStatusApplyConfiguration) *ClusterResourceSetApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ClusterResourceSetApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ClusterResourceSetApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterResourceSetApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ClusterResourceSetApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetbinding.go b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetbinding.go new file mode 100644 index 000000000000..34d8e49da193 --- /dev/null +++ b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetbinding.go @@ -0,0 +1,239 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterResourceSetBindingApplyConfiguration represents a declarative configuration of the ClusterResourceSetBinding type for use +// with apply. +// +// ClusterResourceSetBinding lists all matching ClusterResourceSets with the cluster it belongs to. +type ClusterResourceSetBindingApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is the desired state of ClusterResourceSetBinding. + Spec *ClusterResourceSetBindingSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ClusterResourceSetBinding constructs a declarative configuration of the ClusterResourceSetBinding type for use with +// apply. +func ClusterResourceSetBinding(name, namespace string) *ClusterResourceSetBindingApplyConfiguration { + b := &ClusterResourceSetBindingApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ClusterResourceSetBinding") + b.WithAPIVersion("addons.cluster.x-k8s.io/v1beta2") + return b +} + +func (b ClusterResourceSetBindingApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ClusterResourceSetBindingApplyConfiguration) WithKind(value string) *ClusterResourceSetBindingApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ClusterResourceSetBindingApplyConfiguration) WithAPIVersion(value string) *ClusterResourceSetBindingApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterResourceSetBindingApplyConfiguration) WithName(value string) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ClusterResourceSetBindingApplyConfiguration) WithGenerateName(value string) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ClusterResourceSetBindingApplyConfiguration) WithNamespace(value string) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ClusterResourceSetBindingApplyConfiguration) WithUID(value types.UID) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ClusterResourceSetBindingApplyConfiguration) WithResourceVersion(value string) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ClusterResourceSetBindingApplyConfiguration) WithGeneration(value int64) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ClusterResourceSetBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ClusterResourceSetBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ClusterResourceSetBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ClusterResourceSetBindingApplyConfiguration) WithLabels(entries map[string]string) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ClusterResourceSetBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ClusterResourceSetBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ClusterResourceSetBindingApplyConfiguration) WithFinalizers(values ...string) *ClusterResourceSetBindingApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ClusterResourceSetBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ClusterResourceSetBindingApplyConfiguration) WithSpec(value *ClusterResourceSetBindingSpecApplyConfiguration) *ClusterResourceSetBindingApplyConfiguration { + b.Spec = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ClusterResourceSetBindingApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ClusterResourceSetBindingApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterResourceSetBindingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ClusterResourceSetBindingApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetbindingspec.go b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetbindingspec.go new file mode 100644 index 000000000000..ad033ce8dae5 --- /dev/null +++ b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetbindingspec.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterResourceSetBindingSpecApplyConfiguration represents a declarative configuration of the ClusterResourceSetBindingSpec type for use +// with apply. +// +// ClusterResourceSetBindingSpec defines the desired state of ClusterResourceSetBinding. +type ClusterResourceSetBindingSpecApplyConfiguration struct { + // bindings is a list of ClusterResourceSets and their resources. + Bindings []ResourceSetBindingApplyConfiguration `json:"bindings,omitempty"` + // clusterName is the name of the Cluster this binding applies to. + ClusterName *string `json:"clusterName,omitempty"` +} + +// ClusterResourceSetBindingSpecApplyConfiguration constructs a declarative configuration of the ClusterResourceSetBindingSpec type for use with +// apply. +func ClusterResourceSetBindingSpec() *ClusterResourceSetBindingSpecApplyConfiguration { + return &ClusterResourceSetBindingSpecApplyConfiguration{} +} + +// WithBindings adds the given value to the Bindings field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Bindings field. +func (b *ClusterResourceSetBindingSpecApplyConfiguration) WithBindings(values ...*ResourceSetBindingApplyConfiguration) *ClusterResourceSetBindingSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithBindings") + } + b.Bindings = append(b.Bindings, *values[i]) + } + return b +} + +// WithClusterName sets the ClusterName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterName field is set to the value of the last call. +func (b *ClusterResourceSetBindingSpecApplyConfiguration) WithClusterName(value string) *ClusterResourceSetBindingSpecApplyConfiguration { + b.ClusterName = &value + return b +} diff --git a/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetdeprecatedstatus.go b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetdeprecatedstatus.go new file mode 100644 index 000000000000..0d9f2ab867de --- /dev/null +++ b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetdeprecatedstatus.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterResourceSetDeprecatedStatusApplyConfiguration represents a declarative configuration of the ClusterResourceSetDeprecatedStatus type for use +// with apply. +// +// ClusterResourceSetDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type ClusterResourceSetDeprecatedStatusApplyConfiguration struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + V1Beta1 *ClusterResourceSetV1Beta1DeprecatedStatusApplyConfiguration `json:"v1beta1,omitempty"` +} + +// ClusterResourceSetDeprecatedStatusApplyConfiguration constructs a declarative configuration of the ClusterResourceSetDeprecatedStatus type for use with +// apply. +func ClusterResourceSetDeprecatedStatus() *ClusterResourceSetDeprecatedStatusApplyConfiguration { + return &ClusterResourceSetDeprecatedStatusApplyConfiguration{} +} + +// WithV1Beta1 sets the V1Beta1 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the V1Beta1 field is set to the value of the last call. +func (b *ClusterResourceSetDeprecatedStatusApplyConfiguration) WithV1Beta1(value *ClusterResourceSetV1Beta1DeprecatedStatusApplyConfiguration) *ClusterResourceSetDeprecatedStatusApplyConfiguration { + b.V1Beta1 = value + return b +} diff --git a/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetspec.go b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetspec.go new file mode 100644 index 000000000000..1293881bfa3b --- /dev/null +++ b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetspec.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterResourceSetSpecApplyConfiguration represents a declarative configuration of the ClusterResourceSetSpec type for use +// with apply. +// +// ClusterResourceSetSpec defines the desired state of ClusterResourceSet. +type ClusterResourceSetSpecApplyConfiguration struct { + // clusterSelector is the label selector for Clusters. The Clusters that are + // selected by this will be the ones affected by this ClusterResourceSet. + // It must match the Cluster labels. This field is immutable. + // Label selector cannot be empty. + ClusterSelector *v1.LabelSelectorApplyConfiguration `json:"clusterSelector,omitempty"` + // resources is a list of Secrets/ConfigMaps where each contains 1 or more resources to be applied to remote clusters. + Resources []ResourceRefApplyConfiguration `json:"resources,omitempty"` + // strategy is the strategy to be used during applying resources. Defaults to ApplyOnce. This field is immutable. + Strategy *string `json:"strategy,omitempty"` +} + +// ClusterResourceSetSpecApplyConfiguration constructs a declarative configuration of the ClusterResourceSetSpec type for use with +// apply. +func ClusterResourceSetSpec() *ClusterResourceSetSpecApplyConfiguration { + return &ClusterResourceSetSpecApplyConfiguration{} +} + +// WithClusterSelector sets the ClusterSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterSelector field is set to the value of the last call. +func (b *ClusterResourceSetSpecApplyConfiguration) WithClusterSelector(value *v1.LabelSelectorApplyConfiguration) *ClusterResourceSetSpecApplyConfiguration { + b.ClusterSelector = value + return b +} + +// WithResources adds the given value to the Resources field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Resources field. +func (b *ClusterResourceSetSpecApplyConfiguration) WithResources(values ...*ResourceRefApplyConfiguration) *ClusterResourceSetSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResources") + } + b.Resources = append(b.Resources, *values[i]) + } + return b +} + +// WithStrategy sets the Strategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Strategy field is set to the value of the last call. +func (b *ClusterResourceSetSpecApplyConfiguration) WithStrategy(value string) *ClusterResourceSetSpecApplyConfiguration { + b.Strategy = &value + return b +} diff --git a/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetstatus.go b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetstatus.go new file mode 100644 index 000000000000..7fa822459613 --- /dev/null +++ b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetstatus.go @@ -0,0 +1,72 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterResourceSetStatusApplyConfiguration represents a declarative configuration of the ClusterResourceSetStatus type for use +// with apply. +// +// ClusterResourceSetStatus defines the observed state of ClusterResourceSet. +type ClusterResourceSetStatusApplyConfiguration struct { + // conditions represents the observations of a ClusterResourceSet's current state. + // Known condition types are ResourcesApplied. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // observedGeneration reflects the generation of the most recently observed ClusterResourceSet. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + Deprecated *ClusterResourceSetDeprecatedStatusApplyConfiguration `json:"deprecated,omitempty"` +} + +// ClusterResourceSetStatusApplyConfiguration constructs a declarative configuration of the ClusterResourceSetStatus type for use with +// apply. +func ClusterResourceSetStatus() *ClusterResourceSetStatusApplyConfiguration { + return &ClusterResourceSetStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ClusterResourceSetStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ClusterResourceSetStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *ClusterResourceSetStatusApplyConfiguration) WithObservedGeneration(value int64) *ClusterResourceSetStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithDeprecated sets the Deprecated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deprecated field is set to the value of the last call. +func (b *ClusterResourceSetStatusApplyConfiguration) WithDeprecated(value *ClusterResourceSetDeprecatedStatusApplyConfiguration) *ClusterResourceSetStatusApplyConfiguration { + b.Deprecated = value + return b +} diff --git a/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetv1beta1deprecatedstatus.go b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetv1beta1deprecatedstatus.go new file mode 100644 index 000000000000..5685a912c87f --- /dev/null +++ b/pkg/generated/applyconfiguration/addons/v1beta2/clusterresourcesetv1beta1deprecatedstatus.go @@ -0,0 +1,49 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// ClusterResourceSetV1Beta1DeprecatedStatusApplyConfiguration represents a declarative configuration of the ClusterResourceSetV1Beta1DeprecatedStatus type for use +// with apply. +// +// ClusterResourceSetV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type ClusterResourceSetV1Beta1DeprecatedStatusApplyConfiguration struct { + // conditions defines current state of the ClusterResourceSet. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + Conditions *corev1beta2.Conditions `json:"conditions,omitempty"` +} + +// ClusterResourceSetV1Beta1DeprecatedStatusApplyConfiguration constructs a declarative configuration of the ClusterResourceSetV1Beta1DeprecatedStatus type for use with +// apply. +func ClusterResourceSetV1Beta1DeprecatedStatus() *ClusterResourceSetV1Beta1DeprecatedStatusApplyConfiguration { + return &ClusterResourceSetV1Beta1DeprecatedStatusApplyConfiguration{} +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *ClusterResourceSetV1Beta1DeprecatedStatusApplyConfiguration) WithConditions(value corev1beta2.Conditions) *ClusterResourceSetV1Beta1DeprecatedStatusApplyConfiguration { + b.Conditions = &value + return b +} diff --git a/pkg/generated/applyconfiguration/addons/v1beta2/resourcebinding.go b/pkg/generated/applyconfiguration/addons/v1beta2/resourcebinding.go new file mode 100644 index 000000000000..7a66a6a0212f --- /dev/null +++ b/pkg/generated/applyconfiguration/addons/v1beta2/resourcebinding.go @@ -0,0 +1,85 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ResourceBindingApplyConfiguration represents a declarative configuration of the ResourceBinding type for use +// with apply. +// +// ResourceBinding shows the status of a resource that belongs to a ClusterResourceSet matched by the owner cluster of the ClusterResourceSetBinding object. +type ResourceBindingApplyConfiguration struct { + // ResourceRef specifies a resource. + ResourceRefApplyConfiguration `json:",inline"` + // hash is the hash of a resource's data. This can be used to decide if a resource is changed. + // For "ApplyOnce" ClusterResourceSet.spec.strategy, this is no-op as that strategy does not act on change. + Hash *string `json:"hash,omitempty"` + // lastAppliedTime identifies when this resource was last applied to the cluster. + LastAppliedTime *v1.Time `json:"lastAppliedTime,omitempty"` + // applied is to track if a resource is applied to the cluster or not. + Applied *bool `json:"applied,omitempty"` +} + +// ResourceBindingApplyConfiguration constructs a declarative configuration of the ResourceBinding type for use with +// apply. +func ResourceBinding() *ResourceBindingApplyConfiguration { + return &ResourceBindingApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourceBindingApplyConfiguration) WithName(value string) *ResourceBindingApplyConfiguration { + b.ResourceRefApplyConfiguration.Name = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ResourceBindingApplyConfiguration) WithKind(value string) *ResourceBindingApplyConfiguration { + b.ResourceRefApplyConfiguration.Kind = &value + return b +} + +// WithHash sets the Hash field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hash field is set to the value of the last call. +func (b *ResourceBindingApplyConfiguration) WithHash(value string) *ResourceBindingApplyConfiguration { + b.Hash = &value + return b +} + +// WithLastAppliedTime sets the LastAppliedTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastAppliedTime field is set to the value of the last call. +func (b *ResourceBindingApplyConfiguration) WithLastAppliedTime(value v1.Time) *ResourceBindingApplyConfiguration { + b.LastAppliedTime = &value + return b +} + +// WithApplied sets the Applied field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Applied field is set to the value of the last call. +func (b *ResourceBindingApplyConfiguration) WithApplied(value bool) *ResourceBindingApplyConfiguration { + b.Applied = &value + return b +} diff --git a/pkg/generated/applyconfiguration/addons/v1beta2/resourceref.go b/pkg/generated/applyconfiguration/addons/v1beta2/resourceref.go new file mode 100644 index 000000000000..04de4c3fe59d --- /dev/null +++ b/pkg/generated/applyconfiguration/addons/v1beta2/resourceref.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ResourceRefApplyConfiguration represents a declarative configuration of the ResourceRef type for use +// with apply. +// +// ResourceRef specifies a resource. +type ResourceRefApplyConfiguration struct { + // name of the resource that is in the same namespace with ClusterResourceSet object. + Name *string `json:"name,omitempty"` + // kind of the resource. Supported kinds are: Secrets and ConfigMaps. + Kind *string `json:"kind,omitempty"` +} + +// ResourceRefApplyConfiguration constructs a declarative configuration of the ResourceRef type for use with +// apply. +func ResourceRef() *ResourceRefApplyConfiguration { + return &ResourceRefApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourceRefApplyConfiguration) WithName(value string) *ResourceRefApplyConfiguration { + b.Name = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ResourceRefApplyConfiguration) WithKind(value string) *ResourceRefApplyConfiguration { + b.Kind = &value + return b +} diff --git a/pkg/generated/applyconfiguration/addons/v1beta2/resourcesetbinding.go b/pkg/generated/applyconfiguration/addons/v1beta2/resourcesetbinding.go new file mode 100644 index 000000000000..3b7e798ed86d --- /dev/null +++ b/pkg/generated/applyconfiguration/addons/v1beta2/resourcesetbinding.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ResourceSetBindingApplyConfiguration represents a declarative configuration of the ResourceSetBinding type for use +// with apply. +// +// ResourceSetBinding keeps info on all of the resources in a ClusterResourceSet. +type ResourceSetBindingApplyConfiguration struct { + // clusterResourceSetName is the name of the ClusterResourceSet that is applied to the owner cluster of the binding. + ClusterResourceSetName *string `json:"clusterResourceSetName,omitempty"` + // resources is a list of resources that the ClusterResourceSet has. + Resources []ResourceBindingApplyConfiguration `json:"resources,omitempty"` +} + +// ResourceSetBindingApplyConfiguration constructs a declarative configuration of the ResourceSetBinding type for use with +// apply. +func ResourceSetBinding() *ResourceSetBindingApplyConfiguration { + return &ResourceSetBindingApplyConfiguration{} +} + +// WithClusterResourceSetName sets the ClusterResourceSetName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterResourceSetName field is set to the value of the last call. +func (b *ResourceSetBindingApplyConfiguration) WithClusterResourceSetName(value string) *ResourceSetBindingApplyConfiguration { + b.ClusterResourceSetName = &value + return b +} + +// WithResources adds the given value to the Resources field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Resources field. +func (b *ResourceSetBindingApplyConfiguration) WithResources(values ...*ResourceBindingApplyConfiguration) *ResourceSetBindingApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResources") + } + b.Resources = append(b.Resources, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/apiendpoint.go b/pkg/generated/applyconfiguration/core/v1beta2/apiendpoint.go new file mode 100644 index 000000000000..47b38da64bfd --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/apiendpoint.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// APIEndpointApplyConfiguration represents a declarative configuration of the APIEndpoint type for use +// with apply. +// +// APIEndpoint represents a reachable Kubernetes API endpoint. +type APIEndpointApplyConfiguration struct { + // host is the hostname on which the API server is serving. + Host *string `json:"host,omitempty"` + // port is the port on which the API server is serving. + Port *int32 `json:"port,omitempty"` +} + +// APIEndpointApplyConfiguration constructs a declarative configuration of the APIEndpoint type for use with +// apply. +func APIEndpoint() *APIEndpointApplyConfiguration { + return &APIEndpointApplyConfiguration{} +} + +// WithHost sets the Host field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Host field is set to the value of the last call. +func (b *APIEndpointApplyConfiguration) WithHost(value string) *APIEndpointApplyConfiguration { + b.Host = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *APIEndpointApplyConfiguration) WithPort(value int32) *APIEndpointApplyConfiguration { + b.Port = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/bootstrap.go b/pkg/generated/applyconfiguration/core/v1beta2/bootstrap.go new file mode 100644 index 000000000000..99fb521174d1 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/bootstrap.go @@ -0,0 +1,56 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// BootstrapApplyConfiguration represents a declarative configuration of the Bootstrap type for use +// with apply. +// +// Bootstrap encapsulates fields to configure the Machine’s bootstrapping mechanism. +type BootstrapApplyConfiguration struct { + // configRef is a reference to a bootstrap provider-specific resource + // that holds configuration details. The reference is optional to + // allow users/operators to specify Bootstrap.DataSecretName without + // the need of a controller. + ConfigRef *ContractVersionedObjectReferenceApplyConfiguration `json:"configRef,omitempty"` + // dataSecretName is the name of the secret that stores the bootstrap data script. + // If nil, the Machine should remain in the Pending state. + DataSecretName *string `json:"dataSecretName,omitempty"` +} + +// BootstrapApplyConfiguration constructs a declarative configuration of the Bootstrap type for use with +// apply. +func Bootstrap() *BootstrapApplyConfiguration { + return &BootstrapApplyConfiguration{} +} + +// WithConfigRef sets the ConfigRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfigRef field is set to the value of the last call. +func (b *BootstrapApplyConfiguration) WithConfigRef(value *ContractVersionedObjectReferenceApplyConfiguration) *BootstrapApplyConfiguration { + b.ConfigRef = value + return b +} + +// WithDataSecretName sets the DataSecretName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DataSecretName field is set to the value of the last call. +func (b *BootstrapApplyConfiguration) WithDataSecretName(value string) *BootstrapApplyConfiguration { + b.DataSecretName = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/cluster.go b/pkg/generated/applyconfiguration/core/v1beta2/cluster.go new file mode 100644 index 000000000000..f16c3c9277e0 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/cluster.go @@ -0,0 +1,249 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterApplyConfiguration represents a declarative configuration of the Cluster type for use +// with apply. +// +// Cluster is the Schema for the clusters API. +type ClusterApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is the desired state of Cluster. + Spec *ClusterSpecApplyConfiguration `json:"spec,omitempty"` + // status is the observed state of Cluster. + Status *ClusterStatusApplyConfiguration `json:"status,omitempty"` +} + +// Cluster constructs a declarative configuration of the Cluster type for use with +// apply. +func Cluster(name, namespace string) *ClusterApplyConfiguration { + b := &ClusterApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Cluster") + b.WithAPIVersion("cluster.x-k8s.io/v1beta2") + return b +} + +func (b ClusterApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithKind(value string) *ClusterApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithAPIVersion(value string) *ClusterApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithName(value string) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithGenerateName(value string) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithNamespace(value string) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithUID(value types.UID) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithResourceVersion(value string) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithGeneration(value int64) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ClusterApplyConfiguration) WithLabels(entries map[string]string) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ClusterApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ClusterApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ClusterApplyConfiguration) WithFinalizers(values ...string) *ClusterApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ClusterApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithSpec(value *ClusterSpecApplyConfiguration) *ClusterApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ClusterApplyConfiguration) WithStatus(value *ClusterStatusApplyConfiguration) *ClusterApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ClusterApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ClusterApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ClusterApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/cluster_test.go b/pkg/generated/applyconfiguration/core/v1beta2/cluster_test.go new file mode 100644 index 000000000000..233d4adf95dd --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/cluster_test.go @@ -0,0 +1,127 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + "encoding/json" + "testing" + + metav1apply "k8s.io/client-go/applyconfigurations/meta/v1" +) + +func TestClusterApplyConfiguration(t *testing.T) { + tests := []struct { + name string + builder func() *ClusterApplyConfiguration + wantJSON string + }{ + { + name: "basic cluster with name and namespace", + builder: func() *ClusterApplyConfiguration { + return Cluster("test-cluster", "default") + }, + wantJSON: `{"kind":"Cluster","apiVersion":"cluster.x-k8s.io/v1beta2","metadata":{"name":"test-cluster","namespace":"default"}}`, + }, + { + name: "cluster with control plane endpoint", + builder: func() *ClusterApplyConfiguration { + return Cluster("test-cluster", "default"). + WithSpec(ClusterSpec(). + WithControlPlaneEndpoint(APIEndpoint(). + WithHost("10.0.0.1"). + WithPort(6443))) + }, + wantJSON: `{"kind":"Cluster","apiVersion":"cluster.x-k8s.io/v1beta2","metadata":{"name":"test-cluster","namespace":"default"},"spec":{"controlPlaneEndpoint":{"host":"10.0.0.1","port":6443}}}`, + }, + { + name: "cluster with paused field", + builder: func() *ClusterApplyConfiguration { + return Cluster("test-cluster", "default"). + WithSpec(ClusterSpec(). + WithPaused(true)) + }, + wantJSON: `{"kind":"Cluster","apiVersion":"cluster.x-k8s.io/v1beta2","metadata":{"name":"test-cluster","namespace":"default"},"spec":{"paused":true}}`, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + applyConfig := tt.builder() + + // Serialize to JSON + gotJSON, err := json.Marshal(applyConfig) + if err != nil { + t.Fatalf("failed to marshal ApplyConfiguration: %v", err) + } + + // Compare JSON + if string(gotJSON) != tt.wantJSON { + t.Errorf("JSON mismatch:\ngot: %s\nwant: %s", string(gotJSON), tt.wantJSON) + } + }) + } +} + +func TestClusterStatusApplyConfiguration(t *testing.T) { + cluster := Cluster("test-cluster", "default"). + WithStatus(ClusterStatus(). + WithPhase("Provisioned"). + WithConditions(metav1apply.Condition(). + WithType("Ready"). + WithStatus("True"). + WithReason("ClusterReady"))) + + // Verify the cluster has status + if cluster.Status == nil { + t.Error("expected Status to be set") + } + + if cluster.Status.Phase == nil || *cluster.Status.Phase != "Provisioned" { + t.Error("expected Phase to be 'Provisioned'") + } + + if cluster.Status.Conditions == nil || len(cluster.Status.Conditions) == 0 { + t.Error("expected Conditions to be set") + } +} + +func TestMachineApplyConfiguration(t *testing.T) { + machine := Machine("test-machine", "default"). + WithSpec(MachineSpec(). + WithVersion("v1.28.0"). + WithClusterName("test-cluster")) + + // Serialize to JSON + gotJSON, err := json.Marshal(machine) + if err != nil { + t.Fatalf("failed to marshal Machine ApplyConfiguration: %v", err) + } + + // Verify it contains expected fields + var result map[string]interface{} + if err := json.Unmarshal(gotJSON, &result); err != nil { + t.Fatalf("failed to unmarshal JSON: %v", err) + } + + if result["kind"] != "Machine" { + t.Errorf("expected kind=Machine, got %v", result["kind"]) + } + + if result["apiVersion"] != "cluster.x-k8s.io/v1beta2" { + t.Errorf("expected apiVersion=cluster.x-k8s.io/v1beta2, got %v", result["apiVersion"]) + } +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusteravailabilitygate.go b/pkg/generated/applyconfiguration/core/v1beta2/clusteravailabilitygate.go new file mode 100644 index 000000000000..ecab979cde87 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusteravailabilitygate.go @@ -0,0 +1,62 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// ClusterAvailabilityGateApplyConfiguration represents a declarative configuration of the ClusterAvailabilityGate type for use +// with apply. +// +// ClusterAvailabilityGate contains the type of a Cluster condition to be used as availability gate. +type ClusterAvailabilityGateApplyConfiguration struct { + // conditionType refers to a condition with matching type in the Cluster's condition list. + // If the conditions doesn't exist, it will be treated as unknown. + // Note: Both Cluster API conditions or conditions added by 3rd party controllers can be used as availability gates. + ConditionType *string `json:"conditionType,omitempty"` + // polarity of the conditionType specified in this availabilityGate. + // Valid values are Positive, Negative and omitted. + // When omitted, the default behaviour will be Positive. + // A positive polarity means that the condition should report a true status under normal conditions. + // A negative polarity means that the condition should report a false status under normal conditions. + Polarity *corev1beta2.ConditionPolarity `json:"polarity,omitempty"` +} + +// ClusterAvailabilityGateApplyConfiguration constructs a declarative configuration of the ClusterAvailabilityGate type for use with +// apply. +func ClusterAvailabilityGate() *ClusterAvailabilityGateApplyConfiguration { + return &ClusterAvailabilityGateApplyConfiguration{} +} + +// WithConditionType sets the ConditionType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConditionType field is set to the value of the last call. +func (b *ClusterAvailabilityGateApplyConfiguration) WithConditionType(value string) *ClusterAvailabilityGateApplyConfiguration { + b.ConditionType = &value + return b +} + +// WithPolarity sets the Polarity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Polarity field is set to the value of the last call. +func (b *ClusterAvailabilityGateApplyConfiguration) WithPolarity(value corev1beta2.ConditionPolarity) *ClusterAvailabilityGateApplyConfiguration { + b.Polarity = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclass.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclass.go new file mode 100644 index 000000000000..81b2b077eb12 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclass.go @@ -0,0 +1,250 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterClassApplyConfiguration represents a declarative configuration of the ClusterClass type for use +// with apply. +// +// ClusterClass is a template which can be used to create managed topologies. +// NOTE: This CRD can only be used if the ClusterTopology feature gate is enabled. +type ClusterClassApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is the desired state of ClusterClass. + Spec *ClusterClassSpecApplyConfiguration `json:"spec,omitempty"` + // status is the observed state of ClusterClass. + Status *ClusterClassStatusApplyConfiguration `json:"status,omitempty"` +} + +// ClusterClass constructs a declarative configuration of the ClusterClass type for use with +// apply. +func ClusterClass(name, namespace string) *ClusterClassApplyConfiguration { + b := &ClusterClassApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ClusterClass") + b.WithAPIVersion("cluster.x-k8s.io/v1beta2") + return b +} + +func (b ClusterClassApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithKind(value string) *ClusterClassApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithAPIVersion(value string) *ClusterClassApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithName(value string) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithGenerateName(value string) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithNamespace(value string) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithUID(value types.UID) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithResourceVersion(value string) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithGeneration(value int64) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ClusterClassApplyConfiguration) WithLabels(entries map[string]string) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ClusterClassApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ClusterClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ClusterClassApplyConfiguration) WithFinalizers(values ...string) *ClusterClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ClusterClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithSpec(value *ClusterClassSpecApplyConfiguration) *ClusterClassApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ClusterClassApplyConfiguration) WithStatus(value *ClusterClassStatusApplyConfiguration) *ClusterClassApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ClusterClassApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ClusterClassApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ClusterClassApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclassdeprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassdeprecatedstatus.go new file mode 100644 index 000000000000..802ba8c45d46 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassdeprecatedstatus.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterClassDeprecatedStatusApplyConfiguration represents a declarative configuration of the ClusterClassDeprecatedStatus type for use +// with apply. +// +// ClusterClassDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type ClusterClassDeprecatedStatusApplyConfiguration struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + V1Beta1 *ClusterClassV1Beta1DeprecatedStatusApplyConfiguration `json:"v1beta1,omitempty"` +} + +// ClusterClassDeprecatedStatusApplyConfiguration constructs a declarative configuration of the ClusterClassDeprecatedStatus type for use with +// apply. +func ClusterClassDeprecatedStatus() *ClusterClassDeprecatedStatusApplyConfiguration { + return &ClusterClassDeprecatedStatusApplyConfiguration{} +} + +// WithV1Beta1 sets the V1Beta1 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the V1Beta1 field is set to the value of the last call. +func (b *ClusterClassDeprecatedStatusApplyConfiguration) WithV1Beta1(value *ClusterClassV1Beta1DeprecatedStatusApplyConfiguration) *ClusterClassDeprecatedStatusApplyConfiguration { + b.V1Beta1 = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclasspatch.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclasspatch.go new file mode 100644 index 000000000000..43f3c7772e9b --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclasspatch.go @@ -0,0 +1,94 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterClassPatchApplyConfiguration represents a declarative configuration of the ClusterClassPatch type for use +// with apply. +// +// ClusterClassPatch defines a patch which is applied to customize the referenced templates. +type ClusterClassPatchApplyConfiguration struct { + // name of the patch. + Name *string `json:"name,omitempty"` + // description is a human-readable description of this patch. + Description *string `json:"description,omitempty"` + // enabledIf is a Go template to be used to calculate if a patch should be enabled. + // It can reference variables defined in .spec.variables and builtin variables. + // The patch will be enabled if the template evaluates to `true`, otherwise it will + // be disabled. + // If EnabledIf is not set, the patch will be enabled per default. + EnabledIf *string `json:"enabledIf,omitempty"` + // definitions define inline patches. + // Note: Patches will be applied in the order of the array. + // Note: Exactly one of Definitions or External must be set. + Definitions []PatchDefinitionApplyConfiguration `json:"definitions,omitempty"` + // external defines an external patch. + // Note: Exactly one of Definitions or External must be set. + External *ExternalPatchDefinitionApplyConfiguration `json:"external,omitempty"` +} + +// ClusterClassPatchApplyConfiguration constructs a declarative configuration of the ClusterClassPatch type for use with +// apply. +func ClusterClassPatch() *ClusterClassPatchApplyConfiguration { + return &ClusterClassPatchApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterClassPatchApplyConfiguration) WithName(value string) *ClusterClassPatchApplyConfiguration { + b.Name = &value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *ClusterClassPatchApplyConfiguration) WithDescription(value string) *ClusterClassPatchApplyConfiguration { + b.Description = &value + return b +} + +// WithEnabledIf sets the EnabledIf field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnabledIf field is set to the value of the last call. +func (b *ClusterClassPatchApplyConfiguration) WithEnabledIf(value string) *ClusterClassPatchApplyConfiguration { + b.EnabledIf = &value + return b +} + +// WithDefinitions adds the given value to the Definitions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Definitions field. +func (b *ClusterClassPatchApplyConfiguration) WithDefinitions(values ...*PatchDefinitionApplyConfiguration) *ClusterClassPatchApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDefinitions") + } + b.Definitions = append(b.Definitions, *values[i]) + } + return b +} + +// WithExternal sets the External field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the External field is set to the value of the last call. +func (b *ClusterClassPatchApplyConfiguration) WithExternal(value *ExternalPatchDefinitionApplyConfiguration) *ClusterClassPatchApplyConfiguration { + b.External = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclassref.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassref.go new file mode 100644 index 000000000000..e84a231e1b7f --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassref.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterClassRefApplyConfiguration represents a declarative configuration of the ClusterClassRef type for use +// with apply. +// +// ClusterClassRef is the ref to the ClusterClass that should be used for the topology. +type ClusterClassRefApplyConfiguration struct { + // name is the name of the ClusterClass that should be used for the topology. + // name must be a valid ClusterClass name and because of that be at most 253 characters in length + // and it must consist only of lower case alphanumeric characters, hyphens (-) and periods (.), and must start + // and end with an alphanumeric character. + Name *string `json:"name,omitempty"` + // namespace is the namespace of the ClusterClass that should be used for the topology. + // If namespace is empty or not set, it is defaulted to the namespace of the Cluster object. + // namespace must be a valid namespace name and because of that be at most 63 characters in length + // and it must consist only of lower case alphanumeric characters or hyphens (-), and must start + // and end with an alphanumeric character. + Namespace *string `json:"namespace,omitempty"` +} + +// ClusterClassRefApplyConfiguration constructs a declarative configuration of the ClusterClassRef type for use with +// apply. +func ClusterClassRef() *ClusterClassRefApplyConfiguration { + return &ClusterClassRefApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterClassRefApplyConfiguration) WithName(value string) *ClusterClassRefApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ClusterClassRefApplyConfiguration) WithNamespace(value string) *ClusterClassRefApplyConfiguration { + b.Namespace = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclassspec.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassspec.go new file mode 100644 index 000000000000..4513492e069e --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassspec.go @@ -0,0 +1,142 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterClassSpecApplyConfiguration represents a declarative configuration of the ClusterClassSpec type for use +// with apply. +// +// ClusterClassSpec describes the desired state of the ClusterClass. +type ClusterClassSpecApplyConfiguration struct { + // availabilityGates specifies additional conditions to include when evaluating Cluster Available condition. + // + // NOTE: If a Cluster is using this ClusterClass, and this Cluster defines a custom list of availabilityGates, + // such list overrides availabilityGates defined in this field. + AvailabilityGates []ClusterAvailabilityGateApplyConfiguration `json:"availabilityGates,omitempty"` + // infrastructure is a reference to a local struct that holds the details + // for provisioning the infrastructure cluster for the Cluster. + Infrastructure *InfrastructureClassApplyConfiguration `json:"infrastructure,omitempty"` + // controlPlane is a reference to a local struct that holds the details + // for provisioning the Control Plane for the Cluster. + ControlPlane *ControlPlaneClassApplyConfiguration `json:"controlPlane,omitempty"` + // workers describes the worker nodes for the cluster. + // It is a collection of node types which can be used to create + // the worker nodes of the cluster. + Workers *WorkersClassApplyConfiguration `json:"workers,omitempty"` + // variables defines the variables which can be configured + // in the Cluster topology and are then used in patches. + Variables []ClusterClassVariableApplyConfiguration `json:"variables,omitempty"` + // patches defines the patches which are applied to customize + // referenced templates of a ClusterClass. + // Note: Patches will be applied in the order of the array. + Patches []ClusterClassPatchApplyConfiguration `json:"patches,omitempty"` + // upgrade defines the upgrade configuration for clusters using this ClusterClass. + Upgrade *ClusterClassUpgradeApplyConfiguration `json:"upgrade,omitempty"` + // kubernetesVersions is the list of Kubernetes versions that can be + // used for clusters using this ClusterClass. + // The list of version must be ordered from the older to the newer version, and there should be + // at least one version for every minor in between the first and the last version. + KubernetesVersions []string `json:"kubernetesVersions,omitempty"` +} + +// ClusterClassSpecApplyConfiguration constructs a declarative configuration of the ClusterClassSpec type for use with +// apply. +func ClusterClassSpec() *ClusterClassSpecApplyConfiguration { + return &ClusterClassSpecApplyConfiguration{} +} + +// WithAvailabilityGates adds the given value to the AvailabilityGates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AvailabilityGates field. +func (b *ClusterClassSpecApplyConfiguration) WithAvailabilityGates(values ...*ClusterAvailabilityGateApplyConfiguration) *ClusterClassSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAvailabilityGates") + } + b.AvailabilityGates = append(b.AvailabilityGates, *values[i]) + } + return b +} + +// WithInfrastructure sets the Infrastructure field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Infrastructure field is set to the value of the last call. +func (b *ClusterClassSpecApplyConfiguration) WithInfrastructure(value *InfrastructureClassApplyConfiguration) *ClusterClassSpecApplyConfiguration { + b.Infrastructure = value + return b +} + +// WithControlPlane sets the ControlPlane field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControlPlane field is set to the value of the last call. +func (b *ClusterClassSpecApplyConfiguration) WithControlPlane(value *ControlPlaneClassApplyConfiguration) *ClusterClassSpecApplyConfiguration { + b.ControlPlane = value + return b +} + +// WithWorkers sets the Workers field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Workers field is set to the value of the last call. +func (b *ClusterClassSpecApplyConfiguration) WithWorkers(value *WorkersClassApplyConfiguration) *ClusterClassSpecApplyConfiguration { + b.Workers = value + return b +} + +// WithVariables adds the given value to the Variables field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Variables field. +func (b *ClusterClassSpecApplyConfiguration) WithVariables(values ...*ClusterClassVariableApplyConfiguration) *ClusterClassSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVariables") + } + b.Variables = append(b.Variables, *values[i]) + } + return b +} + +// WithPatches adds the given value to the Patches field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Patches field. +func (b *ClusterClassSpecApplyConfiguration) WithPatches(values ...*ClusterClassPatchApplyConfiguration) *ClusterClassSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPatches") + } + b.Patches = append(b.Patches, *values[i]) + } + return b +} + +// WithUpgrade sets the Upgrade field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Upgrade field is set to the value of the last call. +func (b *ClusterClassSpecApplyConfiguration) WithUpgrade(value *ClusterClassUpgradeApplyConfiguration) *ClusterClassSpecApplyConfiguration { + b.Upgrade = value + return b +} + +// WithKubernetesVersions adds the given value to the KubernetesVersions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the KubernetesVersions field. +func (b *ClusterClassSpecApplyConfiguration) WithKubernetesVersions(values ...string) *ClusterClassSpecApplyConfiguration { + for i := range values { + b.KubernetesVersions = append(b.KubernetesVersions, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclassstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassstatus.go new file mode 100644 index 000000000000..3aa391ccd7a8 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassstatus.go @@ -0,0 +1,87 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterClassStatusApplyConfiguration represents a declarative configuration of the ClusterClassStatus type for use +// with apply. +// +// ClusterClassStatus defines the observed state of the ClusterClass. +type ClusterClassStatusApplyConfiguration struct { + // conditions represents the observations of a ClusterClass's current state. + // Known condition types are VariablesReady, RefVersionsUpToDate, Paused. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // variables is a list of ClusterClassStatusVariable that are defined for the ClusterClass. + Variables []ClusterClassStatusVariableApplyConfiguration `json:"variables,omitempty"` + // observedGeneration is the latest generation observed by the controller. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + Deprecated *ClusterClassDeprecatedStatusApplyConfiguration `json:"deprecated,omitempty"` +} + +// ClusterClassStatusApplyConfiguration constructs a declarative configuration of the ClusterClassStatus type for use with +// apply. +func ClusterClassStatus() *ClusterClassStatusApplyConfiguration { + return &ClusterClassStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ClusterClassStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ClusterClassStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithVariables adds the given value to the Variables field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Variables field. +func (b *ClusterClassStatusApplyConfiguration) WithVariables(values ...*ClusterClassStatusVariableApplyConfiguration) *ClusterClassStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVariables") + } + b.Variables = append(b.Variables, *values[i]) + } + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *ClusterClassStatusApplyConfiguration) WithObservedGeneration(value int64) *ClusterClassStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithDeprecated sets the Deprecated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deprecated field is set to the value of the last call. +func (b *ClusterClassStatusApplyConfiguration) WithDeprecated(value *ClusterClassDeprecatedStatusApplyConfiguration) *ClusterClassStatusApplyConfiguration { + b.Deprecated = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclassstatusvariable.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassstatusvariable.go new file mode 100644 index 000000000000..9033bb18ea4a --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassstatusvariable.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterClassStatusVariableApplyConfiguration represents a declarative configuration of the ClusterClassStatusVariable type for use +// with apply. +// +// ClusterClassStatusVariable defines a variable which appears in the status of a ClusterClass. +type ClusterClassStatusVariableApplyConfiguration struct { + // name is the name of the variable. + Name *string `json:"name,omitempty"` + // definitionsConflict specifies whether or not there are conflicting definitions for a single variable name. + DefinitionsConflict *bool `json:"definitionsConflict,omitempty"` + // definitions is a list of definitions for a variable. + Definitions []ClusterClassStatusVariableDefinitionApplyConfiguration `json:"definitions,omitempty"` +} + +// ClusterClassStatusVariableApplyConfiguration constructs a declarative configuration of the ClusterClassStatusVariable type for use with +// apply. +func ClusterClassStatusVariable() *ClusterClassStatusVariableApplyConfiguration { + return &ClusterClassStatusVariableApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterClassStatusVariableApplyConfiguration) WithName(value string) *ClusterClassStatusVariableApplyConfiguration { + b.Name = &value + return b +} + +// WithDefinitionsConflict sets the DefinitionsConflict field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DefinitionsConflict field is set to the value of the last call. +func (b *ClusterClassStatusVariableApplyConfiguration) WithDefinitionsConflict(value bool) *ClusterClassStatusVariableApplyConfiguration { + b.DefinitionsConflict = &value + return b +} + +// WithDefinitions adds the given value to the Definitions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Definitions field. +func (b *ClusterClassStatusVariableApplyConfiguration) WithDefinitions(values ...*ClusterClassStatusVariableDefinitionApplyConfiguration) *ClusterClassStatusVariableApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDefinitions") + } + b.Definitions = append(b.Definitions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclassstatusvariabledefinition.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassstatusvariabledefinition.go new file mode 100644 index 000000000000..5aeedb43d300 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassstatusvariabledefinition.go @@ -0,0 +1,81 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterClassStatusVariableDefinitionApplyConfiguration represents a declarative configuration of the ClusterClassStatusVariableDefinition type for use +// with apply. +// +// ClusterClassStatusVariableDefinition defines a variable which appears in the status of a ClusterClass. +type ClusterClassStatusVariableDefinitionApplyConfiguration struct { + // from specifies the origin of the variable definition. + // This will be `inline` for variables defined in the ClusterClass or the name of a patch defined in the ClusterClass + // for variables discovered from a DiscoverVariables runtime extensions. + From *string `json:"from,omitempty"` + // required specifies if the variable is required. + // Note: this applies to the variable as a whole and thus the + // top-level object defined in the schema. If nested fields are + // required, this will be specified inside the schema. + Required *bool `json:"required,omitempty"` + // deprecatedV1Beta1Metadata is the metadata of a variable. + // It can be used to add additional data for higher level tools to + // a ClusterClassVariable. + // + // Deprecated: This field is deprecated and will be removed when support for v1beta1 will be dropped. Please use XMetadata in JSONSchemaProps instead. + DeprecatedV1Beta1Metadata *ClusterClassVariableMetadataApplyConfiguration `json:"deprecatedV1Beta1Metadata,omitempty"` + // schema defines the schema of the variable. + Schema *VariableSchemaApplyConfiguration `json:"schema,omitempty"` +} + +// ClusterClassStatusVariableDefinitionApplyConfiguration constructs a declarative configuration of the ClusterClassStatusVariableDefinition type for use with +// apply. +func ClusterClassStatusVariableDefinition() *ClusterClassStatusVariableDefinitionApplyConfiguration { + return &ClusterClassStatusVariableDefinitionApplyConfiguration{} +} + +// WithFrom sets the From field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the From field is set to the value of the last call. +func (b *ClusterClassStatusVariableDefinitionApplyConfiguration) WithFrom(value string) *ClusterClassStatusVariableDefinitionApplyConfiguration { + b.From = &value + return b +} + +// WithRequired sets the Required field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Required field is set to the value of the last call. +func (b *ClusterClassStatusVariableDefinitionApplyConfiguration) WithRequired(value bool) *ClusterClassStatusVariableDefinitionApplyConfiguration { + b.Required = &value + return b +} + +// WithDeprecatedV1Beta1Metadata sets the DeprecatedV1Beta1Metadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeprecatedV1Beta1Metadata field is set to the value of the last call. +func (b *ClusterClassStatusVariableDefinitionApplyConfiguration) WithDeprecatedV1Beta1Metadata(value *ClusterClassVariableMetadataApplyConfiguration) *ClusterClassStatusVariableDefinitionApplyConfiguration { + b.DeprecatedV1Beta1Metadata = value + return b +} + +// WithSchema sets the Schema field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Schema field is set to the value of the last call. +func (b *ClusterClassStatusVariableDefinitionApplyConfiguration) WithSchema(value *VariableSchemaApplyConfiguration) *ClusterClassStatusVariableDefinitionApplyConfiguration { + b.Schema = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclasstemplatereference.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclasstemplatereference.go new file mode 100644 index 000000000000..9624d2fdbe5a --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclasstemplatereference.go @@ -0,0 +1,65 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterClassTemplateReferenceApplyConfiguration represents a declarative configuration of the ClusterClassTemplateReference type for use +// with apply. +// +// ClusterClassTemplateReference is a reference to a ClusterClass template. +type ClusterClassTemplateReferenceApplyConfiguration struct { + // kind of the template. + // kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. + Kind *string `json:"kind,omitempty"` + // name of the template. + // name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + Name *string `json:"name,omitempty"` + // apiVersion of the template. + // apiVersion must be fully qualified domain name followed by / and a version. + APIVersion *string `json:"apiVersion,omitempty"` +} + +// ClusterClassTemplateReferenceApplyConfiguration constructs a declarative configuration of the ClusterClassTemplateReference type for use with +// apply. +func ClusterClassTemplateReference() *ClusterClassTemplateReferenceApplyConfiguration { + return &ClusterClassTemplateReferenceApplyConfiguration{} +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ClusterClassTemplateReferenceApplyConfiguration) WithKind(value string) *ClusterClassTemplateReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterClassTemplateReferenceApplyConfiguration) WithName(value string) *ClusterClassTemplateReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ClusterClassTemplateReferenceApplyConfiguration) WithAPIVersion(value string) *ClusterClassTemplateReferenceApplyConfiguration { + b.APIVersion = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclassupgrade.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassupgrade.go new file mode 100644 index 000000000000..6a77ad190698 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassupgrade.go @@ -0,0 +1,42 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterClassUpgradeApplyConfiguration represents a declarative configuration of the ClusterClassUpgrade type for use +// with apply. +// +// ClusterClassUpgrade defines the upgrade configuration for clusters using the ClusterClass. +type ClusterClassUpgradeApplyConfiguration struct { + // external defines external runtime extensions for upgrade operations. + External *ClusterClassUpgradeExternalApplyConfiguration `json:"external,omitempty"` +} + +// ClusterClassUpgradeApplyConfiguration constructs a declarative configuration of the ClusterClassUpgrade type for use with +// apply. +func ClusterClassUpgrade() *ClusterClassUpgradeApplyConfiguration { + return &ClusterClassUpgradeApplyConfiguration{} +} + +// WithExternal sets the External field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the External field is set to the value of the last call. +func (b *ClusterClassUpgradeApplyConfiguration) WithExternal(value *ClusterClassUpgradeExternalApplyConfiguration) *ClusterClassUpgradeApplyConfiguration { + b.External = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclassupgradeexternal.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassupgradeexternal.go new file mode 100644 index 000000000000..af9218cc11d6 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassupgradeexternal.go @@ -0,0 +1,42 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterClassUpgradeExternalApplyConfiguration represents a declarative configuration of the ClusterClassUpgradeExternal type for use +// with apply. +// +// ClusterClassUpgradeExternal defines external runtime extensions for upgrade operations. +type ClusterClassUpgradeExternalApplyConfiguration struct { + // generateUpgradePlanExtension references an extension which is called to generate upgrade plan. + GenerateUpgradePlanExtension *string `json:"generateUpgradePlanExtension,omitempty"` +} + +// ClusterClassUpgradeExternalApplyConfiguration constructs a declarative configuration of the ClusterClassUpgradeExternal type for use with +// apply. +func ClusterClassUpgradeExternal() *ClusterClassUpgradeExternalApplyConfiguration { + return &ClusterClassUpgradeExternalApplyConfiguration{} +} + +// WithGenerateUpgradePlanExtension sets the GenerateUpgradePlanExtension field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateUpgradePlanExtension field is set to the value of the last call. +func (b *ClusterClassUpgradeExternalApplyConfiguration) WithGenerateUpgradePlanExtension(value string) *ClusterClassUpgradeExternalApplyConfiguration { + b.GenerateUpgradePlanExtension = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclassv1beta1deprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassv1beta1deprecatedstatus.go new file mode 100644 index 000000000000..19395a200717 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassv1beta1deprecatedstatus.go @@ -0,0 +1,49 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// ClusterClassV1Beta1DeprecatedStatusApplyConfiguration represents a declarative configuration of the ClusterClassV1Beta1DeprecatedStatus type for use +// with apply. +// +// ClusterClassV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type ClusterClassV1Beta1DeprecatedStatusApplyConfiguration struct { + // conditions defines current observed state of the ClusterClass. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + Conditions *corev1beta2.Conditions `json:"conditions,omitempty"` +} + +// ClusterClassV1Beta1DeprecatedStatusApplyConfiguration constructs a declarative configuration of the ClusterClassV1Beta1DeprecatedStatus type for use with +// apply. +func ClusterClassV1Beta1DeprecatedStatus() *ClusterClassV1Beta1DeprecatedStatusApplyConfiguration { + return &ClusterClassV1Beta1DeprecatedStatusApplyConfiguration{} +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *ClusterClassV1Beta1DeprecatedStatusApplyConfiguration) WithConditions(value corev1beta2.Conditions) *ClusterClassV1Beta1DeprecatedStatusApplyConfiguration { + b.Conditions = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclassvariable.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassvariable.go new file mode 100644 index 000000000000..e001b4680138 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassvariable.go @@ -0,0 +1,80 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterClassVariableApplyConfiguration represents a declarative configuration of the ClusterClassVariable type for use +// with apply. +// +// ClusterClassVariable defines a variable which can +// be configured in the Cluster topology and used in patches. +type ClusterClassVariableApplyConfiguration struct { + // name of the variable. + Name *string `json:"name,omitempty"` + // required specifies if the variable is required. + // Note: this applies to the variable as a whole and thus the + // top-level object defined in the schema. If nested fields are + // required, this will be specified inside the schema. + Required *bool `json:"required,omitempty"` + // deprecatedV1Beta1Metadata is the metadata of a variable. + // It can be used to add additional data for higher level tools to + // a ClusterClassVariable. + // + // Deprecated: This field is deprecated and will be removed when support for v1beta1 will be dropped. Please use XMetadata in JSONSchemaProps instead. + DeprecatedV1Beta1Metadata *ClusterClassVariableMetadataApplyConfiguration `json:"deprecatedV1Beta1Metadata,omitempty"` + // schema defines the schema of the variable. + Schema *VariableSchemaApplyConfiguration `json:"schema,omitempty"` +} + +// ClusterClassVariableApplyConfiguration constructs a declarative configuration of the ClusterClassVariable type for use with +// apply. +func ClusterClassVariable() *ClusterClassVariableApplyConfiguration { + return &ClusterClassVariableApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterClassVariableApplyConfiguration) WithName(value string) *ClusterClassVariableApplyConfiguration { + b.Name = &value + return b +} + +// WithRequired sets the Required field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Required field is set to the value of the last call. +func (b *ClusterClassVariableApplyConfiguration) WithRequired(value bool) *ClusterClassVariableApplyConfiguration { + b.Required = &value + return b +} + +// WithDeprecatedV1Beta1Metadata sets the DeprecatedV1Beta1Metadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeprecatedV1Beta1Metadata field is set to the value of the last call. +func (b *ClusterClassVariableApplyConfiguration) WithDeprecatedV1Beta1Metadata(value *ClusterClassVariableMetadataApplyConfiguration) *ClusterClassVariableApplyConfiguration { + b.DeprecatedV1Beta1Metadata = value + return b +} + +// WithSchema sets the Schema field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Schema field is set to the value of the last call. +func (b *ClusterClassVariableApplyConfiguration) WithSchema(value *VariableSchemaApplyConfiguration) *ClusterClassVariableApplyConfiguration { + b.Schema = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterclassvariablemetadata.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassvariablemetadata.go new file mode 100644 index 000000000000..e9c6bcab2adc --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterclassvariablemetadata.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterClassVariableMetadataApplyConfiguration represents a declarative configuration of the ClusterClassVariableMetadata type for use +// with apply. +// +// ClusterClassVariableMetadata is the metadata of a variable. +// It can be used to add additional data for higher level tools to +// a ClusterClassVariable. +// +// Deprecated: This struct is deprecated and is going to be removed in the next apiVersion. +type ClusterClassVariableMetadataApplyConfiguration struct { + // labels is a map of string keys and values that can be used to organize and categorize + // (scope and select) variables. + Labels map[string]string `json:"labels,omitempty"` + // annotations is an unstructured key value map that can be used to store and + // retrieve arbitrary metadata. + // They are not queryable. + Annotations map[string]string `json:"annotations,omitempty"` +} + +// ClusterClassVariableMetadataApplyConfiguration constructs a declarative configuration of the ClusterClassVariableMetadata type for use with +// apply. +func ClusterClassVariableMetadata() *ClusterClassVariableMetadataApplyConfiguration { + return &ClusterClassVariableMetadataApplyConfiguration{} +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ClusterClassVariableMetadataApplyConfiguration) WithLabels(entries map[string]string) *ClusterClassVariableMetadataApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ClusterClassVariableMetadataApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterClassVariableMetadataApplyConfiguration { + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clustercontrolplanestatus.go b/pkg/generated/applyconfiguration/core/v1beta2/clustercontrolplanestatus.go new file mode 100644 index 000000000000..8699ac49d920 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clustercontrolplanestatus.go @@ -0,0 +1,83 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterControlPlaneStatusApplyConfiguration represents a declarative configuration of the ClusterControlPlaneStatus type for use +// with apply. +// +// ClusterControlPlaneStatus groups all the observations about control plane current state. +type ClusterControlPlaneStatusApplyConfiguration struct { + // desiredReplicas is the total number of desired control plane machines in this cluster. + DesiredReplicas *int32 `json:"desiredReplicas,omitempty"` + // replicas is the total number of control plane machines in this cluster. + // NOTE: replicas also includes machines still being provisioned or being deleted. + Replicas *int32 `json:"replicas,omitempty"` + // upToDateReplicas is the number of up-to-date control plane machines in this cluster. A machine is considered up-to-date when Machine's UpToDate condition is true. + UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` + // readyReplicas is the total number of ready control plane machines in this cluster. A machine is considered ready when Machine's Ready condition is true. + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + // availableReplicas is the total number of available control plane machines in this cluster. A machine is considered available when Machine's Available condition is true. + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` +} + +// ClusterControlPlaneStatusApplyConfiguration constructs a declarative configuration of the ClusterControlPlaneStatus type for use with +// apply. +func ClusterControlPlaneStatus() *ClusterControlPlaneStatusApplyConfiguration { + return &ClusterControlPlaneStatusApplyConfiguration{} +} + +// WithDesiredReplicas sets the DesiredReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DesiredReplicas field is set to the value of the last call. +func (b *ClusterControlPlaneStatusApplyConfiguration) WithDesiredReplicas(value int32) *ClusterControlPlaneStatusApplyConfiguration { + b.DesiredReplicas = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ClusterControlPlaneStatusApplyConfiguration) WithReplicas(value int32) *ClusterControlPlaneStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithUpToDateReplicas sets the UpToDateReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpToDateReplicas field is set to the value of the last call. +func (b *ClusterControlPlaneStatusApplyConfiguration) WithUpToDateReplicas(value int32) *ClusterControlPlaneStatusApplyConfiguration { + b.UpToDateReplicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *ClusterControlPlaneStatusApplyConfiguration) WithReadyReplicas(value int32) *ClusterControlPlaneStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *ClusterControlPlaneStatusApplyConfiguration) WithAvailableReplicas(value int32) *ClusterControlPlaneStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterdeprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterdeprecatedstatus.go new file mode 100644 index 000000000000..abb75793f3b7 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterdeprecatedstatus.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterDeprecatedStatusApplyConfiguration represents a declarative configuration of the ClusterDeprecatedStatus type for use +// with apply. +// +// ClusterDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type ClusterDeprecatedStatusApplyConfiguration struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + V1Beta1 *ClusterV1Beta1DeprecatedStatusApplyConfiguration `json:"v1beta1,omitempty"` +} + +// ClusterDeprecatedStatusApplyConfiguration constructs a declarative configuration of the ClusterDeprecatedStatus type for use with +// apply. +func ClusterDeprecatedStatus() *ClusterDeprecatedStatusApplyConfiguration { + return &ClusterDeprecatedStatusApplyConfiguration{} +} + +// WithV1Beta1 sets the V1Beta1 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the V1Beta1 field is set to the value of the last call. +func (b *ClusterDeprecatedStatusApplyConfiguration) WithV1Beta1(value *ClusterV1Beta1DeprecatedStatusApplyConfiguration) *ClusterDeprecatedStatusApplyConfiguration { + b.V1Beta1 = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterinitializationstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterinitializationstatus.go new file mode 100644 index 000000000000..3c3cdedc6f98 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterinitializationstatus.go @@ -0,0 +1,60 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterInitializationStatusApplyConfiguration represents a declarative configuration of the ClusterInitializationStatus type for use +// with apply. +// +// ClusterInitializationStatus provides observations of the Cluster initialization process. +// NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Cluster provisioning. +type ClusterInitializationStatusApplyConfiguration struct { + // infrastructureProvisioned is true when the infrastructure provider reports that Cluster's infrastructure is fully provisioned. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. + // The value of this field is never updated after provisioning is completed. + InfrastructureProvisioned *bool `json:"infrastructureProvisioned,omitempty"` + // controlPlaneInitialized denotes when the control plane is functional enough to accept requests. + // This information is usually used as a signal for starting all the provisioning operations that depends on + // a functional API server, but do not require a full HA control plane to exists, like e.g. join worker Machines, + // install core addons like CNI, CPI, CSI etc. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. + // The value of this field is never updated after initialization is completed. + ControlPlaneInitialized *bool `json:"controlPlaneInitialized,omitempty"` +} + +// ClusterInitializationStatusApplyConfiguration constructs a declarative configuration of the ClusterInitializationStatus type for use with +// apply. +func ClusterInitializationStatus() *ClusterInitializationStatusApplyConfiguration { + return &ClusterInitializationStatusApplyConfiguration{} +} + +// WithInfrastructureProvisioned sets the InfrastructureProvisioned field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InfrastructureProvisioned field is set to the value of the last call. +func (b *ClusterInitializationStatusApplyConfiguration) WithInfrastructureProvisioned(value bool) *ClusterInitializationStatusApplyConfiguration { + b.InfrastructureProvisioned = &value + return b +} + +// WithControlPlaneInitialized sets the ControlPlaneInitialized field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControlPlaneInitialized field is set to the value of the last call. +func (b *ClusterInitializationStatusApplyConfiguration) WithControlPlaneInitialized(value bool) *ClusterInitializationStatusApplyConfiguration { + b.ControlPlaneInitialized = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusternetwork.go b/pkg/generated/applyconfiguration/core/v1beta2/clusternetwork.go new file mode 100644 index 000000000000..d8b3e7ef5a0f --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusternetwork.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterNetworkApplyConfiguration represents a declarative configuration of the ClusterNetwork type for use +// with apply. +// +// ClusterNetwork specifies the different networking +// parameters for a cluster. +type ClusterNetworkApplyConfiguration struct { + // apiServerPort specifies the port the API Server should bind to. + // Defaults to 6443. + APIServerPort *int32 `json:"apiServerPort,omitempty"` + // services is the network ranges from which service VIPs are allocated. + Services *NetworkRangesApplyConfiguration `json:"services,omitempty"` + // pods is the network ranges from which Pod networks are allocated. + Pods *NetworkRangesApplyConfiguration `json:"pods,omitempty"` + // serviceDomain is the domain name for services. + ServiceDomain *string `json:"serviceDomain,omitempty"` +} + +// ClusterNetworkApplyConfiguration constructs a declarative configuration of the ClusterNetwork type for use with +// apply. +func ClusterNetwork() *ClusterNetworkApplyConfiguration { + return &ClusterNetworkApplyConfiguration{} +} + +// WithAPIServerPort sets the APIServerPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIServerPort field is set to the value of the last call. +func (b *ClusterNetworkApplyConfiguration) WithAPIServerPort(value int32) *ClusterNetworkApplyConfiguration { + b.APIServerPort = &value + return b +} + +// WithServices sets the Services field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Services field is set to the value of the last call. +func (b *ClusterNetworkApplyConfiguration) WithServices(value *NetworkRangesApplyConfiguration) *ClusterNetworkApplyConfiguration { + b.Services = value + return b +} + +// WithPods sets the Pods field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pods field is set to the value of the last call. +func (b *ClusterNetworkApplyConfiguration) WithPods(value *NetworkRangesApplyConfiguration) *ClusterNetworkApplyConfiguration { + b.Pods = value + return b +} + +// WithServiceDomain sets the ServiceDomain field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceDomain field is set to the value of the last call. +func (b *ClusterNetworkApplyConfiguration) WithServiceDomain(value string) *ClusterNetworkApplyConfiguration { + b.ServiceDomain = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterspec.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterspec.go new file mode 100644 index 000000000000..c506818cc7c2 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterspec.go @@ -0,0 +1,115 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ClusterSpecApplyConfiguration represents a declarative configuration of the ClusterSpec type for use +// with apply. +// +// ClusterSpec defines the desired state of Cluster. +type ClusterSpecApplyConfiguration struct { + // paused can be used to prevent controllers from processing the Cluster and all its associated objects. + Paused *bool `json:"paused,omitempty"` + // clusterNetwork represents the cluster network configuration. + ClusterNetwork *ClusterNetworkApplyConfiguration `json:"clusterNetwork,omitempty"` + // controlPlaneEndpoint represents the endpoint used to communicate with the control plane. + ControlPlaneEndpoint *APIEndpointApplyConfiguration `json:"controlPlaneEndpoint,omitempty"` + // controlPlaneRef is an optional reference to a provider-specific resource that holds + // the details for provisioning the Control Plane for a Cluster. + ControlPlaneRef *ContractVersionedObjectReferenceApplyConfiguration `json:"controlPlaneRef,omitempty"` + // infrastructureRef is a reference to a provider-specific resource that holds the details + // for provisioning infrastructure for a cluster in said provider. + InfrastructureRef *ContractVersionedObjectReferenceApplyConfiguration `json:"infrastructureRef,omitempty"` + // topology encapsulates the topology for the cluster. + // NOTE: It is required to enable the ClusterTopology + // feature gate flag to activate managed topologies support; + // this feature is highly experimental, and parts of it might still be not implemented. + Topology *TopologyApplyConfiguration `json:"topology,omitempty"` + // availabilityGates specifies additional conditions to include when evaluating Cluster Available condition. + // + // If this field is not defined and the Cluster implements a managed topology, availabilityGates + // from the corresponding ClusterClass will be used, if any. + AvailabilityGates []ClusterAvailabilityGateApplyConfiguration `json:"availabilityGates,omitempty"` +} + +// ClusterSpecApplyConfiguration constructs a declarative configuration of the ClusterSpec type for use with +// apply. +func ClusterSpec() *ClusterSpecApplyConfiguration { + return &ClusterSpecApplyConfiguration{} +} + +// WithPaused sets the Paused field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Paused field is set to the value of the last call. +func (b *ClusterSpecApplyConfiguration) WithPaused(value bool) *ClusterSpecApplyConfiguration { + b.Paused = &value + return b +} + +// WithClusterNetwork sets the ClusterNetwork field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterNetwork field is set to the value of the last call. +func (b *ClusterSpecApplyConfiguration) WithClusterNetwork(value *ClusterNetworkApplyConfiguration) *ClusterSpecApplyConfiguration { + b.ClusterNetwork = value + return b +} + +// WithControlPlaneEndpoint sets the ControlPlaneEndpoint field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControlPlaneEndpoint field is set to the value of the last call. +func (b *ClusterSpecApplyConfiguration) WithControlPlaneEndpoint(value *APIEndpointApplyConfiguration) *ClusterSpecApplyConfiguration { + b.ControlPlaneEndpoint = value + return b +} + +// WithControlPlaneRef sets the ControlPlaneRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControlPlaneRef field is set to the value of the last call. +func (b *ClusterSpecApplyConfiguration) WithControlPlaneRef(value *ContractVersionedObjectReferenceApplyConfiguration) *ClusterSpecApplyConfiguration { + b.ControlPlaneRef = value + return b +} + +// WithInfrastructureRef sets the InfrastructureRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InfrastructureRef field is set to the value of the last call. +func (b *ClusterSpecApplyConfiguration) WithInfrastructureRef(value *ContractVersionedObjectReferenceApplyConfiguration) *ClusterSpecApplyConfiguration { + b.InfrastructureRef = value + return b +} + +// WithTopology sets the Topology field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Topology field is set to the value of the last call. +func (b *ClusterSpecApplyConfiguration) WithTopology(value *TopologyApplyConfiguration) *ClusterSpecApplyConfiguration { + b.Topology = value + return b +} + +// WithAvailabilityGates adds the given value to the AvailabilityGates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AvailabilityGates field. +func (b *ClusterSpecApplyConfiguration) WithAvailabilityGates(values ...*ClusterAvailabilityGateApplyConfiguration) *ClusterSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAvailabilityGates") + } + b.AvailabilityGates = append(b.AvailabilityGates, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterstatus.go new file mode 100644 index 000000000000..0501de6f96a3 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterstatus.go @@ -0,0 +1,130 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterStatusApplyConfiguration represents a declarative configuration of the ClusterStatus type for use +// with apply. +// +// ClusterStatus defines the observed state of Cluster. +type ClusterStatusApplyConfiguration struct { + // conditions represents the observations of a Cluster's current state. + // Known condition types are Available, InfrastructureReady, ControlPlaneInitialized, ControlPlaneAvailable, WorkersAvailable, MachinesReady + // MachinesUpToDate, RemoteConnectionProbe, ScalingUp, ScalingDown, Remediating, Deleting, Paused. + // Additionally, a TopologyReconciled condition will be added in case the Cluster is referencing a ClusterClass / defining a managed Topology. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // initialization provides observations of the Cluster initialization process. + // NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Cluster provisioning. + Initialization *ClusterInitializationStatusApplyConfiguration `json:"initialization,omitempty"` + // controlPlane groups all the observations about Cluster's ControlPlane current state. + ControlPlane *ClusterControlPlaneStatusApplyConfiguration `json:"controlPlane,omitempty"` + // workers groups all the observations about Cluster's Workers current state. + Workers *WorkersStatusApplyConfiguration `json:"workers,omitempty"` + // failureDomains is a slice of failure domain objects synced from the infrastructure provider. + FailureDomains []FailureDomainApplyConfiguration `json:"failureDomains,omitempty"` + // phase represents the current phase of cluster actuation. + Phase *string `json:"phase,omitempty"` + // observedGeneration is the latest generation observed by the controller. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + Deprecated *ClusterDeprecatedStatusApplyConfiguration `json:"deprecated,omitempty"` +} + +// ClusterStatusApplyConfiguration constructs a declarative configuration of the ClusterStatus type for use with +// apply. +func ClusterStatus() *ClusterStatusApplyConfiguration { + return &ClusterStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ClusterStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ClusterStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithInitialization sets the Initialization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Initialization field is set to the value of the last call. +func (b *ClusterStatusApplyConfiguration) WithInitialization(value *ClusterInitializationStatusApplyConfiguration) *ClusterStatusApplyConfiguration { + b.Initialization = value + return b +} + +// WithControlPlane sets the ControlPlane field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControlPlane field is set to the value of the last call. +func (b *ClusterStatusApplyConfiguration) WithControlPlane(value *ClusterControlPlaneStatusApplyConfiguration) *ClusterStatusApplyConfiguration { + b.ControlPlane = value + return b +} + +// WithWorkers sets the Workers field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Workers field is set to the value of the last call. +func (b *ClusterStatusApplyConfiguration) WithWorkers(value *WorkersStatusApplyConfiguration) *ClusterStatusApplyConfiguration { + b.Workers = value + return b +} + +// WithFailureDomains adds the given value to the FailureDomains field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the FailureDomains field. +func (b *ClusterStatusApplyConfiguration) WithFailureDomains(values ...*FailureDomainApplyConfiguration) *ClusterStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFailureDomains") + } + b.FailureDomains = append(b.FailureDomains, *values[i]) + } + return b +} + +// WithPhase sets the Phase field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Phase field is set to the value of the last call. +func (b *ClusterStatusApplyConfiguration) WithPhase(value string) *ClusterStatusApplyConfiguration { + b.Phase = &value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *ClusterStatusApplyConfiguration) WithObservedGeneration(value int64) *ClusterStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithDeprecated sets the Deprecated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deprecated field is set to the value of the last call. +func (b *ClusterStatusApplyConfiguration) WithDeprecated(value *ClusterDeprecatedStatusApplyConfiguration) *ClusterStatusApplyConfiguration { + b.Deprecated = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clusterv1beta1deprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/clusterv1beta1deprecatedstatus.go new file mode 100644 index 000000000000..484305032753 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clusterv1beta1deprecatedstatus.go @@ -0,0 +1,77 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + errors "sigs.k8s.io/cluster-api/errors" +) + +// ClusterV1Beta1DeprecatedStatusApplyConfiguration represents a declarative configuration of the ClusterV1Beta1DeprecatedStatus type for use +// with apply. +// +// ClusterV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type ClusterV1Beta1DeprecatedStatusApplyConfiguration struct { + // conditions defines current service state of the cluster. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + Conditions *corev1beta2.Conditions `json:"conditions,omitempty"` + // failureReason indicates that there is a fatal problem reconciling the + // state, and will be set to a token value suitable for + // programmatic interpretation. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + FailureReason *errors.ClusterStatusError `json:"failureReason,omitempty"` + // failureMessage indicates that there is a fatal problem reconciling the + // state, and will be set to a descriptive error message. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + FailureMessage *string `json:"failureMessage,omitempty"` +} + +// ClusterV1Beta1DeprecatedStatusApplyConfiguration constructs a declarative configuration of the ClusterV1Beta1DeprecatedStatus type for use with +// apply. +func ClusterV1Beta1DeprecatedStatus() *ClusterV1Beta1DeprecatedStatusApplyConfiguration { + return &ClusterV1Beta1DeprecatedStatusApplyConfiguration{} +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *ClusterV1Beta1DeprecatedStatusApplyConfiguration) WithConditions(value corev1beta2.Conditions) *ClusterV1Beta1DeprecatedStatusApplyConfiguration { + b.Conditions = &value + return b +} + +// WithFailureReason sets the FailureReason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureReason field is set to the value of the last call. +func (b *ClusterV1Beta1DeprecatedStatusApplyConfiguration) WithFailureReason(value errors.ClusterStatusError) *ClusterV1Beta1DeprecatedStatusApplyConfiguration { + b.FailureReason = &value + return b +} + +// WithFailureMessage sets the FailureMessage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureMessage field is set to the value of the last call. +func (b *ClusterV1Beta1DeprecatedStatusApplyConfiguration) WithFailureMessage(value string) *ClusterV1Beta1DeprecatedStatusApplyConfiguration { + b.FailureMessage = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/clustervariable.go b/pkg/generated/applyconfiguration/core/v1beta2/clustervariable.go new file mode 100644 index 000000000000..243e63285c5a --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/clustervariable.go @@ -0,0 +1,63 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// ClusterVariableApplyConfiguration represents a declarative configuration of the ClusterVariable type for use +// with apply. +// +// ClusterVariable can be used to customize the Cluster through patches. Each ClusterVariable is associated with a +// Variable definition in the ClusterClass `status` variables. +type ClusterVariableApplyConfiguration struct { + // name of the variable. + Name *string `json:"name,omitempty"` + // value of the variable. + // Note: the value will be validated against the schema of the corresponding ClusterClassVariable + // from the ClusterClass. + // Note: We have to use apiextensionsv1.JSON instead of a custom JSON type, because controller-tools has a + // hard-coded schema for apiextensionsv1.JSON which cannot be produced by another type via controller-tools, + // i.e. it is not possible to have no type field. + // Ref: https://github.com/kubernetes-sigs/controller-tools/blob/d0e03a142d0ecdd5491593e941ee1d6b5d91dba6/pkg/crd/known_types.go#L106-L111 + Value *v1.JSON `json:"value,omitempty"` +} + +// ClusterVariableApplyConfiguration constructs a declarative configuration of the ClusterVariable type for use with +// apply. +func ClusterVariable() *ClusterVariableApplyConfiguration { + return &ClusterVariableApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterVariableApplyConfiguration) WithName(value string) *ClusterVariableApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *ClusterVariableApplyConfiguration) WithValue(value v1.JSON) *ClusterVariableApplyConfiguration { + b.Value = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/condition.go b/pkg/generated/applyconfiguration/core/v1beta2/condition.go new file mode 100644 index 000000000000..d2b6a5eb88d0 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/condition.go @@ -0,0 +1,109 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// ConditionApplyConfiguration represents a declarative configuration of the Condition type for use +// with apply. +// +// Condition defines an observation of a Cluster API resource operational state. +// +// Deprecated: This type is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. +type ConditionApplyConfiguration struct { + // type of condition in CamelCase or in foo.example.com/CamelCase. + // Many .condition.type values are consistent across resources like Available, but because arbitrary conditions + // can be useful (see .node.status.conditions), the ability to deconflict is important. + Type *corev1beta2.ConditionType `json:"type,omitempty"` + // status of the condition, one of True, False, Unknown. + Status *v1.ConditionStatus `json:"status,omitempty"` + // severity provides an explicit classification of Reason code, so the users or machines can immediately + // understand the current situation and act accordingly. + // The Severity field MUST be set only when Status=False. + Severity *corev1beta2.ConditionSeverity `json:"severity,omitempty"` + // lastTransitionTime is the last time the condition transitioned from one status to another. + // This should be when the underlying condition changed. If that is not known, then using the time when + // the API field changed is acceptable. + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + // reason is the reason for the condition's last transition in CamelCase. + // The specific API may choose whether or not this field is considered a guaranteed API. + // This field may be empty. + Reason *string `json:"reason,omitempty"` + // message is a human readable message indicating details about the transition. + // This field may be empty. + Message *string `json:"message,omitempty"` +} + +// ConditionApplyConfiguration constructs a declarative configuration of the Condition type for use with +// apply. +func Condition() *ConditionApplyConfiguration { + return &ConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithType(value corev1beta2.ConditionType) *ConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithSeverity sets the Severity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Severity field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithSeverity(value corev1beta2.ConditionSeverity) *ConditionApplyConfiguration { + b.Severity = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *ConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithReason(value string) *ConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithMessage(value string) *ConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/contractversionedobjectreference.go b/pkg/generated/applyconfiguration/core/v1beta2/contractversionedobjectreference.go new file mode 100644 index 000000000000..0e539a237e3d --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/contractversionedobjectreference.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ContractVersionedObjectReferenceApplyConfiguration represents a declarative configuration of the ContractVersionedObjectReference type for use +// with apply. +// +// ContractVersionedObjectReference is a reference to a resource for which the version is inferred from contract labels. +type ContractVersionedObjectReferenceApplyConfiguration struct { + // kind of the resource being referenced. + // kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. + Kind *string `json:"kind,omitempty"` + // name of the resource being referenced. + // name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + Name *string `json:"name,omitempty"` + // apiGroup is the group of the resource being referenced. + // apiGroup must be fully qualified domain name. + // The corresponding version for this reference will be looked up from the contract + // labels of the corresponding CRD of the resource being referenced. + APIGroup *string `json:"apiGroup,omitempty"` +} + +// ContractVersionedObjectReferenceApplyConfiguration constructs a declarative configuration of the ContractVersionedObjectReference type for use with +// apply. +func ContractVersionedObjectReference() *ContractVersionedObjectReferenceApplyConfiguration { + return &ContractVersionedObjectReferenceApplyConfiguration{} +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ContractVersionedObjectReferenceApplyConfiguration) WithKind(value string) *ContractVersionedObjectReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ContractVersionedObjectReferenceApplyConfiguration) WithName(value string) *ContractVersionedObjectReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithAPIGroup sets the APIGroup field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIGroup field is set to the value of the last call. +func (b *ContractVersionedObjectReferenceApplyConfiguration) WithAPIGroup(value string) *ContractVersionedObjectReferenceApplyConfiguration { + b.APIGroup = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclass.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclass.go new file mode 100644 index 000000000000..312d2d0602c3 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclass.go @@ -0,0 +1,127 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneClassApplyConfiguration represents a declarative configuration of the ControlPlaneClass type for use +// with apply. +// +// ControlPlaneClass defines the class for the control plane. +type ControlPlaneClassApplyConfiguration struct { + // metadata is the metadata applied to the ControlPlane and the Machines of the ControlPlane + // if the ControlPlaneTemplate referenced is machine based. If not, it is applied only to the + // ControlPlane. + // At runtime this metadata is merged with the corresponding metadata from the topology. + // + // This field is supported if and only if the control plane provider template + // referenced is Machine based. + Metadata *ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // templateRef contains the reference to a provider-specific control plane template. + TemplateRef *ClusterClassTemplateReferenceApplyConfiguration `json:"templateRef,omitempty"` + // machineInfrastructure defines the metadata and infrastructure information + // for control plane machines. + // + // This field is supported if and only if the control plane provider template + // referenced above is Machine based and supports setting replicas. + MachineInfrastructure *ControlPlaneClassMachineInfrastructureTemplateApplyConfiguration `json:"machineInfrastructure,omitempty"` + // healthCheck defines a MachineHealthCheck for this ControlPlaneClass. + // This field is supported if and only if the ControlPlane provider template + // referenced above is Machine based and supports setting replicas. + HealthCheck *ControlPlaneClassHealthCheckApplyConfiguration `json:"healthCheck,omitempty"` + // naming allows changing the naming pattern used when creating the control plane provider object. + Naming *ControlPlaneClassNamingSpecApplyConfiguration `json:"naming,omitempty"` + // deletion contains configuration options for Machine deletion. + Deletion *ControlPlaneClassMachineDeletionSpecApplyConfiguration `json:"deletion,omitempty"` + // readinessGates specifies additional conditions to include when evaluating Machine Ready condition. + // + // This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready + // computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine. + // + // NOTE: If a Cluster defines a custom list of readinessGates for the control plane, + // such list overrides readinessGates defined in this field. + // NOTE: Specific control plane provider implementations might automatically extend the list of readinessGates; + // e.g. the kubeadm control provider adds ReadinessGates for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc. + ReadinessGates []MachineReadinessGateApplyConfiguration `json:"readinessGates,omitempty"` +} + +// ControlPlaneClassApplyConfiguration constructs a declarative configuration of the ControlPlaneClass type for use with +// apply. +func ControlPlaneClass() *ControlPlaneClassApplyConfiguration { + return &ControlPlaneClassApplyConfiguration{} +} + +// WithMetadata sets the Metadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Metadata field is set to the value of the last call. +func (b *ControlPlaneClassApplyConfiguration) WithMetadata(value *ObjectMetaApplyConfiguration) *ControlPlaneClassApplyConfiguration { + b.Metadata = value + return b +} + +// WithTemplateRef sets the TemplateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateRef field is set to the value of the last call. +func (b *ControlPlaneClassApplyConfiguration) WithTemplateRef(value *ClusterClassTemplateReferenceApplyConfiguration) *ControlPlaneClassApplyConfiguration { + b.TemplateRef = value + return b +} + +// WithMachineInfrastructure sets the MachineInfrastructure field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MachineInfrastructure field is set to the value of the last call. +func (b *ControlPlaneClassApplyConfiguration) WithMachineInfrastructure(value *ControlPlaneClassMachineInfrastructureTemplateApplyConfiguration) *ControlPlaneClassApplyConfiguration { + b.MachineInfrastructure = value + return b +} + +// WithHealthCheck sets the HealthCheck field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HealthCheck field is set to the value of the last call. +func (b *ControlPlaneClassApplyConfiguration) WithHealthCheck(value *ControlPlaneClassHealthCheckApplyConfiguration) *ControlPlaneClassApplyConfiguration { + b.HealthCheck = value + return b +} + +// WithNaming sets the Naming field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Naming field is set to the value of the last call. +func (b *ControlPlaneClassApplyConfiguration) WithNaming(value *ControlPlaneClassNamingSpecApplyConfiguration) *ControlPlaneClassApplyConfiguration { + b.Naming = value + return b +} + +// WithDeletion sets the Deletion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deletion field is set to the value of the last call. +func (b *ControlPlaneClassApplyConfiguration) WithDeletion(value *ControlPlaneClassMachineDeletionSpecApplyConfiguration) *ControlPlaneClassApplyConfiguration { + b.Deletion = value + return b +} + +// WithReadinessGates adds the given value to the ReadinessGates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ReadinessGates field. +func (b *ControlPlaneClassApplyConfiguration) WithReadinessGates(values ...*MachineReadinessGateApplyConfiguration) *ControlPlaneClassApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithReadinessGates") + } + b.ReadinessGates = append(b.ReadinessGates, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclasshealthcheck.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclasshealthcheck.go new file mode 100644 index 000000000000..1011c1d9f14b --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclasshealthcheck.go @@ -0,0 +1,66 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneClassHealthCheckApplyConfiguration represents a declarative configuration of the ControlPlaneClassHealthCheck type for use +// with apply. +// +// ControlPlaneClassHealthCheck defines a MachineHealthCheck for control plane machines. +type ControlPlaneClassHealthCheckApplyConfiguration struct { + // checks are the checks that are used to evaluate if a Machine is healthy. + // + // Independent of this configuration the MachineHealthCheck controller will always + // flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and + // Machines with deleted Nodes as unhealthy. + // + // Furthermore, if checks.nodeStartupTimeoutSeconds is not set it + // is defaulted to 10 minutes and evaluated accordingly. + Checks *ControlPlaneClassHealthCheckChecksApplyConfiguration `json:"checks,omitempty"` + // remediation configures if and how remediations are triggered if a Machine is unhealthy. + // + // If remediation or remediation.triggerIf is not set, + // remediation will always be triggered for unhealthy Machines. + // + // If remediation or remediation.templateRef is not set, + // the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via + // the owner of the Machines, for example a MachineSet or a KubeadmControlPlane. + Remediation *ControlPlaneClassHealthCheckRemediationApplyConfiguration `json:"remediation,omitempty"` +} + +// ControlPlaneClassHealthCheckApplyConfiguration constructs a declarative configuration of the ControlPlaneClassHealthCheck type for use with +// apply. +func ControlPlaneClassHealthCheck() *ControlPlaneClassHealthCheckApplyConfiguration { + return &ControlPlaneClassHealthCheckApplyConfiguration{} +} + +// WithChecks sets the Checks field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Checks field is set to the value of the last call. +func (b *ControlPlaneClassHealthCheckApplyConfiguration) WithChecks(value *ControlPlaneClassHealthCheckChecksApplyConfiguration) *ControlPlaneClassHealthCheckApplyConfiguration { + b.Checks = value + return b +} + +// WithRemediation sets the Remediation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Remediation field is set to the value of the last call. +func (b *ControlPlaneClassHealthCheckApplyConfiguration) WithRemediation(value *ControlPlaneClassHealthCheckRemediationApplyConfiguration) *ControlPlaneClassHealthCheckApplyConfiguration { + b.Remediation = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclasshealthcheckchecks.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclasshealthcheckchecks.go new file mode 100644 index 000000000000..f85fee71471e --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclasshealthcheckchecks.go @@ -0,0 +1,87 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneClassHealthCheckChecksApplyConfiguration represents a declarative configuration of the ControlPlaneClassHealthCheckChecks type for use +// with apply. +// +// ControlPlaneClassHealthCheckChecks are the checks that are used to evaluate if a control plane Machine is healthy. +type ControlPlaneClassHealthCheckChecksApplyConfiguration struct { + // nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck + // to consider a Machine unhealthy if a corresponding Node isn't associated + // through a `Spec.ProviderID` field. + // + // The duration set in this field is compared to the greatest of: + // - Cluster's infrastructure ready condition timestamp (if and when available) + // - Control Plane's initialized condition timestamp (if and when available) + // - Machine's infrastructure ready condition timestamp (if and when available) + // - Machine's metadata creation timestamp + // + // Defaults to 10 minutes. + // If you wish to disable this feature, set the value explicitly to 0. + NodeStartupTimeoutSeconds *int32 `json:"nodeStartupTimeoutSeconds,omitempty"` + // unhealthyNodeConditions contains a list of conditions that determine + // whether a node is considered unhealthy. The conditions are combined in a + // logical OR, i.e. if any of the conditions is met, the node is unhealthy. + UnhealthyNodeConditions []UnhealthyNodeConditionApplyConfiguration `json:"unhealthyNodeConditions,omitempty"` + // unhealthyMachineConditions contains a list of the machine conditions that determine + // whether a machine is considered unhealthy. The conditions are combined in a + // logical OR, i.e. if any of the conditions is met, the machine is unhealthy. + UnhealthyMachineConditions []UnhealthyMachineConditionApplyConfiguration `json:"unhealthyMachineConditions,omitempty"` +} + +// ControlPlaneClassHealthCheckChecksApplyConfiguration constructs a declarative configuration of the ControlPlaneClassHealthCheckChecks type for use with +// apply. +func ControlPlaneClassHealthCheckChecks() *ControlPlaneClassHealthCheckChecksApplyConfiguration { + return &ControlPlaneClassHealthCheckChecksApplyConfiguration{} +} + +// WithNodeStartupTimeoutSeconds sets the NodeStartupTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeStartupTimeoutSeconds field is set to the value of the last call. +func (b *ControlPlaneClassHealthCheckChecksApplyConfiguration) WithNodeStartupTimeoutSeconds(value int32) *ControlPlaneClassHealthCheckChecksApplyConfiguration { + b.NodeStartupTimeoutSeconds = &value + return b +} + +// WithUnhealthyNodeConditions adds the given value to the UnhealthyNodeConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the UnhealthyNodeConditions field. +func (b *ControlPlaneClassHealthCheckChecksApplyConfiguration) WithUnhealthyNodeConditions(values ...*UnhealthyNodeConditionApplyConfiguration) *ControlPlaneClassHealthCheckChecksApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithUnhealthyNodeConditions") + } + b.UnhealthyNodeConditions = append(b.UnhealthyNodeConditions, *values[i]) + } + return b +} + +// WithUnhealthyMachineConditions adds the given value to the UnhealthyMachineConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the UnhealthyMachineConditions field. +func (b *ControlPlaneClassHealthCheckChecksApplyConfiguration) WithUnhealthyMachineConditions(values ...*UnhealthyMachineConditionApplyConfiguration) *ControlPlaneClassHealthCheckChecksApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithUnhealthyMachineConditions") + } + b.UnhealthyMachineConditions = append(b.UnhealthyMachineConditions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclasshealthcheckremediation.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclasshealthcheckremediation.go new file mode 100644 index 000000000000..7d420adfd53c --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclasshealthcheckremediation.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneClassHealthCheckRemediationApplyConfiguration represents a declarative configuration of the ControlPlaneClassHealthCheckRemediation type for use +// with apply. +// +// ControlPlaneClassHealthCheckRemediation configures if and how remediations are triggered if a control plane Machine is unhealthy. +type ControlPlaneClassHealthCheckRemediationApplyConfiguration struct { + // triggerIf configures if remediations are triggered. + // If this field is not set, remediations are always triggered. + TriggerIf *ControlPlaneClassHealthCheckRemediationTriggerIfApplyConfiguration `json:"triggerIf,omitempty"` + // templateRef is a reference to a remediation template + // provided by an infrastructure provider. + // + // This field is completely optional, when filled, the MachineHealthCheck controller + // creates a new object from the template referenced and hands off remediation of the machine to + // a controller that lives outside of Cluster API. + TemplateRef *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration `json:"templateRef,omitempty"` +} + +// ControlPlaneClassHealthCheckRemediationApplyConfiguration constructs a declarative configuration of the ControlPlaneClassHealthCheckRemediation type for use with +// apply. +func ControlPlaneClassHealthCheckRemediation() *ControlPlaneClassHealthCheckRemediationApplyConfiguration { + return &ControlPlaneClassHealthCheckRemediationApplyConfiguration{} +} + +// WithTriggerIf sets the TriggerIf field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TriggerIf field is set to the value of the last call. +func (b *ControlPlaneClassHealthCheckRemediationApplyConfiguration) WithTriggerIf(value *ControlPlaneClassHealthCheckRemediationTriggerIfApplyConfiguration) *ControlPlaneClassHealthCheckRemediationApplyConfiguration { + b.TriggerIf = value + return b +} + +// WithTemplateRef sets the TemplateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateRef field is set to the value of the last call. +func (b *ControlPlaneClassHealthCheckRemediationApplyConfiguration) WithTemplateRef(value *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration) *ControlPlaneClassHealthCheckRemediationApplyConfiguration { + b.TemplateRef = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclasshealthcheckremediationtriggerif.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclasshealthcheckremediationtriggerif.go new file mode 100644 index 000000000000..70670577587f --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclasshealthcheckremediationtriggerif.go @@ -0,0 +1,63 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// ControlPlaneClassHealthCheckRemediationTriggerIfApplyConfiguration represents a declarative configuration of the ControlPlaneClassHealthCheckRemediationTriggerIf type for use +// with apply. +// +// ControlPlaneClassHealthCheckRemediationTriggerIf configures if remediations are triggered. +type ControlPlaneClassHealthCheckRemediationTriggerIfApplyConfiguration struct { + // unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of + // unhealthy Machines is less than or equal to the configured value. + // unhealthyInRange takes precedence if set. + UnhealthyLessThanOrEqualTo *intstr.IntOrString `json:"unhealthyLessThanOrEqualTo,omitempty"` + // unhealthyInRange specifies that remediations are only triggered if the number of + // unhealthy Machines is in the configured range. + // Takes precedence over unhealthyLessThanOrEqualTo. + // Eg. "[3-5]" - This means that remediation will be allowed only when: + // (a) there are at least 3 unhealthy Machines (and) + // (b) there are at most 5 unhealthy Machines + UnhealthyInRange *string `json:"unhealthyInRange,omitempty"` +} + +// ControlPlaneClassHealthCheckRemediationTriggerIfApplyConfiguration constructs a declarative configuration of the ControlPlaneClassHealthCheckRemediationTriggerIf type for use with +// apply. +func ControlPlaneClassHealthCheckRemediationTriggerIf() *ControlPlaneClassHealthCheckRemediationTriggerIfApplyConfiguration { + return &ControlPlaneClassHealthCheckRemediationTriggerIfApplyConfiguration{} +} + +// WithUnhealthyLessThanOrEqualTo sets the UnhealthyLessThanOrEqualTo field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnhealthyLessThanOrEqualTo field is set to the value of the last call. +func (b *ControlPlaneClassHealthCheckRemediationTriggerIfApplyConfiguration) WithUnhealthyLessThanOrEqualTo(value intstr.IntOrString) *ControlPlaneClassHealthCheckRemediationTriggerIfApplyConfiguration { + b.UnhealthyLessThanOrEqualTo = &value + return b +} + +// WithUnhealthyInRange sets the UnhealthyInRange field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnhealthyInRange field is set to the value of the last call. +func (b *ControlPlaneClassHealthCheckRemediationTriggerIfApplyConfiguration) WithUnhealthyInRange(value string) *ControlPlaneClassHealthCheckRemediationTriggerIfApplyConfiguration { + b.UnhealthyInRange = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclassmachinedeletionspec.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclassmachinedeletionspec.go new file mode 100644 index 000000000000..13b18aed2914 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclassmachinedeletionspec.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneClassMachineDeletionSpecApplyConfiguration represents a declarative configuration of the ControlPlaneClassMachineDeletionSpec type for use +// with apply. +// +// ControlPlaneClassMachineDeletionSpec contains configuration options for Machine deletion. +type ControlPlaneClassMachineDeletionSpecApplyConfiguration struct { + // nodeDrainTimeoutSeconds is the total amount of time that the controller will spend on draining a node. + // The default value is 0, meaning that the node can be drained without any time limitations. + // NOTE: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + // NOTE: This value can be overridden while defining a Cluster.Topology. + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + // NOTE: This value can be overridden while defining a Cluster.Topology. + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine + // hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + // NOTE: This value can be overridden while defining a Cluster.Topology. + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// ControlPlaneClassMachineDeletionSpecApplyConfiguration constructs a declarative configuration of the ControlPlaneClassMachineDeletionSpec type for use with +// apply. +func ControlPlaneClassMachineDeletionSpec() *ControlPlaneClassMachineDeletionSpecApplyConfiguration { + return &ControlPlaneClassMachineDeletionSpecApplyConfiguration{} +} + +// WithNodeDrainTimeoutSeconds sets the NodeDrainTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDrainTimeoutSeconds field is set to the value of the last call. +func (b *ControlPlaneClassMachineDeletionSpecApplyConfiguration) WithNodeDrainTimeoutSeconds(value int32) *ControlPlaneClassMachineDeletionSpecApplyConfiguration { + b.NodeDrainTimeoutSeconds = &value + return b +} + +// WithNodeVolumeDetachTimeoutSeconds sets the NodeVolumeDetachTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeVolumeDetachTimeoutSeconds field is set to the value of the last call. +func (b *ControlPlaneClassMachineDeletionSpecApplyConfiguration) WithNodeVolumeDetachTimeoutSeconds(value int32) *ControlPlaneClassMachineDeletionSpecApplyConfiguration { + b.NodeVolumeDetachTimeoutSeconds = &value + return b +} + +// WithNodeDeletionTimeoutSeconds sets the NodeDeletionTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDeletionTimeoutSeconds field is set to the value of the last call. +func (b *ControlPlaneClassMachineDeletionSpecApplyConfiguration) WithNodeDeletionTimeoutSeconds(value int32) *ControlPlaneClassMachineDeletionSpecApplyConfiguration { + b.NodeDeletionTimeoutSeconds = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclassmachineinfrastructuretemplate.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclassmachineinfrastructuretemplate.go new file mode 100644 index 000000000000..e555e1f6628f --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclassmachineinfrastructuretemplate.go @@ -0,0 +1,42 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneClassMachineInfrastructureTemplateApplyConfiguration represents a declarative configuration of the ControlPlaneClassMachineInfrastructureTemplate type for use +// with apply. +// +// ControlPlaneClassMachineInfrastructureTemplate defines the template for a MachineInfrastructure of a ControlPlane. +type ControlPlaneClassMachineInfrastructureTemplateApplyConfiguration struct { + // templateRef is a required reference to the template for a MachineInfrastructure of a ControlPlane. + TemplateRef *ClusterClassTemplateReferenceApplyConfiguration `json:"templateRef,omitempty"` +} + +// ControlPlaneClassMachineInfrastructureTemplateApplyConfiguration constructs a declarative configuration of the ControlPlaneClassMachineInfrastructureTemplate type for use with +// apply. +func ControlPlaneClassMachineInfrastructureTemplate() *ControlPlaneClassMachineInfrastructureTemplateApplyConfiguration { + return &ControlPlaneClassMachineInfrastructureTemplateApplyConfiguration{} +} + +// WithTemplateRef sets the TemplateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateRef field is set to the value of the last call. +func (b *ControlPlaneClassMachineInfrastructureTemplateApplyConfiguration) WithTemplateRef(value *ClusterClassTemplateReferenceApplyConfiguration) *ControlPlaneClassMachineInfrastructureTemplateApplyConfiguration { + b.TemplateRef = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclassnamingspec.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclassnamingspec.go new file mode 100644 index 000000000000..e35a9f49067a --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplaneclassnamingspec.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneClassNamingSpecApplyConfiguration represents a declarative configuration of the ControlPlaneClassNamingSpec type for use +// with apply. +// +// ControlPlaneClassNamingSpec defines the naming strategy for control plane objects. +type ControlPlaneClassNamingSpecApplyConfiguration struct { + // template defines the template to use for generating the name of the ControlPlane object. + // If not defined, it will fallback to `{{ .cluster.name }}-{{ .random }}`. + // If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will + // get concatenated with a random suffix of length 5. + // The templating mechanism provides the following arguments: + // * `.cluster.name`: The name of the cluster object. + // * `.random`: A random alphanumeric string, without vowels, of length 5. + Template *string `json:"template,omitempty"` +} + +// ControlPlaneClassNamingSpecApplyConfiguration constructs a declarative configuration of the ControlPlaneClassNamingSpec type for use with +// apply. +func ControlPlaneClassNamingSpec() *ControlPlaneClassNamingSpecApplyConfiguration { + return &ControlPlaneClassNamingSpecApplyConfiguration{} +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *ControlPlaneClassNamingSpecApplyConfiguration) WithTemplate(value string) *ControlPlaneClassNamingSpecApplyConfiguration { + b.Template = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopology.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopology.go new file mode 100644 index 000000000000..dabefbbaf95f --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopology.go @@ -0,0 +1,112 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneTopologyApplyConfiguration represents a declarative configuration of the ControlPlaneTopology type for use +// with apply. +// +// ControlPlaneTopology specifies the parameters for the control plane nodes in the cluster. +type ControlPlaneTopologyApplyConfiguration struct { + // metadata is the metadata applied to the ControlPlane and the Machines of the ControlPlane + // if the ControlPlaneTemplate referenced by the ClusterClass is machine based. If not, it + // is applied only to the ControlPlane. + // At runtime this metadata is merged with the corresponding metadata from the ClusterClass. + Metadata *ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // replicas is the number of control plane nodes. + // If the value is not set, the ControlPlane object is created without the number of Replicas + // and it's assumed that the control plane controller does not implement support for this field. + // When specified against a control plane provider that lacks support for this field, this value will be ignored. + Replicas *int32 `json:"replicas,omitempty"` + // healthCheck allows to enable, disable and override control plane health check + // configuration from the ClusterClass for this control plane. + HealthCheck *ControlPlaneTopologyHealthCheckApplyConfiguration `json:"healthCheck,omitempty"` + // deletion contains configuration options for Machine deletion. + Deletion *ControlPlaneTopologyMachineDeletionSpecApplyConfiguration `json:"deletion,omitempty"` + // readinessGates specifies additional conditions to include when evaluating Machine Ready condition. + // + // This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready + // computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine. + // + // If this field is not defined, readinessGates from the corresponding ControlPlaneClass will be used, if any. + // + // NOTE: Specific control plane provider implementations might automatically extend the list of readinessGates; + // e.g. the kubeadm control provider adds ReadinessGates for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc. + ReadinessGates []MachineReadinessGateApplyConfiguration `json:"readinessGates,omitempty"` + // variables can be used to customize the ControlPlane through patches. + Variables *ControlPlaneVariablesApplyConfiguration `json:"variables,omitempty"` +} + +// ControlPlaneTopologyApplyConfiguration constructs a declarative configuration of the ControlPlaneTopology type for use with +// apply. +func ControlPlaneTopology() *ControlPlaneTopologyApplyConfiguration { + return &ControlPlaneTopologyApplyConfiguration{} +} + +// WithMetadata sets the Metadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Metadata field is set to the value of the last call. +func (b *ControlPlaneTopologyApplyConfiguration) WithMetadata(value *ObjectMetaApplyConfiguration) *ControlPlaneTopologyApplyConfiguration { + b.Metadata = value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ControlPlaneTopologyApplyConfiguration) WithReplicas(value int32) *ControlPlaneTopologyApplyConfiguration { + b.Replicas = &value + return b +} + +// WithHealthCheck sets the HealthCheck field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HealthCheck field is set to the value of the last call. +func (b *ControlPlaneTopologyApplyConfiguration) WithHealthCheck(value *ControlPlaneTopologyHealthCheckApplyConfiguration) *ControlPlaneTopologyApplyConfiguration { + b.HealthCheck = value + return b +} + +// WithDeletion sets the Deletion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deletion field is set to the value of the last call. +func (b *ControlPlaneTopologyApplyConfiguration) WithDeletion(value *ControlPlaneTopologyMachineDeletionSpecApplyConfiguration) *ControlPlaneTopologyApplyConfiguration { + b.Deletion = value + return b +} + +// WithReadinessGates adds the given value to the ReadinessGates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ReadinessGates field. +func (b *ControlPlaneTopologyApplyConfiguration) WithReadinessGates(values ...*MachineReadinessGateApplyConfiguration) *ControlPlaneTopologyApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithReadinessGates") + } + b.ReadinessGates = append(b.ReadinessGates, *values[i]) + } + return b +} + +// WithVariables sets the Variables field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Variables field is set to the value of the last call. +func (b *ControlPlaneTopologyApplyConfiguration) WithVariables(value *ControlPlaneVariablesApplyConfiguration) *ControlPlaneTopologyApplyConfiguration { + b.Variables = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologyhealthcheck.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologyhealthcheck.go new file mode 100644 index 000000000000..77dca554da75 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologyhealthcheck.go @@ -0,0 +1,92 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneTopologyHealthCheckApplyConfiguration represents a declarative configuration of the ControlPlaneTopologyHealthCheck type for use +// with apply. +// +// ControlPlaneTopologyHealthCheck defines a MachineHealthCheck for control plane machines. +type ControlPlaneTopologyHealthCheckApplyConfiguration struct { + // enabled controls if a MachineHealthCheck should be created for the target machines. + // + // If false: No MachineHealthCheck will be created. + // + // If not set(default): A MachineHealthCheck will be created if it is defined here or + // in the associated ClusterClass. If no MachineHealthCheck is defined then none will be created. + // + // If true: A MachineHealthCheck is guaranteed to be created. Cluster validation will + // block if `enable` is true and no MachineHealthCheck definition is available. + Enabled *bool `json:"enabled,omitempty"` + // checks are the checks that are used to evaluate if a Machine is healthy. + // + // If one of checks and remediation fields are set, the system assumes that an healthCheck override is defined, + // and as a consequence the checks and remediation fields from Cluster will be used instead of the + // corresponding fields in ClusterClass. + // + // Independent of this configuration the MachineHealthCheck controller will always + // flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and + // Machines with deleted Nodes as unhealthy. + // + // Furthermore, if checks.nodeStartupTimeoutSeconds is not set it + // is defaulted to 10 minutes and evaluated accordingly. + Checks *ControlPlaneTopologyHealthCheckChecksApplyConfiguration `json:"checks,omitempty"` + // remediation configures if and how remediations are triggered if a Machine is unhealthy. + // + // If one of checks and remediation fields are set, the system assumes that an healthCheck override is defined, + // and as a consequence the checks and remediation fields from cluster will be used instead of the + // corresponding fields in ClusterClass. + // + // If an health check override is defined and remediation or remediation.triggerIf is not set, + // remediation will always be triggered for unhealthy Machines. + // + // If an health check override is defined and remediation or remediation.templateRef is not set, + // the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via + // the owner of the Machines, for example a MachineSet or a KubeadmControlPlane. + Remediation *ControlPlaneTopologyHealthCheckRemediationApplyConfiguration `json:"remediation,omitempty"` +} + +// ControlPlaneTopologyHealthCheckApplyConfiguration constructs a declarative configuration of the ControlPlaneTopologyHealthCheck type for use with +// apply. +func ControlPlaneTopologyHealthCheck() *ControlPlaneTopologyHealthCheckApplyConfiguration { + return &ControlPlaneTopologyHealthCheckApplyConfiguration{} +} + +// WithEnabled sets the Enabled field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Enabled field is set to the value of the last call. +func (b *ControlPlaneTopologyHealthCheckApplyConfiguration) WithEnabled(value bool) *ControlPlaneTopologyHealthCheckApplyConfiguration { + b.Enabled = &value + return b +} + +// WithChecks sets the Checks field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Checks field is set to the value of the last call. +func (b *ControlPlaneTopologyHealthCheckApplyConfiguration) WithChecks(value *ControlPlaneTopologyHealthCheckChecksApplyConfiguration) *ControlPlaneTopologyHealthCheckApplyConfiguration { + b.Checks = value + return b +} + +// WithRemediation sets the Remediation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Remediation field is set to the value of the last call. +func (b *ControlPlaneTopologyHealthCheckApplyConfiguration) WithRemediation(value *ControlPlaneTopologyHealthCheckRemediationApplyConfiguration) *ControlPlaneTopologyHealthCheckApplyConfiguration { + b.Remediation = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologyhealthcheckchecks.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologyhealthcheckchecks.go new file mode 100644 index 000000000000..08cc680a6ae2 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologyhealthcheckchecks.go @@ -0,0 +1,87 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneTopologyHealthCheckChecksApplyConfiguration represents a declarative configuration of the ControlPlaneTopologyHealthCheckChecks type for use +// with apply. +// +// ControlPlaneTopologyHealthCheckChecks are the checks that are used to evaluate if a control plane Machine is healthy. +type ControlPlaneTopologyHealthCheckChecksApplyConfiguration struct { + // nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck + // to consider a Machine unhealthy if a corresponding Node isn't associated + // through a `Spec.ProviderID` field. + // + // The duration set in this field is compared to the greatest of: + // - Cluster's infrastructure ready condition timestamp (if and when available) + // - Control Plane's initialized condition timestamp (if and when available) + // - Machine's infrastructure ready condition timestamp (if and when available) + // - Machine's metadata creation timestamp + // + // Defaults to 10 minutes. + // If you wish to disable this feature, set the value explicitly to 0. + NodeStartupTimeoutSeconds *int32 `json:"nodeStartupTimeoutSeconds,omitempty"` + // unhealthyNodeConditions contains a list of conditions that determine + // whether a node is considered unhealthy. The conditions are combined in a + // logical OR, i.e. if any of the conditions is met, the node is unhealthy. + UnhealthyNodeConditions []UnhealthyNodeConditionApplyConfiguration `json:"unhealthyNodeConditions,omitempty"` + // unhealthyMachineConditions contains a list of the machine conditions that determine + // whether a machine is considered unhealthy. The conditions are combined in a + // logical OR, i.e. if any of the conditions is met, the machine is unhealthy. + UnhealthyMachineConditions []UnhealthyMachineConditionApplyConfiguration `json:"unhealthyMachineConditions,omitempty"` +} + +// ControlPlaneTopologyHealthCheckChecksApplyConfiguration constructs a declarative configuration of the ControlPlaneTopologyHealthCheckChecks type for use with +// apply. +func ControlPlaneTopologyHealthCheckChecks() *ControlPlaneTopologyHealthCheckChecksApplyConfiguration { + return &ControlPlaneTopologyHealthCheckChecksApplyConfiguration{} +} + +// WithNodeStartupTimeoutSeconds sets the NodeStartupTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeStartupTimeoutSeconds field is set to the value of the last call. +func (b *ControlPlaneTopologyHealthCheckChecksApplyConfiguration) WithNodeStartupTimeoutSeconds(value int32) *ControlPlaneTopologyHealthCheckChecksApplyConfiguration { + b.NodeStartupTimeoutSeconds = &value + return b +} + +// WithUnhealthyNodeConditions adds the given value to the UnhealthyNodeConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the UnhealthyNodeConditions field. +func (b *ControlPlaneTopologyHealthCheckChecksApplyConfiguration) WithUnhealthyNodeConditions(values ...*UnhealthyNodeConditionApplyConfiguration) *ControlPlaneTopologyHealthCheckChecksApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithUnhealthyNodeConditions") + } + b.UnhealthyNodeConditions = append(b.UnhealthyNodeConditions, *values[i]) + } + return b +} + +// WithUnhealthyMachineConditions adds the given value to the UnhealthyMachineConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the UnhealthyMachineConditions field. +func (b *ControlPlaneTopologyHealthCheckChecksApplyConfiguration) WithUnhealthyMachineConditions(values ...*UnhealthyMachineConditionApplyConfiguration) *ControlPlaneTopologyHealthCheckChecksApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithUnhealthyMachineConditions") + } + b.UnhealthyMachineConditions = append(b.UnhealthyMachineConditions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologyhealthcheckremediation.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologyhealthcheckremediation.go new file mode 100644 index 000000000000..00c55a6f3896 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologyhealthcheckremediation.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneTopologyHealthCheckRemediationApplyConfiguration represents a declarative configuration of the ControlPlaneTopologyHealthCheckRemediation type for use +// with apply. +// +// ControlPlaneTopologyHealthCheckRemediation configures if and how remediations are triggered if a control plane Machine is unhealthy. +type ControlPlaneTopologyHealthCheckRemediationApplyConfiguration struct { + // triggerIf configures if remediations are triggered. + // If this field is not set, remediations are always triggered. + TriggerIf *ControlPlaneTopologyHealthCheckRemediationTriggerIfApplyConfiguration `json:"triggerIf,omitempty"` + // templateRef is a reference to a remediation template + // provided by an infrastructure provider. + // + // This field is completely optional, when filled, the MachineHealthCheck controller + // creates a new object from the template referenced and hands off remediation of the machine to + // a controller that lives outside of Cluster API. + TemplateRef *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration `json:"templateRef,omitempty"` +} + +// ControlPlaneTopologyHealthCheckRemediationApplyConfiguration constructs a declarative configuration of the ControlPlaneTopologyHealthCheckRemediation type for use with +// apply. +func ControlPlaneTopologyHealthCheckRemediation() *ControlPlaneTopologyHealthCheckRemediationApplyConfiguration { + return &ControlPlaneTopologyHealthCheckRemediationApplyConfiguration{} +} + +// WithTriggerIf sets the TriggerIf field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TriggerIf field is set to the value of the last call. +func (b *ControlPlaneTopologyHealthCheckRemediationApplyConfiguration) WithTriggerIf(value *ControlPlaneTopologyHealthCheckRemediationTriggerIfApplyConfiguration) *ControlPlaneTopologyHealthCheckRemediationApplyConfiguration { + b.TriggerIf = value + return b +} + +// WithTemplateRef sets the TemplateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateRef field is set to the value of the last call. +func (b *ControlPlaneTopologyHealthCheckRemediationApplyConfiguration) WithTemplateRef(value *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration) *ControlPlaneTopologyHealthCheckRemediationApplyConfiguration { + b.TemplateRef = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologyhealthcheckremediationtriggerif.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologyhealthcheckremediationtriggerif.go new file mode 100644 index 000000000000..ff10dc2eb966 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologyhealthcheckremediationtriggerif.go @@ -0,0 +1,63 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// ControlPlaneTopologyHealthCheckRemediationTriggerIfApplyConfiguration represents a declarative configuration of the ControlPlaneTopologyHealthCheckRemediationTriggerIf type for use +// with apply. +// +// ControlPlaneTopologyHealthCheckRemediationTriggerIf configures if remediations are triggered. +type ControlPlaneTopologyHealthCheckRemediationTriggerIfApplyConfiguration struct { + // unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of + // unhealthy Machines is less than or equal to the configured value. + // unhealthyInRange takes precedence if set. + UnhealthyLessThanOrEqualTo *intstr.IntOrString `json:"unhealthyLessThanOrEqualTo,omitempty"` + // unhealthyInRange specifies that remediations are only triggered if the number of + // unhealthy Machines is in the configured range. + // Takes precedence over unhealthyLessThanOrEqualTo. + // Eg. "[3-5]" - This means that remediation will be allowed only when: + // (a) there are at least 3 unhealthy Machines (and) + // (b) there are at most 5 unhealthy Machines + UnhealthyInRange *string `json:"unhealthyInRange,omitempty"` +} + +// ControlPlaneTopologyHealthCheckRemediationTriggerIfApplyConfiguration constructs a declarative configuration of the ControlPlaneTopologyHealthCheckRemediationTriggerIf type for use with +// apply. +func ControlPlaneTopologyHealthCheckRemediationTriggerIf() *ControlPlaneTopologyHealthCheckRemediationTriggerIfApplyConfiguration { + return &ControlPlaneTopologyHealthCheckRemediationTriggerIfApplyConfiguration{} +} + +// WithUnhealthyLessThanOrEqualTo sets the UnhealthyLessThanOrEqualTo field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnhealthyLessThanOrEqualTo field is set to the value of the last call. +func (b *ControlPlaneTopologyHealthCheckRemediationTriggerIfApplyConfiguration) WithUnhealthyLessThanOrEqualTo(value intstr.IntOrString) *ControlPlaneTopologyHealthCheckRemediationTriggerIfApplyConfiguration { + b.UnhealthyLessThanOrEqualTo = &value + return b +} + +// WithUnhealthyInRange sets the UnhealthyInRange field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnhealthyInRange field is set to the value of the last call. +func (b *ControlPlaneTopologyHealthCheckRemediationTriggerIfApplyConfiguration) WithUnhealthyInRange(value string) *ControlPlaneTopologyHealthCheckRemediationTriggerIfApplyConfiguration { + b.UnhealthyInRange = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologymachinedeletionspec.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologymachinedeletionspec.go new file mode 100644 index 000000000000..fbd0bf73ea77 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplanetopologymachinedeletionspec.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneTopologyMachineDeletionSpecApplyConfiguration represents a declarative configuration of the ControlPlaneTopologyMachineDeletionSpec type for use +// with apply. +// +// ControlPlaneTopologyMachineDeletionSpec contains configuration options for Machine deletion. +type ControlPlaneTopologyMachineDeletionSpecApplyConfiguration struct { + // nodeDrainTimeoutSeconds is the total amount of time that the controller will spend on draining a node. + // The default value is 0, meaning that the node can be drained without any time limitations. + // NOTE: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine + // hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// ControlPlaneTopologyMachineDeletionSpecApplyConfiguration constructs a declarative configuration of the ControlPlaneTopologyMachineDeletionSpec type for use with +// apply. +func ControlPlaneTopologyMachineDeletionSpec() *ControlPlaneTopologyMachineDeletionSpecApplyConfiguration { + return &ControlPlaneTopologyMachineDeletionSpecApplyConfiguration{} +} + +// WithNodeDrainTimeoutSeconds sets the NodeDrainTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDrainTimeoutSeconds field is set to the value of the last call. +func (b *ControlPlaneTopologyMachineDeletionSpecApplyConfiguration) WithNodeDrainTimeoutSeconds(value int32) *ControlPlaneTopologyMachineDeletionSpecApplyConfiguration { + b.NodeDrainTimeoutSeconds = &value + return b +} + +// WithNodeVolumeDetachTimeoutSeconds sets the NodeVolumeDetachTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeVolumeDetachTimeoutSeconds field is set to the value of the last call. +func (b *ControlPlaneTopologyMachineDeletionSpecApplyConfiguration) WithNodeVolumeDetachTimeoutSeconds(value int32) *ControlPlaneTopologyMachineDeletionSpecApplyConfiguration { + b.NodeVolumeDetachTimeoutSeconds = &value + return b +} + +// WithNodeDeletionTimeoutSeconds sets the NodeDeletionTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDeletionTimeoutSeconds field is set to the value of the last call. +func (b *ControlPlaneTopologyMachineDeletionSpecApplyConfiguration) WithNodeDeletionTimeoutSeconds(value int32) *ControlPlaneTopologyMachineDeletionSpecApplyConfiguration { + b.NodeDeletionTimeoutSeconds = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/controlplanevariables.go b/pkg/generated/applyconfiguration/core/v1beta2/controlplanevariables.go new file mode 100644 index 000000000000..819307efb10d --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/controlplanevariables.go @@ -0,0 +1,47 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ControlPlaneVariablesApplyConfiguration represents a declarative configuration of the ControlPlaneVariables type for use +// with apply. +// +// ControlPlaneVariables can be used to provide variables for the ControlPlane. +type ControlPlaneVariablesApplyConfiguration struct { + // overrides can be used to override Cluster level variables. + Overrides []ClusterVariableApplyConfiguration `json:"overrides,omitempty"` +} + +// ControlPlaneVariablesApplyConfiguration constructs a declarative configuration of the ControlPlaneVariables type for use with +// apply. +func ControlPlaneVariables() *ControlPlaneVariablesApplyConfiguration { + return &ControlPlaneVariablesApplyConfiguration{} +} + +// WithOverrides adds the given value to the Overrides field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Overrides field. +func (b *ControlPlaneVariablesApplyConfiguration) WithOverrides(values ...*ClusterVariableApplyConfiguration) *ControlPlaneVariablesApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOverrides") + } + b.Overrides = append(b.Overrides, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/externalpatchdefinition.go b/pkg/generated/applyconfiguration/core/v1beta2/externalpatchdefinition.go new file mode 100644 index 000000000000..e85e2bb91def --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/externalpatchdefinition.go @@ -0,0 +1,81 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ExternalPatchDefinitionApplyConfiguration represents a declarative configuration of the ExternalPatchDefinition type for use +// with apply. +// +// ExternalPatchDefinition defines an external patch. +// Note: At least one of GeneratePatchesExtension or ValidateTopologyExtension must be set. +type ExternalPatchDefinitionApplyConfiguration struct { + // generatePatchesExtension references an extension which is called to generate patches. + GeneratePatchesExtension *string `json:"generatePatchesExtension,omitempty"` + // validateTopologyExtension references an extension which is called to validate the topology. + ValidateTopologyExtension *string `json:"validateTopologyExtension,omitempty"` + // discoverVariablesExtension references an extension which is called to discover variables. + DiscoverVariablesExtension *string `json:"discoverVariablesExtension,omitempty"` + // settings defines key value pairs to be passed to the extensions. + // Values defined here take precedence over the values defined in the + // corresponding ExtensionConfig. + Settings map[string]string `json:"settings,omitempty"` +} + +// ExternalPatchDefinitionApplyConfiguration constructs a declarative configuration of the ExternalPatchDefinition type for use with +// apply. +func ExternalPatchDefinition() *ExternalPatchDefinitionApplyConfiguration { + return &ExternalPatchDefinitionApplyConfiguration{} +} + +// WithGeneratePatchesExtension sets the GeneratePatchesExtension field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GeneratePatchesExtension field is set to the value of the last call. +func (b *ExternalPatchDefinitionApplyConfiguration) WithGeneratePatchesExtension(value string) *ExternalPatchDefinitionApplyConfiguration { + b.GeneratePatchesExtension = &value + return b +} + +// WithValidateTopologyExtension sets the ValidateTopologyExtension field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ValidateTopologyExtension field is set to the value of the last call. +func (b *ExternalPatchDefinitionApplyConfiguration) WithValidateTopologyExtension(value string) *ExternalPatchDefinitionApplyConfiguration { + b.ValidateTopologyExtension = &value + return b +} + +// WithDiscoverVariablesExtension sets the DiscoverVariablesExtension field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DiscoverVariablesExtension field is set to the value of the last call. +func (b *ExternalPatchDefinitionApplyConfiguration) WithDiscoverVariablesExtension(value string) *ExternalPatchDefinitionApplyConfiguration { + b.DiscoverVariablesExtension = &value + return b +} + +// WithSettings puts the entries into the Settings field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Settings field, +// overwriting an existing map entries in Settings field with the same key. +func (b *ExternalPatchDefinitionApplyConfiguration) WithSettings(entries map[string]string) *ExternalPatchDefinitionApplyConfiguration { + if b.Settings == nil && len(entries) > 0 { + b.Settings = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Settings[k] = v + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/failuredomain.go b/pkg/generated/applyconfiguration/core/v1beta2/failuredomain.go new file mode 100644 index 000000000000..98ed4bc1d1f6 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/failuredomain.go @@ -0,0 +1,69 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// FailureDomainApplyConfiguration represents a declarative configuration of the FailureDomain type for use +// with apply. +// +// FailureDomain is the Schema for Cluster API failure domains. +// It allows controllers to understand how many failure domains a cluster can optionally span across. +type FailureDomainApplyConfiguration struct { + // name is the name of the failure domain. + Name *string `json:"name,omitempty"` + // controlPlane determines if this failure domain is suitable for use by control plane machines. + ControlPlane *bool `json:"controlPlane,omitempty"` + // attributes is a free form map of attributes an infrastructure provider might use or require. + Attributes map[string]string `json:"attributes,omitempty"` +} + +// FailureDomainApplyConfiguration constructs a declarative configuration of the FailureDomain type for use with +// apply. +func FailureDomain() *FailureDomainApplyConfiguration { + return &FailureDomainApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *FailureDomainApplyConfiguration) WithName(value string) *FailureDomainApplyConfiguration { + b.Name = &value + return b +} + +// WithControlPlane sets the ControlPlane field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControlPlane field is set to the value of the last call. +func (b *FailureDomainApplyConfiguration) WithControlPlane(value bool) *FailureDomainApplyConfiguration { + b.ControlPlane = &value + return b +} + +// WithAttributes puts the entries into the Attributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Attributes field, +// overwriting an existing map entries in Attributes field with the same key. +func (b *FailureDomainApplyConfiguration) WithAttributes(entries map[string]string) *FailureDomainApplyConfiguration { + if b.Attributes == nil && len(entries) > 0 { + b.Attributes = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Attributes[k] = v + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/infrastructureclass.go b/pkg/generated/applyconfiguration/core/v1beta2/infrastructureclass.go new file mode 100644 index 000000000000..9cf2b1bbc046 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/infrastructureclass.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// InfrastructureClassApplyConfiguration represents a declarative configuration of the InfrastructureClass type for use +// with apply. +// +// InfrastructureClass defines the class for the infrastructure cluster. +type InfrastructureClassApplyConfiguration struct { + // templateRef contains the reference to a provider-specific infrastructure cluster template. + TemplateRef *ClusterClassTemplateReferenceApplyConfiguration `json:"templateRef,omitempty"` + // naming allows changing the naming pattern used when creating the infrastructure cluster object. + Naming *InfrastructureClassNamingSpecApplyConfiguration `json:"naming,omitempty"` +} + +// InfrastructureClassApplyConfiguration constructs a declarative configuration of the InfrastructureClass type for use with +// apply. +func InfrastructureClass() *InfrastructureClassApplyConfiguration { + return &InfrastructureClassApplyConfiguration{} +} + +// WithTemplateRef sets the TemplateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateRef field is set to the value of the last call. +func (b *InfrastructureClassApplyConfiguration) WithTemplateRef(value *ClusterClassTemplateReferenceApplyConfiguration) *InfrastructureClassApplyConfiguration { + b.TemplateRef = value + return b +} + +// WithNaming sets the Naming field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Naming field is set to the value of the last call. +func (b *InfrastructureClassApplyConfiguration) WithNaming(value *InfrastructureClassNamingSpecApplyConfiguration) *InfrastructureClassApplyConfiguration { + b.Naming = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/infrastructureclassnamingspec.go b/pkg/generated/applyconfiguration/core/v1beta2/infrastructureclassnamingspec.go new file mode 100644 index 000000000000..3a2b8de08289 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/infrastructureclassnamingspec.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// InfrastructureClassNamingSpecApplyConfiguration represents a declarative configuration of the InfrastructureClassNamingSpec type for use +// with apply. +// +// InfrastructureClassNamingSpec defines the naming strategy for infrastructure objects. +type InfrastructureClassNamingSpecApplyConfiguration struct { + // template defines the template to use for generating the name of the Infrastructure object. + // If not defined, it will fallback to `{{ .cluster.name }}-{{ .random }}`. + // If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will + // get concatenated with a random suffix of length 5. + // The templating mechanism provides the following arguments: + // * `.cluster.name`: The name of the cluster object. + // * `.random`: A random alphanumeric string, without vowels, of length 5. + Template *string `json:"template,omitempty"` +} + +// InfrastructureClassNamingSpecApplyConfiguration constructs a declarative configuration of the InfrastructureClassNamingSpec type for use with +// apply. +func InfrastructureClassNamingSpec() *InfrastructureClassNamingSpecApplyConfiguration { + return &InfrastructureClassNamingSpecApplyConfiguration{} +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *InfrastructureClassNamingSpecApplyConfiguration) WithTemplate(value string) *InfrastructureClassNamingSpecApplyConfiguration { + b.Template = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/jsonpatch.go b/pkg/generated/applyconfiguration/core/v1beta2/jsonpatch.go new file mode 100644 index 000000000000..e6202a99976b --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/jsonpatch.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// JSONPatchApplyConfiguration represents a declarative configuration of the JSONPatch type for use +// with apply. +// +// JSONPatch defines a JSON patch. +type JSONPatchApplyConfiguration struct { + // op defines the operation of the patch. + // Note: Only `add`, `replace` and `remove` are supported. + Op *string `json:"op,omitempty"` + // path defines the path of the patch. + // Note: Only the spec of a template can be patched, thus the path has to start with /spec/. + // Note: For now the only allowed array modifications are `append` and `prepend`, i.e.: + // * for op: `add`: only index 0 (prepend) and - (append) are allowed + // * for op: `replace` or `remove`: no indexes are allowed + Path *string `json:"path,omitempty"` + // value defines the value of the patch. + // Note: Either Value or ValueFrom is required for add and replace + // operations. Only one of them is allowed to be set at the same time. + // Note: We have to use apiextensionsv1.JSON instead of our JSON type, + // because controller-tools has a hard-coded schema for apiextensionsv1.JSON + // which cannot be produced by another type (unset type field). + // Ref: https://github.com/kubernetes-sigs/controller-tools/blob/d0e03a142d0ecdd5491593e941ee1d6b5d91dba6/pkg/crd/known_types.go#L106-L111 + Value *v1.JSON `json:"value,omitempty"` + // valueFrom defines the value of the patch. + // Note: Either Value or ValueFrom is required for add and replace + // operations. Only one of them is allowed to be set at the same time. + ValueFrom *JSONPatchValueApplyConfiguration `json:"valueFrom,omitempty"` +} + +// JSONPatchApplyConfiguration constructs a declarative configuration of the JSONPatch type for use with +// apply. +func JSONPatch() *JSONPatchApplyConfiguration { + return &JSONPatchApplyConfiguration{} +} + +// WithOp sets the Op field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Op field is set to the value of the last call. +func (b *JSONPatchApplyConfiguration) WithOp(value string) *JSONPatchApplyConfiguration { + b.Op = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *JSONPatchApplyConfiguration) WithPath(value string) *JSONPatchApplyConfiguration { + b.Path = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *JSONPatchApplyConfiguration) WithValue(value v1.JSON) *JSONPatchApplyConfiguration { + b.Value = &value + return b +} + +// WithValueFrom sets the ValueFrom field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ValueFrom field is set to the value of the last call. +func (b *JSONPatchApplyConfiguration) WithValueFrom(value *JSONPatchValueApplyConfiguration) *JSONPatchApplyConfiguration { + b.ValueFrom = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/jsonpatchvalue.go b/pkg/generated/applyconfiguration/core/v1beta2/jsonpatchvalue.go new file mode 100644 index 000000000000..efe10227977d --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/jsonpatchvalue.go @@ -0,0 +1,56 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// JSONPatchValueApplyConfiguration represents a declarative configuration of the JSONPatchValue type for use +// with apply. +// +// JSONPatchValue defines the value of a patch. +// Note: Only one of the fields is allowed to be set at the same time. +type JSONPatchValueApplyConfiguration struct { + // variable is the variable to be used as value. + // Variable can be one of the variables defined in .spec.variables or a builtin variable. + Variable *string `json:"variable,omitempty"` + // template is the Go template to be used to calculate the value. + // A template can reference variables defined in .spec.variables and builtin variables. + // Note: The template must evaluate to a valid YAML or JSON value. + Template *string `json:"template,omitempty"` +} + +// JSONPatchValueApplyConfiguration constructs a declarative configuration of the JSONPatchValue type for use with +// apply. +func JSONPatchValue() *JSONPatchValueApplyConfiguration { + return &JSONPatchValueApplyConfiguration{} +} + +// WithVariable sets the Variable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Variable field is set to the value of the last call. +func (b *JSONPatchValueApplyConfiguration) WithVariable(value string) *JSONPatchValueApplyConfiguration { + b.Variable = &value + return b +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *JSONPatchValueApplyConfiguration) WithTemplate(value string) *JSONPatchValueApplyConfiguration { + b.Template = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/jsonschemaprops.go b/pkg/generated/applyconfiguration/core/v1beta2/jsonschemaprops.go new file mode 100644 index 000000000000..2ab8566d10d8 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/jsonschemaprops.go @@ -0,0 +1,426 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// JSONSchemaPropsApplyConfiguration represents a declarative configuration of the JSONSchemaProps type for use +// with apply. +// +// Adapted from https://github.com/kubernetes/apiextensions-apiserver/blob/v0.28.5/pkg/apis/apiextensions/v1/types_jsonschema.go#L40 +// JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/). +// This struct has been initially copied from apiextensionsv1.JSONSchemaProps, but all fields +// which are not supported in CAPI have been removed. +type JSONSchemaPropsApplyConfiguration struct { + // description is a human-readable description of this variable. + Description *string `json:"description,omitempty"` + // example is an example for this variable. + Example *v1.JSON `json:"example,omitempty"` + // type is the type of the variable. + // Valid values are: object, array, string, integer, number or boolean. + Type *string `json:"type,omitempty"` + // properties specifies fields of an object. + // NOTE: Can only be set if type is object. + // NOTE: Properties is mutually exclusive with AdditionalProperties. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + Properties map[string]JSONSchemaPropsApplyConfiguration `json:"properties,omitempty"` + // additionalProperties specifies the schema of values in a map (keys are always strings). + // NOTE: Can only be set if type is object. + // NOTE: AdditionalProperties is mutually exclusive with Properties. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + AdditionalProperties *JSONSchemaPropsApplyConfiguration `json:"additionalProperties,omitempty"` + // maxProperties is the maximum amount of entries in a map or properties in an object. + // NOTE: Can only be set if type is object. + MaxProperties *int64 `json:"maxProperties,omitempty"` + // minProperties is the minimum amount of entries in a map or properties in an object. + // NOTE: Can only be set if type is object. + MinProperties *int64 `json:"minProperties,omitempty"` + // required specifies which fields of an object are required. + // NOTE: Can only be set if type is object. + Required []string `json:"required,omitempty"` + // items specifies fields of an array. + // NOTE: Can only be set if type is array. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + Items *JSONSchemaPropsApplyConfiguration `json:"items,omitempty"` + // maxItems is the max length of an array variable. + // NOTE: Can only be set if type is array. + MaxItems *int64 `json:"maxItems,omitempty"` + // minItems is the min length of an array variable. + // NOTE: Can only be set if type is array. + MinItems *int64 `json:"minItems,omitempty"` + // uniqueItems specifies if items in an array must be unique. + // NOTE: Can only be set if type is array. + UniqueItems *bool `json:"uniqueItems,omitempty"` + // format is an OpenAPI v3 format string. Unknown formats are ignored. + // For a list of supported formats please see: (of the k8s.io/apiextensions-apiserver version we're currently using) + // https://github.com/kubernetes/apiextensions-apiserver/blob/master/pkg/apiserver/validation/formats.go + // NOTE: Can only be set if type is string. + Format *string `json:"format,omitempty"` + // maxLength is the max length of a string variable. + // NOTE: Can only be set if type is string. + MaxLength *int64 `json:"maxLength,omitempty"` + // minLength is the min length of a string variable. + // NOTE: Can only be set if type is string. + MinLength *int64 `json:"minLength,omitempty"` + // pattern is the regex which a string variable must match. + // NOTE: Can only be set if type is string. + Pattern *string `json:"pattern,omitempty"` + // maximum is the maximum of an integer or number variable. + // If ExclusiveMaximum is false, the variable is valid if it is lower than, or equal to, the value of Maximum. + // If ExclusiveMaximum is true, the variable is valid if it is strictly lower than the value of Maximum. + // NOTE: Can only be set if type is integer or number. + Maximum *int64 `json:"maximum,omitempty"` + // exclusiveMaximum specifies if the Maximum is exclusive. + // NOTE: Can only be set if type is integer or number. + ExclusiveMaximum *bool `json:"exclusiveMaximum,omitempty"` + // minimum is the minimum of an integer or number variable. + // If ExclusiveMinimum is false, the variable is valid if it is greater than, or equal to, the value of Minimum. + // If ExclusiveMinimum is true, the variable is valid if it is strictly greater than the value of Minimum. + // NOTE: Can only be set if type is integer or number. + Minimum *int64 `json:"minimum,omitempty"` + // exclusiveMinimum specifies if the Minimum is exclusive. + // NOTE: Can only be set if type is integer or number. + ExclusiveMinimum *bool `json:"exclusiveMinimum,omitempty"` + // x-kubernetes-preserve-unknown-fields allows setting fields in a variable object + // which are not defined in the variable schema. This affects fields recursively, + // except if nested properties or additionalProperties are specified in the schema. + XPreserveUnknownFields *bool `json:"x-kubernetes-preserve-unknown-fields,omitempty"` + // enum is the list of valid values of the variable. + // NOTE: Can be set for all types. + Enum []v1.JSON `json:"enum,omitempty"` + // default is the default value of the variable. + // NOTE: Can be set for all types. + Default *v1.JSON `json:"default,omitempty"` + // x-kubernetes-validations describes a list of validation rules written in the CEL expression language. + XValidations []ValidationRuleApplyConfiguration `json:"x-kubernetes-validations,omitempty"` + // x-metadata is the metadata of a variable or a nested field within a variable. + // It can be used to add additional data for higher level tools. + XMetadata *VariableSchemaMetadataApplyConfiguration `json:"x-metadata,omitempty"` + // x-kubernetes-int-or-string specifies that this value is + // either an integer or a string. If this is true, an empty + // type is allowed and type as child of anyOf is permitted + // if following one of the following patterns: + // + // 1) anyOf: + // - type: integer + // - type: string + // 2) allOf: + // - anyOf: + // - type: integer + // - type: string + // - ... zero or more + XIntOrString *bool `json:"x-kubernetes-int-or-string,omitempty"` + // allOf specifies that the variable must validate against all of the subschemas in the array. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + AllOf []JSONSchemaPropsApplyConfiguration `json:"allOf,omitempty"` + // oneOf specifies that the variable must validate against exactly one of the subschemas in the array. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + OneOf []JSONSchemaPropsApplyConfiguration `json:"oneOf,omitempty"` + // anyOf specifies that the variable must validate against one or more of the subschemas in the array. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + AnyOf []JSONSchemaPropsApplyConfiguration `json:"anyOf,omitempty"` + // not specifies that the variable must not validate against the subschema. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + Not *JSONSchemaPropsApplyConfiguration `json:"not,omitempty"` +} + +// JSONSchemaPropsApplyConfiguration constructs a declarative configuration of the JSONSchemaProps type for use with +// apply. +func JSONSchemaProps() *JSONSchemaPropsApplyConfiguration { + return &JSONSchemaPropsApplyConfiguration{} +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithDescription(value string) *JSONSchemaPropsApplyConfiguration { + b.Description = &value + return b +} + +// WithExample sets the Example field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Example field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithExample(value v1.JSON) *JSONSchemaPropsApplyConfiguration { + b.Example = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithType(value string) *JSONSchemaPropsApplyConfiguration { + b.Type = &value + return b +} + +// WithProperties puts the entries into the Properties field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Properties field, +// overwriting an existing map entries in Properties field with the same key. +func (b *JSONSchemaPropsApplyConfiguration) WithProperties(entries map[string]JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + if b.Properties == nil && len(entries) > 0 { + b.Properties = make(map[string]JSONSchemaPropsApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Properties[k] = v + } + return b +} + +// WithAdditionalProperties sets the AdditionalProperties field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AdditionalProperties field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithAdditionalProperties(value *JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + b.AdditionalProperties = value + return b +} + +// WithMaxProperties sets the MaxProperties field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxProperties field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMaxProperties(value int64) *JSONSchemaPropsApplyConfiguration { + b.MaxProperties = &value + return b +} + +// WithMinProperties sets the MinProperties field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinProperties field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMinProperties(value int64) *JSONSchemaPropsApplyConfiguration { + b.MinProperties = &value + return b +} + +// WithRequired adds the given value to the Required field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Required field. +func (b *JSONSchemaPropsApplyConfiguration) WithRequired(values ...string) *JSONSchemaPropsApplyConfiguration { + for i := range values { + b.Required = append(b.Required, values[i]) + } + return b +} + +// WithItems sets the Items field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Items field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithItems(value *JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + b.Items = value + return b +} + +// WithMaxItems sets the MaxItems field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxItems field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMaxItems(value int64) *JSONSchemaPropsApplyConfiguration { + b.MaxItems = &value + return b +} + +// WithMinItems sets the MinItems field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinItems field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMinItems(value int64) *JSONSchemaPropsApplyConfiguration { + b.MinItems = &value + return b +} + +// WithUniqueItems sets the UniqueItems field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UniqueItems field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithUniqueItems(value bool) *JSONSchemaPropsApplyConfiguration { + b.UniqueItems = &value + return b +} + +// WithFormat sets the Format field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Format field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithFormat(value string) *JSONSchemaPropsApplyConfiguration { + b.Format = &value + return b +} + +// WithMaxLength sets the MaxLength field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxLength field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMaxLength(value int64) *JSONSchemaPropsApplyConfiguration { + b.MaxLength = &value + return b +} + +// WithMinLength sets the MinLength field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinLength field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMinLength(value int64) *JSONSchemaPropsApplyConfiguration { + b.MinLength = &value + return b +} + +// WithPattern sets the Pattern field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pattern field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithPattern(value string) *JSONSchemaPropsApplyConfiguration { + b.Pattern = &value + return b +} + +// WithMaximum sets the Maximum field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Maximum field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMaximum(value int64) *JSONSchemaPropsApplyConfiguration { + b.Maximum = &value + return b +} + +// WithExclusiveMaximum sets the ExclusiveMaximum field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExclusiveMaximum field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithExclusiveMaximum(value bool) *JSONSchemaPropsApplyConfiguration { + b.ExclusiveMaximum = &value + return b +} + +// WithMinimum sets the Minimum field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Minimum field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMinimum(value int64) *JSONSchemaPropsApplyConfiguration { + b.Minimum = &value + return b +} + +// WithExclusiveMinimum sets the ExclusiveMinimum field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExclusiveMinimum field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithExclusiveMinimum(value bool) *JSONSchemaPropsApplyConfiguration { + b.ExclusiveMinimum = &value + return b +} + +// WithXPreserveUnknownFields sets the XPreserveUnknownFields field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the XPreserveUnknownFields field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithXPreserveUnknownFields(value bool) *JSONSchemaPropsApplyConfiguration { + b.XPreserveUnknownFields = &value + return b +} + +// WithEnum adds the given value to the Enum field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Enum field. +func (b *JSONSchemaPropsApplyConfiguration) WithEnum(values ...v1.JSON) *JSONSchemaPropsApplyConfiguration { + for i := range values { + b.Enum = append(b.Enum, values[i]) + } + return b +} + +// WithDefault sets the Default field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Default field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithDefault(value v1.JSON) *JSONSchemaPropsApplyConfiguration { + b.Default = &value + return b +} + +// WithXValidations adds the given value to the XValidations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the XValidations field. +func (b *JSONSchemaPropsApplyConfiguration) WithXValidations(values ...*ValidationRuleApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithXValidations") + } + b.XValidations = append(b.XValidations, *values[i]) + } + return b +} + +// WithXMetadata sets the XMetadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the XMetadata field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithXMetadata(value *VariableSchemaMetadataApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + b.XMetadata = value + return b +} + +// WithXIntOrString sets the XIntOrString field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the XIntOrString field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithXIntOrString(value bool) *JSONSchemaPropsApplyConfiguration { + b.XIntOrString = &value + return b +} + +// WithAllOf adds the given value to the AllOf field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AllOf field. +func (b *JSONSchemaPropsApplyConfiguration) WithAllOf(values ...*JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAllOf") + } + b.AllOf = append(b.AllOf, *values[i]) + } + return b +} + +// WithOneOf adds the given value to the OneOf field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OneOf field. +func (b *JSONSchemaPropsApplyConfiguration) WithOneOf(values ...*JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOneOf") + } + b.OneOf = append(b.OneOf, *values[i]) + } + return b +} + +// WithAnyOf adds the given value to the AnyOf field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AnyOf field. +func (b *JSONSchemaPropsApplyConfiguration) WithAnyOf(values ...*JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAnyOf") + } + b.AnyOf = append(b.AnyOf, *values[i]) + } + return b +} + +// WithNot sets the Not field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Not field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithNot(value *JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + b.Not = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machine.go b/pkg/generated/applyconfiguration/core/v1beta2/machine.go new file mode 100644 index 000000000000..c740d16f1ae6 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machine.go @@ -0,0 +1,249 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineApplyConfiguration represents a declarative configuration of the Machine type for use +// with apply. +// +// Machine is the Schema for the machines API. +type MachineApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is the desired state of Machine. + Spec *MachineSpecApplyConfiguration `json:"spec,omitempty"` + // status is the observed state of Machine. + Status *MachineStatusApplyConfiguration `json:"status,omitempty"` +} + +// Machine constructs a declarative configuration of the Machine type for use with +// apply. +func Machine(name, namespace string) *MachineApplyConfiguration { + b := &MachineApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Machine") + b.WithAPIVersion("cluster.x-k8s.io/v1beta2") + return b +} + +func (b MachineApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithKind(value string) *MachineApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithAPIVersion(value string) *MachineApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithName(value string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithGenerateName(value string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithNamespace(value string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithUID(value types.UID) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithResourceVersion(value string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithGeneration(value int64) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MachineApplyConfiguration) WithLabels(entries map[string]string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MachineApplyConfiguration) WithAnnotations(entries map[string]string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *MachineApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *MachineApplyConfiguration) WithFinalizers(values ...string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *MachineApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithSpec(value *MachineSpecApplyConfiguration) *MachineApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithStatus(value *MachineStatusApplyConfiguration) *MachineApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *MachineApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *MachineApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *MachineApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *MachineApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machineaddress.go b/pkg/generated/applyconfiguration/core/v1beta2/machineaddress.go new file mode 100644 index 000000000000..5bc7b31dd508 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machineaddress.go @@ -0,0 +1,56 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineAddressApplyConfiguration represents a declarative configuration of the MachineAddress type for use +// with apply. +// +// MachineAddress contains information for the node's address. +type MachineAddressApplyConfiguration struct { + // type is the machine address type, one of Hostname, ExternalIP, InternalIP, ExternalDNS or InternalDNS. + Type *corev1beta2.MachineAddressType `json:"type,omitempty"` + // address is the machine address. + Address *string `json:"address,omitempty"` +} + +// MachineAddressApplyConfiguration constructs a declarative configuration of the MachineAddress type for use with +// apply. +func MachineAddress() *MachineAddressApplyConfiguration { + return &MachineAddressApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *MachineAddressApplyConfiguration) WithType(value corev1beta2.MachineAddressType) *MachineAddressApplyConfiguration { + b.Type = &value + return b +} + +// WithAddress sets the Address field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Address field is set to the value of the last call. +func (b *MachineAddressApplyConfiguration) WithAddress(value string) *MachineAddressApplyConfiguration { + b.Address = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeletionspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeletionspec.go new file mode 100644 index 000000000000..34cc7dfc44fd --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeletionspec.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeletionSpecApplyConfiguration represents a declarative configuration of the MachineDeletionSpec type for use +// with apply. +// +// MachineDeletionSpec contains configuration options for Machine deletion. +type MachineDeletionSpecApplyConfiguration struct { + // nodeDrainTimeoutSeconds is the total amount of time that the controller will spend on draining a node. + // The default value is 0, meaning that the node can be drained without any time limitations. + // NOTE: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine + // hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// MachineDeletionSpecApplyConfiguration constructs a declarative configuration of the MachineDeletionSpec type for use with +// apply. +func MachineDeletionSpec() *MachineDeletionSpecApplyConfiguration { + return &MachineDeletionSpecApplyConfiguration{} +} + +// WithNodeDrainTimeoutSeconds sets the NodeDrainTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDrainTimeoutSeconds field is set to the value of the last call. +func (b *MachineDeletionSpecApplyConfiguration) WithNodeDrainTimeoutSeconds(value int32) *MachineDeletionSpecApplyConfiguration { + b.NodeDrainTimeoutSeconds = &value + return b +} + +// WithNodeVolumeDetachTimeoutSeconds sets the NodeVolumeDetachTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeVolumeDetachTimeoutSeconds field is set to the value of the last call. +func (b *MachineDeletionSpecApplyConfiguration) WithNodeVolumeDetachTimeoutSeconds(value int32) *MachineDeletionSpecApplyConfiguration { + b.NodeVolumeDetachTimeoutSeconds = &value + return b +} + +// WithNodeDeletionTimeoutSeconds sets the NodeDeletionTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDeletionTimeoutSeconds field is set to the value of the last call. +func (b *MachineDeletionSpecApplyConfiguration) WithNodeDeletionTimeoutSeconds(value int32) *MachineDeletionSpecApplyConfiguration { + b.NodeDeletionTimeoutSeconds = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeletionstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeletionstatus.go new file mode 100644 index 000000000000..35b7ff2df348 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeletionstatus.go @@ -0,0 +1,62 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// MachineDeletionStatusApplyConfiguration represents a declarative configuration of the MachineDeletionStatus type for use +// with apply. +// +// MachineDeletionStatus is the deletion state of the Machine. +type MachineDeletionStatusApplyConfiguration struct { + // nodeDrainStartTime is the time when the drain of the node started and is used to determine + // if the nodeDrainTimeoutSeconds is exceeded. + // Only present when the Machine has a deletionTimestamp and draining the node had been started. + NodeDrainStartTime *v1.Time `json:"nodeDrainStartTime,omitempty"` + // waitForNodeVolumeDetachStartTime is the time when waiting for volume detachment started + // and is used to determine if the nodeVolumeDetachTimeoutSeconds is exceeded. + // Detaching volumes from nodes is usually done by CSI implementations and the current state + // is observed from the node's `.Status.VolumesAttached` field. + // Only present when the Machine has a deletionTimestamp and waiting for volume detachments had been started. + WaitForNodeVolumeDetachStartTime *v1.Time `json:"waitForNodeVolumeDetachStartTime,omitempty"` +} + +// MachineDeletionStatusApplyConfiguration constructs a declarative configuration of the MachineDeletionStatus type for use with +// apply. +func MachineDeletionStatus() *MachineDeletionStatusApplyConfiguration { + return &MachineDeletionStatusApplyConfiguration{} +} + +// WithNodeDrainStartTime sets the NodeDrainStartTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDrainStartTime field is set to the value of the last call. +func (b *MachineDeletionStatusApplyConfiguration) WithNodeDrainStartTime(value v1.Time) *MachineDeletionStatusApplyConfiguration { + b.NodeDrainStartTime = &value + return b +} + +// WithWaitForNodeVolumeDetachStartTime sets the WaitForNodeVolumeDetachStartTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WaitForNodeVolumeDetachStartTime field is set to the value of the last call. +func (b *MachineDeletionStatusApplyConfiguration) WithWaitForNodeVolumeDetachStartTime(value v1.Time) *MachineDeletionStatusApplyConfiguration { + b.WaitForNodeVolumeDetachStartTime = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeployment.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeployment.go new file mode 100644 index 000000000000..8c2b693d609d --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeployment.go @@ -0,0 +1,249 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineDeploymentApplyConfiguration represents a declarative configuration of the MachineDeployment type for use +// with apply. +// +// MachineDeployment is the Schema for the machinedeployments API. +type MachineDeploymentApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is the desired state of MachineDeployment. + Spec *MachineDeploymentSpecApplyConfiguration `json:"spec,omitempty"` + // status is the observed state of MachineDeployment. + Status *MachineDeploymentStatusApplyConfiguration `json:"status,omitempty"` +} + +// MachineDeployment constructs a declarative configuration of the MachineDeployment type for use with +// apply. +func MachineDeployment(name, namespace string) *MachineDeploymentApplyConfiguration { + b := &MachineDeploymentApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("MachineDeployment") + b.WithAPIVersion("cluster.x-k8s.io/v1beta2") + return b +} + +func (b MachineDeploymentApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithKind(value string) *MachineDeploymentApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithAPIVersion(value string) *MachineDeploymentApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithName(value string) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithGenerateName(value string) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithNamespace(value string) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithUID(value types.UID) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithResourceVersion(value string) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithGeneration(value int64) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MachineDeploymentApplyConfiguration) WithLabels(entries map[string]string) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MachineDeploymentApplyConfiguration) WithAnnotations(entries map[string]string) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *MachineDeploymentApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *MachineDeploymentApplyConfiguration) WithFinalizers(values ...string) *MachineDeploymentApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *MachineDeploymentApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithSpec(value *MachineDeploymentSpecApplyConfiguration) *MachineDeploymentApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *MachineDeploymentApplyConfiguration) WithStatus(value *MachineDeploymentStatusApplyConfiguration) *MachineDeploymentApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *MachineDeploymentApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *MachineDeploymentApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *MachineDeploymentApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *MachineDeploymentApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclass.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclass.go new file mode 100644 index 000000000000..2d0658e27268 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclass.go @@ -0,0 +1,166 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentClassApplyConfiguration represents a declarative configuration of the MachineDeploymentClass type for use +// with apply. +// +// MachineDeploymentClass serves as a template to define a set of worker nodes of the cluster +// provisioned using the `ClusterClass`. +type MachineDeploymentClassApplyConfiguration struct { + // metadata is the metadata applied to the MachineDeployment and the machines of the MachineDeployment. + // At runtime this metadata is merged with the corresponding metadata from the topology. + Metadata *ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // class denotes a type of worker node present in the cluster, + // this name MUST be unique within a ClusterClass and can be referenced + // in the Cluster to create a managed MachineDeployment. + Class *string `json:"class,omitempty"` + // bootstrap contains the bootstrap template reference to be used + // for the creation of worker Machines. + Bootstrap *MachineDeploymentClassBootstrapTemplateApplyConfiguration `json:"bootstrap,omitempty"` + // infrastructure contains the infrastructure template reference to be used + // for the creation of worker Machines. + Infrastructure *MachineDeploymentClassInfrastructureTemplateApplyConfiguration `json:"infrastructure,omitempty"` + // healthCheck defines a MachineHealthCheck for this MachineDeploymentClass. + HealthCheck *MachineDeploymentClassHealthCheckApplyConfiguration `json:"healthCheck,omitempty"` + // failureDomain is the failure domain the machines will be created in. + // Must match the name of a FailureDomain from the Cluster status. + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass. + FailureDomain *string `json:"failureDomain,omitempty"` + // naming allows changing the naming pattern used when creating the MachineDeployment. + Naming *MachineDeploymentClassNamingSpecApplyConfiguration `json:"naming,omitempty"` + // deletion contains configuration options for Machine deletion. + Deletion *MachineDeploymentClassMachineDeletionSpecApplyConfiguration `json:"deletion,omitempty"` + // minReadySeconds is the minimum number of seconds for which a newly created machine should + // be ready. + // Defaults to 0 (machine will be considered available as soon as it + // is ready) + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass. + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + // readinessGates specifies additional conditions to include when evaluating Machine Ready condition. + // + // This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready + // computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine. + // + // NOTE: If a Cluster defines a custom list of readinessGates for a MachineDeployment using this MachineDeploymentClass, + // such list overrides readinessGates defined in this field. + ReadinessGates []MachineReadinessGateApplyConfiguration `json:"readinessGates,omitempty"` + // rollout allows you to configure the behaviour of rolling updates to the MachineDeployment Machines. + // It allows you to define the strategy used during rolling replacements. + Rollout *MachineDeploymentClassRolloutSpecApplyConfiguration `json:"rollout,omitempty"` +} + +// MachineDeploymentClassApplyConfiguration constructs a declarative configuration of the MachineDeploymentClass type for use with +// apply. +func MachineDeploymentClass() *MachineDeploymentClassApplyConfiguration { + return &MachineDeploymentClassApplyConfiguration{} +} + +// WithMetadata sets the Metadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Metadata field is set to the value of the last call. +func (b *MachineDeploymentClassApplyConfiguration) WithMetadata(value *ObjectMetaApplyConfiguration) *MachineDeploymentClassApplyConfiguration { + b.Metadata = value + return b +} + +// WithClass sets the Class field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Class field is set to the value of the last call. +func (b *MachineDeploymentClassApplyConfiguration) WithClass(value string) *MachineDeploymentClassApplyConfiguration { + b.Class = &value + return b +} + +// WithBootstrap sets the Bootstrap field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Bootstrap field is set to the value of the last call. +func (b *MachineDeploymentClassApplyConfiguration) WithBootstrap(value *MachineDeploymentClassBootstrapTemplateApplyConfiguration) *MachineDeploymentClassApplyConfiguration { + b.Bootstrap = value + return b +} + +// WithInfrastructure sets the Infrastructure field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Infrastructure field is set to the value of the last call. +func (b *MachineDeploymentClassApplyConfiguration) WithInfrastructure(value *MachineDeploymentClassInfrastructureTemplateApplyConfiguration) *MachineDeploymentClassApplyConfiguration { + b.Infrastructure = value + return b +} + +// WithHealthCheck sets the HealthCheck field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HealthCheck field is set to the value of the last call. +func (b *MachineDeploymentClassApplyConfiguration) WithHealthCheck(value *MachineDeploymentClassHealthCheckApplyConfiguration) *MachineDeploymentClassApplyConfiguration { + b.HealthCheck = value + return b +} + +// WithFailureDomain sets the FailureDomain field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureDomain field is set to the value of the last call. +func (b *MachineDeploymentClassApplyConfiguration) WithFailureDomain(value string) *MachineDeploymentClassApplyConfiguration { + b.FailureDomain = &value + return b +} + +// WithNaming sets the Naming field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Naming field is set to the value of the last call. +func (b *MachineDeploymentClassApplyConfiguration) WithNaming(value *MachineDeploymentClassNamingSpecApplyConfiguration) *MachineDeploymentClassApplyConfiguration { + b.Naming = value + return b +} + +// WithDeletion sets the Deletion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deletion field is set to the value of the last call. +func (b *MachineDeploymentClassApplyConfiguration) WithDeletion(value *MachineDeploymentClassMachineDeletionSpecApplyConfiguration) *MachineDeploymentClassApplyConfiguration { + b.Deletion = value + return b +} + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *MachineDeploymentClassApplyConfiguration) WithMinReadySeconds(value int32) *MachineDeploymentClassApplyConfiguration { + b.MinReadySeconds = &value + return b +} + +// WithReadinessGates adds the given value to the ReadinessGates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ReadinessGates field. +func (b *MachineDeploymentClassApplyConfiguration) WithReadinessGates(values ...*MachineReadinessGateApplyConfiguration) *MachineDeploymentClassApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithReadinessGates") + } + b.ReadinessGates = append(b.ReadinessGates, *values[i]) + } + return b +} + +// WithRollout sets the Rollout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rollout field is set to the value of the last call. +func (b *MachineDeploymentClassApplyConfiguration) WithRollout(value *MachineDeploymentClassRolloutSpecApplyConfiguration) *MachineDeploymentClassApplyConfiguration { + b.Rollout = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassbootstraptemplate.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassbootstraptemplate.go new file mode 100644 index 000000000000..dca4ceb7c1ef --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassbootstraptemplate.go @@ -0,0 +1,42 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentClassBootstrapTemplateApplyConfiguration represents a declarative configuration of the MachineDeploymentClassBootstrapTemplate type for use +// with apply. +// +// MachineDeploymentClassBootstrapTemplate defines the BootstrapTemplate for a MachineDeployment. +type MachineDeploymentClassBootstrapTemplateApplyConfiguration struct { + // templateRef is a required reference to the BootstrapTemplate for a MachineDeployment. + TemplateRef *ClusterClassTemplateReferenceApplyConfiguration `json:"templateRef,omitempty"` +} + +// MachineDeploymentClassBootstrapTemplateApplyConfiguration constructs a declarative configuration of the MachineDeploymentClassBootstrapTemplate type for use with +// apply. +func MachineDeploymentClassBootstrapTemplate() *MachineDeploymentClassBootstrapTemplateApplyConfiguration { + return &MachineDeploymentClassBootstrapTemplateApplyConfiguration{} +} + +// WithTemplateRef sets the TemplateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateRef field is set to the value of the last call. +func (b *MachineDeploymentClassBootstrapTemplateApplyConfiguration) WithTemplateRef(value *ClusterClassTemplateReferenceApplyConfiguration) *MachineDeploymentClassBootstrapTemplateApplyConfiguration { + b.TemplateRef = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclasshealthcheck.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclasshealthcheck.go new file mode 100644 index 000000000000..2e67c6e521ac --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclasshealthcheck.go @@ -0,0 +1,66 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentClassHealthCheckApplyConfiguration represents a declarative configuration of the MachineDeploymentClassHealthCheck type for use +// with apply. +// +// MachineDeploymentClassHealthCheck defines a MachineHealthCheck for MachineDeployment machines. +type MachineDeploymentClassHealthCheckApplyConfiguration struct { + // checks are the checks that are used to evaluate if a Machine is healthy. + // + // Independent of this configuration the MachineHealthCheck controller will always + // flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and + // Machines with deleted Nodes as unhealthy. + // + // Furthermore, if checks.nodeStartupTimeoutSeconds is not set it + // is defaulted to 10 minutes and evaluated accordingly. + Checks *MachineDeploymentClassHealthCheckChecksApplyConfiguration `json:"checks,omitempty"` + // remediation configures if and how remediations are triggered if a Machine is unhealthy. + // + // If remediation or remediation.triggerIf is not set, + // remediation will always be triggered for unhealthy Machines. + // + // If remediation or remediation.templateRef is not set, + // the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via + // the owner of the Machines, for example a MachineSet or a KubeadmControlPlane. + Remediation *MachineDeploymentClassHealthCheckRemediationApplyConfiguration `json:"remediation,omitempty"` +} + +// MachineDeploymentClassHealthCheckApplyConfiguration constructs a declarative configuration of the MachineDeploymentClassHealthCheck type for use with +// apply. +func MachineDeploymentClassHealthCheck() *MachineDeploymentClassHealthCheckApplyConfiguration { + return &MachineDeploymentClassHealthCheckApplyConfiguration{} +} + +// WithChecks sets the Checks field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Checks field is set to the value of the last call. +func (b *MachineDeploymentClassHealthCheckApplyConfiguration) WithChecks(value *MachineDeploymentClassHealthCheckChecksApplyConfiguration) *MachineDeploymentClassHealthCheckApplyConfiguration { + b.Checks = value + return b +} + +// WithRemediation sets the Remediation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Remediation field is set to the value of the last call. +func (b *MachineDeploymentClassHealthCheckApplyConfiguration) WithRemediation(value *MachineDeploymentClassHealthCheckRemediationApplyConfiguration) *MachineDeploymentClassHealthCheckApplyConfiguration { + b.Remediation = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclasshealthcheckchecks.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclasshealthcheckchecks.go new file mode 100644 index 000000000000..a101949ed7fb --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclasshealthcheckchecks.go @@ -0,0 +1,87 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentClassHealthCheckChecksApplyConfiguration represents a declarative configuration of the MachineDeploymentClassHealthCheckChecks type for use +// with apply. +// +// MachineDeploymentClassHealthCheckChecks are the checks that are used to evaluate if a MachineDeployment Machine is healthy. +type MachineDeploymentClassHealthCheckChecksApplyConfiguration struct { + // nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck + // to consider a Machine unhealthy if a corresponding Node isn't associated + // through a `Spec.ProviderID` field. + // + // The duration set in this field is compared to the greatest of: + // - Cluster's infrastructure ready condition timestamp (if and when available) + // - Control Plane's initialized condition timestamp (if and when available) + // - Machine's infrastructure ready condition timestamp (if and when available) + // - Machine's metadata creation timestamp + // + // Defaults to 10 minutes. + // If you wish to disable this feature, set the value explicitly to 0. + NodeStartupTimeoutSeconds *int32 `json:"nodeStartupTimeoutSeconds,omitempty"` + // unhealthyNodeConditions contains a list of conditions that determine + // whether a node is considered unhealthy. The conditions are combined in a + // logical OR, i.e. if any of the conditions is met, the node is unhealthy. + UnhealthyNodeConditions []UnhealthyNodeConditionApplyConfiguration `json:"unhealthyNodeConditions,omitempty"` + // unhealthyMachineConditions contains a list of the machine conditions that determine + // whether a machine is considered unhealthy. The conditions are combined in a + // logical OR, i.e. if any of the conditions is met, the machine is unhealthy. + UnhealthyMachineConditions []UnhealthyMachineConditionApplyConfiguration `json:"unhealthyMachineConditions,omitempty"` +} + +// MachineDeploymentClassHealthCheckChecksApplyConfiguration constructs a declarative configuration of the MachineDeploymentClassHealthCheckChecks type for use with +// apply. +func MachineDeploymentClassHealthCheckChecks() *MachineDeploymentClassHealthCheckChecksApplyConfiguration { + return &MachineDeploymentClassHealthCheckChecksApplyConfiguration{} +} + +// WithNodeStartupTimeoutSeconds sets the NodeStartupTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeStartupTimeoutSeconds field is set to the value of the last call. +func (b *MachineDeploymentClassHealthCheckChecksApplyConfiguration) WithNodeStartupTimeoutSeconds(value int32) *MachineDeploymentClassHealthCheckChecksApplyConfiguration { + b.NodeStartupTimeoutSeconds = &value + return b +} + +// WithUnhealthyNodeConditions adds the given value to the UnhealthyNodeConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the UnhealthyNodeConditions field. +func (b *MachineDeploymentClassHealthCheckChecksApplyConfiguration) WithUnhealthyNodeConditions(values ...*UnhealthyNodeConditionApplyConfiguration) *MachineDeploymentClassHealthCheckChecksApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithUnhealthyNodeConditions") + } + b.UnhealthyNodeConditions = append(b.UnhealthyNodeConditions, *values[i]) + } + return b +} + +// WithUnhealthyMachineConditions adds the given value to the UnhealthyMachineConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the UnhealthyMachineConditions field. +func (b *MachineDeploymentClassHealthCheckChecksApplyConfiguration) WithUnhealthyMachineConditions(values ...*UnhealthyMachineConditionApplyConfiguration) *MachineDeploymentClassHealthCheckChecksApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithUnhealthyMachineConditions") + } + b.UnhealthyMachineConditions = append(b.UnhealthyMachineConditions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclasshealthcheckremediation.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclasshealthcheckremediation.go new file mode 100644 index 000000000000..4ffbbcadac64 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclasshealthcheckremediation.go @@ -0,0 +1,85 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// MachineDeploymentClassHealthCheckRemediationApplyConfiguration represents a declarative configuration of the MachineDeploymentClassHealthCheckRemediation type for use +// with apply. +// +// MachineDeploymentClassHealthCheckRemediation configures if and how remediations are triggered if a MachineDeployment Machine is unhealthy. +type MachineDeploymentClassHealthCheckRemediationApplyConfiguration struct { + // maxInFlight determines how many in flight remediations should happen at the same time. + // + // Remediation only happens on the MachineSet with the most current revision, while + // older MachineSets (usually present during rollout operations) aren't allowed to remediate. + // + // Note: In general (independent of remediations), unhealthy machines are always + // prioritized during scale down operations over healthy ones. + // + // MaxInFlight can be set to a fixed number or a percentage. + // Example: when this is set to 20%, the MachineSet controller deletes at most 20% of + // the desired replicas. + // + // If not set, remediation is limited to all machines (bounded by replicas) + // under the active MachineSet's management. + MaxInFlight *intstr.IntOrString `json:"maxInFlight,omitempty"` + // triggerIf configures if remediations are triggered. + // If this field is not set, remediations are always triggered. + TriggerIf *MachineDeploymentClassHealthCheckRemediationTriggerIfApplyConfiguration `json:"triggerIf,omitempty"` + // templateRef is a reference to a remediation template + // provided by an infrastructure provider. + // + // This field is completely optional, when filled, the MachineHealthCheck controller + // creates a new object from the template referenced and hands off remediation of the machine to + // a controller that lives outside of Cluster API. + TemplateRef *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration `json:"templateRef,omitempty"` +} + +// MachineDeploymentClassHealthCheckRemediationApplyConfiguration constructs a declarative configuration of the MachineDeploymentClassHealthCheckRemediation type for use with +// apply. +func MachineDeploymentClassHealthCheckRemediation() *MachineDeploymentClassHealthCheckRemediationApplyConfiguration { + return &MachineDeploymentClassHealthCheckRemediationApplyConfiguration{} +} + +// WithMaxInFlight sets the MaxInFlight field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxInFlight field is set to the value of the last call. +func (b *MachineDeploymentClassHealthCheckRemediationApplyConfiguration) WithMaxInFlight(value intstr.IntOrString) *MachineDeploymentClassHealthCheckRemediationApplyConfiguration { + b.MaxInFlight = &value + return b +} + +// WithTriggerIf sets the TriggerIf field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TriggerIf field is set to the value of the last call. +func (b *MachineDeploymentClassHealthCheckRemediationApplyConfiguration) WithTriggerIf(value *MachineDeploymentClassHealthCheckRemediationTriggerIfApplyConfiguration) *MachineDeploymentClassHealthCheckRemediationApplyConfiguration { + b.TriggerIf = value + return b +} + +// WithTemplateRef sets the TemplateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateRef field is set to the value of the last call. +func (b *MachineDeploymentClassHealthCheckRemediationApplyConfiguration) WithTemplateRef(value *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration) *MachineDeploymentClassHealthCheckRemediationApplyConfiguration { + b.TemplateRef = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclasshealthcheckremediationtriggerif.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclasshealthcheckremediationtriggerif.go new file mode 100644 index 000000000000..50067a77d43c --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclasshealthcheckremediationtriggerif.go @@ -0,0 +1,63 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// MachineDeploymentClassHealthCheckRemediationTriggerIfApplyConfiguration represents a declarative configuration of the MachineDeploymentClassHealthCheckRemediationTriggerIf type for use +// with apply. +// +// MachineDeploymentClassHealthCheckRemediationTriggerIf configures if remediations are triggered. +type MachineDeploymentClassHealthCheckRemediationTriggerIfApplyConfiguration struct { + // unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of + // unhealthy Machines is less than or equal to the configured value. + // unhealthyInRange takes precedence if set. + UnhealthyLessThanOrEqualTo *intstr.IntOrString `json:"unhealthyLessThanOrEqualTo,omitempty"` + // unhealthyInRange specifies that remediations are only triggered if the number of + // unhealthy Machines is in the configured range. + // Takes precedence over unhealthyLessThanOrEqualTo. + // Eg. "[3-5]" - This means that remediation will be allowed only when: + // (a) there are at least 3 unhealthy Machines (and) + // (b) there are at most 5 unhealthy Machines + UnhealthyInRange *string `json:"unhealthyInRange,omitempty"` +} + +// MachineDeploymentClassHealthCheckRemediationTriggerIfApplyConfiguration constructs a declarative configuration of the MachineDeploymentClassHealthCheckRemediationTriggerIf type for use with +// apply. +func MachineDeploymentClassHealthCheckRemediationTriggerIf() *MachineDeploymentClassHealthCheckRemediationTriggerIfApplyConfiguration { + return &MachineDeploymentClassHealthCheckRemediationTriggerIfApplyConfiguration{} +} + +// WithUnhealthyLessThanOrEqualTo sets the UnhealthyLessThanOrEqualTo field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnhealthyLessThanOrEqualTo field is set to the value of the last call. +func (b *MachineDeploymentClassHealthCheckRemediationTriggerIfApplyConfiguration) WithUnhealthyLessThanOrEqualTo(value intstr.IntOrString) *MachineDeploymentClassHealthCheckRemediationTriggerIfApplyConfiguration { + b.UnhealthyLessThanOrEqualTo = &value + return b +} + +// WithUnhealthyInRange sets the UnhealthyInRange field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnhealthyInRange field is set to the value of the last call. +func (b *MachineDeploymentClassHealthCheckRemediationTriggerIfApplyConfiguration) WithUnhealthyInRange(value string) *MachineDeploymentClassHealthCheckRemediationTriggerIfApplyConfiguration { + b.UnhealthyInRange = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassinfrastructuretemplate.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassinfrastructuretemplate.go new file mode 100644 index 000000000000..808953da0eaf --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassinfrastructuretemplate.go @@ -0,0 +1,42 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentClassInfrastructureTemplateApplyConfiguration represents a declarative configuration of the MachineDeploymentClassInfrastructureTemplate type for use +// with apply. +// +// MachineDeploymentClassInfrastructureTemplate defines the InfrastructureTemplate for a MachineDeployment. +type MachineDeploymentClassInfrastructureTemplateApplyConfiguration struct { + // templateRef is a required reference to the InfrastructureTemplate for a MachineDeployment. + TemplateRef *ClusterClassTemplateReferenceApplyConfiguration `json:"templateRef,omitempty"` +} + +// MachineDeploymentClassInfrastructureTemplateApplyConfiguration constructs a declarative configuration of the MachineDeploymentClassInfrastructureTemplate type for use with +// apply. +func MachineDeploymentClassInfrastructureTemplate() *MachineDeploymentClassInfrastructureTemplateApplyConfiguration { + return &MachineDeploymentClassInfrastructureTemplateApplyConfiguration{} +} + +// WithTemplateRef sets the TemplateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateRef field is set to the value of the last call. +func (b *MachineDeploymentClassInfrastructureTemplateApplyConfiguration) WithTemplateRef(value *ClusterClassTemplateReferenceApplyConfiguration) *MachineDeploymentClassInfrastructureTemplateApplyConfiguration { + b.TemplateRef = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassmachinedeletionspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassmachinedeletionspec.go new file mode 100644 index 000000000000..564e634f9596 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassmachinedeletionspec.go @@ -0,0 +1,85 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineDeploymentClassMachineDeletionSpecApplyConfiguration represents a declarative configuration of the MachineDeploymentClassMachineDeletionSpec type for use +// with apply. +// +// MachineDeploymentClassMachineDeletionSpec contains configuration options for Machine deletion. +type MachineDeploymentClassMachineDeletionSpecApplyConfiguration struct { + // order defines the order in which Machines are deleted when downscaling. + // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" + Order *corev1beta2.MachineSetDeletionOrder `json:"order,omitempty"` + // nodeDrainTimeoutSeconds is the total amount of time that the controller will spend on draining a node. + // The default value is 0, meaning that the node can be drained without any time limitations. + // NOTE: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass. + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass. + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine + // hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass. + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// MachineDeploymentClassMachineDeletionSpecApplyConfiguration constructs a declarative configuration of the MachineDeploymentClassMachineDeletionSpec type for use with +// apply. +func MachineDeploymentClassMachineDeletionSpec() *MachineDeploymentClassMachineDeletionSpecApplyConfiguration { + return &MachineDeploymentClassMachineDeletionSpecApplyConfiguration{} +} + +// WithOrder sets the Order field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Order field is set to the value of the last call. +func (b *MachineDeploymentClassMachineDeletionSpecApplyConfiguration) WithOrder(value corev1beta2.MachineSetDeletionOrder) *MachineDeploymentClassMachineDeletionSpecApplyConfiguration { + b.Order = &value + return b +} + +// WithNodeDrainTimeoutSeconds sets the NodeDrainTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDrainTimeoutSeconds field is set to the value of the last call. +func (b *MachineDeploymentClassMachineDeletionSpecApplyConfiguration) WithNodeDrainTimeoutSeconds(value int32) *MachineDeploymentClassMachineDeletionSpecApplyConfiguration { + b.NodeDrainTimeoutSeconds = &value + return b +} + +// WithNodeVolumeDetachTimeoutSeconds sets the NodeVolumeDetachTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeVolumeDetachTimeoutSeconds field is set to the value of the last call. +func (b *MachineDeploymentClassMachineDeletionSpecApplyConfiguration) WithNodeVolumeDetachTimeoutSeconds(value int32) *MachineDeploymentClassMachineDeletionSpecApplyConfiguration { + b.NodeVolumeDetachTimeoutSeconds = &value + return b +} + +// WithNodeDeletionTimeoutSeconds sets the NodeDeletionTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDeletionTimeoutSeconds field is set to the value of the last call. +func (b *MachineDeploymentClassMachineDeletionSpecApplyConfiguration) WithNodeDeletionTimeoutSeconds(value int32) *MachineDeploymentClassMachineDeletionSpecApplyConfiguration { + b.NodeDeletionTimeoutSeconds = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassnamingspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassnamingspec.go new file mode 100644 index 000000000000..ba10ee147bba --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassnamingspec.go @@ -0,0 +1,49 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentClassNamingSpecApplyConfiguration represents a declarative configuration of the MachineDeploymentClassNamingSpec type for use +// with apply. +// +// MachineDeploymentClassNamingSpec defines the naming strategy for machine deployment objects. +type MachineDeploymentClassNamingSpecApplyConfiguration struct { + // template defines the template to use for generating the name of the MachineDeployment object. + // If not defined, it will fallback to `{{ .cluster.name }}-{{ .machineDeployment.topologyName }}-{{ .random }}`. + // If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will + // get concatenated with a random suffix of length 5. + // The templating mechanism provides the following arguments: + // * `.cluster.name`: The name of the cluster object. + // * `.random`: A random alphanumeric string, without vowels, of length 5. + // * `.machineDeployment.topologyName`: The name of the MachineDeployment topology (Cluster.spec.topology.workers.machineDeployments[].name). + Template *string `json:"template,omitempty"` +} + +// MachineDeploymentClassNamingSpecApplyConfiguration constructs a declarative configuration of the MachineDeploymentClassNamingSpec type for use with +// apply. +func MachineDeploymentClassNamingSpec() *MachineDeploymentClassNamingSpecApplyConfiguration { + return &MachineDeploymentClassNamingSpecApplyConfiguration{} +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *MachineDeploymentClassNamingSpecApplyConfiguration) WithTemplate(value string) *MachineDeploymentClassNamingSpecApplyConfiguration { + b.Template = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassrolloutspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassrolloutspec.go new file mode 100644 index 000000000000..d0f91d3bf284 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassrolloutspec.go @@ -0,0 +1,42 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentClassRolloutSpecApplyConfiguration represents a declarative configuration of the MachineDeploymentClassRolloutSpec type for use +// with apply. +// +// MachineDeploymentClassRolloutSpec defines the rollout behavior. +type MachineDeploymentClassRolloutSpecApplyConfiguration struct { + // strategy specifies how to roll out control plane Machines. + Strategy *MachineDeploymentClassRolloutStrategyApplyConfiguration `json:"strategy,omitempty"` +} + +// MachineDeploymentClassRolloutSpecApplyConfiguration constructs a declarative configuration of the MachineDeploymentClassRolloutSpec type for use with +// apply. +func MachineDeploymentClassRolloutSpec() *MachineDeploymentClassRolloutSpecApplyConfiguration { + return &MachineDeploymentClassRolloutSpecApplyConfiguration{} +} + +// WithStrategy sets the Strategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Strategy field is set to the value of the last call. +func (b *MachineDeploymentClassRolloutSpecApplyConfiguration) WithStrategy(value *MachineDeploymentClassRolloutStrategyApplyConfiguration) *MachineDeploymentClassRolloutSpecApplyConfiguration { + b.Strategy = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassrolloutstrategy.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassrolloutstrategy.go new file mode 100644 index 000000000000..2c17a2379d2f --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassrolloutstrategy.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineDeploymentClassRolloutStrategyApplyConfiguration represents a declarative configuration of the MachineDeploymentClassRolloutStrategy type for use +// with apply. +// +// MachineDeploymentClassRolloutStrategy describes how to replace existing machines +// with new ones. +type MachineDeploymentClassRolloutStrategyApplyConfiguration struct { + // type of rollout. Allowed values are RollingUpdate and OnDelete. + // Default is RollingUpdate. + Type *corev1beta2.MachineDeploymentRolloutStrategyType `json:"type,omitempty"` + // rollingUpdate is the rolling update config params. Present only if + // type = RollingUpdate. + RollingUpdate *MachineDeploymentClassRolloutStrategyRollingUpdateApplyConfiguration `json:"rollingUpdate,omitempty"` +} + +// MachineDeploymentClassRolloutStrategyApplyConfiguration constructs a declarative configuration of the MachineDeploymentClassRolloutStrategy type for use with +// apply. +func MachineDeploymentClassRolloutStrategy() *MachineDeploymentClassRolloutStrategyApplyConfiguration { + return &MachineDeploymentClassRolloutStrategyApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *MachineDeploymentClassRolloutStrategyApplyConfiguration) WithType(value corev1beta2.MachineDeploymentRolloutStrategyType) *MachineDeploymentClassRolloutStrategyApplyConfiguration { + b.Type = &value + return b +} + +// WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RollingUpdate field is set to the value of the last call. +func (b *MachineDeploymentClassRolloutStrategyApplyConfiguration) WithRollingUpdate(value *MachineDeploymentClassRolloutStrategyRollingUpdateApplyConfiguration) *MachineDeploymentClassRolloutStrategyApplyConfiguration { + b.RollingUpdate = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassrolloutstrategyrollingupdate.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassrolloutstrategyrollingupdate.go new file mode 100644 index 000000000000..546da7a67278 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentclassrolloutstrategyrollingupdate.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// MachineDeploymentClassRolloutStrategyRollingUpdateApplyConfiguration represents a declarative configuration of the MachineDeploymentClassRolloutStrategyRollingUpdate type for use +// with apply. +// +// MachineDeploymentClassRolloutStrategyRollingUpdate is used to control the desired behavior of rolling update. +type MachineDeploymentClassRolloutStrategyRollingUpdateApplyConfiguration struct { + // maxUnavailable is the maximum number of machines that can be unavailable during the update. + // Value can be an absolute number (ex: 5) or a percentage of desired + // machines (ex: 10%). + // Absolute number is calculated from percentage by rounding down. + // This can not be 0 if MaxSurge is 0. + // Defaults to 0. + // Example: when this is set to 30%, the old MachineSet can be scaled + // down to 70% of desired machines immediately when the rolling update + // starts. Once new machines are ready, old MachineSet can be scaled + // down further, followed by scaling up the new MachineSet, ensuring + // that the total number of machines available at all times + // during the update is at least 70% of desired machines. + MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` + // maxSurge is the maximum number of machines that can be scheduled above the + // desired number of machines. + // Value can be an absolute number (ex: 5) or a percentage of + // desired machines (ex: 10%). + // This can not be 0 if MaxUnavailable is 0. + // Absolute number is calculated from percentage by rounding up. + // Defaults to 1. + // Example: when this is set to 30%, the new MachineSet can be scaled + // up immediately when the rolling update starts, such that the total + // number of old and new machines do not exceed 130% of desired + // machines. Once old machines have been killed, new MachineSet can + // be scaled up further, ensuring that total number of machines running + // at any time during the update is at most 130% of desired machines. + MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` +} + +// MachineDeploymentClassRolloutStrategyRollingUpdateApplyConfiguration constructs a declarative configuration of the MachineDeploymentClassRolloutStrategyRollingUpdate type for use with +// apply. +func MachineDeploymentClassRolloutStrategyRollingUpdate() *MachineDeploymentClassRolloutStrategyRollingUpdateApplyConfiguration { + return &MachineDeploymentClassRolloutStrategyRollingUpdateApplyConfiguration{} +} + +// WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxUnavailable field is set to the value of the last call. +func (b *MachineDeploymentClassRolloutStrategyRollingUpdateApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *MachineDeploymentClassRolloutStrategyRollingUpdateApplyConfiguration { + b.MaxUnavailable = &value + return b +} + +// WithMaxSurge sets the MaxSurge field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxSurge field is set to the value of the last call. +func (b *MachineDeploymentClassRolloutStrategyRollingUpdateApplyConfiguration) WithMaxSurge(value intstr.IntOrString) *MachineDeploymentClassRolloutStrategyRollingUpdateApplyConfiguration { + b.MaxSurge = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentdeletionspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentdeletionspec.go new file mode 100644 index 000000000000..2415f4eafc18 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentdeletionspec.go @@ -0,0 +1,47 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineDeploymentDeletionSpecApplyConfiguration represents a declarative configuration of the MachineDeploymentDeletionSpec type for use +// with apply. +// +// MachineDeploymentDeletionSpec contains configuration options for MachineDeployment deletion. +type MachineDeploymentDeletionSpecApplyConfiguration struct { + // order defines the order in which Machines are deleted when downscaling. + // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" + Order *corev1beta2.MachineSetDeletionOrder `json:"order,omitempty"` +} + +// MachineDeploymentDeletionSpecApplyConfiguration constructs a declarative configuration of the MachineDeploymentDeletionSpec type for use with +// apply. +func MachineDeploymentDeletionSpec() *MachineDeploymentDeletionSpecApplyConfiguration { + return &MachineDeploymentDeletionSpecApplyConfiguration{} +} + +// WithOrder sets the Order field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Order field is set to the value of the last call. +func (b *MachineDeploymentDeletionSpecApplyConfiguration) WithOrder(value corev1beta2.MachineSetDeletionOrder) *MachineDeploymentDeletionSpecApplyConfiguration { + b.Order = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentdeprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentdeprecatedstatus.go new file mode 100644 index 000000000000..69a9400bea0c --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentdeprecatedstatus.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentDeprecatedStatusApplyConfiguration represents a declarative configuration of the MachineDeploymentDeprecatedStatus type for use +// with apply. +// +// MachineDeploymentDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineDeploymentDeprecatedStatusApplyConfiguration struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + V1Beta1 *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration `json:"v1beta1,omitempty"` +} + +// MachineDeploymentDeprecatedStatusApplyConfiguration constructs a declarative configuration of the MachineDeploymentDeprecatedStatus type for use with +// apply. +func MachineDeploymentDeprecatedStatus() *MachineDeploymentDeprecatedStatusApplyConfiguration { + return &MachineDeploymentDeprecatedStatusApplyConfiguration{} +} + +// WithV1Beta1 sets the V1Beta1 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the V1Beta1 field is set to the value of the last call. +func (b *MachineDeploymentDeprecatedStatusApplyConfiguration) WithV1Beta1(value *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration) *MachineDeploymentDeprecatedStatusApplyConfiguration { + b.V1Beta1 = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentremediationspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentremediationspec.go new file mode 100644 index 000000000000..d4208b72e2fa --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentremediationspec.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// MachineDeploymentRemediationSpecApplyConfiguration represents a declarative configuration of the MachineDeploymentRemediationSpec type for use +// with apply. +// +// MachineDeploymentRemediationSpec controls how unhealthy Machines are remediated. +type MachineDeploymentRemediationSpecApplyConfiguration struct { + // maxInFlight determines how many in flight remediations should happen at the same time. + // + // Remediation only happens on the MachineSet with the most current revision, while + // older MachineSets (usually present during rollout operations) aren't allowed to remediate. + // + // Note: In general (independent of remediations), unhealthy machines are always + // prioritized during scale down operations over healthy ones. + // + // MaxInFlight can be set to a fixed number or a percentage. + // Example: when this is set to 20%, the MachineSet controller deletes at most 20% of + // the desired replicas. + // + // If not set, remediation is limited to all machines (bounded by replicas) + // under the active MachineSet's management. + MaxInFlight *intstr.IntOrString `json:"maxInFlight,omitempty"` +} + +// MachineDeploymentRemediationSpecApplyConfiguration constructs a declarative configuration of the MachineDeploymentRemediationSpec type for use with +// apply. +func MachineDeploymentRemediationSpec() *MachineDeploymentRemediationSpecApplyConfiguration { + return &MachineDeploymentRemediationSpecApplyConfiguration{} +} + +// WithMaxInFlight sets the MaxInFlight field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxInFlight field is set to the value of the last call. +func (b *MachineDeploymentRemediationSpecApplyConfiguration) WithMaxInFlight(value intstr.IntOrString) *MachineDeploymentRemediationSpecApplyConfiguration { + b.MaxInFlight = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentrolloutspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentrolloutspec.go new file mode 100644 index 000000000000..00b2c29a8935 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentrolloutspec.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// MachineDeploymentRolloutSpecApplyConfiguration represents a declarative configuration of the MachineDeploymentRolloutSpec type for use +// with apply. +// +// MachineDeploymentRolloutSpec defines the rollout behavior. +type MachineDeploymentRolloutSpecApplyConfiguration struct { + // after is a field to indicate a rollout should be performed + // after the specified time even if no changes have been made to the + // MachineDeployment. + // Example: In the YAML the time can be specified in the RFC3339 format. + // To specify the rolloutAfter target as March 9, 2023, at 9 am UTC + // use "2023-03-09T09:00:00Z". + After *v1.Time `json:"after,omitempty"` + // strategy specifies how to roll out control plane Machines. + Strategy *MachineDeploymentRolloutStrategyApplyConfiguration `json:"strategy,omitempty"` +} + +// MachineDeploymentRolloutSpecApplyConfiguration constructs a declarative configuration of the MachineDeploymentRolloutSpec type for use with +// apply. +func MachineDeploymentRolloutSpec() *MachineDeploymentRolloutSpecApplyConfiguration { + return &MachineDeploymentRolloutSpecApplyConfiguration{} +} + +// WithAfter sets the After field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the After field is set to the value of the last call. +func (b *MachineDeploymentRolloutSpecApplyConfiguration) WithAfter(value v1.Time) *MachineDeploymentRolloutSpecApplyConfiguration { + b.After = &value + return b +} + +// WithStrategy sets the Strategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Strategy field is set to the value of the last call. +func (b *MachineDeploymentRolloutSpecApplyConfiguration) WithStrategy(value *MachineDeploymentRolloutStrategyApplyConfiguration) *MachineDeploymentRolloutSpecApplyConfiguration { + b.Strategy = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentrolloutstrategy.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentrolloutstrategy.go new file mode 100644 index 000000000000..1cfe26729e04 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentrolloutstrategy.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineDeploymentRolloutStrategyApplyConfiguration represents a declarative configuration of the MachineDeploymentRolloutStrategy type for use +// with apply. +// +// MachineDeploymentRolloutStrategy describes how to replace existing machines +// with new ones. +type MachineDeploymentRolloutStrategyApplyConfiguration struct { + // type of rollout. Allowed values are RollingUpdate and OnDelete. + // Default is RollingUpdate. + Type *corev1beta2.MachineDeploymentRolloutStrategyType `json:"type,omitempty"` + // rollingUpdate is the rolling update config params. Present only if + // type = RollingUpdate. + RollingUpdate *MachineDeploymentRolloutStrategyRollingUpdateApplyConfiguration `json:"rollingUpdate,omitempty"` +} + +// MachineDeploymentRolloutStrategyApplyConfiguration constructs a declarative configuration of the MachineDeploymentRolloutStrategy type for use with +// apply. +func MachineDeploymentRolloutStrategy() *MachineDeploymentRolloutStrategyApplyConfiguration { + return &MachineDeploymentRolloutStrategyApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *MachineDeploymentRolloutStrategyApplyConfiguration) WithType(value corev1beta2.MachineDeploymentRolloutStrategyType) *MachineDeploymentRolloutStrategyApplyConfiguration { + b.Type = &value + return b +} + +// WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RollingUpdate field is set to the value of the last call. +func (b *MachineDeploymentRolloutStrategyApplyConfiguration) WithRollingUpdate(value *MachineDeploymentRolloutStrategyRollingUpdateApplyConfiguration) *MachineDeploymentRolloutStrategyApplyConfiguration { + b.RollingUpdate = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentrolloutstrategyrollingupdate.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentrolloutstrategyrollingupdate.go new file mode 100644 index 000000000000..d893050c9db4 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentrolloutstrategyrollingupdate.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// MachineDeploymentRolloutStrategyRollingUpdateApplyConfiguration represents a declarative configuration of the MachineDeploymentRolloutStrategyRollingUpdate type for use +// with apply. +// +// MachineDeploymentRolloutStrategyRollingUpdate is used to control the desired behavior of rolling update. +type MachineDeploymentRolloutStrategyRollingUpdateApplyConfiguration struct { + // maxUnavailable is the maximum number of machines that can be unavailable during the update. + // Value can be an absolute number (ex: 5) or a percentage of desired + // machines (ex: 10%). + // Absolute number is calculated from percentage by rounding down. + // This can not be 0 if MaxSurge is 0. + // Defaults to 0. + // Example: when this is set to 30%, the old MachineSet can be scaled + // down to 70% of desired machines immediately when the rolling update + // starts. Once new machines are ready, old MachineSet can be scaled + // down further, followed by scaling up the new MachineSet, ensuring + // that the total number of machines available at all times + // during the update is at least 70% of desired machines. + MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` + // maxSurge is the maximum number of machines that can be scheduled above the + // desired number of machines. + // Value can be an absolute number (ex: 5) or a percentage of + // desired machines (ex: 10%). + // This can not be 0 if MaxUnavailable is 0. + // Absolute number is calculated from percentage by rounding up. + // Defaults to 1. + // Example: when this is set to 30%, the new MachineSet can be scaled + // up immediately when the rolling update starts, such that the total + // number of old and new machines do not exceed 130% of desired + // machines. Once old machines have been killed, new MachineSet can + // be scaled up further, ensuring that total number of machines running + // at any time during the update is at most 130% of desired machines. + MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` +} + +// MachineDeploymentRolloutStrategyRollingUpdateApplyConfiguration constructs a declarative configuration of the MachineDeploymentRolloutStrategyRollingUpdate type for use with +// apply. +func MachineDeploymentRolloutStrategyRollingUpdate() *MachineDeploymentRolloutStrategyRollingUpdateApplyConfiguration { + return &MachineDeploymentRolloutStrategyRollingUpdateApplyConfiguration{} +} + +// WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxUnavailable field is set to the value of the last call. +func (b *MachineDeploymentRolloutStrategyRollingUpdateApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *MachineDeploymentRolloutStrategyRollingUpdateApplyConfiguration { + b.MaxUnavailable = &value + return b +} + +// WithMaxSurge sets the MaxSurge field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxSurge field is set to the value of the last call. +func (b *MachineDeploymentRolloutStrategyRollingUpdateApplyConfiguration) WithMaxSurge(value intstr.IntOrString) *MachineDeploymentRolloutStrategyRollingUpdateApplyConfiguration { + b.MaxSurge = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentspec.go new file mode 100644 index 000000000000..0300b7c3591b --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentspec.go @@ -0,0 +1,147 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineDeploymentSpecApplyConfiguration represents a declarative configuration of the MachineDeploymentSpec type for use +// with apply. +// +// MachineDeploymentSpec defines the desired state of MachineDeployment. +type MachineDeploymentSpecApplyConfiguration struct { + // clusterName is the name of the Cluster this object belongs to. + ClusterName *string `json:"clusterName,omitempty"` + // replicas is the number of desired machines. + // This is a pointer to distinguish between explicit zero and not specified. + // + // Defaults to: + // * if the Kubernetes autoscaler min size and max size annotations are set: + // - if it's a new MachineDeployment, use min size + // - if the replicas field of the old MachineDeployment is < min size, use min size + // - if the replicas field of the old MachineDeployment is > max size, use max size + // - if the replicas field of the old MachineDeployment is in the (min size, max size) range, keep the value from the oldMD + // * otherwise use 1 + // Note: Defaulting will be run whenever the replicas field is not set: + // * A new MachineDeployment is created with replicas not set. + // * On an existing MachineDeployment the replicas field was first set and is now unset. + // Those cases are especially relevant for the following Kubernetes autoscaler use cases: + // * A new MachineDeployment is created and replicas should be managed by the autoscaler + // * An existing MachineDeployment which initially wasn't controlled by the autoscaler + // should be later controlled by the autoscaler + Replicas *int32 `json:"replicas,omitempty"` + // rollout allows you to configure the behaviour of rolling updates to the MachineDeployment Machines. + // It allows you to require that all Machines are replaced after a certain time, + // and allows you to define the strategy used during rolling replacements. + Rollout *MachineDeploymentRolloutSpecApplyConfiguration `json:"rollout,omitempty"` + // selector is the label selector for machines. Existing MachineSets whose machines are + // selected by this will be the ones affected by this deployment. + // It must match the machine template's labels. + Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` + // template describes the machines that will be created. + Template *MachineTemplateSpecApplyConfiguration `json:"template,omitempty"` + // machineNaming allows changing the naming pattern used when creating Machines. + // Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines. + MachineNaming *MachineNamingSpecApplyConfiguration `json:"machineNaming,omitempty"` + // remediation controls how unhealthy Machines are remediated. + Remediation *MachineDeploymentRemediationSpecApplyConfiguration `json:"remediation,omitempty"` + // deletion contains configuration options for MachineDeployment deletion. + Deletion *MachineDeploymentDeletionSpecApplyConfiguration `json:"deletion,omitempty"` + // paused indicates that the deployment is paused. + Paused *bool `json:"paused,omitempty"` +} + +// MachineDeploymentSpecApplyConfiguration constructs a declarative configuration of the MachineDeploymentSpec type for use with +// apply. +func MachineDeploymentSpec() *MachineDeploymentSpecApplyConfiguration { + return &MachineDeploymentSpecApplyConfiguration{} +} + +// WithClusterName sets the ClusterName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterName field is set to the value of the last call. +func (b *MachineDeploymentSpecApplyConfiguration) WithClusterName(value string) *MachineDeploymentSpecApplyConfiguration { + b.ClusterName = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *MachineDeploymentSpecApplyConfiguration) WithReplicas(value int32) *MachineDeploymentSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithRollout sets the Rollout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rollout field is set to the value of the last call. +func (b *MachineDeploymentSpecApplyConfiguration) WithRollout(value *MachineDeploymentRolloutSpecApplyConfiguration) *MachineDeploymentSpecApplyConfiguration { + b.Rollout = value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *MachineDeploymentSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *MachineDeploymentSpecApplyConfiguration { + b.Selector = value + return b +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *MachineDeploymentSpecApplyConfiguration) WithTemplate(value *MachineTemplateSpecApplyConfiguration) *MachineDeploymentSpecApplyConfiguration { + b.Template = value + return b +} + +// WithMachineNaming sets the MachineNaming field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MachineNaming field is set to the value of the last call. +func (b *MachineDeploymentSpecApplyConfiguration) WithMachineNaming(value *MachineNamingSpecApplyConfiguration) *MachineDeploymentSpecApplyConfiguration { + b.MachineNaming = value + return b +} + +// WithRemediation sets the Remediation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Remediation field is set to the value of the last call. +func (b *MachineDeploymentSpecApplyConfiguration) WithRemediation(value *MachineDeploymentRemediationSpecApplyConfiguration) *MachineDeploymentSpecApplyConfiguration { + b.Remediation = value + return b +} + +// WithDeletion sets the Deletion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deletion field is set to the value of the last call. +func (b *MachineDeploymentSpecApplyConfiguration) WithDeletion(value *MachineDeploymentDeletionSpecApplyConfiguration) *MachineDeploymentSpecApplyConfiguration { + b.Deletion = value + return b +} + +// WithPaused sets the Paused field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Paused field is set to the value of the last call. +func (b *MachineDeploymentSpecApplyConfiguration) WithPaused(value bool) *MachineDeploymentSpecApplyConfiguration { + b.Paused = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentstatus.go new file mode 100644 index 000000000000..9408dc0727cb --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentstatus.go @@ -0,0 +1,135 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineDeploymentStatusApplyConfiguration represents a declarative configuration of the MachineDeploymentStatus type for use +// with apply. +// +// MachineDeploymentStatus defines the observed state of MachineDeployment. +type MachineDeploymentStatusApplyConfiguration struct { + // conditions represents the observations of a MachineDeployment's current state. + // Known condition types are Available, MachinesReady, MachinesUpToDate, ScalingUp, ScalingDown, Remediating, Deleting, Paused. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // observedGeneration is the generation observed by the deployment controller. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + // selector is the same as the label selector but in the string format to avoid introspection + // by clients. The string will be in the same format as the query-param syntax. + // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors + Selector *string `json:"selector,omitempty"` + // replicas is the total number of non-terminated machines targeted by this deployment + // (their labels match the selector). + Replicas *int32 `json:"replicas,omitempty"` + // readyReplicas is the number of ready replicas for this MachineDeployment. A machine is considered ready when Machine's Ready condition is true. + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + // availableReplicas is the number of available replicas for this MachineDeployment. A machine is considered available when Machine's Available condition is true. + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + // upToDateReplicas is the number of up-to-date replicas targeted by this deployment. A machine is considered up-to-date when Machine's UpToDate condition is true. + UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` + // phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown). + Phase *string `json:"phase,omitempty"` + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + Deprecated *MachineDeploymentDeprecatedStatusApplyConfiguration `json:"deprecated,omitempty"` +} + +// MachineDeploymentStatusApplyConfiguration constructs a declarative configuration of the MachineDeploymentStatus type for use with +// apply. +func MachineDeploymentStatus() *MachineDeploymentStatusApplyConfiguration { + return &MachineDeploymentStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *MachineDeploymentStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *MachineDeploymentStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *MachineDeploymentStatusApplyConfiguration) WithObservedGeneration(value int64) *MachineDeploymentStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *MachineDeploymentStatusApplyConfiguration) WithSelector(value string) *MachineDeploymentStatusApplyConfiguration { + b.Selector = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *MachineDeploymentStatusApplyConfiguration) WithReplicas(value int32) *MachineDeploymentStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *MachineDeploymentStatusApplyConfiguration) WithReadyReplicas(value int32) *MachineDeploymentStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *MachineDeploymentStatusApplyConfiguration) WithAvailableReplicas(value int32) *MachineDeploymentStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithUpToDateReplicas sets the UpToDateReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpToDateReplicas field is set to the value of the last call. +func (b *MachineDeploymentStatusApplyConfiguration) WithUpToDateReplicas(value int32) *MachineDeploymentStatusApplyConfiguration { + b.UpToDateReplicas = &value + return b +} + +// WithPhase sets the Phase field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Phase field is set to the value of the last call. +func (b *MachineDeploymentStatusApplyConfiguration) WithPhase(value string) *MachineDeploymentStatusApplyConfiguration { + b.Phase = &value + return b +} + +// WithDeprecated sets the Deprecated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deprecated field is set to the value of the last call. +func (b *MachineDeploymentStatusApplyConfiguration) WithDeprecated(value *MachineDeploymentDeprecatedStatusApplyConfiguration) *MachineDeploymentStatusApplyConfiguration { + b.Deprecated = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopology.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopology.go new file mode 100644 index 000000000000..4024d552c7db --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopology.go @@ -0,0 +1,168 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentTopologyApplyConfiguration represents a declarative configuration of the MachineDeploymentTopology type for use +// with apply. +// +// MachineDeploymentTopology specifies the different parameters for a set of worker nodes in the topology. +// This set of nodes is managed by a MachineDeployment object whose lifecycle is managed by the Cluster controller. +type MachineDeploymentTopologyApplyConfiguration struct { + // metadata is the metadata applied to the MachineDeployment and the machines of the MachineDeployment. + // At runtime this metadata is merged with the corresponding metadata from the ClusterClass. + Metadata *ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // class is the name of the MachineDeploymentClass used to create the set of worker nodes. + // This should match one of the deployment classes defined in the ClusterClass object + // mentioned in the `Cluster.Spec.Class` field. + Class *string `json:"class,omitempty"` + // name is the unique identifier for this MachineDeploymentTopology. + // The value is used with other unique identifiers to create a MachineDeployment's Name + // (e.g. cluster's name, etc). In case the name is greater than the allowed maximum length, + // the values are hashed together. + Name *string `json:"name,omitempty"` + // failureDomain is the failure domain the machines will be created in. + // Must match a key in the FailureDomains map stored on the cluster object. + FailureDomain *string `json:"failureDomain,omitempty"` + // replicas is the number of worker nodes belonging to this set. + // If the value is nil, the MachineDeployment is created without the number of Replicas (defaulting to 1) + // and it's assumed that an external entity (like cluster autoscaler) is responsible for the management + // of this value. + Replicas *int32 `json:"replicas,omitempty"` + // healthCheck allows to enable, disable and override MachineDeployment health check + // configuration from the ClusterClass for this MachineDeployment. + HealthCheck *MachineDeploymentTopologyHealthCheckApplyConfiguration `json:"healthCheck,omitempty"` + // deletion contains configuration options for Machine deletion. + Deletion *MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration `json:"deletion,omitempty"` + // minReadySeconds is the minimum number of seconds for which a newly created machine should + // be ready. + // Defaults to 0 (machine will be considered available as soon as it + // is ready) + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + // readinessGates specifies additional conditions to include when evaluating Machine Ready condition. + // + // This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready + // computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine. + // + // If this field is not defined, readinessGates from the corresponding MachineDeploymentClass will be used, if any. + ReadinessGates []MachineReadinessGateApplyConfiguration `json:"readinessGates,omitempty"` + // rollout allows you to configure the behaviour of rolling updates to the MachineDeployment Machines. + // It allows you to define the strategy used during rolling replacements. + Rollout *MachineDeploymentTopologyRolloutSpecApplyConfiguration `json:"rollout,omitempty"` + // variables can be used to customize the MachineDeployment through patches. + Variables *MachineDeploymentVariablesApplyConfiguration `json:"variables,omitempty"` +} + +// MachineDeploymentTopologyApplyConfiguration constructs a declarative configuration of the MachineDeploymentTopology type for use with +// apply. +func MachineDeploymentTopology() *MachineDeploymentTopologyApplyConfiguration { + return &MachineDeploymentTopologyApplyConfiguration{} +} + +// WithMetadata sets the Metadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Metadata field is set to the value of the last call. +func (b *MachineDeploymentTopologyApplyConfiguration) WithMetadata(value *ObjectMetaApplyConfiguration) *MachineDeploymentTopologyApplyConfiguration { + b.Metadata = value + return b +} + +// WithClass sets the Class field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Class field is set to the value of the last call. +func (b *MachineDeploymentTopologyApplyConfiguration) WithClass(value string) *MachineDeploymentTopologyApplyConfiguration { + b.Class = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachineDeploymentTopologyApplyConfiguration) WithName(value string) *MachineDeploymentTopologyApplyConfiguration { + b.Name = &value + return b +} + +// WithFailureDomain sets the FailureDomain field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureDomain field is set to the value of the last call. +func (b *MachineDeploymentTopologyApplyConfiguration) WithFailureDomain(value string) *MachineDeploymentTopologyApplyConfiguration { + b.FailureDomain = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *MachineDeploymentTopologyApplyConfiguration) WithReplicas(value int32) *MachineDeploymentTopologyApplyConfiguration { + b.Replicas = &value + return b +} + +// WithHealthCheck sets the HealthCheck field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HealthCheck field is set to the value of the last call. +func (b *MachineDeploymentTopologyApplyConfiguration) WithHealthCheck(value *MachineDeploymentTopologyHealthCheckApplyConfiguration) *MachineDeploymentTopologyApplyConfiguration { + b.HealthCheck = value + return b +} + +// WithDeletion sets the Deletion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deletion field is set to the value of the last call. +func (b *MachineDeploymentTopologyApplyConfiguration) WithDeletion(value *MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration) *MachineDeploymentTopologyApplyConfiguration { + b.Deletion = value + return b +} + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *MachineDeploymentTopologyApplyConfiguration) WithMinReadySeconds(value int32) *MachineDeploymentTopologyApplyConfiguration { + b.MinReadySeconds = &value + return b +} + +// WithReadinessGates adds the given value to the ReadinessGates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ReadinessGates field. +func (b *MachineDeploymentTopologyApplyConfiguration) WithReadinessGates(values ...*MachineReadinessGateApplyConfiguration) *MachineDeploymentTopologyApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithReadinessGates") + } + b.ReadinessGates = append(b.ReadinessGates, *values[i]) + } + return b +} + +// WithRollout sets the Rollout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rollout field is set to the value of the last call. +func (b *MachineDeploymentTopologyApplyConfiguration) WithRollout(value *MachineDeploymentTopologyRolloutSpecApplyConfiguration) *MachineDeploymentTopologyApplyConfiguration { + b.Rollout = value + return b +} + +// WithVariables sets the Variables field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Variables field is set to the value of the last call. +func (b *MachineDeploymentTopologyApplyConfiguration) WithVariables(value *MachineDeploymentVariablesApplyConfiguration) *MachineDeploymentTopologyApplyConfiguration { + b.Variables = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyhealthcheck.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyhealthcheck.go new file mode 100644 index 000000000000..e48abfc9351e --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyhealthcheck.go @@ -0,0 +1,92 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentTopologyHealthCheckApplyConfiguration represents a declarative configuration of the MachineDeploymentTopologyHealthCheck type for use +// with apply. +// +// MachineDeploymentTopologyHealthCheck defines a MachineHealthCheck for MachineDeployment machines. +type MachineDeploymentTopologyHealthCheckApplyConfiguration struct { + // enabled controls if a MachineHealthCheck should be created for the target machines. + // + // If false: No MachineHealthCheck will be created. + // + // If not set(default): A MachineHealthCheck will be created if it is defined here or + // in the associated ClusterClass. If no MachineHealthCheck is defined then none will be created. + // + // If true: A MachineHealthCheck is guaranteed to be created. Cluster validation will + // block if `enable` is true and no MachineHealthCheck definition is available. + Enabled *bool `json:"enabled,omitempty"` + // checks are the checks that are used to evaluate if a Machine is healthy. + // + // If one of checks and remediation fields are set, the system assumes that an healthCheck override is defined, + // and as a consequence the checks and remediation fields from Cluster will be used instead of the + // corresponding fields in ClusterClass. + // + // Independent of this configuration the MachineHealthCheck controller will always + // flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and + // Machines with deleted Nodes as unhealthy. + // + // Furthermore, if checks.nodeStartupTimeoutSeconds is not set it + // is defaulted to 10 minutes and evaluated accordingly. + Checks *MachineDeploymentTopologyHealthCheckChecksApplyConfiguration `json:"checks,omitempty"` + // remediation configures if and how remediations are triggered if a Machine is unhealthy. + // + // If one of checks and remediation fields are set, the system assumes that an healthCheck override is defined, + // and as a consequence the checks and remediation fields from cluster will be used instead of the + // corresponding fields in ClusterClass. + // + // If an health check override is defined and remediation or remediation.triggerIf is not set, + // remediation will always be triggered for unhealthy Machines. + // + // If an health check override is defined and remediation or remediation.templateRef is not set, + // the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via + // the owner of the Machines, for example a MachineSet or a KubeadmControlPlane. + Remediation *MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration `json:"remediation,omitempty"` +} + +// MachineDeploymentTopologyHealthCheckApplyConfiguration constructs a declarative configuration of the MachineDeploymentTopologyHealthCheck type for use with +// apply. +func MachineDeploymentTopologyHealthCheck() *MachineDeploymentTopologyHealthCheckApplyConfiguration { + return &MachineDeploymentTopologyHealthCheckApplyConfiguration{} +} + +// WithEnabled sets the Enabled field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Enabled field is set to the value of the last call. +func (b *MachineDeploymentTopologyHealthCheckApplyConfiguration) WithEnabled(value bool) *MachineDeploymentTopologyHealthCheckApplyConfiguration { + b.Enabled = &value + return b +} + +// WithChecks sets the Checks field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Checks field is set to the value of the last call. +func (b *MachineDeploymentTopologyHealthCheckApplyConfiguration) WithChecks(value *MachineDeploymentTopologyHealthCheckChecksApplyConfiguration) *MachineDeploymentTopologyHealthCheckApplyConfiguration { + b.Checks = value + return b +} + +// WithRemediation sets the Remediation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Remediation field is set to the value of the last call. +func (b *MachineDeploymentTopologyHealthCheckApplyConfiguration) WithRemediation(value *MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration) *MachineDeploymentTopologyHealthCheckApplyConfiguration { + b.Remediation = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyhealthcheckchecks.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyhealthcheckchecks.go new file mode 100644 index 000000000000..ec4b82ecc3a3 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyhealthcheckchecks.go @@ -0,0 +1,87 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentTopologyHealthCheckChecksApplyConfiguration represents a declarative configuration of the MachineDeploymentTopologyHealthCheckChecks type for use +// with apply. +// +// MachineDeploymentTopologyHealthCheckChecks are the checks that are used to evaluate if a MachineDeployment Machine is healthy. +type MachineDeploymentTopologyHealthCheckChecksApplyConfiguration struct { + // nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck + // to consider a Machine unhealthy if a corresponding Node isn't associated + // through a `Spec.ProviderID` field. + // + // The duration set in this field is compared to the greatest of: + // - Cluster's infrastructure ready condition timestamp (if and when available) + // - Control Plane's initialized condition timestamp (if and when available) + // - Machine's infrastructure ready condition timestamp (if and when available) + // - Machine's metadata creation timestamp + // + // Defaults to 10 minutes. + // If you wish to disable this feature, set the value explicitly to 0. + NodeStartupTimeoutSeconds *int32 `json:"nodeStartupTimeoutSeconds,omitempty"` + // unhealthyNodeConditions contains a list of conditions that determine + // whether a node is considered unhealthy. The conditions are combined in a + // logical OR, i.e. if any of the conditions is met, the node is unhealthy. + UnhealthyNodeConditions []UnhealthyNodeConditionApplyConfiguration `json:"unhealthyNodeConditions,omitempty"` + // unhealthyMachineConditions contains a list of the machine conditions that determine + // whether a machine is considered unhealthy. The conditions are combined in a + // logical OR, i.e. if any of the conditions is met, the machine is unhealthy. + UnhealthyMachineConditions []UnhealthyMachineConditionApplyConfiguration `json:"unhealthyMachineConditions,omitempty"` +} + +// MachineDeploymentTopologyHealthCheckChecksApplyConfiguration constructs a declarative configuration of the MachineDeploymentTopologyHealthCheckChecks type for use with +// apply. +func MachineDeploymentTopologyHealthCheckChecks() *MachineDeploymentTopologyHealthCheckChecksApplyConfiguration { + return &MachineDeploymentTopologyHealthCheckChecksApplyConfiguration{} +} + +// WithNodeStartupTimeoutSeconds sets the NodeStartupTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeStartupTimeoutSeconds field is set to the value of the last call. +func (b *MachineDeploymentTopologyHealthCheckChecksApplyConfiguration) WithNodeStartupTimeoutSeconds(value int32) *MachineDeploymentTopologyHealthCheckChecksApplyConfiguration { + b.NodeStartupTimeoutSeconds = &value + return b +} + +// WithUnhealthyNodeConditions adds the given value to the UnhealthyNodeConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the UnhealthyNodeConditions field. +func (b *MachineDeploymentTopologyHealthCheckChecksApplyConfiguration) WithUnhealthyNodeConditions(values ...*UnhealthyNodeConditionApplyConfiguration) *MachineDeploymentTopologyHealthCheckChecksApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithUnhealthyNodeConditions") + } + b.UnhealthyNodeConditions = append(b.UnhealthyNodeConditions, *values[i]) + } + return b +} + +// WithUnhealthyMachineConditions adds the given value to the UnhealthyMachineConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the UnhealthyMachineConditions field. +func (b *MachineDeploymentTopologyHealthCheckChecksApplyConfiguration) WithUnhealthyMachineConditions(values ...*UnhealthyMachineConditionApplyConfiguration) *MachineDeploymentTopologyHealthCheckChecksApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithUnhealthyMachineConditions") + } + b.UnhealthyMachineConditions = append(b.UnhealthyMachineConditions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyhealthcheckremediation.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyhealthcheckremediation.go new file mode 100644 index 000000000000..97d8e6a51fe5 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyhealthcheckremediation.go @@ -0,0 +1,85 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration represents a declarative configuration of the MachineDeploymentTopologyHealthCheckRemediation type for use +// with apply. +// +// MachineDeploymentTopologyHealthCheckRemediation configures if and how remediations are triggered if a MachineDeployment Machine is unhealthy. +type MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration struct { + // maxInFlight determines how many in flight remediations should happen at the same time. + // + // Remediation only happens on the MachineSet with the most current revision, while + // older MachineSets (usually present during rollout operations) aren't allowed to remediate. + // + // Note: In general (independent of remediations), unhealthy machines are always + // prioritized during scale down operations over healthy ones. + // + // MaxInFlight can be set to a fixed number or a percentage. + // Example: when this is set to 20%, the MachineSet controller deletes at most 20% of + // the desired replicas. + // + // If not set, remediation is limited to all machines (bounded by replicas) + // under the active MachineSet's management. + MaxInFlight *intstr.IntOrString `json:"maxInFlight,omitempty"` + // triggerIf configures if remediations are triggered. + // If this field is not set, remediations are always triggered. + TriggerIf *MachineDeploymentTopologyHealthCheckRemediationTriggerIfApplyConfiguration `json:"triggerIf,omitempty"` + // templateRef is a reference to a remediation template + // provided by an infrastructure provider. + // + // This field is completely optional, when filled, the MachineHealthCheck controller + // creates a new object from the template referenced and hands off remediation of the machine to + // a controller that lives outside of Cluster API. + TemplateRef *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration `json:"templateRef,omitempty"` +} + +// MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration constructs a declarative configuration of the MachineDeploymentTopologyHealthCheckRemediation type for use with +// apply. +func MachineDeploymentTopologyHealthCheckRemediation() *MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration { + return &MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration{} +} + +// WithMaxInFlight sets the MaxInFlight field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxInFlight field is set to the value of the last call. +func (b *MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration) WithMaxInFlight(value intstr.IntOrString) *MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration { + b.MaxInFlight = &value + return b +} + +// WithTriggerIf sets the TriggerIf field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TriggerIf field is set to the value of the last call. +func (b *MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration) WithTriggerIf(value *MachineDeploymentTopologyHealthCheckRemediationTriggerIfApplyConfiguration) *MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration { + b.TriggerIf = value + return b +} + +// WithTemplateRef sets the TemplateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateRef field is set to the value of the last call. +func (b *MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration) WithTemplateRef(value *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration) *MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration { + b.TemplateRef = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyhealthcheckremediationtriggerif.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyhealthcheckremediationtriggerif.go new file mode 100644 index 000000000000..2e5da660dd81 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyhealthcheckremediationtriggerif.go @@ -0,0 +1,63 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// MachineDeploymentTopologyHealthCheckRemediationTriggerIfApplyConfiguration represents a declarative configuration of the MachineDeploymentTopologyHealthCheckRemediationTriggerIf type for use +// with apply. +// +// MachineDeploymentTopologyHealthCheckRemediationTriggerIf configures if remediations are triggered. +type MachineDeploymentTopologyHealthCheckRemediationTriggerIfApplyConfiguration struct { + // unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of + // unhealthy Machines is less than or equal to the configured value. + // unhealthyInRange takes precedence if set. + UnhealthyLessThanOrEqualTo *intstr.IntOrString `json:"unhealthyLessThanOrEqualTo,omitempty"` + // unhealthyInRange specifies that remediations are only triggered if the number of + // unhealthy Machines is in the configured range. + // Takes precedence over unhealthyLessThanOrEqualTo. + // Eg. "[3-5]" - This means that remediation will be allowed only when: + // (a) there are at least 3 unhealthy Machines (and) + // (b) there are at most 5 unhealthy Machines + UnhealthyInRange *string `json:"unhealthyInRange,omitempty"` +} + +// MachineDeploymentTopologyHealthCheckRemediationTriggerIfApplyConfiguration constructs a declarative configuration of the MachineDeploymentTopologyHealthCheckRemediationTriggerIf type for use with +// apply. +func MachineDeploymentTopologyHealthCheckRemediationTriggerIf() *MachineDeploymentTopologyHealthCheckRemediationTriggerIfApplyConfiguration { + return &MachineDeploymentTopologyHealthCheckRemediationTriggerIfApplyConfiguration{} +} + +// WithUnhealthyLessThanOrEqualTo sets the UnhealthyLessThanOrEqualTo field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnhealthyLessThanOrEqualTo field is set to the value of the last call. +func (b *MachineDeploymentTopologyHealthCheckRemediationTriggerIfApplyConfiguration) WithUnhealthyLessThanOrEqualTo(value intstr.IntOrString) *MachineDeploymentTopologyHealthCheckRemediationTriggerIfApplyConfiguration { + b.UnhealthyLessThanOrEqualTo = &value + return b +} + +// WithUnhealthyInRange sets the UnhealthyInRange field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnhealthyInRange field is set to the value of the last call. +func (b *MachineDeploymentTopologyHealthCheckRemediationTriggerIfApplyConfiguration) WithUnhealthyInRange(value string) *MachineDeploymentTopologyHealthCheckRemediationTriggerIfApplyConfiguration { + b.UnhealthyInRange = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologymachinedeletionspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologymachinedeletionspec.go new file mode 100644 index 000000000000..3cb4b605fbec --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologymachinedeletionspec.go @@ -0,0 +1,82 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration represents a declarative configuration of the MachineDeploymentTopologyMachineDeletionSpec type for use +// with apply. +// +// MachineDeploymentTopologyMachineDeletionSpec contains configuration options for Machine deletion. +type MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration struct { + // order defines the order in which Machines are deleted when downscaling. + // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" + Order *corev1beta2.MachineSetDeletionOrder `json:"order,omitempty"` + // nodeDrainTimeoutSeconds is the total amount of time that the controller will spend on draining a node. + // The default value is 0, meaning that the node can be drained without any time limitations. + // NOTE: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine + // hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration constructs a declarative configuration of the MachineDeploymentTopologyMachineDeletionSpec type for use with +// apply. +func MachineDeploymentTopologyMachineDeletionSpec() *MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration { + return &MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration{} +} + +// WithOrder sets the Order field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Order field is set to the value of the last call. +func (b *MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration) WithOrder(value corev1beta2.MachineSetDeletionOrder) *MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration { + b.Order = &value + return b +} + +// WithNodeDrainTimeoutSeconds sets the NodeDrainTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDrainTimeoutSeconds field is set to the value of the last call. +func (b *MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration) WithNodeDrainTimeoutSeconds(value int32) *MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration { + b.NodeDrainTimeoutSeconds = &value + return b +} + +// WithNodeVolumeDetachTimeoutSeconds sets the NodeVolumeDetachTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeVolumeDetachTimeoutSeconds field is set to the value of the last call. +func (b *MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration) WithNodeVolumeDetachTimeoutSeconds(value int32) *MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration { + b.NodeVolumeDetachTimeoutSeconds = &value + return b +} + +// WithNodeDeletionTimeoutSeconds sets the NodeDeletionTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDeletionTimeoutSeconds field is set to the value of the last call. +func (b *MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration) WithNodeDeletionTimeoutSeconds(value int32) *MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration { + b.NodeDeletionTimeoutSeconds = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyrolloutspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyrolloutspec.go new file mode 100644 index 000000000000..752a69456461 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyrolloutspec.go @@ -0,0 +1,42 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentTopologyRolloutSpecApplyConfiguration represents a declarative configuration of the MachineDeploymentTopologyRolloutSpec type for use +// with apply. +// +// MachineDeploymentTopologyRolloutSpec defines the rollout behavior. +type MachineDeploymentTopologyRolloutSpecApplyConfiguration struct { + // strategy specifies how to roll out control plane Machines. + Strategy *MachineDeploymentTopologyRolloutStrategyApplyConfiguration `json:"strategy,omitempty"` +} + +// MachineDeploymentTopologyRolloutSpecApplyConfiguration constructs a declarative configuration of the MachineDeploymentTopologyRolloutSpec type for use with +// apply. +func MachineDeploymentTopologyRolloutSpec() *MachineDeploymentTopologyRolloutSpecApplyConfiguration { + return &MachineDeploymentTopologyRolloutSpecApplyConfiguration{} +} + +// WithStrategy sets the Strategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Strategy field is set to the value of the last call. +func (b *MachineDeploymentTopologyRolloutSpecApplyConfiguration) WithStrategy(value *MachineDeploymentTopologyRolloutStrategyApplyConfiguration) *MachineDeploymentTopologyRolloutSpecApplyConfiguration { + b.Strategy = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyrolloutstrategy.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyrolloutstrategy.go new file mode 100644 index 000000000000..bfc64a238cf3 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyrolloutstrategy.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineDeploymentTopologyRolloutStrategyApplyConfiguration represents a declarative configuration of the MachineDeploymentTopologyRolloutStrategy type for use +// with apply. +// +// MachineDeploymentTopologyRolloutStrategy describes how to replace existing machines +// with new ones. +type MachineDeploymentTopologyRolloutStrategyApplyConfiguration struct { + // type of rollout. Allowed values are RollingUpdate and OnDelete. + // Default is RollingUpdate. + Type *corev1beta2.MachineDeploymentRolloutStrategyType `json:"type,omitempty"` + // rollingUpdate is the rolling update config params. Present only if + // type = RollingUpdate. + RollingUpdate *MachineDeploymentTopologyRolloutStrategyRollingUpdateApplyConfiguration `json:"rollingUpdate,omitempty"` +} + +// MachineDeploymentTopologyRolloutStrategyApplyConfiguration constructs a declarative configuration of the MachineDeploymentTopologyRolloutStrategy type for use with +// apply. +func MachineDeploymentTopologyRolloutStrategy() *MachineDeploymentTopologyRolloutStrategyApplyConfiguration { + return &MachineDeploymentTopologyRolloutStrategyApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *MachineDeploymentTopologyRolloutStrategyApplyConfiguration) WithType(value corev1beta2.MachineDeploymentRolloutStrategyType) *MachineDeploymentTopologyRolloutStrategyApplyConfiguration { + b.Type = &value + return b +} + +// WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RollingUpdate field is set to the value of the last call. +func (b *MachineDeploymentTopologyRolloutStrategyApplyConfiguration) WithRollingUpdate(value *MachineDeploymentTopologyRolloutStrategyRollingUpdateApplyConfiguration) *MachineDeploymentTopologyRolloutStrategyApplyConfiguration { + b.RollingUpdate = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyrolloutstrategyrollingupdate.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyrolloutstrategyrollingupdate.go new file mode 100644 index 000000000000..707f4a796c31 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymenttopologyrolloutstrategyrollingupdate.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// MachineDeploymentTopologyRolloutStrategyRollingUpdateApplyConfiguration represents a declarative configuration of the MachineDeploymentTopologyRolloutStrategyRollingUpdate type for use +// with apply. +// +// MachineDeploymentTopologyRolloutStrategyRollingUpdate is used to control the desired behavior of rolling update. +type MachineDeploymentTopologyRolloutStrategyRollingUpdateApplyConfiguration struct { + // maxUnavailable is the maximum number of machines that can be unavailable during the update. + // Value can be an absolute number (ex: 5) or a percentage of desired + // machines (ex: 10%). + // Absolute number is calculated from percentage by rounding down. + // This can not be 0 if MaxSurge is 0. + // Defaults to 0. + // Example: when this is set to 30%, the old MachineSet can be scaled + // down to 70% of desired machines immediately when the rolling update + // starts. Once new machines are ready, old MachineSet can be scaled + // down further, followed by scaling up the new MachineSet, ensuring + // that the total number of machines available at all times + // during the update is at least 70% of desired machines. + MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` + // maxSurge is the maximum number of machines that can be scheduled above the + // desired number of machines. + // Value can be an absolute number (ex: 5) or a percentage of + // desired machines (ex: 10%). + // This can not be 0 if MaxUnavailable is 0. + // Absolute number is calculated from percentage by rounding up. + // Defaults to 1. + // Example: when this is set to 30%, the new MachineSet can be scaled + // up immediately when the rolling update starts, such that the total + // number of old and new machines do not exceed 130% of desired + // machines. Once old machines have been killed, new MachineSet can + // be scaled up further, ensuring that total number of machines running + // at any time during the update is at most 130% of desired machines. + MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` +} + +// MachineDeploymentTopologyRolloutStrategyRollingUpdateApplyConfiguration constructs a declarative configuration of the MachineDeploymentTopologyRolloutStrategyRollingUpdate type for use with +// apply. +func MachineDeploymentTopologyRolloutStrategyRollingUpdate() *MachineDeploymentTopologyRolloutStrategyRollingUpdateApplyConfiguration { + return &MachineDeploymentTopologyRolloutStrategyRollingUpdateApplyConfiguration{} +} + +// WithMaxUnavailable sets the MaxUnavailable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxUnavailable field is set to the value of the last call. +func (b *MachineDeploymentTopologyRolloutStrategyRollingUpdateApplyConfiguration) WithMaxUnavailable(value intstr.IntOrString) *MachineDeploymentTopologyRolloutStrategyRollingUpdateApplyConfiguration { + b.MaxUnavailable = &value + return b +} + +// WithMaxSurge sets the MaxSurge field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxSurge field is set to the value of the last call. +func (b *MachineDeploymentTopologyRolloutStrategyRollingUpdateApplyConfiguration) WithMaxSurge(value intstr.IntOrString) *MachineDeploymentTopologyRolloutStrategyRollingUpdateApplyConfiguration { + b.MaxSurge = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentv1beta1deprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentv1beta1deprecatedstatus.go new file mode 100644 index 000000000000..fdcd7ccfe659 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentv1beta1deprecatedstatus.go @@ -0,0 +1,103 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration represents a declarative configuration of the MachineDeploymentV1Beta1DeprecatedStatus type for use +// with apply. +// +// MachineDeploymentV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration struct { + // conditions defines current service state of the MachineDeployment. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + Conditions *corev1beta2.Conditions `json:"conditions,omitempty"` + // updatedReplicas is the total number of non-terminated machines targeted by this deployment + // that have the desired template spec. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` + // readyReplicas is the total number of ready machines targeted by this deployment. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + // availableReplicas is the total number of available machines (ready for at least minReadySeconds) + // targeted by this deployment. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + // unavailableReplicas is the total number of unavailable machines targeted by this deployment. + // This is the total number of machines that are still required for + // the deployment to have 100% available capacity. They may either + // be machines that are running but not yet available or machines + // that still have not been created. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` +} + +// MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration constructs a declarative configuration of the MachineDeploymentV1Beta1DeprecatedStatus type for use with +// apply. +func MachineDeploymentV1Beta1DeprecatedStatus() *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration { + return &MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration{} +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration) WithConditions(value corev1beta2.Conditions) *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration { + b.Conditions = &value + return b +} + +// WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpdatedReplicas field is set to the value of the last call. +func (b *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration) WithUpdatedReplicas(value int32) *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration { + b.UpdatedReplicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration) WithReadyReplicas(value int32) *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration) WithAvailableReplicas(value int32) *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithUnavailableReplicas sets the UnavailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnavailableReplicas field is set to the value of the last call. +func (b *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration) WithUnavailableReplicas(value int32) *MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration { + b.UnavailableReplicas = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentvariables.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentvariables.go new file mode 100644 index 000000000000..4a0aae65eff3 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeploymentvariables.go @@ -0,0 +1,47 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeploymentVariablesApplyConfiguration represents a declarative configuration of the MachineDeploymentVariables type for use +// with apply. +// +// MachineDeploymentVariables can be used to provide variables for a specific MachineDeployment. +type MachineDeploymentVariablesApplyConfiguration struct { + // overrides can be used to override Cluster level variables. + Overrides []ClusterVariableApplyConfiguration `json:"overrides,omitempty"` +} + +// MachineDeploymentVariablesApplyConfiguration constructs a declarative configuration of the MachineDeploymentVariables type for use with +// apply. +func MachineDeploymentVariables() *MachineDeploymentVariablesApplyConfiguration { + return &MachineDeploymentVariablesApplyConfiguration{} +} + +// WithOverrides adds the given value to the Overrides field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Overrides field. +func (b *MachineDeploymentVariablesApplyConfiguration) WithOverrides(values ...*ClusterVariableApplyConfiguration) *MachineDeploymentVariablesApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOverrides") + } + b.Overrides = append(b.Overrides, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinedeprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinedeprecatedstatus.go new file mode 100644 index 000000000000..af271e70a83d --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinedeprecatedstatus.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineDeprecatedStatusApplyConfiguration represents a declarative configuration of the MachineDeprecatedStatus type for use +// with apply. +// +// MachineDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineDeprecatedStatusApplyConfiguration struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + V1Beta1 *MachineV1Beta1DeprecatedStatusApplyConfiguration `json:"v1beta1,omitempty"` +} + +// MachineDeprecatedStatusApplyConfiguration constructs a declarative configuration of the MachineDeprecatedStatus type for use with +// apply. +func MachineDeprecatedStatus() *MachineDeprecatedStatusApplyConfiguration { + return &MachineDeprecatedStatusApplyConfiguration{} +} + +// WithV1Beta1 sets the V1Beta1 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the V1Beta1 field is set to the value of the last call. +func (b *MachineDeprecatedStatusApplyConfiguration) WithV1Beta1(value *MachineV1Beta1DeprecatedStatusApplyConfiguration) *MachineDeprecatedStatusApplyConfiguration { + b.V1Beta1 = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheck.go b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheck.go new file mode 100644 index 000000000000..94de81c869d7 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheck.go @@ -0,0 +1,249 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineHealthCheckApplyConfiguration represents a declarative configuration of the MachineHealthCheck type for use +// with apply. +// +// MachineHealthCheck is the Schema for the machinehealthchecks API. +type MachineHealthCheckApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is the specification of machine health check policy + Spec *MachineHealthCheckSpecApplyConfiguration `json:"spec,omitempty"` + // status is the most recently observed status of MachineHealthCheck resource + Status *MachineHealthCheckStatusApplyConfiguration `json:"status,omitempty"` +} + +// MachineHealthCheck constructs a declarative configuration of the MachineHealthCheck type for use with +// apply. +func MachineHealthCheck(name, namespace string) *MachineHealthCheckApplyConfiguration { + b := &MachineHealthCheckApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("MachineHealthCheck") + b.WithAPIVersion("cluster.x-k8s.io/v1beta2") + return b +} + +func (b MachineHealthCheckApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithKind(value string) *MachineHealthCheckApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithAPIVersion(value string) *MachineHealthCheckApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithName(value string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithGenerateName(value string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithNamespace(value string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithUID(value types.UID) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithResourceVersion(value string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithGeneration(value int64) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MachineHealthCheckApplyConfiguration) WithLabels(entries map[string]string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MachineHealthCheckApplyConfiguration) WithAnnotations(entries map[string]string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *MachineHealthCheckApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *MachineHealthCheckApplyConfiguration) WithFinalizers(values ...string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *MachineHealthCheckApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithSpec(value *MachineHealthCheckSpecApplyConfiguration) *MachineHealthCheckApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithStatus(value *MachineHealthCheckStatusApplyConfiguration) *MachineHealthCheckApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *MachineHealthCheckApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *MachineHealthCheckApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *MachineHealthCheckApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *MachineHealthCheckApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckchecks.go b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckchecks.go new file mode 100644 index 000000000000..530251e38b2d --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckchecks.go @@ -0,0 +1,87 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineHealthCheckChecksApplyConfiguration represents a declarative configuration of the MachineHealthCheckChecks type for use +// with apply. +// +// MachineHealthCheckChecks are the checks that are used to evaluate if a Machine is healthy. +type MachineHealthCheckChecksApplyConfiguration struct { + // nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck + // to consider a Machine unhealthy if a corresponding Node isn't associated + // through a `Spec.ProviderID` field. + // + // The duration set in this field is compared to the greatest of: + // - Cluster's infrastructure ready condition timestamp (if and when available) + // - Control Plane's initialized condition timestamp (if and when available) + // - Machine's infrastructure ready condition timestamp (if and when available) + // - Machine's metadata creation timestamp + // + // Defaults to 10 minutes. + // If you wish to disable this feature, set the value explicitly to 0. + NodeStartupTimeoutSeconds *int32 `json:"nodeStartupTimeoutSeconds,omitempty"` + // unhealthyNodeConditions contains a list of conditions that determine + // whether a node is considered unhealthy. The conditions are combined in a + // logical OR, i.e. if any of the conditions is met, the node is unhealthy. + UnhealthyNodeConditions []UnhealthyNodeConditionApplyConfiguration `json:"unhealthyNodeConditions,omitempty"` + // unhealthyMachineConditions contains a list of the machine conditions that determine + // whether a machine is considered unhealthy. The conditions are combined in a + // logical OR, i.e. if any of the conditions is met, the machine is unhealthy. + UnhealthyMachineConditions []UnhealthyMachineConditionApplyConfiguration `json:"unhealthyMachineConditions,omitempty"` +} + +// MachineHealthCheckChecksApplyConfiguration constructs a declarative configuration of the MachineHealthCheckChecks type for use with +// apply. +func MachineHealthCheckChecks() *MachineHealthCheckChecksApplyConfiguration { + return &MachineHealthCheckChecksApplyConfiguration{} +} + +// WithNodeStartupTimeoutSeconds sets the NodeStartupTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeStartupTimeoutSeconds field is set to the value of the last call. +func (b *MachineHealthCheckChecksApplyConfiguration) WithNodeStartupTimeoutSeconds(value int32) *MachineHealthCheckChecksApplyConfiguration { + b.NodeStartupTimeoutSeconds = &value + return b +} + +// WithUnhealthyNodeConditions adds the given value to the UnhealthyNodeConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the UnhealthyNodeConditions field. +func (b *MachineHealthCheckChecksApplyConfiguration) WithUnhealthyNodeConditions(values ...*UnhealthyNodeConditionApplyConfiguration) *MachineHealthCheckChecksApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithUnhealthyNodeConditions") + } + b.UnhealthyNodeConditions = append(b.UnhealthyNodeConditions, *values[i]) + } + return b +} + +// WithUnhealthyMachineConditions adds the given value to the UnhealthyMachineConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the UnhealthyMachineConditions field. +func (b *MachineHealthCheckChecksApplyConfiguration) WithUnhealthyMachineConditions(values ...*UnhealthyMachineConditionApplyConfiguration) *MachineHealthCheckChecksApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithUnhealthyMachineConditions") + } + b.UnhealthyMachineConditions = append(b.UnhealthyMachineConditions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckdeprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckdeprecatedstatus.go new file mode 100644 index 000000000000..a2fccb72a7d6 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckdeprecatedstatus.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineHealthCheckDeprecatedStatusApplyConfiguration represents a declarative configuration of the MachineHealthCheckDeprecatedStatus type for use +// with apply. +// +// MachineHealthCheckDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineHealthCheckDeprecatedStatusApplyConfiguration struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + V1Beta1 *MachineHealthCheckV1Beta1DeprecatedStatusApplyConfiguration `json:"v1beta1,omitempty"` +} + +// MachineHealthCheckDeprecatedStatusApplyConfiguration constructs a declarative configuration of the MachineHealthCheckDeprecatedStatus type for use with +// apply. +func MachineHealthCheckDeprecatedStatus() *MachineHealthCheckDeprecatedStatusApplyConfiguration { + return &MachineHealthCheckDeprecatedStatusApplyConfiguration{} +} + +// WithV1Beta1 sets the V1Beta1 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the V1Beta1 field is set to the value of the last call. +func (b *MachineHealthCheckDeprecatedStatusApplyConfiguration) WithV1Beta1(value *MachineHealthCheckV1Beta1DeprecatedStatusApplyConfiguration) *MachineHealthCheckDeprecatedStatusApplyConfiguration { + b.V1Beta1 = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckremediation.go b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckremediation.go new file mode 100644 index 000000000000..c7d53a4d55fd --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckremediation.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineHealthCheckRemediationApplyConfiguration represents a declarative configuration of the MachineHealthCheckRemediation type for use +// with apply. +// +// MachineHealthCheckRemediation configures if and how remediations are triggered if a Machine is unhealthy. +type MachineHealthCheckRemediationApplyConfiguration struct { + // triggerIf configures if remediations are triggered. + // If this field is not set, remediations are always triggered. + TriggerIf *MachineHealthCheckRemediationTriggerIfApplyConfiguration `json:"triggerIf,omitempty"` + // templateRef is a reference to a remediation template + // provided by an infrastructure provider. + // + // This field is completely optional, when filled, the MachineHealthCheck controller + // creates a new object from the template referenced and hands off remediation of the machine to + // a controller that lives outside of Cluster API. + TemplateRef *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration `json:"templateRef,omitempty"` +} + +// MachineHealthCheckRemediationApplyConfiguration constructs a declarative configuration of the MachineHealthCheckRemediation type for use with +// apply. +func MachineHealthCheckRemediation() *MachineHealthCheckRemediationApplyConfiguration { + return &MachineHealthCheckRemediationApplyConfiguration{} +} + +// WithTriggerIf sets the TriggerIf field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TriggerIf field is set to the value of the last call. +func (b *MachineHealthCheckRemediationApplyConfiguration) WithTriggerIf(value *MachineHealthCheckRemediationTriggerIfApplyConfiguration) *MachineHealthCheckRemediationApplyConfiguration { + b.TriggerIf = value + return b +} + +// WithTemplateRef sets the TemplateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateRef field is set to the value of the last call. +func (b *MachineHealthCheckRemediationApplyConfiguration) WithTemplateRef(value *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration) *MachineHealthCheckRemediationApplyConfiguration { + b.TemplateRef = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckremediationtemplatereference.go b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckremediationtemplatereference.go new file mode 100644 index 000000000000..2b1af7b58dd9 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckremediationtemplatereference.go @@ -0,0 +1,66 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineHealthCheckRemediationTemplateReferenceApplyConfiguration represents a declarative configuration of the MachineHealthCheckRemediationTemplateReference type for use +// with apply. +// +// MachineHealthCheckRemediationTemplateReference is a reference to a remediation template. +type MachineHealthCheckRemediationTemplateReferenceApplyConfiguration struct { + // kind of the remediation template. + // kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. + Kind *string `json:"kind,omitempty"` + // name of the remediation template. + // name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + Name *string `json:"name,omitempty"` + // apiVersion of the remediation template. + // apiVersion must be fully qualified domain name followed by / and a version. + // NOTE: This field must be kept in sync with the APIVersion of the remediation template. + APIVersion *string `json:"apiVersion,omitempty"` +} + +// MachineHealthCheckRemediationTemplateReferenceApplyConfiguration constructs a declarative configuration of the MachineHealthCheckRemediationTemplateReference type for use with +// apply. +func MachineHealthCheckRemediationTemplateReference() *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration { + return &MachineHealthCheckRemediationTemplateReferenceApplyConfiguration{} +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration) WithKind(value string) *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration) WithName(value string) *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration) WithAPIVersion(value string) *MachineHealthCheckRemediationTemplateReferenceApplyConfiguration { + b.APIVersion = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckremediationtriggerif.go b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckremediationtriggerif.go new file mode 100644 index 000000000000..a49d7bf29048 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckremediationtriggerif.go @@ -0,0 +1,63 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// MachineHealthCheckRemediationTriggerIfApplyConfiguration represents a declarative configuration of the MachineHealthCheckRemediationTriggerIf type for use +// with apply. +// +// MachineHealthCheckRemediationTriggerIf configures if remediations are triggered. +type MachineHealthCheckRemediationTriggerIfApplyConfiguration struct { + // unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of + // unhealthy Machines is less than or equal to the configured value. + // unhealthyInRange takes precedence if set. + UnhealthyLessThanOrEqualTo *intstr.IntOrString `json:"unhealthyLessThanOrEqualTo,omitempty"` + // unhealthyInRange specifies that remediations are only triggered if the number of + // unhealthy Machines is in the configured range. + // Takes precedence over unhealthyLessThanOrEqualTo. + // Eg. "[3-5]" - This means that remediation will be allowed only when: + // (a) there are at least 3 unhealthy Machines (and) + // (b) there are at most 5 unhealthy Machines + UnhealthyInRange *string `json:"unhealthyInRange,omitempty"` +} + +// MachineHealthCheckRemediationTriggerIfApplyConfiguration constructs a declarative configuration of the MachineHealthCheckRemediationTriggerIf type for use with +// apply. +func MachineHealthCheckRemediationTriggerIf() *MachineHealthCheckRemediationTriggerIfApplyConfiguration { + return &MachineHealthCheckRemediationTriggerIfApplyConfiguration{} +} + +// WithUnhealthyLessThanOrEqualTo sets the UnhealthyLessThanOrEqualTo field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnhealthyLessThanOrEqualTo field is set to the value of the last call. +func (b *MachineHealthCheckRemediationTriggerIfApplyConfiguration) WithUnhealthyLessThanOrEqualTo(value intstr.IntOrString) *MachineHealthCheckRemediationTriggerIfApplyConfiguration { + b.UnhealthyLessThanOrEqualTo = &value + return b +} + +// WithUnhealthyInRange sets the UnhealthyInRange field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnhealthyInRange field is set to the value of the last call. +func (b *MachineHealthCheckRemediationTriggerIfApplyConfiguration) WithUnhealthyInRange(value string) *MachineHealthCheckRemediationTriggerIfApplyConfiguration { + b.UnhealthyInRange = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckspec.go new file mode 100644 index 000000000000..633b6782df06 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckspec.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineHealthCheckSpecApplyConfiguration represents a declarative configuration of the MachineHealthCheckSpec type for use +// with apply. +// +// MachineHealthCheckSpec defines the desired state of MachineHealthCheck. +type MachineHealthCheckSpecApplyConfiguration struct { + // clusterName is the name of the Cluster this object belongs to. + ClusterName *string `json:"clusterName,omitempty"` + // selector is a label selector to match machines whose health will be exercised + Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` + // checks are the checks that are used to evaluate if a Machine is healthy. + // + // Independent of this configuration the MachineHealthCheck controller will always + // flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and + // Machines with deleted Nodes as unhealthy. + // + // Furthermore, if checks.nodeStartupTimeoutSeconds is not set it + // is defaulted to 10 minutes and evaluated accordingly. + Checks *MachineHealthCheckChecksApplyConfiguration `json:"checks,omitempty"` + // remediation configures if and how remediations are triggered if a Machine is unhealthy. + // + // If remediation or remediation.triggerIf is not set, + // remediation will always be triggered for unhealthy Machines. + // + // If remediation or remediation.templateRef is not set, + // the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via + // the owner of the Machines, for example a MachineSet or a KubeadmControlPlane. + Remediation *MachineHealthCheckRemediationApplyConfiguration `json:"remediation,omitempty"` +} + +// MachineHealthCheckSpecApplyConfiguration constructs a declarative configuration of the MachineHealthCheckSpec type for use with +// apply. +func MachineHealthCheckSpec() *MachineHealthCheckSpecApplyConfiguration { + return &MachineHealthCheckSpecApplyConfiguration{} +} + +// WithClusterName sets the ClusterName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterName field is set to the value of the last call. +func (b *MachineHealthCheckSpecApplyConfiguration) WithClusterName(value string) *MachineHealthCheckSpecApplyConfiguration { + b.ClusterName = &value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *MachineHealthCheckSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *MachineHealthCheckSpecApplyConfiguration { + b.Selector = value + return b +} + +// WithChecks sets the Checks field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Checks field is set to the value of the last call. +func (b *MachineHealthCheckSpecApplyConfiguration) WithChecks(value *MachineHealthCheckChecksApplyConfiguration) *MachineHealthCheckSpecApplyConfiguration { + b.Checks = value + return b +} + +// WithRemediation sets the Remediation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Remediation field is set to the value of the last call. +func (b *MachineHealthCheckSpecApplyConfiguration) WithRemediation(value *MachineHealthCheckRemediationApplyConfiguration) *MachineHealthCheckSpecApplyConfiguration { + b.Remediation = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckstatus.go new file mode 100644 index 000000000000..cc2f8836991e --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckstatus.go @@ -0,0 +1,115 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineHealthCheckStatusApplyConfiguration represents a declarative configuration of the MachineHealthCheckStatus type for use +// with apply. +// +// MachineHealthCheckStatus defines the observed state of MachineHealthCheck. +type MachineHealthCheckStatusApplyConfiguration struct { + // conditions represents the observations of a MachineHealthCheck's current state. + // Known condition types are RemediationAllowed, Paused. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // expectedMachines is the total number of machines counted by this machine health check + ExpectedMachines *int32 `json:"expectedMachines,omitempty"` + // currentHealthy is the total number of healthy machines counted by this machine health check + CurrentHealthy *int32 `json:"currentHealthy,omitempty"` + // remediationsAllowed is the number of further remediations allowed by this machine health check before + // maxUnhealthy short circuiting will be applied + RemediationsAllowed *int32 `json:"remediationsAllowed,omitempty"` + // observedGeneration is the latest generation observed by the controller. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + // targets shows the current list of machines the machine health check is watching + Targets []string `json:"targets,omitempty"` + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + Deprecated *MachineHealthCheckDeprecatedStatusApplyConfiguration `json:"deprecated,omitempty"` +} + +// MachineHealthCheckStatusApplyConfiguration constructs a declarative configuration of the MachineHealthCheckStatus type for use with +// apply. +func MachineHealthCheckStatus() *MachineHealthCheckStatusApplyConfiguration { + return &MachineHealthCheckStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *MachineHealthCheckStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *MachineHealthCheckStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithExpectedMachines sets the ExpectedMachines field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExpectedMachines field is set to the value of the last call. +func (b *MachineHealthCheckStatusApplyConfiguration) WithExpectedMachines(value int32) *MachineHealthCheckStatusApplyConfiguration { + b.ExpectedMachines = &value + return b +} + +// WithCurrentHealthy sets the CurrentHealthy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CurrentHealthy field is set to the value of the last call. +func (b *MachineHealthCheckStatusApplyConfiguration) WithCurrentHealthy(value int32) *MachineHealthCheckStatusApplyConfiguration { + b.CurrentHealthy = &value + return b +} + +// WithRemediationsAllowed sets the RemediationsAllowed field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RemediationsAllowed field is set to the value of the last call. +func (b *MachineHealthCheckStatusApplyConfiguration) WithRemediationsAllowed(value int32) *MachineHealthCheckStatusApplyConfiguration { + b.RemediationsAllowed = &value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *MachineHealthCheckStatusApplyConfiguration) WithObservedGeneration(value int64) *MachineHealthCheckStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithTargets adds the given value to the Targets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Targets field. +func (b *MachineHealthCheckStatusApplyConfiguration) WithTargets(values ...string) *MachineHealthCheckStatusApplyConfiguration { + for i := range values { + b.Targets = append(b.Targets, values[i]) + } + return b +} + +// WithDeprecated sets the Deprecated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deprecated field is set to the value of the last call. +func (b *MachineHealthCheckStatusApplyConfiguration) WithDeprecated(value *MachineHealthCheckDeprecatedStatusApplyConfiguration) *MachineHealthCheckStatusApplyConfiguration { + b.Deprecated = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckv1beta1deprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckv1beta1deprecatedstatus.go new file mode 100644 index 000000000000..e9a9fb29f245 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinehealthcheckv1beta1deprecatedstatus.go @@ -0,0 +1,49 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineHealthCheckV1Beta1DeprecatedStatusApplyConfiguration represents a declarative configuration of the MachineHealthCheckV1Beta1DeprecatedStatus type for use +// with apply. +// +// MachineHealthCheckV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineHealthCheckV1Beta1DeprecatedStatusApplyConfiguration struct { + // conditions defines current service state of the MachineHealthCheck. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + Conditions *corev1beta2.Conditions `json:"conditions,omitempty"` +} + +// MachineHealthCheckV1Beta1DeprecatedStatusApplyConfiguration constructs a declarative configuration of the MachineHealthCheckV1Beta1DeprecatedStatus type for use with +// apply. +func MachineHealthCheckV1Beta1DeprecatedStatus() *MachineHealthCheckV1Beta1DeprecatedStatusApplyConfiguration { + return &MachineHealthCheckV1Beta1DeprecatedStatusApplyConfiguration{} +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *MachineHealthCheckV1Beta1DeprecatedStatusApplyConfiguration) WithConditions(value corev1beta2.Conditions) *MachineHealthCheckV1Beta1DeprecatedStatusApplyConfiguration { + b.Conditions = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machineinitializationstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machineinitializationstatus.go new file mode 100644 index 000000000000..186f207a9114 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machineinitializationstatus.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineInitializationStatusApplyConfiguration represents a declarative configuration of the MachineInitializationStatus type for use +// with apply. +// +// MachineInitializationStatus provides observations of the Machine initialization process. +// NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Machine provisioning. +type MachineInitializationStatusApplyConfiguration struct { + // infrastructureProvisioned is true when the infrastructure provider reports that Machine's infrastructure is fully provisioned. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. + // The value of this field is never updated after provisioning is completed. + InfrastructureProvisioned *bool `json:"infrastructureProvisioned,omitempty"` + // bootstrapDataSecretCreated is true when the bootstrap provider reports that the Machine's boostrap secret is created. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. + // The value of this field is never updated after provisioning is completed. + BootstrapDataSecretCreated *bool `json:"bootstrapDataSecretCreated,omitempty"` +} + +// MachineInitializationStatusApplyConfiguration constructs a declarative configuration of the MachineInitializationStatus type for use with +// apply. +func MachineInitializationStatus() *MachineInitializationStatusApplyConfiguration { + return &MachineInitializationStatusApplyConfiguration{} +} + +// WithInfrastructureProvisioned sets the InfrastructureProvisioned field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InfrastructureProvisioned field is set to the value of the last call. +func (b *MachineInitializationStatusApplyConfiguration) WithInfrastructureProvisioned(value bool) *MachineInitializationStatusApplyConfiguration { + b.InfrastructureProvisioned = &value + return b +} + +// WithBootstrapDataSecretCreated sets the BootstrapDataSecretCreated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BootstrapDataSecretCreated field is set to the value of the last call. +func (b *MachineInitializationStatusApplyConfiguration) WithBootstrapDataSecretCreated(value bool) *MachineInitializationStatusApplyConfiguration { + b.BootstrapDataSecretCreated = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinenamingspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinenamingspec.go new file mode 100644 index 000000000000..14145c320262 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinenamingspec.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineNamingSpecApplyConfiguration represents a declarative configuration of the MachineNamingSpec type for use +// with apply. +// +// MachineNamingSpec allows changing the naming pattern used when creating +// Machines. +// Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines. +type MachineNamingSpecApplyConfiguration struct { + // template defines the template to use for generating the names of the + // Machine objects. + // If not defined, it will fallback to `{{ .machineSet.name }}-{{ .random }}`. + // If the generated name string exceeds 63 characters, it will be trimmed to + // 58 characters and will + // get concatenated with a random suffix of length 5. + // Length of the template string must not exceed 256 characters. + // The template allows the following variables `.cluster.name`, + // `.machineSet.name` and `.random`. + // The variable `.cluster.name` retrieves the name of the cluster object + // that owns the Machines being created. + // The variable `.machineSet.name` retrieves the name of the MachineSet + // object that owns the Machines being created. + // The variable `.random` is substituted with random alphanumeric string, + // without vowels, of length 5. This variable is required part of the + // template. If not provided, validation will fail. + Template *string `json:"template,omitempty"` +} + +// MachineNamingSpecApplyConfiguration constructs a declarative configuration of the MachineNamingSpec type for use with +// apply. +func MachineNamingSpec() *MachineNamingSpecApplyConfiguration { + return &MachineNamingSpecApplyConfiguration{} +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *MachineNamingSpecApplyConfiguration) WithTemplate(value string) *MachineNamingSpecApplyConfiguration { + b.Template = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinenodereference.go b/pkg/generated/applyconfiguration/core/v1beta2/machinenodereference.go new file mode 100644 index 000000000000..1986ed8a1d11 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinenodereference.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineNodeReferenceApplyConfiguration represents a declarative configuration of the MachineNodeReference type for use +// with apply. +// +// MachineNodeReference is a reference to the node running on the machine. +type MachineNodeReferenceApplyConfiguration struct { + // name of the node. + // name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + Name *string `json:"name,omitempty"` +} + +// MachineNodeReferenceApplyConfiguration constructs a declarative configuration of the MachineNodeReference type for use with +// apply. +func MachineNodeReference() *MachineNodeReferenceApplyConfiguration { + return &MachineNodeReferenceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachineNodeReferenceApplyConfiguration) WithName(value string) *MachineNodeReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepool.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepool.go new file mode 100644 index 000000000000..402bf82f2883 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepool.go @@ -0,0 +1,250 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachinePoolApplyConfiguration represents a declarative configuration of the MachinePool type for use +// with apply. +// +// MachinePool is the Schema for the machinepools API. +// NOTE: This CRD can only be used if the MachinePool feature gate is enabled. +type MachinePoolApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is the desired state of MachinePool. + Spec *MachinePoolSpecApplyConfiguration `json:"spec,omitempty"` + // status is the observed state of MachinePool. + Status *MachinePoolStatusApplyConfiguration `json:"status,omitempty"` +} + +// MachinePool constructs a declarative configuration of the MachinePool type for use with +// apply. +func MachinePool(name, namespace string) *MachinePoolApplyConfiguration { + b := &MachinePoolApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("MachinePool") + b.WithAPIVersion("cluster.x-k8s.io/v1beta2") + return b +} + +func (b MachinePoolApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithKind(value string) *MachinePoolApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithAPIVersion(value string) *MachinePoolApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithName(value string) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithGenerateName(value string) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithNamespace(value string) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithUID(value types.UID) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithResourceVersion(value string) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithGeneration(value int64) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MachinePoolApplyConfiguration) WithLabels(entries map[string]string) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MachinePoolApplyConfiguration) WithAnnotations(entries map[string]string) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *MachinePoolApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *MachinePoolApplyConfiguration) WithFinalizers(values ...string) *MachinePoolApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *MachinePoolApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithSpec(value *MachinePoolSpecApplyConfiguration) *MachinePoolApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *MachinePoolApplyConfiguration) WithStatus(value *MachinePoolStatusApplyConfiguration) *MachinePoolApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *MachinePoolApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *MachinePoolApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *MachinePoolApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *MachinePoolApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclass.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclass.go new file mode 100644 index 000000000000..2bf17a760f4c --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclass.go @@ -0,0 +1,126 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachinePoolClassApplyConfiguration represents a declarative configuration of the MachinePoolClass type for use +// with apply. +// +// MachinePoolClass serves as a template to define a pool of worker nodes of the cluster +// provisioned using `ClusterClass`. +type MachinePoolClassApplyConfiguration struct { + // metadata is the metadata applied to the MachinePool. + // At runtime this metadata is merged with the corresponding metadata from the topology. + Metadata *ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // class denotes a type of machine pool present in the cluster, + // this name MUST be unique within a ClusterClass and can be referenced + // in the Cluster to create a managed MachinePool. + Class *string `json:"class,omitempty"` + // bootstrap contains the bootstrap template reference to be used + // for the creation of the Machines in the MachinePool. + Bootstrap *MachinePoolClassBootstrapTemplateApplyConfiguration `json:"bootstrap,omitempty"` + // infrastructure contains the infrastructure template reference to be used + // for the creation of the MachinePool. + Infrastructure *MachinePoolClassInfrastructureTemplateApplyConfiguration `json:"infrastructure,omitempty"` + // failureDomains is the list of failure domains the MachinePool should be attached to. + // Must match a key in the FailureDomains map stored on the cluster object. + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass. + FailureDomains []string `json:"failureDomains,omitempty"` + // naming allows changing the naming pattern used when creating the MachinePool. + Naming *MachinePoolClassNamingSpecApplyConfiguration `json:"naming,omitempty"` + // deletion contains configuration options for Machine deletion. + Deletion *MachinePoolClassMachineDeletionSpecApplyConfiguration `json:"deletion,omitempty"` + // minReadySeconds is the minimum number of seconds for which a newly created machine pool should + // be ready. + // Defaults to 0 (machine will be considered available as soon as it + // is ready) + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass. + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` +} + +// MachinePoolClassApplyConfiguration constructs a declarative configuration of the MachinePoolClass type for use with +// apply. +func MachinePoolClass() *MachinePoolClassApplyConfiguration { + return &MachinePoolClassApplyConfiguration{} +} + +// WithMetadata sets the Metadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Metadata field is set to the value of the last call. +func (b *MachinePoolClassApplyConfiguration) WithMetadata(value *ObjectMetaApplyConfiguration) *MachinePoolClassApplyConfiguration { + b.Metadata = value + return b +} + +// WithClass sets the Class field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Class field is set to the value of the last call. +func (b *MachinePoolClassApplyConfiguration) WithClass(value string) *MachinePoolClassApplyConfiguration { + b.Class = &value + return b +} + +// WithBootstrap sets the Bootstrap field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Bootstrap field is set to the value of the last call. +func (b *MachinePoolClassApplyConfiguration) WithBootstrap(value *MachinePoolClassBootstrapTemplateApplyConfiguration) *MachinePoolClassApplyConfiguration { + b.Bootstrap = value + return b +} + +// WithInfrastructure sets the Infrastructure field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Infrastructure field is set to the value of the last call. +func (b *MachinePoolClassApplyConfiguration) WithInfrastructure(value *MachinePoolClassInfrastructureTemplateApplyConfiguration) *MachinePoolClassApplyConfiguration { + b.Infrastructure = value + return b +} + +// WithFailureDomains adds the given value to the FailureDomains field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the FailureDomains field. +func (b *MachinePoolClassApplyConfiguration) WithFailureDomains(values ...string) *MachinePoolClassApplyConfiguration { + for i := range values { + b.FailureDomains = append(b.FailureDomains, values[i]) + } + return b +} + +// WithNaming sets the Naming field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Naming field is set to the value of the last call. +func (b *MachinePoolClassApplyConfiguration) WithNaming(value *MachinePoolClassNamingSpecApplyConfiguration) *MachinePoolClassApplyConfiguration { + b.Naming = value + return b +} + +// WithDeletion sets the Deletion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deletion field is set to the value of the last call. +func (b *MachinePoolClassApplyConfiguration) WithDeletion(value *MachinePoolClassMachineDeletionSpecApplyConfiguration) *MachinePoolClassApplyConfiguration { + b.Deletion = value + return b +} + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *MachinePoolClassApplyConfiguration) WithMinReadySeconds(value int32) *MachinePoolClassApplyConfiguration { + b.MinReadySeconds = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclassbootstraptemplate.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclassbootstraptemplate.go new file mode 100644 index 000000000000..b2319de633d7 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclassbootstraptemplate.go @@ -0,0 +1,42 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachinePoolClassBootstrapTemplateApplyConfiguration represents a declarative configuration of the MachinePoolClassBootstrapTemplate type for use +// with apply. +// +// MachinePoolClassBootstrapTemplate defines the BootstrapTemplate for a MachinePool. +type MachinePoolClassBootstrapTemplateApplyConfiguration struct { + // templateRef is a required reference to the BootstrapTemplate for a MachinePool. + TemplateRef *ClusterClassTemplateReferenceApplyConfiguration `json:"templateRef,omitempty"` +} + +// MachinePoolClassBootstrapTemplateApplyConfiguration constructs a declarative configuration of the MachinePoolClassBootstrapTemplate type for use with +// apply. +func MachinePoolClassBootstrapTemplate() *MachinePoolClassBootstrapTemplateApplyConfiguration { + return &MachinePoolClassBootstrapTemplateApplyConfiguration{} +} + +// WithTemplateRef sets the TemplateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateRef field is set to the value of the last call. +func (b *MachinePoolClassBootstrapTemplateApplyConfiguration) WithTemplateRef(value *ClusterClassTemplateReferenceApplyConfiguration) *MachinePoolClassBootstrapTemplateApplyConfiguration { + b.TemplateRef = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclassinfrastructuretemplate.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclassinfrastructuretemplate.go new file mode 100644 index 000000000000..be2a0ddc962a --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclassinfrastructuretemplate.go @@ -0,0 +1,42 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachinePoolClassInfrastructureTemplateApplyConfiguration represents a declarative configuration of the MachinePoolClassInfrastructureTemplate type for use +// with apply. +// +// MachinePoolClassInfrastructureTemplate defines the InfrastructureTemplate for a MachinePool. +type MachinePoolClassInfrastructureTemplateApplyConfiguration struct { + // templateRef is a required reference to the InfrastructureTemplate for a MachinePool. + TemplateRef *ClusterClassTemplateReferenceApplyConfiguration `json:"templateRef,omitempty"` +} + +// MachinePoolClassInfrastructureTemplateApplyConfiguration constructs a declarative configuration of the MachinePoolClassInfrastructureTemplate type for use with +// apply. +func MachinePoolClassInfrastructureTemplate() *MachinePoolClassInfrastructureTemplateApplyConfiguration { + return &MachinePoolClassInfrastructureTemplateApplyConfiguration{} +} + +// WithTemplateRef sets the TemplateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TemplateRef field is set to the value of the last call. +func (b *MachinePoolClassInfrastructureTemplateApplyConfiguration) WithTemplateRef(value *ClusterClassTemplateReferenceApplyConfiguration) *MachinePoolClassInfrastructureTemplateApplyConfiguration { + b.TemplateRef = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclassmachinedeletionspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclassmachinedeletionspec.go new file mode 100644 index 000000000000..8da847d1e4c2 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclassmachinedeletionspec.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachinePoolClassMachineDeletionSpecApplyConfiguration represents a declarative configuration of the MachinePoolClassMachineDeletionSpec type for use +// with apply. +// +// MachinePoolClassMachineDeletionSpec contains configuration options for Machine deletion. +type MachinePoolClassMachineDeletionSpecApplyConfiguration struct { + // nodeDrainTimeoutSeconds is the total amount of time that the controller will spend on draining a node. + // The default value is 0, meaning that the node can be drained without any time limitations. + // NOTE: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass. + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass. + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine + // hosts after the Machine Pool is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass. + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// MachinePoolClassMachineDeletionSpecApplyConfiguration constructs a declarative configuration of the MachinePoolClassMachineDeletionSpec type for use with +// apply. +func MachinePoolClassMachineDeletionSpec() *MachinePoolClassMachineDeletionSpecApplyConfiguration { + return &MachinePoolClassMachineDeletionSpecApplyConfiguration{} +} + +// WithNodeDrainTimeoutSeconds sets the NodeDrainTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDrainTimeoutSeconds field is set to the value of the last call. +func (b *MachinePoolClassMachineDeletionSpecApplyConfiguration) WithNodeDrainTimeoutSeconds(value int32) *MachinePoolClassMachineDeletionSpecApplyConfiguration { + b.NodeDrainTimeoutSeconds = &value + return b +} + +// WithNodeVolumeDetachTimeoutSeconds sets the NodeVolumeDetachTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeVolumeDetachTimeoutSeconds field is set to the value of the last call. +func (b *MachinePoolClassMachineDeletionSpecApplyConfiguration) WithNodeVolumeDetachTimeoutSeconds(value int32) *MachinePoolClassMachineDeletionSpecApplyConfiguration { + b.NodeVolumeDetachTimeoutSeconds = &value + return b +} + +// WithNodeDeletionTimeoutSeconds sets the NodeDeletionTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDeletionTimeoutSeconds field is set to the value of the last call. +func (b *MachinePoolClassMachineDeletionSpecApplyConfiguration) WithNodeDeletionTimeoutSeconds(value int32) *MachinePoolClassMachineDeletionSpecApplyConfiguration { + b.NodeDeletionTimeoutSeconds = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclassnamingspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclassnamingspec.go new file mode 100644 index 000000000000..69dee015143d --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolclassnamingspec.go @@ -0,0 +1,49 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachinePoolClassNamingSpecApplyConfiguration represents a declarative configuration of the MachinePoolClassNamingSpec type for use +// with apply. +// +// MachinePoolClassNamingSpec defines the naming strategy for MachinePool objects. +type MachinePoolClassNamingSpecApplyConfiguration struct { + // template defines the template to use for generating the name of the MachinePool object. + // If not defined, it will fallback to `{{ .cluster.name }}-{{ .machinePool.topologyName }}-{{ .random }}`. + // If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will + // get concatenated with a random suffix of length 5. + // The templating mechanism provides the following arguments: + // * `.cluster.name`: The name of the cluster object. + // * `.random`: A random alphanumeric string, without vowels, of length 5. + // * `.machinePool.topologyName`: The name of the MachinePool topology (Cluster.spec.topology.workers.machinePools[].name). + Template *string `json:"template,omitempty"` +} + +// MachinePoolClassNamingSpecApplyConfiguration constructs a declarative configuration of the MachinePoolClassNamingSpec type for use with +// apply. +func MachinePoolClassNamingSpec() *MachinePoolClassNamingSpecApplyConfiguration { + return &MachinePoolClassNamingSpecApplyConfiguration{} +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *MachinePoolClassNamingSpecApplyConfiguration) WithTemplate(value string) *MachinePoolClassNamingSpecApplyConfiguration { + b.Template = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepooldeprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepooldeprecatedstatus.go new file mode 100644 index 000000000000..6b8f7ffc526a --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepooldeprecatedstatus.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachinePoolDeprecatedStatusApplyConfiguration represents a declarative configuration of the MachinePoolDeprecatedStatus type for use +// with apply. +// +// MachinePoolDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachinePoolDeprecatedStatusApplyConfiguration struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + V1Beta1 *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration `json:"v1beta1,omitempty"` +} + +// MachinePoolDeprecatedStatusApplyConfiguration constructs a declarative configuration of the MachinePoolDeprecatedStatus type for use with +// apply. +func MachinePoolDeprecatedStatus() *MachinePoolDeprecatedStatusApplyConfiguration { + return &MachinePoolDeprecatedStatusApplyConfiguration{} +} + +// WithV1Beta1 sets the V1Beta1 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the V1Beta1 field is set to the value of the last call. +func (b *MachinePoolDeprecatedStatusApplyConfiguration) WithV1Beta1(value *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration) *MachinePoolDeprecatedStatusApplyConfiguration { + b.V1Beta1 = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepoolinitializationstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolinitializationstatus.go new file mode 100644 index 000000000000..1d7bd36785f4 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolinitializationstatus.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachinePoolInitializationStatusApplyConfiguration represents a declarative configuration of the MachinePoolInitializationStatus type for use +// with apply. +// +// MachinePoolInitializationStatus provides observations of the MachinePool initialization process. +// NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial MachinePool provisioning. +type MachinePoolInitializationStatusApplyConfiguration struct { + // infrastructureProvisioned is true when the infrastructure provider reports that MachinePool's infrastructure is fully provisioned. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. + // The value of this field is never updated after provisioning is completed. + InfrastructureProvisioned *bool `json:"infrastructureProvisioned,omitempty"` + // bootstrapDataSecretCreated is true when the bootstrap provider reports that the MachinePool's boostrap secret is created. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. + // The value of this field is never updated after provisioning is completed. + BootstrapDataSecretCreated *bool `json:"bootstrapDataSecretCreated,omitempty"` +} + +// MachinePoolInitializationStatusApplyConfiguration constructs a declarative configuration of the MachinePoolInitializationStatus type for use with +// apply. +func MachinePoolInitializationStatus() *MachinePoolInitializationStatusApplyConfiguration { + return &MachinePoolInitializationStatusApplyConfiguration{} +} + +// WithInfrastructureProvisioned sets the InfrastructureProvisioned field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InfrastructureProvisioned field is set to the value of the last call. +func (b *MachinePoolInitializationStatusApplyConfiguration) WithInfrastructureProvisioned(value bool) *MachinePoolInitializationStatusApplyConfiguration { + b.InfrastructureProvisioned = &value + return b +} + +// WithBootstrapDataSecretCreated sets the BootstrapDataSecretCreated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BootstrapDataSecretCreated field is set to the value of the last call. +func (b *MachinePoolInitializationStatusApplyConfiguration) WithBootstrapDataSecretCreated(value bool) *MachinePoolInitializationStatusApplyConfiguration { + b.BootstrapDataSecretCreated = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepoolspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolspec.go new file mode 100644 index 000000000000..dbc71d6007bd --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolspec.go @@ -0,0 +1,121 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachinePoolSpecApplyConfiguration represents a declarative configuration of the MachinePoolSpec type for use +// with apply. +// +// NOTE: we are commenting const for MachinePool's V1Beta2 conditions and reasons because not yet implemented for the 1.9 CAPI release. +// However, we are keeping the v1beta2 struct in the MachinePool struct because the code that will collect conditions and replica +// counters at cluster level is already implemented. +// +// // Conditions that will be used for the MachinePool object in v1Beta2 API version. +// const ( +// // MachinePoolAvailableCondition is true when InfrastructureReady and available replicas >= desired replicas. +// MachinePoolAvailableCondition = clusterv1.AvailableCondition +// +// // MachinePoolBootstrapConfigReadyCondition mirrors the corresponding condition from the MachinePool's BootstrapConfig resource. +// MachinePoolBootstrapConfigReadyCondition = clusterv1.BootstrapConfigReadyCondition +// +// // MachinePoolInfrastructureReadyCondition mirrors the corresponding condition from the MachinePool's Infrastructure resource. +// MachinePoolInfrastructureReadyCondition = clusterv1.InfrastructureReadyCondition +// +// // MachinePoolMachinesReadyCondition surfaces detail of issues on the controlled machines, if any. +// MachinePoolMachinesReadyCondition = clusterv1.MachinesReadyCondition +// +// // MachinePoolMachinesUpToDateCondition surfaces details of controlled machines not up to date, if any. +// MachinePoolMachinesUpToDateCondition = clusterv1.MachinesUpToDateCondition +// +// // MachinePoolScalingUpCondition is true if available replicas < desired replicas. +// MachinePoolScalingUpCondition = clusterv1.ScalingUpCondition +// +// // MachinePoolScalingDownCondition is true if replicas > desired replicas. +// MachinePoolScalingDownCondition = clusterv1.ScalingDownCondition +// +// // MachinePoolRemediatingCondition surfaces details about ongoing remediation of the controlled machines, if any. +// MachinePoolRemediatingCondition = clusterv1.RemediatingCondition +// +// // MachinePoolDeletingCondition surfaces details about ongoing deletion of the controlled machines. +// MachinePoolDeletingCondition = clusterv1.DeletingCondition +// ). +// MachinePoolSpec defines the desired state of MachinePool. +type MachinePoolSpecApplyConfiguration struct { + // clusterName is the name of the Cluster this object belongs to. + ClusterName *string `json:"clusterName,omitempty"` + // replicas is the number of desired machines. Defaults to 1. + // This is a pointer to distinguish between explicit zero and not specified. + Replicas *int32 `json:"replicas,omitempty"` + // template describes the machines that will be created. + Template *MachineTemplateSpecApplyConfiguration `json:"template,omitempty"` + // providerIDList are the identification IDs of machine instances provided by the provider. + // This field must match the provider IDs as seen on the node objects corresponding to a machine pool's machine instances. + ProviderIDList []string `json:"providerIDList,omitempty"` + // failureDomains is the list of failure domains this MachinePool should be attached to. + FailureDomains []string `json:"failureDomains,omitempty"` +} + +// MachinePoolSpecApplyConfiguration constructs a declarative configuration of the MachinePoolSpec type for use with +// apply. +func MachinePoolSpec() *MachinePoolSpecApplyConfiguration { + return &MachinePoolSpecApplyConfiguration{} +} + +// WithClusterName sets the ClusterName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterName field is set to the value of the last call. +func (b *MachinePoolSpecApplyConfiguration) WithClusterName(value string) *MachinePoolSpecApplyConfiguration { + b.ClusterName = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *MachinePoolSpecApplyConfiguration) WithReplicas(value int32) *MachinePoolSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *MachinePoolSpecApplyConfiguration) WithTemplate(value *MachineTemplateSpecApplyConfiguration) *MachinePoolSpecApplyConfiguration { + b.Template = value + return b +} + +// WithProviderIDList adds the given value to the ProviderIDList field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ProviderIDList field. +func (b *MachinePoolSpecApplyConfiguration) WithProviderIDList(values ...string) *MachinePoolSpecApplyConfiguration { + for i := range values { + b.ProviderIDList = append(b.ProviderIDList, values[i]) + } + return b +} + +// WithFailureDomains adds the given value to the FailureDomains field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the FailureDomains field. +func (b *MachinePoolSpecApplyConfiguration) WithFailureDomains(values ...string) *MachinePoolSpecApplyConfiguration { + for i := range values { + b.FailureDomains = append(b.FailureDomains, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepoolstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolstatus.go new file mode 100644 index 000000000000..723c0d0bba0a --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolstatus.go @@ -0,0 +1,147 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachinePoolStatusApplyConfiguration represents a declarative configuration of the MachinePoolStatus type for use +// with apply. +// +// MachinePoolStatus defines the observed state of MachinePool. +type MachinePoolStatusApplyConfiguration struct { + // conditions represents the observations of a MachinePool's current state. + // Known condition types are Available, BootstrapConfigReady, InfrastructureReady, MachinesReady, MachinesUpToDate, + // ScalingUp, ScalingDown, Remediating, Deleting, Paused. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // initialization provides observations of the MachinePool initialization process. + // NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial MachinePool provisioning. + Initialization *MachinePoolInitializationStatusApplyConfiguration `json:"initialization,omitempty"` + // nodeRefs will point to the corresponding Nodes if it they exist. + NodeRefs []corev1.ObjectReference `json:"nodeRefs,omitempty"` + // replicas is the most recently observed number of replicas. + Replicas *int32 `json:"replicas,omitempty"` + // readyReplicas is the number of ready replicas for this MachinePool. A machine is considered ready when Machine's Ready condition is true. + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + // availableReplicas is the number of available replicas for this MachinePool. A machine is considered available when Machine's Available condition is true. + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + // upToDateReplicas is the number of up-to-date replicas targeted by this MachinePool. A machine is considered up-to-date when Machine's UpToDate condition is true. + UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` + // phase represents the current phase of cluster actuation. + Phase *string `json:"phase,omitempty"` + // observedGeneration is the latest generation observed by the controller. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + Deprecated *MachinePoolDeprecatedStatusApplyConfiguration `json:"deprecated,omitempty"` +} + +// MachinePoolStatusApplyConfiguration constructs a declarative configuration of the MachinePoolStatus type for use with +// apply. +func MachinePoolStatus() *MachinePoolStatusApplyConfiguration { + return &MachinePoolStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *MachinePoolStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *MachinePoolStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithInitialization sets the Initialization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Initialization field is set to the value of the last call. +func (b *MachinePoolStatusApplyConfiguration) WithInitialization(value *MachinePoolInitializationStatusApplyConfiguration) *MachinePoolStatusApplyConfiguration { + b.Initialization = value + return b +} + +// WithNodeRefs adds the given value to the NodeRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the NodeRefs field. +func (b *MachinePoolStatusApplyConfiguration) WithNodeRefs(values ...corev1.ObjectReference) *MachinePoolStatusApplyConfiguration { + for i := range values { + b.NodeRefs = append(b.NodeRefs, values[i]) + } + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *MachinePoolStatusApplyConfiguration) WithReplicas(value int32) *MachinePoolStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *MachinePoolStatusApplyConfiguration) WithReadyReplicas(value int32) *MachinePoolStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *MachinePoolStatusApplyConfiguration) WithAvailableReplicas(value int32) *MachinePoolStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithUpToDateReplicas sets the UpToDateReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpToDateReplicas field is set to the value of the last call. +func (b *MachinePoolStatusApplyConfiguration) WithUpToDateReplicas(value int32) *MachinePoolStatusApplyConfiguration { + b.UpToDateReplicas = &value + return b +} + +// WithPhase sets the Phase field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Phase field is set to the value of the last call. +func (b *MachinePoolStatusApplyConfiguration) WithPhase(value string) *MachinePoolStatusApplyConfiguration { + b.Phase = &value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *MachinePoolStatusApplyConfiguration) WithObservedGeneration(value int64) *MachinePoolStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithDeprecated sets the Deprecated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deprecated field is set to the value of the last call. +func (b *MachinePoolStatusApplyConfiguration) WithDeprecated(value *MachinePoolDeprecatedStatusApplyConfiguration) *MachinePoolStatusApplyConfiguration { + b.Deprecated = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepooltopology.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepooltopology.go new file mode 100644 index 000000000000..5833373b5a7f --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepooltopology.go @@ -0,0 +1,128 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachinePoolTopologyApplyConfiguration represents a declarative configuration of the MachinePoolTopology type for use +// with apply. +// +// MachinePoolTopology specifies the different parameters for a pool of worker nodes in the topology. +// This pool of nodes is managed by a MachinePool object whose lifecycle is managed by the Cluster controller. +type MachinePoolTopologyApplyConfiguration struct { + // metadata is the metadata applied to the MachinePool. + // At runtime this metadata is merged with the corresponding metadata from the ClusterClass. + Metadata *ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // class is the name of the MachinePoolClass used to create the pool of worker nodes. + // This should match one of the deployment classes defined in the ClusterClass object + // mentioned in the `Cluster.Spec.Class` field. + Class *string `json:"class,omitempty"` + // name is the unique identifier for this MachinePoolTopology. + // The value is used with other unique identifiers to create a MachinePool's Name + // (e.g. cluster's name, etc). In case the name is greater than the allowed maximum length, + // the values are hashed together. + Name *string `json:"name,omitempty"` + // failureDomains is the list of failure domains the machine pool will be created in. + // Must match a key in the FailureDomains map stored on the cluster object. + FailureDomains []string `json:"failureDomains,omitempty"` + // deletion contains configuration options for Machine deletion. + Deletion *MachinePoolTopologyMachineDeletionSpecApplyConfiguration `json:"deletion,omitempty"` + // minReadySeconds is the minimum number of seconds for which a newly created machine pool should + // be ready. + // Defaults to 0 (machine will be considered available as soon as it + // is ready) + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + // replicas is the number of nodes belonging to this pool. + // If the value is nil, the MachinePool is created without the number of Replicas (defaulting to 1) + // and it's assumed that an external entity (like cluster autoscaler) is responsible for the management + // of this value. + Replicas *int32 `json:"replicas,omitempty"` + // variables can be used to customize the MachinePool through patches. + Variables *MachinePoolVariablesApplyConfiguration `json:"variables,omitempty"` +} + +// MachinePoolTopologyApplyConfiguration constructs a declarative configuration of the MachinePoolTopology type for use with +// apply. +func MachinePoolTopology() *MachinePoolTopologyApplyConfiguration { + return &MachinePoolTopologyApplyConfiguration{} +} + +// WithMetadata sets the Metadata field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Metadata field is set to the value of the last call. +func (b *MachinePoolTopologyApplyConfiguration) WithMetadata(value *ObjectMetaApplyConfiguration) *MachinePoolTopologyApplyConfiguration { + b.Metadata = value + return b +} + +// WithClass sets the Class field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Class field is set to the value of the last call. +func (b *MachinePoolTopologyApplyConfiguration) WithClass(value string) *MachinePoolTopologyApplyConfiguration { + b.Class = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachinePoolTopologyApplyConfiguration) WithName(value string) *MachinePoolTopologyApplyConfiguration { + b.Name = &value + return b +} + +// WithFailureDomains adds the given value to the FailureDomains field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the FailureDomains field. +func (b *MachinePoolTopologyApplyConfiguration) WithFailureDomains(values ...string) *MachinePoolTopologyApplyConfiguration { + for i := range values { + b.FailureDomains = append(b.FailureDomains, values[i]) + } + return b +} + +// WithDeletion sets the Deletion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deletion field is set to the value of the last call. +func (b *MachinePoolTopologyApplyConfiguration) WithDeletion(value *MachinePoolTopologyMachineDeletionSpecApplyConfiguration) *MachinePoolTopologyApplyConfiguration { + b.Deletion = value + return b +} + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *MachinePoolTopologyApplyConfiguration) WithMinReadySeconds(value int32) *MachinePoolTopologyApplyConfiguration { + b.MinReadySeconds = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *MachinePoolTopologyApplyConfiguration) WithReplicas(value int32) *MachinePoolTopologyApplyConfiguration { + b.Replicas = &value + return b +} + +// WithVariables sets the Variables field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Variables field is set to the value of the last call. +func (b *MachinePoolTopologyApplyConfiguration) WithVariables(value *MachinePoolVariablesApplyConfiguration) *MachinePoolTopologyApplyConfiguration { + b.Variables = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepooltopologymachinedeletionspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepooltopologymachinedeletionspec.go new file mode 100644 index 000000000000..c53961533eab --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepooltopologymachinedeletionspec.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachinePoolTopologyMachineDeletionSpecApplyConfiguration represents a declarative configuration of the MachinePoolTopologyMachineDeletionSpec type for use +// with apply. +// +// MachinePoolTopologyMachineDeletionSpec contains configuration options for Machine deletion. +type MachinePoolTopologyMachineDeletionSpecApplyConfiguration struct { + // nodeDrainTimeoutSeconds is the total amount of time that the controller will spend on draining a node. + // The default value is 0, meaning that the node can be drained without any time limitations. + // NOTE: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the MachinePool + // hosts after the MachinePool is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// MachinePoolTopologyMachineDeletionSpecApplyConfiguration constructs a declarative configuration of the MachinePoolTopologyMachineDeletionSpec type for use with +// apply. +func MachinePoolTopologyMachineDeletionSpec() *MachinePoolTopologyMachineDeletionSpecApplyConfiguration { + return &MachinePoolTopologyMachineDeletionSpecApplyConfiguration{} +} + +// WithNodeDrainTimeoutSeconds sets the NodeDrainTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDrainTimeoutSeconds field is set to the value of the last call. +func (b *MachinePoolTopologyMachineDeletionSpecApplyConfiguration) WithNodeDrainTimeoutSeconds(value int32) *MachinePoolTopologyMachineDeletionSpecApplyConfiguration { + b.NodeDrainTimeoutSeconds = &value + return b +} + +// WithNodeVolumeDetachTimeoutSeconds sets the NodeVolumeDetachTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeVolumeDetachTimeoutSeconds field is set to the value of the last call. +func (b *MachinePoolTopologyMachineDeletionSpecApplyConfiguration) WithNodeVolumeDetachTimeoutSeconds(value int32) *MachinePoolTopologyMachineDeletionSpecApplyConfiguration { + b.NodeVolumeDetachTimeoutSeconds = &value + return b +} + +// WithNodeDeletionTimeoutSeconds sets the NodeDeletionTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDeletionTimeoutSeconds field is set to the value of the last call. +func (b *MachinePoolTopologyMachineDeletionSpecApplyConfiguration) WithNodeDeletionTimeoutSeconds(value int32) *MachinePoolTopologyMachineDeletionSpecApplyConfiguration { + b.NodeDeletionTimeoutSeconds = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepoolv1beta1deprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolv1beta1deprecatedstatus.go new file mode 100644 index 000000000000..05c2ad28616d --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolv1beta1deprecatedstatus.go @@ -0,0 +1,116 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + errors "sigs.k8s.io/cluster-api/errors" +) + +// MachinePoolV1Beta1DeprecatedStatusApplyConfiguration represents a declarative configuration of the MachinePoolV1Beta1DeprecatedStatus type for use +// with apply. +// +// MachinePoolV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachinePoolV1Beta1DeprecatedStatusApplyConfiguration struct { + // conditions define the current service state of the MachinePool. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + Conditions *corev1beta2.Conditions `json:"conditions,omitempty"` + // failureReason indicates that there is a problem reconciling the state, and + // will be set to a token value suitable for programmatic interpretation. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + FailureReason *errors.MachinePoolStatusFailure `json:"failureReason,omitempty"` + // failureMessage indicates that there is a problem reconciling the state, + // and will be set to a descriptive error message. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + FailureMessage *string `json:"failureMessage,omitempty"` + // readyReplicas is the number of ready replicas for this MachinePool. A machine is considered ready when the node has been created and is "Ready". + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + // availableReplicas is the number of available replicas (ready for at least minReadySeconds) for this MachinePool. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + // unavailableReplicas is the total number of unavailable machine instances targeted by this machine pool. + // This is the total number of machine instances that are still required for + // the machine pool to have 100% available capacity. They may either + // be machine instances that are running but not yet available or machine instances + // that still have not been created. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` +} + +// MachinePoolV1Beta1DeprecatedStatusApplyConfiguration constructs a declarative configuration of the MachinePoolV1Beta1DeprecatedStatus type for use with +// apply. +func MachinePoolV1Beta1DeprecatedStatus() *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration { + return &MachinePoolV1Beta1DeprecatedStatusApplyConfiguration{} +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration) WithConditions(value corev1beta2.Conditions) *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration { + b.Conditions = &value + return b +} + +// WithFailureReason sets the FailureReason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureReason field is set to the value of the last call. +func (b *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration) WithFailureReason(value errors.MachinePoolStatusFailure) *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration { + b.FailureReason = &value + return b +} + +// WithFailureMessage sets the FailureMessage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureMessage field is set to the value of the last call. +func (b *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration) WithFailureMessage(value string) *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration { + b.FailureMessage = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration) WithReadyReplicas(value int32) *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration) WithAvailableReplicas(value int32) *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithUnavailableReplicas sets the UnavailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnavailableReplicas field is set to the value of the last call. +func (b *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration) WithUnavailableReplicas(value int32) *MachinePoolV1Beta1DeprecatedStatusApplyConfiguration { + b.UnavailableReplicas = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinepoolvariables.go b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolvariables.go new file mode 100644 index 000000000000..63cb7219d101 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinepoolvariables.go @@ -0,0 +1,47 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachinePoolVariablesApplyConfiguration represents a declarative configuration of the MachinePoolVariables type for use +// with apply. +// +// MachinePoolVariables can be used to provide variables for a specific MachinePool. +type MachinePoolVariablesApplyConfiguration struct { + // overrides can be used to override Cluster level variables. + Overrides []ClusterVariableApplyConfiguration `json:"overrides,omitempty"` +} + +// MachinePoolVariablesApplyConfiguration constructs a declarative configuration of the MachinePoolVariables type for use with +// apply. +func MachinePoolVariables() *MachinePoolVariablesApplyConfiguration { + return &MachinePoolVariablesApplyConfiguration{} +} + +// WithOverrides adds the given value to the Overrides field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Overrides field. +func (b *MachinePoolVariablesApplyConfiguration) WithOverrides(values ...*ClusterVariableApplyConfiguration) *MachinePoolVariablesApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOverrides") + } + b.Overrides = append(b.Overrides, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinereadinessgate.go b/pkg/generated/applyconfiguration/core/v1beta2/machinereadinessgate.go new file mode 100644 index 000000000000..02c5df4fa865 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinereadinessgate.go @@ -0,0 +1,62 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineReadinessGateApplyConfiguration represents a declarative configuration of the MachineReadinessGate type for use +// with apply. +// +// MachineReadinessGate contains the type of a Machine condition to be used as a readiness gate. +type MachineReadinessGateApplyConfiguration struct { + // conditionType refers to a condition with matching type in the Machine's condition list. + // If the conditions doesn't exist, it will be treated as unknown. + // Note: Both Cluster API conditions or conditions added by 3rd party controllers can be used as readiness gates. + ConditionType *string `json:"conditionType,omitempty"` + // polarity of the conditionType specified in this readinessGate. + // Valid values are Positive, Negative and omitted. + // When omitted, the default behaviour will be Positive. + // A positive polarity means that the condition should report a true status under normal conditions. + // A negative polarity means that the condition should report a false status under normal conditions. + Polarity *corev1beta2.ConditionPolarity `json:"polarity,omitempty"` +} + +// MachineReadinessGateApplyConfiguration constructs a declarative configuration of the MachineReadinessGate type for use with +// apply. +func MachineReadinessGate() *MachineReadinessGateApplyConfiguration { + return &MachineReadinessGateApplyConfiguration{} +} + +// WithConditionType sets the ConditionType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConditionType field is set to the value of the last call. +func (b *MachineReadinessGateApplyConfiguration) WithConditionType(value string) *MachineReadinessGateApplyConfiguration { + b.ConditionType = &value + return b +} + +// WithPolarity sets the Polarity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Polarity field is set to the value of the last call. +func (b *MachineReadinessGateApplyConfiguration) WithPolarity(value corev1beta2.ConditionPolarity) *MachineReadinessGateApplyConfiguration { + b.Polarity = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machineset.go b/pkg/generated/applyconfiguration/core/v1beta2/machineset.go new file mode 100644 index 000000000000..fa483e3e89b4 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machineset.go @@ -0,0 +1,249 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineSetApplyConfiguration represents a declarative configuration of the MachineSet type for use +// with apply. +// +// MachineSet is the Schema for the machinesets API. +type MachineSetApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is the desired state of MachineSet. + Spec *MachineSetSpecApplyConfiguration `json:"spec,omitempty"` + // status is the observed state of MachineSet. + Status *MachineSetStatusApplyConfiguration `json:"status,omitempty"` +} + +// MachineSet constructs a declarative configuration of the MachineSet type for use with +// apply. +func MachineSet(name, namespace string) *MachineSetApplyConfiguration { + b := &MachineSetApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("MachineSet") + b.WithAPIVersion("cluster.x-k8s.io/v1beta2") + return b +} + +func (b MachineSetApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithKind(value string) *MachineSetApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithAPIVersion(value string) *MachineSetApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithName(value string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithGenerateName(value string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithNamespace(value string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithUID(value types.UID) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithResourceVersion(value string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithGeneration(value int64) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MachineSetApplyConfiguration) WithLabels(entries map[string]string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MachineSetApplyConfiguration) WithAnnotations(entries map[string]string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *MachineSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *MachineSetApplyConfiguration) WithFinalizers(values ...string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *MachineSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithSpec(value *MachineSetSpecApplyConfiguration) *MachineSetApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithStatus(value *MachineSetStatusApplyConfiguration) *MachineSetApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *MachineSetApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *MachineSetApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *MachineSetApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *MachineSetApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinesetdeletionspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinesetdeletionspec.go new file mode 100644 index 000000000000..30a1782ff625 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinesetdeletionspec.go @@ -0,0 +1,47 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineSetDeletionSpecApplyConfiguration represents a declarative configuration of the MachineSetDeletionSpec type for use +// with apply. +// +// MachineSetDeletionSpec contains configuration options for MachineSet deletion. +type MachineSetDeletionSpecApplyConfiguration struct { + // order defines the order in which Machines are deleted when downscaling. + // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" + Order *corev1beta2.MachineSetDeletionOrder `json:"order,omitempty"` +} + +// MachineSetDeletionSpecApplyConfiguration constructs a declarative configuration of the MachineSetDeletionSpec type for use with +// apply. +func MachineSetDeletionSpec() *MachineSetDeletionSpecApplyConfiguration { + return &MachineSetDeletionSpecApplyConfiguration{} +} + +// WithOrder sets the Order field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Order field is set to the value of the last call. +func (b *MachineSetDeletionSpecApplyConfiguration) WithOrder(value corev1beta2.MachineSetDeletionOrder) *MachineSetDeletionSpecApplyConfiguration { + b.Order = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinesetdeprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinesetdeprecatedstatus.go new file mode 100644 index 000000000000..ad4249e250b0 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinesetdeprecatedstatus.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineSetDeprecatedStatusApplyConfiguration represents a declarative configuration of the MachineSetDeprecatedStatus type for use +// with apply. +// +// MachineSetDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineSetDeprecatedStatusApplyConfiguration struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + V1Beta1 *MachineSetV1Beta1DeprecatedStatusApplyConfiguration `json:"v1beta1,omitempty"` +} + +// MachineSetDeprecatedStatusApplyConfiguration constructs a declarative configuration of the MachineSetDeprecatedStatus type for use with +// apply. +func MachineSetDeprecatedStatus() *MachineSetDeprecatedStatusApplyConfiguration { + return &MachineSetDeprecatedStatusApplyConfiguration{} +} + +// WithV1Beta1 sets the V1Beta1 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the V1Beta1 field is set to the value of the last call. +func (b *MachineSetDeprecatedStatusApplyConfiguration) WithV1Beta1(value *MachineSetV1Beta1DeprecatedStatusApplyConfiguration) *MachineSetDeprecatedStatusApplyConfiguration { + b.V1Beta1 = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinesetspec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinesetspec.go new file mode 100644 index 000000000000..6d7d0ffa5703 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinesetspec.go @@ -0,0 +1,118 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineSetSpecApplyConfiguration represents a declarative configuration of the MachineSetSpec type for use +// with apply. +// +// MachineSetSpec defines the desired state of MachineSet. +type MachineSetSpecApplyConfiguration struct { + // clusterName is the name of the Cluster this object belongs to. + ClusterName *string `json:"clusterName,omitempty"` + // replicas is the number of desired replicas. + // This is a pointer to distinguish between explicit zero and unspecified. + // + // Defaults to: + // * if the Kubernetes autoscaler min size and max size annotations are set: + // - if it's a new MachineSet, use min size + // - if the replicas field of the old MachineSet is < min size, use min size + // - if the replicas field of the old MachineSet is > max size, use max size + // - if the replicas field of the old MachineSet is in the (min size, max size) range, keep the value from the oldMS + // * otherwise use 1 + // Note: Defaulting will be run whenever the replicas field is not set: + // * A new MachineSet is created with replicas not set. + // * On an existing MachineSet the replicas field was first set and is now unset. + // Those cases are especially relevant for the following Kubernetes autoscaler use cases: + // * A new MachineSet is created and replicas should be managed by the autoscaler + // * An existing MachineSet which initially wasn't controlled by the autoscaler + // should be later controlled by the autoscaler + Replicas *int32 `json:"replicas,omitempty"` + // selector is a label query over machines that should match the replica count. + // Label keys and values that must match in order to be controlled by this MachineSet. + // It must match the machine template's labels. + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` + // template is the object that describes the machine that will be created if + // insufficient replicas are detected. + // Object references to custom resources are treated as templates. + Template *MachineTemplateSpecApplyConfiguration `json:"template,omitempty"` + // machineNaming allows changing the naming pattern used when creating Machines. + // Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines. + MachineNaming *MachineNamingSpecApplyConfiguration `json:"machineNaming,omitempty"` + // deletion contains configuration options for MachineSet deletion. + Deletion *MachineSetDeletionSpecApplyConfiguration `json:"deletion,omitempty"` +} + +// MachineSetSpecApplyConfiguration constructs a declarative configuration of the MachineSetSpec type for use with +// apply. +func MachineSetSpec() *MachineSetSpecApplyConfiguration { + return &MachineSetSpecApplyConfiguration{} +} + +// WithClusterName sets the ClusterName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterName field is set to the value of the last call. +func (b *MachineSetSpecApplyConfiguration) WithClusterName(value string) *MachineSetSpecApplyConfiguration { + b.ClusterName = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *MachineSetSpecApplyConfiguration) WithReplicas(value int32) *MachineSetSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *MachineSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *MachineSetSpecApplyConfiguration { + b.Selector = value + return b +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *MachineSetSpecApplyConfiguration) WithTemplate(value *MachineTemplateSpecApplyConfiguration) *MachineSetSpecApplyConfiguration { + b.Template = value + return b +} + +// WithMachineNaming sets the MachineNaming field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MachineNaming field is set to the value of the last call. +func (b *MachineSetSpecApplyConfiguration) WithMachineNaming(value *MachineNamingSpecApplyConfiguration) *MachineSetSpecApplyConfiguration { + b.MachineNaming = value + return b +} + +// WithDeletion sets the Deletion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deletion field is set to the value of the last call. +func (b *MachineSetSpecApplyConfiguration) WithDeletion(value *MachineSetDeletionSpecApplyConfiguration) *MachineSetSpecApplyConfiguration { + b.Deletion = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinesetstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinesetstatus.go new file mode 100644 index 000000000000..ef4b0797ab83 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinesetstatus.go @@ -0,0 +1,124 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineSetStatusApplyConfiguration represents a declarative configuration of the MachineSetStatus type for use +// with apply. +// +// MachineSetStatus defines the observed state of MachineSet. +type MachineSetStatusApplyConfiguration struct { + // conditions represents the observations of a MachineSet's current state. + // Known condition types are MachinesReady, MachinesUpToDate, ScalingUp, ScalingDown, Remediating, Deleting, Paused. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // selector is the same as the label selector but in the string format to avoid introspection + // by clients. The string will be in the same format as the query-param syntax. + // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors + Selector *string `json:"selector,omitempty"` + // replicas is the most recently observed number of replicas. + Replicas *int32 `json:"replicas,omitempty"` + // readyReplicas is the number of ready replicas for this MachineSet. A machine is considered ready when Machine's Ready condition is true. + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + // availableReplicas is the number of available replicas for this MachineSet. A machine is considered available when Machine's Available condition is true. + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + // upToDateReplicas is the number of up-to-date replicas for this MachineSet. A machine is considered up-to-date when Machine's UpToDate condition is true. + UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` + // observedGeneration reflects the generation of the most recently observed MachineSet. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + Deprecated *MachineSetDeprecatedStatusApplyConfiguration `json:"deprecated,omitempty"` +} + +// MachineSetStatusApplyConfiguration constructs a declarative configuration of the MachineSetStatus type for use with +// apply. +func MachineSetStatus() *MachineSetStatusApplyConfiguration { + return &MachineSetStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *MachineSetStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *MachineSetStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithSelector(value string) *MachineSetStatusApplyConfiguration { + b.Selector = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithReplicas(value int32) *MachineSetStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithReadyReplicas(value int32) *MachineSetStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithAvailableReplicas(value int32) *MachineSetStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithUpToDateReplicas sets the UpToDateReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpToDateReplicas field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithUpToDateReplicas(value int32) *MachineSetStatusApplyConfiguration { + b.UpToDateReplicas = &value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithObservedGeneration(value int64) *MachineSetStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithDeprecated sets the Deprecated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deprecated field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithDeprecated(value *MachineSetDeprecatedStatusApplyConfiguration) *MachineSetStatusApplyConfiguration { + b.Deprecated = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinesetv1beta1deprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinesetv1beta1deprecatedstatus.go new file mode 100644 index 000000000000..7bc33db06395 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinesetv1beta1deprecatedstatus.go @@ -0,0 +1,133 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + errors "sigs.k8s.io/cluster-api/errors" +) + +// MachineSetV1Beta1DeprecatedStatusApplyConfiguration represents a declarative configuration of the MachineSetV1Beta1DeprecatedStatus type for use +// with apply. +// +// MachineSetV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineSetV1Beta1DeprecatedStatusApplyConfiguration struct { + // conditions defines current service state of the MachineSet. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + Conditions *corev1beta2.Conditions `json:"conditions,omitempty"` + // failureReason will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a succinct value suitable + // for machine interpretation. + // + // In the event that there is a terminal problem reconciling the + // replicas, both FailureReason and FailureMessage will be set. FailureReason + // will be populated with a succinct value suitable for machine + // interpretation, while FailureMessage will contain a more verbose + // string suitable for logging and human consumption. + // + // These fields should not be set for transitive errors that a + // controller faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the MachineTemplate's spec or the configuration of + // the machine controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the machine controller, or the + // responsible machine controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the MachineSet object and/or logged in the + // controller's output. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + FailureReason *errors.MachineSetStatusError `json:"failureReason,omitempty"` + // failureMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + FailureMessage *string `json:"failureMessage,omitempty"` + // fullyLabeledReplicas is the number of replicas that have labels matching the labels of the machine template of the MachineSet. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + FullyLabeledReplicas *int32 `json:"fullyLabeledReplicas,omitempty"` + // readyReplicas is the number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready". + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + // availableReplicas is the number of available replicas (ready for at least minReadySeconds) for this MachineSet. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` +} + +// MachineSetV1Beta1DeprecatedStatusApplyConfiguration constructs a declarative configuration of the MachineSetV1Beta1DeprecatedStatus type for use with +// apply. +func MachineSetV1Beta1DeprecatedStatus() *MachineSetV1Beta1DeprecatedStatusApplyConfiguration { + return &MachineSetV1Beta1DeprecatedStatusApplyConfiguration{} +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *MachineSetV1Beta1DeprecatedStatusApplyConfiguration) WithConditions(value corev1beta2.Conditions) *MachineSetV1Beta1DeprecatedStatusApplyConfiguration { + b.Conditions = &value + return b +} + +// WithFailureReason sets the FailureReason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureReason field is set to the value of the last call. +func (b *MachineSetV1Beta1DeprecatedStatusApplyConfiguration) WithFailureReason(value errors.MachineSetStatusError) *MachineSetV1Beta1DeprecatedStatusApplyConfiguration { + b.FailureReason = &value + return b +} + +// WithFailureMessage sets the FailureMessage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureMessage field is set to the value of the last call. +func (b *MachineSetV1Beta1DeprecatedStatusApplyConfiguration) WithFailureMessage(value string) *MachineSetV1Beta1DeprecatedStatusApplyConfiguration { + b.FailureMessage = &value + return b +} + +// WithFullyLabeledReplicas sets the FullyLabeledReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FullyLabeledReplicas field is set to the value of the last call. +func (b *MachineSetV1Beta1DeprecatedStatusApplyConfiguration) WithFullyLabeledReplicas(value int32) *MachineSetV1Beta1DeprecatedStatusApplyConfiguration { + b.FullyLabeledReplicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *MachineSetV1Beta1DeprecatedStatusApplyConfiguration) WithReadyReplicas(value int32) *MachineSetV1Beta1DeprecatedStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *MachineSetV1Beta1DeprecatedStatusApplyConfiguration) WithAvailableReplicas(value int32) *MachineSetV1Beta1DeprecatedStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinespec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinespec.go new file mode 100644 index 000000000000..9f5e1d411c18 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinespec.go @@ -0,0 +1,176 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineSpecApplyConfiguration represents a declarative configuration of the MachineSpec type for use +// with apply. +// +// MachineSpec defines the desired state of Machine. +type MachineSpecApplyConfiguration struct { + // clusterName is the name of the Cluster this object belongs to. + ClusterName *string `json:"clusterName,omitempty"` + // bootstrap is a reference to a local struct which encapsulates + // fields to configure the Machine’s bootstrapping mechanism. + Bootstrap *BootstrapApplyConfiguration `json:"bootstrap,omitempty"` + // infrastructureRef is a required reference to a custom resource + // offered by an infrastructure provider. + InfrastructureRef *ContractVersionedObjectReferenceApplyConfiguration `json:"infrastructureRef,omitempty"` + // version defines the desired Kubernetes version. + // This field is meant to be optionally used by bootstrap providers. + Version *string `json:"version,omitempty"` + // providerID is the identification ID of the machine provided by the provider. + // This field must match the provider ID as seen on the node object corresponding to this machine. + // This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler + // with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out + // machines at provider which could not get registered as Kubernetes nodes. With cluster-api as a + // generic out-of-tree provider for autoscaler, this field is required by autoscaler to be + // able to have a provider view of the list of machines. Another list of nodes is queried from the k8s apiserver + // and then a comparison is done to find out unregistered machines and are marked for delete. + // This field will be set by the actuators and consumed by higher level entities like autoscaler that will + // be interfacing with cluster-api as generic provider. + ProviderID *string `json:"providerID,omitempty"` + // failureDomain is the failure domain the machine will be created in. + // Must match the name of a FailureDomain from the Cluster status. + FailureDomain *string `json:"failureDomain,omitempty"` + // minReadySeconds is the minimum number of seconds for which a Machine should be ready before considering it available. + // Defaults to 0 (Machine will be considered available as soon as the Machine is ready) + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + // readinessGates specifies additional conditions to include when evaluating Machine Ready condition. + // + // This field can be used e.g. by Cluster API control plane providers to extend the semantic of the + // Ready condition for the Machine they control, like the kubeadm control provider adding ReadinessGates + // for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc. + // + // Another example are external controllers, e.g. responsible to install special software/hardware on the Machines; + // they can include the status of those components with a new condition and add this condition to ReadinessGates. + // + // NOTE: In case readinessGates conditions start with the APIServer, ControllerManager, Scheduler prefix, and all those + // readiness gates condition are reporting the same message, when computing the Machine's Ready condition those + // readinessGates will be replaced by a single entry reporting "Control plane components: " + message. + // This helps to improve readability of conditions bubbling up to the Machine's owner resource / to the Cluster). + ReadinessGates []MachineReadinessGateApplyConfiguration `json:"readinessGates,omitempty"` + // deletion contains configuration options for Machine deletion. + Deletion *MachineDeletionSpecApplyConfiguration `json:"deletion,omitempty"` + // taints are the node taints that Cluster API will manage. + // This list is not necessarily complete: other Kubernetes components may add or remove other taints from nodes, + // e.g. the node controller might add the node.kubernetes.io/not-ready taint. + // Only those taints defined in this list will be added or removed by core Cluster API controllers. + // + // There can be at most 64 taints. + // A pod would have to tolerate all existing taints to run on the corresponding node. + // + // NOTE: This list is implemented as a "map" type, meaning that individual elements can be managed by different owners. + Taints []MachineTaintApplyConfiguration `json:"taints,omitempty"` +} + +// MachineSpecApplyConfiguration constructs a declarative configuration of the MachineSpec type for use with +// apply. +func MachineSpec() *MachineSpecApplyConfiguration { + return &MachineSpecApplyConfiguration{} +} + +// WithClusterName sets the ClusterName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterName field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithClusterName(value string) *MachineSpecApplyConfiguration { + b.ClusterName = &value + return b +} + +// WithBootstrap sets the Bootstrap field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Bootstrap field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithBootstrap(value *BootstrapApplyConfiguration) *MachineSpecApplyConfiguration { + b.Bootstrap = value + return b +} + +// WithInfrastructureRef sets the InfrastructureRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InfrastructureRef field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithInfrastructureRef(value *ContractVersionedObjectReferenceApplyConfiguration) *MachineSpecApplyConfiguration { + b.InfrastructureRef = value + return b +} + +// WithVersion sets the Version field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Version field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithVersion(value string) *MachineSpecApplyConfiguration { + b.Version = &value + return b +} + +// WithProviderID sets the ProviderID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProviderID field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithProviderID(value string) *MachineSpecApplyConfiguration { + b.ProviderID = &value + return b +} + +// WithFailureDomain sets the FailureDomain field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureDomain field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithFailureDomain(value string) *MachineSpecApplyConfiguration { + b.FailureDomain = &value + return b +} + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithMinReadySeconds(value int32) *MachineSpecApplyConfiguration { + b.MinReadySeconds = &value + return b +} + +// WithReadinessGates adds the given value to the ReadinessGates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ReadinessGates field. +func (b *MachineSpecApplyConfiguration) WithReadinessGates(values ...*MachineReadinessGateApplyConfiguration) *MachineSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithReadinessGates") + } + b.ReadinessGates = append(b.ReadinessGates, *values[i]) + } + return b +} + +// WithDeletion sets the Deletion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deletion field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithDeletion(value *MachineDeletionSpecApplyConfiguration) *MachineSpecApplyConfiguration { + b.Deletion = value + return b +} + +// WithTaints adds the given value to the Taints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Taints field. +func (b *MachineSpecApplyConfiguration) WithTaints(values ...*MachineTaintApplyConfiguration) *MachineSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTaints") + } + b.Taints = append(b.Taints, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinestatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinestatus.go new file mode 100644 index 000000000000..85e5e24e92f4 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinestatus.go @@ -0,0 +1,164 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineStatusApplyConfiguration represents a declarative configuration of the MachineStatus type for use +// with apply. +// +// MachineStatus defines the observed state of Machine. +type MachineStatusApplyConfiguration struct { + // conditions represents the observations of a Machine's current state. + // Known condition types are Available, Ready, UpToDate, BootstrapConfigReady, InfrastructureReady, NodeReady, + // NodeHealthy, Updating, Deleting, Paused. + // If a MachineHealthCheck is targeting this machine, also HealthCheckSucceeded, OwnerRemediated conditions are added. + // Additionally control plane Machines controlled by KubeadmControlPlane will have following additional conditions: + // APIServerPodHealthy, ControllerManagerPodHealthy, SchedulerPodHealthy, EtcdPodHealthy, EtcdMemberHealthy. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // initialization provides observations of the Machine initialization process. + // NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Machine provisioning. + Initialization *MachineInitializationStatusApplyConfiguration `json:"initialization,omitempty"` + // nodeRef will point to the corresponding Node if it exists. + NodeRef *MachineNodeReferenceApplyConfiguration `json:"nodeRef,omitempty"` + // nodeInfo is a set of ids/uuids to uniquely identify the node. + // More info: https://kubernetes.io/docs/concepts/nodes/node/#info + NodeInfo *corev1.NodeSystemInfo `json:"nodeInfo,omitempty"` + // lastUpdated identifies when the phase of the Machine last transitioned. + LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` + // addresses is a list of addresses assigned to the machine. + // This field is copied from the infrastructure provider reference. + Addresses *corev1beta2.MachineAddresses `json:"addresses,omitempty"` + // phase represents the current phase of machine actuation. + Phase *string `json:"phase,omitempty"` + // certificatesExpiryDate is the expiry date of the machine certificates. + // This value is only set for control plane machines. + CertificatesExpiryDate *metav1.Time `json:"certificatesExpiryDate,omitempty"` + // observedGeneration is the latest generation observed by the controller. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + // deletion contains information relating to removal of the Machine. + // Only present when the Machine has a deletionTimestamp and drain or wait for volume detach started. + Deletion *MachineDeletionStatusApplyConfiguration `json:"deletion,omitempty"` + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + Deprecated *MachineDeprecatedStatusApplyConfiguration `json:"deprecated,omitempty"` +} + +// MachineStatusApplyConfiguration constructs a declarative configuration of the MachineStatus type for use with +// apply. +func MachineStatus() *MachineStatusApplyConfiguration { + return &MachineStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *MachineStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *MachineStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithInitialization sets the Initialization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Initialization field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithInitialization(value *MachineInitializationStatusApplyConfiguration) *MachineStatusApplyConfiguration { + b.Initialization = value + return b +} + +// WithNodeRef sets the NodeRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeRef field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithNodeRef(value *MachineNodeReferenceApplyConfiguration) *MachineStatusApplyConfiguration { + b.NodeRef = value + return b +} + +// WithNodeInfo sets the NodeInfo field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeInfo field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithNodeInfo(value corev1.NodeSystemInfo) *MachineStatusApplyConfiguration { + b.NodeInfo = &value + return b +} + +// WithLastUpdated sets the LastUpdated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastUpdated field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithLastUpdated(value metav1.Time) *MachineStatusApplyConfiguration { + b.LastUpdated = &value + return b +} + +// WithAddresses sets the Addresses field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Addresses field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithAddresses(value corev1beta2.MachineAddresses) *MachineStatusApplyConfiguration { + b.Addresses = &value + return b +} + +// WithPhase sets the Phase field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Phase field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithPhase(value string) *MachineStatusApplyConfiguration { + b.Phase = &value + return b +} + +// WithCertificatesExpiryDate sets the CertificatesExpiryDate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CertificatesExpiryDate field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithCertificatesExpiryDate(value metav1.Time) *MachineStatusApplyConfiguration { + b.CertificatesExpiryDate = &value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithObservedGeneration(value int64) *MachineStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithDeletion sets the Deletion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deletion field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithDeletion(value *MachineDeletionStatusApplyConfiguration) *MachineStatusApplyConfiguration { + b.Deletion = value + return b +} + +// WithDeprecated sets the Deprecated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deprecated field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithDeprecated(value *MachineDeprecatedStatusApplyConfiguration) *MachineStatusApplyConfiguration { + b.Deprecated = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinetaint.go b/pkg/generated/applyconfiguration/core/v1beta2/machinetaint.go new file mode 100644 index 000000000000..d566c215c23c --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinetaint.go @@ -0,0 +1,84 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/api/core/v1" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// MachineTaintApplyConfiguration represents a declarative configuration of the MachineTaint type for use +// with apply. +// +// MachineTaint defines a taint equivalent to corev1.Taint, but additionally having a propagation field. +type MachineTaintApplyConfiguration struct { + // key is the taint key to be applied to a node. + // Must be a valid qualified name of maximum size 63 characters + // with an optional subdomain prefix of maximum size 253 characters, + // separated by a `/`. + Key *string `json:"key,omitempty"` + // value is the taint value corresponding to the taint key. + // It must be a valid label value of maximum size 63 characters. + Value *string `json:"value,omitempty"` + // effect is the effect for the taint. Valid values are NoSchedule, PreferNoSchedule and NoExecute. + Effect *v1.TaintEffect `json:"effect,omitempty"` + // propagation defines how this taint should be propagated to nodes. + // Valid values are 'Always' and 'OnInitialization'. + // Always: The taint will be continuously reconciled. If it is not set for a node, it will be added during reconciliation. + // OnInitialization: The taint will be added during node initialization. If it gets removed from the node later on it will not get added again. + Propagation *corev1beta2.MachineTaintPropagation `json:"propagation,omitempty"` +} + +// MachineTaintApplyConfiguration constructs a declarative configuration of the MachineTaint type for use with +// apply. +func MachineTaint() *MachineTaintApplyConfiguration { + return &MachineTaintApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *MachineTaintApplyConfiguration) WithKey(value string) *MachineTaintApplyConfiguration { + b.Key = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *MachineTaintApplyConfiguration) WithValue(value string) *MachineTaintApplyConfiguration { + b.Value = &value + return b +} + +// WithEffect sets the Effect field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Effect field is set to the value of the last call. +func (b *MachineTaintApplyConfiguration) WithEffect(value v1.TaintEffect) *MachineTaintApplyConfiguration { + b.Effect = &value + return b +} + +// WithPropagation sets the Propagation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Propagation field is set to the value of the last call. +func (b *MachineTaintApplyConfiguration) WithPropagation(value corev1beta2.MachineTaintPropagation) *MachineTaintApplyConfiguration { + b.Propagation = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinetemplatespec.go b/pkg/generated/applyconfiguration/core/v1beta2/machinetemplatespec.go new file mode 100644 index 000000000000..b0f01293dae6 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinetemplatespec.go @@ -0,0 +1,82 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineTemplateSpecApplyConfiguration represents a declarative configuration of the MachineTemplateSpec type for use +// with apply. +// +// MachineTemplateSpec describes the data needed to create a Machine from a template. +type MachineTemplateSpecApplyConfiguration struct { + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is the specification of the desired behavior of the machine. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + Spec *MachineSpecApplyConfiguration `json:"spec,omitempty"` +} + +// MachineTemplateSpecApplyConfiguration constructs a declarative configuration of the MachineTemplateSpec type for use with +// apply. +func MachineTemplateSpec() *MachineTemplateSpecApplyConfiguration { + return &MachineTemplateSpecApplyConfiguration{} +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MachineTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *MachineTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MachineTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *MachineTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +func (b *MachineTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MachineTemplateSpecApplyConfiguration) WithSpec(value *MachineSpecApplyConfiguration) *MachineTemplateSpecApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/machinev1beta1deprecatedstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/machinev1beta1deprecatedstatus.go new file mode 100644 index 000000000000..ebd218a49a9b --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/machinev1beta1deprecatedstatus.go @@ -0,0 +1,104 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + errors "sigs.k8s.io/cluster-api/errors" +) + +// MachineV1Beta1DeprecatedStatusApplyConfiguration represents a declarative configuration of the MachineV1Beta1DeprecatedStatus type for use +// with apply. +// +// MachineV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineV1Beta1DeprecatedStatusApplyConfiguration struct { + // conditions defines current service state of the Machine. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + Conditions *corev1beta2.Conditions `json:"conditions,omitempty"` + // failureReason will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a succinct value suitable + // for machine interpretation. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"` + // failureMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + FailureMessage *string `json:"failureMessage,omitempty"` +} + +// MachineV1Beta1DeprecatedStatusApplyConfiguration constructs a declarative configuration of the MachineV1Beta1DeprecatedStatus type for use with +// apply. +func MachineV1Beta1DeprecatedStatus() *MachineV1Beta1DeprecatedStatusApplyConfiguration { + return &MachineV1Beta1DeprecatedStatusApplyConfiguration{} +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *MachineV1Beta1DeprecatedStatusApplyConfiguration) WithConditions(value corev1beta2.Conditions) *MachineV1Beta1DeprecatedStatusApplyConfiguration { + b.Conditions = &value + return b +} + +// WithFailureReason sets the FailureReason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureReason field is set to the value of the last call. +func (b *MachineV1Beta1DeprecatedStatusApplyConfiguration) WithFailureReason(value errors.MachineStatusError) *MachineV1Beta1DeprecatedStatusApplyConfiguration { + b.FailureReason = &value + return b +} + +// WithFailureMessage sets the FailureMessage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureMessage field is set to the value of the last call. +func (b *MachineV1Beta1DeprecatedStatusApplyConfiguration) WithFailureMessage(value string) *MachineV1Beta1DeprecatedStatusApplyConfiguration { + b.FailureMessage = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/networkranges.go b/pkg/generated/applyconfiguration/core/v1beta2/networkranges.go new file mode 100644 index 000000000000..acd92074b2a8 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/networkranges.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// NetworkRangesApplyConfiguration represents a declarative configuration of the NetworkRanges type for use +// with apply. +// +// NetworkRanges represents ranges of network addresses. +type NetworkRangesApplyConfiguration struct { + // cidrBlocks is a list of CIDR blocks. + CIDRBlocks []string `json:"cidrBlocks,omitempty"` +} + +// NetworkRangesApplyConfiguration constructs a declarative configuration of the NetworkRanges type for use with +// apply. +func NetworkRanges() *NetworkRangesApplyConfiguration { + return &NetworkRangesApplyConfiguration{} +} + +// WithCIDRBlocks adds the given value to the CIDRBlocks field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CIDRBlocks field. +func (b *NetworkRangesApplyConfiguration) WithCIDRBlocks(values ...string) *NetworkRangesApplyConfiguration { + for i := range values { + b.CIDRBlocks = append(b.CIDRBlocks, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/objectmeta.go b/pkg/generated/applyconfiguration/core/v1beta2/objectmeta.go new file mode 100644 index 000000000000..b6f50c48fd5b --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/objectmeta.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// ObjectMetaApplyConfiguration represents a declarative configuration of the ObjectMeta type for use +// with apply. +// +// 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. +// +// ObjectMeta is embedded in `Machine.Spec`, `MachineDeployment.Template` and `MachineSet.Template`, +// which are not top-level Kubernetes objects. Given that metav1.ObjectMeta has lots of special cases +// and read-only fields which end up in the generated CRD validation, having it as a subset simplifies +// the API and some issues that can impact user experience. +// +// During the [upgrade to controller-tools@v2](https://github.com/kubernetes-sigs/cluster-api/pull/1054) +// for v1alpha2, we noticed a failure would occur running Cluster API test suite against the new CRDs, +// specifically `spec.metadata.creationTimestamp in body must be of type string: "null"`. +// The investigation showed that `controller-tools@v2` behaves differently than its previous version +// when handling types from [metav1](k8s.io/apimachinery/pkg/apis/meta/v1) package. +// +// In more details, we found that embedded (non-top level) types that embedded `metav1.ObjectMeta` +// had validation properties, including for `creationTimestamp` (metav1.Time). +// The `metav1.Time` type specifies a custom json marshaller that, when IsZero() is true, returns `null` +// which breaks validation because the field isn't marked as nullable. +// +// In future versions, controller-tools@v2 might allow overriding the type and validation for embedded +// types. When that happens, this hack should be revisited. +type ObjectMetaApplyConfiguration 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 + 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 + Annotations map[string]string `json:"annotations,omitempty"` +} + +// ObjectMetaApplyConfiguration constructs a declarative configuration of the ObjectMeta type for use with +// apply. +func ObjectMeta() *ObjectMetaApplyConfiguration { + return &ObjectMetaApplyConfiguration{} +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ObjectMetaApplyConfiguration) WithLabels(entries map[string]string) *ObjectMetaApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ObjectMetaApplyConfiguration) WithAnnotations(entries map[string]string) *ObjectMetaApplyConfiguration { + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/patchdefinition.go b/pkg/generated/applyconfiguration/core/v1beta2/patchdefinition.go new file mode 100644 index 000000000000..83af1cedbbac --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/patchdefinition.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// PatchDefinitionApplyConfiguration represents a declarative configuration of the PatchDefinition type for use +// with apply. +// +// PatchDefinition defines a patch which is applied to customize the referenced templates. +type PatchDefinitionApplyConfiguration struct { + // selector defines on which templates the patch should be applied. + Selector *PatchSelectorApplyConfiguration `json:"selector,omitempty"` + // jsonPatches defines the patches which should be applied on the templates + // matching the selector. + // Note: Patches will be applied in the order of the array. + JSONPatches []JSONPatchApplyConfiguration `json:"jsonPatches,omitempty"` +} + +// PatchDefinitionApplyConfiguration constructs a declarative configuration of the PatchDefinition type for use with +// apply. +func PatchDefinition() *PatchDefinitionApplyConfiguration { + return &PatchDefinitionApplyConfiguration{} +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *PatchDefinitionApplyConfiguration) WithSelector(value *PatchSelectorApplyConfiguration) *PatchDefinitionApplyConfiguration { + b.Selector = value + return b +} + +// WithJSONPatches adds the given value to the JSONPatches field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the JSONPatches field. +func (b *PatchDefinitionApplyConfiguration) WithJSONPatches(values ...*JSONPatchApplyConfiguration) *PatchDefinitionApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithJSONPatches") + } + b.JSONPatches = append(b.JSONPatches, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/patchselector.go b/pkg/generated/applyconfiguration/core/v1beta2/patchselector.go new file mode 100644 index 000000000000..e5181fb754cc --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/patchselector.go @@ -0,0 +1,68 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// PatchSelectorApplyConfiguration represents a declarative configuration of the PatchSelector type for use +// with apply. +// +// PatchSelector defines on which templates the patch should be applied. +// Note: Matching on APIVersion and Kind is mandatory, to enforce that the patches are +// written for the correct version. The version of the references in the ClusterClass may +// be automatically updated during reconciliation if there is a newer version for the same contract. +// Note: The results of selection based on the individual fields are ANDed. +type PatchSelectorApplyConfiguration struct { + // apiVersion filters templates by apiVersion. + // apiVersion must be fully qualified domain name followed by / and a version. + APIVersion *string `json:"apiVersion,omitempty"` + // kind filters templates by kind. + // kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. + Kind *string `json:"kind,omitempty"` + // matchResources selects templates based on where they are referenced. + MatchResources *PatchSelectorMatchApplyConfiguration `json:"matchResources,omitempty"` +} + +// PatchSelectorApplyConfiguration constructs a declarative configuration of the PatchSelector type for use with +// apply. +func PatchSelector() *PatchSelectorApplyConfiguration { + return &PatchSelectorApplyConfiguration{} +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *PatchSelectorApplyConfiguration) WithAPIVersion(value string) *PatchSelectorApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PatchSelectorApplyConfiguration) WithKind(value string) *PatchSelectorApplyConfiguration { + b.Kind = &value + return b +} + +// WithMatchResources sets the MatchResources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MatchResources field is set to the value of the last call. +func (b *PatchSelectorApplyConfiguration) WithMatchResources(value *PatchSelectorMatchApplyConfiguration) *PatchSelectorApplyConfiguration { + b.MatchResources = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/patchselectormatch.go b/pkg/generated/applyconfiguration/core/v1beta2/patchselectormatch.go new file mode 100644 index 000000000000..d91d892fc66d --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/patchselectormatch.go @@ -0,0 +1,78 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// PatchSelectorMatchApplyConfiguration represents a declarative configuration of the PatchSelectorMatch type for use +// with apply. +// +// PatchSelectorMatch selects templates based on where they are referenced. +// Note: The selector must match at least one template. +// Note: The results of selection based on the individual fields are ORed. +type PatchSelectorMatchApplyConfiguration struct { + // controlPlane selects templates referenced in .spec.ControlPlane. + // Note: this will match the controlPlane and also the controlPlane + // machineInfrastructure (depending on the kind and apiVersion). + ControlPlane *bool `json:"controlPlane,omitempty"` + // infrastructureCluster selects templates referenced in .spec.infrastructure. + InfrastructureCluster *bool `json:"infrastructureCluster,omitempty"` + // machineDeploymentClass selects templates referenced in specific MachineDeploymentClasses in + // .spec.workers.machineDeployments. + MachineDeploymentClass *PatchSelectorMatchMachineDeploymentClassApplyConfiguration `json:"machineDeploymentClass,omitempty"` + // machinePoolClass selects templates referenced in specific MachinePoolClasses in + // .spec.workers.machinePools. + MachinePoolClass *PatchSelectorMatchMachinePoolClassApplyConfiguration `json:"machinePoolClass,omitempty"` +} + +// PatchSelectorMatchApplyConfiguration constructs a declarative configuration of the PatchSelectorMatch type for use with +// apply. +func PatchSelectorMatch() *PatchSelectorMatchApplyConfiguration { + return &PatchSelectorMatchApplyConfiguration{} +} + +// WithControlPlane sets the ControlPlane field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControlPlane field is set to the value of the last call. +func (b *PatchSelectorMatchApplyConfiguration) WithControlPlane(value bool) *PatchSelectorMatchApplyConfiguration { + b.ControlPlane = &value + return b +} + +// WithInfrastructureCluster sets the InfrastructureCluster field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InfrastructureCluster field is set to the value of the last call. +func (b *PatchSelectorMatchApplyConfiguration) WithInfrastructureCluster(value bool) *PatchSelectorMatchApplyConfiguration { + b.InfrastructureCluster = &value + return b +} + +// WithMachineDeploymentClass sets the MachineDeploymentClass field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MachineDeploymentClass field is set to the value of the last call. +func (b *PatchSelectorMatchApplyConfiguration) WithMachineDeploymentClass(value *PatchSelectorMatchMachineDeploymentClassApplyConfiguration) *PatchSelectorMatchApplyConfiguration { + b.MachineDeploymentClass = value + return b +} + +// WithMachinePoolClass sets the MachinePoolClass field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MachinePoolClass field is set to the value of the last call. +func (b *PatchSelectorMatchApplyConfiguration) WithMachinePoolClass(value *PatchSelectorMatchMachinePoolClassApplyConfiguration) *PatchSelectorMatchApplyConfiguration { + b.MachinePoolClass = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/patchselectormatchmachinedeploymentclass.go b/pkg/generated/applyconfiguration/core/v1beta2/patchselectormatchmachinedeploymentclass.go new file mode 100644 index 000000000000..76eb305db4e0 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/patchselectormatchmachinedeploymentclass.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// PatchSelectorMatchMachineDeploymentClassApplyConfiguration represents a declarative configuration of the PatchSelectorMatchMachineDeploymentClass type for use +// with apply. +// +// PatchSelectorMatchMachineDeploymentClass selects templates referenced +// in specific MachineDeploymentClasses in .spec.workers.machineDeployments. +type PatchSelectorMatchMachineDeploymentClassApplyConfiguration struct { + // names selects templates by class names. + Names []string `json:"names,omitempty"` +} + +// PatchSelectorMatchMachineDeploymentClassApplyConfiguration constructs a declarative configuration of the PatchSelectorMatchMachineDeploymentClass type for use with +// apply. +func PatchSelectorMatchMachineDeploymentClass() *PatchSelectorMatchMachineDeploymentClassApplyConfiguration { + return &PatchSelectorMatchMachineDeploymentClassApplyConfiguration{} +} + +// WithNames adds the given value to the Names field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Names field. +func (b *PatchSelectorMatchMachineDeploymentClassApplyConfiguration) WithNames(values ...string) *PatchSelectorMatchMachineDeploymentClassApplyConfiguration { + for i := range values { + b.Names = append(b.Names, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/patchselectormatchmachinepoolclass.go b/pkg/generated/applyconfiguration/core/v1beta2/patchselectormatchmachinepoolclass.go new file mode 100644 index 000000000000..065e1e45a049 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/patchselectormatchmachinepoolclass.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// PatchSelectorMatchMachinePoolClassApplyConfiguration represents a declarative configuration of the PatchSelectorMatchMachinePoolClass type for use +// with apply. +// +// PatchSelectorMatchMachinePoolClass selects templates referenced +// in specific MachinePoolClasses in .spec.workers.machinePools. +type PatchSelectorMatchMachinePoolClassApplyConfiguration struct { + // names selects templates by class names. + Names []string `json:"names,omitempty"` +} + +// PatchSelectorMatchMachinePoolClassApplyConfiguration constructs a declarative configuration of the PatchSelectorMatchMachinePoolClass type for use with +// apply. +func PatchSelectorMatchMachinePoolClass() *PatchSelectorMatchMachinePoolClassApplyConfiguration { + return &PatchSelectorMatchMachinePoolClassApplyConfiguration{} +} + +// WithNames adds the given value to the Names field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Names field. +func (b *PatchSelectorMatchMachinePoolClassApplyConfiguration) WithNames(values ...string) *PatchSelectorMatchMachinePoolClassApplyConfiguration { + for i := range values { + b.Names = append(b.Names, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/topology.go b/pkg/generated/applyconfiguration/core/v1beta2/topology.go new file mode 100644 index 000000000000..d1bf7e0a2466 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/topology.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// TopologyApplyConfiguration represents a declarative configuration of the Topology type for use +// with apply. +// +// Topology encapsulates the information of the managed resources. +type TopologyApplyConfiguration struct { + // classRef is the ref to the ClusterClass that should be used for the topology. + ClassRef *ClusterClassRefApplyConfiguration `json:"classRef,omitempty"` + // version is the Kubernetes version of the cluster. + Version *string `json:"version,omitempty"` + // controlPlane describes the cluster control plane. + ControlPlane *ControlPlaneTopologyApplyConfiguration `json:"controlPlane,omitempty"` + // workers encapsulates the different constructs that form the worker nodes + // for the cluster. + Workers *WorkersTopologyApplyConfiguration `json:"workers,omitempty"` + // variables can be used to customize the Cluster through + // patches. They must comply to the corresponding + // VariableClasses defined in the ClusterClass. + Variables []ClusterVariableApplyConfiguration `json:"variables,omitempty"` +} + +// TopologyApplyConfiguration constructs a declarative configuration of the Topology type for use with +// apply. +func Topology() *TopologyApplyConfiguration { + return &TopologyApplyConfiguration{} +} + +// WithClassRef sets the ClassRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClassRef field is set to the value of the last call. +func (b *TopologyApplyConfiguration) WithClassRef(value *ClusterClassRefApplyConfiguration) *TopologyApplyConfiguration { + b.ClassRef = value + return b +} + +// WithVersion sets the Version field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Version field is set to the value of the last call. +func (b *TopologyApplyConfiguration) WithVersion(value string) *TopologyApplyConfiguration { + b.Version = &value + return b +} + +// WithControlPlane sets the ControlPlane field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControlPlane field is set to the value of the last call. +func (b *TopologyApplyConfiguration) WithControlPlane(value *ControlPlaneTopologyApplyConfiguration) *TopologyApplyConfiguration { + b.ControlPlane = value + return b +} + +// WithWorkers sets the Workers field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Workers field is set to the value of the last call. +func (b *TopologyApplyConfiguration) WithWorkers(value *WorkersTopologyApplyConfiguration) *TopologyApplyConfiguration { + b.Workers = value + return b +} + +// WithVariables adds the given value to the Variables field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Variables field. +func (b *TopologyApplyConfiguration) WithVariables(values ...*ClusterVariableApplyConfiguration) *TopologyApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVariables") + } + b.Variables = append(b.Variables, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/unhealthymachinecondition.go b/pkg/generated/applyconfiguration/core/v1beta2/unhealthymachinecondition.go new file mode 100644 index 000000000000..30fbdfb2673f --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/unhealthymachinecondition.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// UnhealthyMachineConditionApplyConfiguration represents a declarative configuration of the UnhealthyMachineCondition type for use +// with apply. +// +// UnhealthyMachineCondition represents a Machine condition type and value with a timeout +// specified as a duration. When the named condition has been in the given +// status for at least the timeout value, a machine is considered unhealthy. +type UnhealthyMachineConditionApplyConfiguration struct { + // type of Machine condition + Type *string `json:"type,omitempty"` + // status of the condition, one of True, False, Unknown. + Status *v1.ConditionStatus `json:"status,omitempty"` + // timeoutSeconds is the duration that a machine must be in a given status for, + // after which the machine is considered unhealthy. + // For example, with a value of "3600", the machine must match the status + // for at least 1 hour before being considered unhealthy. + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` +} + +// UnhealthyMachineConditionApplyConfiguration constructs a declarative configuration of the UnhealthyMachineCondition type for use with +// apply. +func UnhealthyMachineCondition() *UnhealthyMachineConditionApplyConfiguration { + return &UnhealthyMachineConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *UnhealthyMachineConditionApplyConfiguration) WithType(value string) *UnhealthyMachineConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *UnhealthyMachineConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *UnhealthyMachineConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithTimeoutSeconds sets the TimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TimeoutSeconds field is set to the value of the last call. +func (b *UnhealthyMachineConditionApplyConfiguration) WithTimeoutSeconds(value int32) *UnhealthyMachineConditionApplyConfiguration { + b.TimeoutSeconds = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/unhealthynodecondition.go b/pkg/generated/applyconfiguration/core/v1beta2/unhealthynodecondition.go new file mode 100644 index 000000000000..3f1999f90ae5 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/unhealthynodecondition.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/api/core/v1" +) + +// UnhealthyNodeConditionApplyConfiguration represents a declarative configuration of the UnhealthyNodeCondition type for use +// with apply. +// +// UnhealthyNodeCondition represents a Node condition type and value with a timeout +// specified as a duration. When the named condition has been in the given +// status for at least the timeout value, a node is considered unhealthy. +type UnhealthyNodeConditionApplyConfiguration struct { + // type of Node condition + Type *v1.NodeConditionType `json:"type,omitempty"` + // status of the condition, one of True, False, Unknown. + Status *v1.ConditionStatus `json:"status,omitempty"` + // timeoutSeconds is the duration that a node must be in a given status for, + // after which the node is considered unhealthy. + // For example, with a value of "3600", the node must match the status + // for at least 1 hour before being considered unhealthy. + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` +} + +// UnhealthyNodeConditionApplyConfiguration constructs a declarative configuration of the UnhealthyNodeCondition type for use with +// apply. +func UnhealthyNodeCondition() *UnhealthyNodeConditionApplyConfiguration { + return &UnhealthyNodeConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *UnhealthyNodeConditionApplyConfiguration) WithType(value v1.NodeConditionType) *UnhealthyNodeConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *UnhealthyNodeConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *UnhealthyNodeConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithTimeoutSeconds sets the TimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TimeoutSeconds field is set to the value of the last call. +func (b *UnhealthyNodeConditionApplyConfiguration) WithTimeoutSeconds(value int32) *UnhealthyNodeConditionApplyConfiguration { + b.TimeoutSeconds = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/validationrule.go b/pkg/generated/applyconfiguration/core/v1beta2/validationrule.go new file mode 100644 index 000000000000..d012a73a077c --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/validationrule.go @@ -0,0 +1,153 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// ValidationRuleApplyConfiguration represents a declarative configuration of the ValidationRule type for use +// with apply. +// +// ValidationRule describes a validation rule written in the CEL expression language. +type ValidationRuleApplyConfiguration struct { + // rule represents the expression which will be evaluated by CEL. + // ref: https://github.com/google/cel-spec + // The Rule is scoped to the location of the x-kubernetes-validations extension in the schema. + // The `self` variable in the CEL expression is bound to the scoped value. + // If the Rule is scoped to an object with properties, the accessible properties of the object are field selectable + // via `self.field` and field presence can be checked via `has(self.field)`. + // If the Rule is scoped to an object with additionalProperties (i.e. a map) the value of the map + // are accessible via `self[mapKey]`, map containment can be checked via `mapKey in self` and all entries of the map + // are accessible via CEL macros and functions such as `self.all(...)`. + // If the Rule is scoped to an array, the elements of the array are accessible via `self[i]` and also by macros and + // functions. + // If the Rule is scoped to a scalar, `self` is bound to the scalar value. + // Examples: + // - Rule scoped to a map of objects: {"rule": "self.components['Widget'].priority < 10"} + // - Rule scoped to a list of integers: {"rule": "self.values.all(value, value >= 0 && value < 100)"} + // - Rule scoped to a string value: {"rule": "self.startsWith('kube')"} + // + // Unknown data preserved in custom resources via x-kubernetes-preserve-unknown-fields is not accessible in CEL + // expressions. This includes: + // - Unknown field values that are preserved by object schemas with x-kubernetes-preserve-unknown-fields. + // - Object properties where the property schema is of an "unknown type". An "unknown type" is recursively defined as: + // - A schema with no type and x-kubernetes-preserve-unknown-fields set to true + // - An array where the items schema is of an "unknown type" + // - An object where the additionalProperties schema is of an "unknown type" + // + // Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. + // Accessible property names are escaped according to the following rules when accessed in the expression: + // - '__' escapes to '__underscores__' + // - '.' escapes to '__dot__' + // - '-' escapes to '__dash__' + // - '/' escapes to '__slash__' + // - Property names that exactly match a CEL RESERVED keyword escape to '__{keyword}__'. The keywords are: + // "true", "false", "null", "in", "as", "break", "const", "continue", "else", "for", "function", "if", + // "import", "let", "loop", "package", "namespace", "return". + // Examples: + // - Rule accessing a property named "namespace": {"rule": "self.__namespace__ > 0"} + // - Rule accessing a property named "x-prop": {"rule": "self.x__dash__prop > 0"} + // - Rule accessing a property named "redact__d": {"rule": "self.redact__underscores__d > 0"} + // + // If `rule` makes use of the `oldSelf` variable it is implicitly a + // `transition rule`. + // + // By default, the `oldSelf` variable is the same type as `self`. + // + // Transition rules by default are applied only on UPDATE requests and are + // skipped if an old value could not be found. + Rule *string `json:"rule,omitempty"` + // message represents the message displayed when validation fails. The message is required if the Rule contains + // line breaks. The message must not contain line breaks. + // If unset, the message is "failed rule: {Rule}". + // e.g. "must be a URL with the host matching spec.host" + Message *string `json:"message,omitempty"` + // messageExpression declares a CEL expression that evaluates to the validation failure message that is returned when this rule fails. + // Since messageExpression is used as a failure message, it must evaluate to a string. + // If both message and messageExpression are present on a rule, then messageExpression will be used if validation + // fails. If messageExpression results in a runtime error, the validation failure message is produced + // as if the messageExpression field were unset. If messageExpression evaluates to an empty string, a string with only spaces, or a string + // that contains line breaks, then the validation failure message will also be produced as if the messageExpression field were unset. + // messageExpression has access to all the same variables as the rule; the only difference is the return type. + // Example: + // "x must be less than max ("+string(self.max)+")" + MessageExpression *string `json:"messageExpression,omitempty"` + // reason provides a machine-readable validation failure reason that is returned to the caller when a request fails this validation rule. + // The currently supported reasons are: "FieldValueInvalid", "FieldValueForbidden", "FieldValueRequired", "FieldValueDuplicate". + // If not set, default to use "FieldValueInvalid". + // All future added reasons must be accepted by clients when reading this value and unknown reasons should be treated as FieldValueInvalid. + Reason *corev1beta2.FieldValueErrorReason `json:"reason,omitempty"` + // fieldPath represents the field path returned when the validation fails. + // It must be a relative JSON path (i.e. with array notation) scoped to the location of this x-kubernetes-validations extension in the schema and refer to an existing field. + // e.g. when validation checks if a specific attribute `foo` under a map `testMap`, the fieldPath could be set to `.testMap.foo` + // If the validation checks two lists must have unique attributes, the fieldPath could be set to either of the list: e.g. `.testList` + // It does not support list numeric index. + // It supports child operation to refer to an existing field currently. Refer to [JSONPath support in Kubernetes](https://kubernetes.io/docs/reference/kubectl/jsonpath/) for more info. + // Numeric index of array is not supported. + // For field name which contains special characters, use `['specialName']` to refer the field name. + // e.g. for attribute `foo.34$` appears in a list `testList`, the fieldPath could be set to `.testList['foo.34$']` + FieldPath *string `json:"fieldPath,omitempty"` +} + +// ValidationRuleApplyConfiguration constructs a declarative configuration of the ValidationRule type for use with +// apply. +func ValidationRule() *ValidationRuleApplyConfiguration { + return &ValidationRuleApplyConfiguration{} +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *ValidationRuleApplyConfiguration) WithRule(value string) *ValidationRuleApplyConfiguration { + b.Rule = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ValidationRuleApplyConfiguration) WithMessage(value string) *ValidationRuleApplyConfiguration { + b.Message = &value + return b +} + +// WithMessageExpression sets the MessageExpression field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MessageExpression field is set to the value of the last call. +func (b *ValidationRuleApplyConfiguration) WithMessageExpression(value string) *ValidationRuleApplyConfiguration { + b.MessageExpression = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *ValidationRuleApplyConfiguration) WithReason(value corev1beta2.FieldValueErrorReason) *ValidationRuleApplyConfiguration { + b.Reason = &value + return b +} + +// WithFieldPath sets the FieldPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FieldPath field is set to the value of the last call. +func (b *ValidationRuleApplyConfiguration) WithFieldPath(value string) *ValidationRuleApplyConfiguration { + b.FieldPath = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/variableschema.go b/pkg/generated/applyconfiguration/core/v1beta2/variableschema.go new file mode 100644 index 000000000000..d7faf1a6be38 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/variableschema.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// VariableSchemaApplyConfiguration represents a declarative configuration of the VariableSchema type for use +// with apply. +// +// VariableSchema defines the schema of a variable. +type VariableSchemaApplyConfiguration struct { + // openAPIV3Schema defines the schema of a variable via OpenAPI v3 + // schema. The schema is a subset of the schema used in + // Kubernetes CRDs. + OpenAPIV3Schema *JSONSchemaPropsApplyConfiguration `json:"openAPIV3Schema,omitempty"` +} + +// VariableSchemaApplyConfiguration constructs a declarative configuration of the VariableSchema type for use with +// apply. +func VariableSchema() *VariableSchemaApplyConfiguration { + return &VariableSchemaApplyConfiguration{} +} + +// WithOpenAPIV3Schema sets the OpenAPIV3Schema field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OpenAPIV3Schema field is set to the value of the last call. +func (b *VariableSchemaApplyConfiguration) WithOpenAPIV3Schema(value *JSONSchemaPropsApplyConfiguration) *VariableSchemaApplyConfiguration { + b.OpenAPIV3Schema = value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/variableschemametadata.go b/pkg/generated/applyconfiguration/core/v1beta2/variableschemametadata.go new file mode 100644 index 000000000000..57a1e7327bd6 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/variableschemametadata.go @@ -0,0 +1,68 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// VariableSchemaMetadataApplyConfiguration represents a declarative configuration of the VariableSchemaMetadata type for use +// with apply. +// +// VariableSchemaMetadata is the metadata of a variable or a nested field within a variable. +// It can be used to add additional data for higher level tools. +type VariableSchemaMetadataApplyConfiguration struct { + // labels is a map of string keys and values that can be used to organize and categorize + // (scope and select) variables. + Labels map[string]string `json:"labels,omitempty"` + // annotations is an unstructured key value map that can be used to store and + // retrieve arbitrary metadata. + // They are not queryable. + Annotations map[string]string `json:"annotations,omitempty"` +} + +// VariableSchemaMetadataApplyConfiguration constructs a declarative configuration of the VariableSchemaMetadata type for use with +// apply. +func VariableSchemaMetadata() *VariableSchemaMetadataApplyConfiguration { + return &VariableSchemaMetadataApplyConfiguration{} +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *VariableSchemaMetadataApplyConfiguration) WithLabels(entries map[string]string) *VariableSchemaMetadataApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *VariableSchemaMetadataApplyConfiguration) WithAnnotations(entries map[string]string) *VariableSchemaMetadataApplyConfiguration { + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/workersclass.go b/pkg/generated/applyconfiguration/core/v1beta2/workersclass.go new file mode 100644 index 000000000000..bde3a4c39165 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/workersclass.go @@ -0,0 +1,64 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// WorkersClassApplyConfiguration represents a declarative configuration of the WorkersClass type for use +// with apply. +// +// WorkersClass is a collection of deployment classes. +type WorkersClassApplyConfiguration struct { + // machineDeployments is a list of machine deployment classes that can be used to create + // a set of worker nodes. + MachineDeployments []MachineDeploymentClassApplyConfiguration `json:"machineDeployments,omitempty"` + // machinePools is a list of machine pool classes that can be used to create + // a set of worker nodes. + MachinePools []MachinePoolClassApplyConfiguration `json:"machinePools,omitempty"` +} + +// WorkersClassApplyConfiguration constructs a declarative configuration of the WorkersClass type for use with +// apply. +func WorkersClass() *WorkersClassApplyConfiguration { + return &WorkersClassApplyConfiguration{} +} + +// WithMachineDeployments adds the given value to the MachineDeployments field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MachineDeployments field. +func (b *WorkersClassApplyConfiguration) WithMachineDeployments(values ...*MachineDeploymentClassApplyConfiguration) *WorkersClassApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMachineDeployments") + } + b.MachineDeployments = append(b.MachineDeployments, *values[i]) + } + return b +} + +// WithMachinePools adds the given value to the MachinePools field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MachinePools field. +func (b *WorkersClassApplyConfiguration) WithMachinePools(values ...*MachinePoolClassApplyConfiguration) *WorkersClassApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMachinePools") + } + b.MachinePools = append(b.MachinePools, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/workersstatus.go b/pkg/generated/applyconfiguration/core/v1beta2/workersstatus.go new file mode 100644 index 000000000000..25d6879659b1 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/workersstatus.go @@ -0,0 +1,83 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// WorkersStatusApplyConfiguration represents a declarative configuration of the WorkersStatus type for use +// with apply. +// +// WorkersStatus groups all the observations about workers current state. +type WorkersStatusApplyConfiguration struct { + // desiredReplicas is the total number of desired worker machines in this cluster. + DesiredReplicas *int32 `json:"desiredReplicas,omitempty"` + // replicas is the total number of worker machines in this cluster. + // NOTE: replicas also includes machines still being provisioned or being deleted. + Replicas *int32 `json:"replicas,omitempty"` + // upToDateReplicas is the number of up-to-date worker machines in this cluster. A machine is considered up-to-date when Machine's UpToDate condition is true. + UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` + // readyReplicas is the total number of ready worker machines in this cluster. A machine is considered ready when Machine's Ready condition is true. + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + // availableReplicas is the total number of available worker machines in this cluster. A machine is considered available when Machine's Available condition is true. + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` +} + +// WorkersStatusApplyConfiguration constructs a declarative configuration of the WorkersStatus type for use with +// apply. +func WorkersStatus() *WorkersStatusApplyConfiguration { + return &WorkersStatusApplyConfiguration{} +} + +// WithDesiredReplicas sets the DesiredReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DesiredReplicas field is set to the value of the last call. +func (b *WorkersStatusApplyConfiguration) WithDesiredReplicas(value int32) *WorkersStatusApplyConfiguration { + b.DesiredReplicas = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *WorkersStatusApplyConfiguration) WithReplicas(value int32) *WorkersStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithUpToDateReplicas sets the UpToDateReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpToDateReplicas field is set to the value of the last call. +func (b *WorkersStatusApplyConfiguration) WithUpToDateReplicas(value int32) *WorkersStatusApplyConfiguration { + b.UpToDateReplicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *WorkersStatusApplyConfiguration) WithReadyReplicas(value int32) *WorkersStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *WorkersStatusApplyConfiguration) WithAvailableReplicas(value int32) *WorkersStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} diff --git a/pkg/generated/applyconfiguration/core/v1beta2/workerstopology.go b/pkg/generated/applyconfiguration/core/v1beta2/workerstopology.go new file mode 100644 index 000000000000..fdbc25b614d6 --- /dev/null +++ b/pkg/generated/applyconfiguration/core/v1beta2/workerstopology.go @@ -0,0 +1,62 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// WorkersTopologyApplyConfiguration represents a declarative configuration of the WorkersTopology type for use +// with apply. +// +// WorkersTopology represents the different sets of worker nodes in the cluster. +type WorkersTopologyApplyConfiguration struct { + // machineDeployments is a list of machine deployments in the cluster. + MachineDeployments []MachineDeploymentTopologyApplyConfiguration `json:"machineDeployments,omitempty"` + // machinePools is a list of machine pools in the cluster. + MachinePools []MachinePoolTopologyApplyConfiguration `json:"machinePools,omitempty"` +} + +// WorkersTopologyApplyConfiguration constructs a declarative configuration of the WorkersTopology type for use with +// apply. +func WorkersTopology() *WorkersTopologyApplyConfiguration { + return &WorkersTopologyApplyConfiguration{} +} + +// WithMachineDeployments adds the given value to the MachineDeployments field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MachineDeployments field. +func (b *WorkersTopologyApplyConfiguration) WithMachineDeployments(values ...*MachineDeploymentTopologyApplyConfiguration) *WorkersTopologyApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMachineDeployments") + } + b.MachineDeployments = append(b.MachineDeployments, *values[i]) + } + return b +} + +// WithMachinePools adds the given value to the MachinePools field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MachinePools field. +func (b *WorkersTopologyApplyConfiguration) WithMachinePools(values ...*MachinePoolTopologyApplyConfiguration) *WorkersTopologyApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMachinePools") + } + b.MachinePools = append(b.MachinePools, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfiguration/internal/internal.go b/pkg/generated/applyconfiguration/internal/internal.go new file mode 100644 index 000000000000..c482faa5c20f --- /dev/null +++ b/pkg/generated/applyconfiguration/internal/internal.go @@ -0,0 +1,62 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package internal + +import ( + fmt "fmt" + sync "sync" + + typed "sigs.k8s.io/structured-merge-diff/v6/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplane.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplane.go new file mode 100644 index 000000000000..666d9e787ee0 --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplane.go @@ -0,0 +1,249 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// KubeadmControlPlaneApplyConfiguration represents a declarative configuration of the KubeadmControlPlane type for use +// with apply. +// +// KubeadmControlPlane is the Schema for the KubeadmControlPlane API. +type KubeadmControlPlaneApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec is the desired state of KubeadmControlPlane. + Spec *KubeadmControlPlaneSpecApplyConfiguration `json:"spec,omitempty"` + // status is the observed state of KubeadmControlPlane. + Status *KubeadmControlPlaneStatusApplyConfiguration `json:"status,omitempty"` +} + +// KubeadmControlPlane constructs a declarative configuration of the KubeadmControlPlane type for use with +// apply. +func KubeadmControlPlane(name, namespace string) *KubeadmControlPlaneApplyConfiguration { + b := &KubeadmControlPlaneApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("KubeadmControlPlane") + b.WithAPIVersion("controlplane.cluster.x-k8s.io/v1beta2") + return b +} + +func (b KubeadmControlPlaneApplyConfiguration) IsApplyConfiguration() {} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithKind(value string) *KubeadmControlPlaneApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithAPIVersion(value string) *KubeadmControlPlaneApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithName(value string) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithGenerateName(value string) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithNamespace(value string) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithUID(value types.UID) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithResourceVersion(value string) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithGeneration(value int64) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithCreationTimestamp(value metav1.Time) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *KubeadmControlPlaneApplyConfiguration) WithLabels(entries map[string]string) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *KubeadmControlPlaneApplyConfiguration) WithAnnotations(entries map[string]string) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *KubeadmControlPlaneApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *KubeadmControlPlaneApplyConfiguration) WithFinalizers(values ...string) *KubeadmControlPlaneApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *KubeadmControlPlaneApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithSpec(value *KubeadmControlPlaneSpecApplyConfiguration) *KubeadmControlPlaneApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *KubeadmControlPlaneApplyConfiguration) WithStatus(value *KubeadmControlPlaneStatusApplyConfiguration) *KubeadmControlPlaneApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *KubeadmControlPlaneApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *KubeadmControlPlaneApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *KubeadmControlPlaneApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *KubeadmControlPlaneApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanedeprecatedstatus.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanedeprecatedstatus.go new file mode 100644 index 000000000000..262274cb828e --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanedeprecatedstatus.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// KubeadmControlPlaneDeprecatedStatusApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneDeprecatedStatus type for use +// with apply. +// +// KubeadmControlPlaneDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type KubeadmControlPlaneDeprecatedStatusApplyConfiguration struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + V1Beta1 *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration `json:"v1beta1,omitempty"` +} + +// KubeadmControlPlaneDeprecatedStatusApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneDeprecatedStatus type for use with +// apply. +func KubeadmControlPlaneDeprecatedStatus() *KubeadmControlPlaneDeprecatedStatusApplyConfiguration { + return &KubeadmControlPlaneDeprecatedStatusApplyConfiguration{} +} + +// WithV1Beta1 sets the V1Beta1 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the V1Beta1 field is set to the value of the last call. +func (b *KubeadmControlPlaneDeprecatedStatusApplyConfiguration) WithV1Beta1(value *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration) *KubeadmControlPlaneDeprecatedStatusApplyConfiguration { + b.V1Beta1 = value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplaneinitializationstatus.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplaneinitializationstatus.go new file mode 100644 index 000000000000..2c950ad7e76f --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplaneinitializationstatus.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// KubeadmControlPlaneInitializationStatusApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneInitializationStatus type for use +// with apply. +// +// KubeadmControlPlaneInitializationStatus provides observations of the KubeadmControlPlane initialization process. +type KubeadmControlPlaneInitializationStatusApplyConfiguration struct { + // controlPlaneInitialized is true when the KubeadmControlPlane provider reports that the Kubernetes control plane is initialized; + // A control plane is considered initialized when it can accept requests, no matter if this happens before + // the control plane is fully provisioned or not. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate initial Machine provisioning. + ControlPlaneInitialized *bool `json:"controlPlaneInitialized,omitempty"` +} + +// KubeadmControlPlaneInitializationStatusApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneInitializationStatus type for use with +// apply. +func KubeadmControlPlaneInitializationStatus() *KubeadmControlPlaneInitializationStatusApplyConfiguration { + return &KubeadmControlPlaneInitializationStatusApplyConfiguration{} +} + +// WithControlPlaneInitialized sets the ControlPlaneInitialized field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControlPlaneInitialized field is set to the value of the last call. +func (b *KubeadmControlPlaneInitializationStatusApplyConfiguration) WithControlPlaneInitialized(value bool) *KubeadmControlPlaneInitializationStatusApplyConfiguration { + b.ControlPlaneInitialized = &value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanemachinetemplate.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanemachinetemplate.go new file mode 100644 index 000000000000..00c54d04fd50 --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanemachinetemplate.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" +) + +// KubeadmControlPlaneMachineTemplateApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneMachineTemplate type for use +// with apply. +// +// KubeadmControlPlaneMachineTemplate defines the template for Machines +// in a KubeadmControlPlane object. +type KubeadmControlPlaneMachineTemplateApplyConfiguration struct { + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + ObjectMeta *corev1beta2.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // spec defines the spec for Machines + // in a KubeadmControlPlane object. + Spec *KubeadmControlPlaneMachineTemplateSpecApplyConfiguration `json:"spec,omitempty"` +} + +// KubeadmControlPlaneMachineTemplateApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneMachineTemplate type for use with +// apply. +func KubeadmControlPlaneMachineTemplate() *KubeadmControlPlaneMachineTemplateApplyConfiguration { + return &KubeadmControlPlaneMachineTemplateApplyConfiguration{} +} + +// WithObjectMeta sets the ObjectMeta field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObjectMeta field is set to the value of the last call. +func (b *KubeadmControlPlaneMachineTemplateApplyConfiguration) WithObjectMeta(value *corev1beta2.ObjectMetaApplyConfiguration) *KubeadmControlPlaneMachineTemplateApplyConfiguration { + b.ObjectMeta = value + return b +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *KubeadmControlPlaneMachineTemplateApplyConfiguration) WithSpec(value *KubeadmControlPlaneMachineTemplateSpecApplyConfiguration) *KubeadmControlPlaneMachineTemplateApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanemachinetemplatedeletionspec.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanemachinetemplatedeletionspec.go new file mode 100644 index 000000000000..8268ed0fc1cb --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanemachinetemplatedeletionspec.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneMachineTemplateDeletionSpec type for use +// with apply. +// +// KubeadmControlPlaneMachineTemplateDeletionSpec contains configuration options for Machine deletion. +type KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration struct { + // nodeDrainTimeoutSeconds is the total amount of time that the controller will spend on draining a controlplane node + // The default value is 0, meaning that the node can be drained without any time limitations. + // NOTE: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + // nodeDeletionTimeoutSeconds defines how long the machine controller will attempt to delete the Node that the Machine + // hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. + // If no value is provided, the default value for this property of the Machine resource will be used. + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneMachineTemplateDeletionSpec type for use with +// apply. +func KubeadmControlPlaneMachineTemplateDeletionSpec() *KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration { + return &KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration{} +} + +// WithNodeDrainTimeoutSeconds sets the NodeDrainTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDrainTimeoutSeconds field is set to the value of the last call. +func (b *KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration) WithNodeDrainTimeoutSeconds(value int32) *KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration { + b.NodeDrainTimeoutSeconds = &value + return b +} + +// WithNodeVolumeDetachTimeoutSeconds sets the NodeVolumeDetachTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeVolumeDetachTimeoutSeconds field is set to the value of the last call. +func (b *KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration) WithNodeVolumeDetachTimeoutSeconds(value int32) *KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration { + b.NodeVolumeDetachTimeoutSeconds = &value + return b +} + +// WithNodeDeletionTimeoutSeconds sets the NodeDeletionTimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeDeletionTimeoutSeconds field is set to the value of the last call. +func (b *KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration) WithNodeDeletionTimeoutSeconds(value int32) *KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration { + b.NodeDeletionTimeoutSeconds = &value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanemachinetemplatespec.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanemachinetemplatespec.go new file mode 100644 index 000000000000..2da99c780d70 --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanemachinetemplatespec.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" +) + +// KubeadmControlPlaneMachineTemplateSpecApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneMachineTemplateSpec type for use +// with apply. +// +// KubeadmControlPlaneMachineTemplateSpec defines the spec for Machines +// in a KubeadmControlPlane object. +type KubeadmControlPlaneMachineTemplateSpecApplyConfiguration struct { + // infrastructureRef is a required reference to a custom resource + // offered by an infrastructure provider. + InfrastructureRef *corev1beta2.ContractVersionedObjectReferenceApplyConfiguration `json:"infrastructureRef,omitempty"` + // readinessGates specifies additional conditions to include when evaluating Machine Ready condition; + // KubeadmControlPlane will always add readinessGates for the condition it is setting on the Machine: + // APIServerPodHealthy, SchedulerPodHealthy, ControllerManagerPodHealthy, and if etcd is managed by CKP also + // EtcdPodHealthy, EtcdMemberHealthy. + // + // This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready + // computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine. + ReadinessGates []corev1beta2.MachineReadinessGateApplyConfiguration `json:"readinessGates,omitempty"` + // deletion contains configuration options for Machine deletion. + Deletion *KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration `json:"deletion,omitempty"` +} + +// KubeadmControlPlaneMachineTemplateSpecApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneMachineTemplateSpec type for use with +// apply. +func KubeadmControlPlaneMachineTemplateSpec() *KubeadmControlPlaneMachineTemplateSpecApplyConfiguration { + return &KubeadmControlPlaneMachineTemplateSpecApplyConfiguration{} +} + +// WithInfrastructureRef sets the InfrastructureRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InfrastructureRef field is set to the value of the last call. +func (b *KubeadmControlPlaneMachineTemplateSpecApplyConfiguration) WithInfrastructureRef(value *corev1beta2.ContractVersionedObjectReferenceApplyConfiguration) *KubeadmControlPlaneMachineTemplateSpecApplyConfiguration { + b.InfrastructureRef = value + return b +} + +// WithReadinessGates adds the given value to the ReadinessGates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ReadinessGates field. +func (b *KubeadmControlPlaneMachineTemplateSpecApplyConfiguration) WithReadinessGates(values ...*corev1beta2.MachineReadinessGateApplyConfiguration) *KubeadmControlPlaneMachineTemplateSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithReadinessGates") + } + b.ReadinessGates = append(b.ReadinessGates, *values[i]) + } + return b +} + +// WithDeletion sets the Deletion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deletion field is set to the value of the last call. +func (b *KubeadmControlPlaneMachineTemplateSpecApplyConfiguration) WithDeletion(value *KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration) *KubeadmControlPlaneMachineTemplateSpecApplyConfiguration { + b.Deletion = value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplaneremediationspec.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplaneremediationspec.go new file mode 100644 index 000000000000..58234b838162 --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplaneremediationspec.go @@ -0,0 +1,91 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// KubeadmControlPlaneRemediationSpecApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneRemediationSpec type for use +// with apply. +// +// KubeadmControlPlaneRemediationSpec controls how unhealthy control plane Machines are remediated. +type KubeadmControlPlaneRemediationSpecApplyConfiguration struct { + // maxRetry is the Max number of retries while attempting to remediate an unhealthy machine. + // A retry happens when a machine that was created as a replacement for an unhealthy machine also fails. + // For example, given a control plane with three machines M1, M2, M3: + // + // M1 become unhealthy; remediation happens, and M1-1 is created as a replacement. + // If M1-1 (replacement of M1) has problems while bootstrapping it will become unhealthy, and then be + // remediated; such operation is considered a retry, remediation-retry #1. + // If M1-2 (replacement of M1-1) becomes unhealthy, remediation-retry #2 will happen, etc. + // + // A retry could happen only after retryPeriodSeconds from the previous retry. + // If a machine is marked as unhealthy after minHealthyPeriodSeconds from the previous remediation expired, + // this is not considered a retry anymore because the new issue is assumed unrelated from the previous one. + // + // If not set, the remedation will be retried infinitely. + MaxRetry *int32 `json:"maxRetry,omitempty"` + // retryPeriodSeconds is the duration that KCP should wait before remediating a machine being created as a replacement + // for an unhealthy machine (a retry). + // + // If not set, a retry will happen immediately. + RetryPeriodSeconds *int32 `json:"retryPeriodSeconds,omitempty"` + // minHealthyPeriodSeconds defines the duration after which KCP will consider any failure to a machine unrelated + // from the previous one. In this case the remediation is not considered a retry anymore, and thus the retry + // counter restarts from 0. For example, assuming minHealthyPeriodSeconds is set to 1h (default) + // + // M1 become unhealthy; remediation happens, and M1-1 is created as a replacement. + // If M1-1 (replacement of M1) has problems within the 1hr after the creation, also + // this machine will be remediated and this operation is considered a retry - a problem related + // to the original issue happened to M1 -. + // + // If instead the problem on M1-1 is happening after minHealthyPeriodSeconds expired, e.g. four days after + // m1-1 has been created as a remediation of M1, the problem on M1-1 is considered unrelated to + // the original issue happened to M1. + // + // If not set, this value is defaulted to 1h. + MinHealthyPeriodSeconds *int32 `json:"minHealthyPeriodSeconds,omitempty"` +} + +// KubeadmControlPlaneRemediationSpecApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneRemediationSpec type for use with +// apply. +func KubeadmControlPlaneRemediationSpec() *KubeadmControlPlaneRemediationSpecApplyConfiguration { + return &KubeadmControlPlaneRemediationSpecApplyConfiguration{} +} + +// WithMaxRetry sets the MaxRetry field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxRetry field is set to the value of the last call. +func (b *KubeadmControlPlaneRemediationSpecApplyConfiguration) WithMaxRetry(value int32) *KubeadmControlPlaneRemediationSpecApplyConfiguration { + b.MaxRetry = &value + return b +} + +// WithRetryPeriodSeconds sets the RetryPeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RetryPeriodSeconds field is set to the value of the last call. +func (b *KubeadmControlPlaneRemediationSpecApplyConfiguration) WithRetryPeriodSeconds(value int32) *KubeadmControlPlaneRemediationSpecApplyConfiguration { + b.RetryPeriodSeconds = &value + return b +} + +// WithMinHealthyPeriodSeconds sets the MinHealthyPeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinHealthyPeriodSeconds field is set to the value of the last call. +func (b *KubeadmControlPlaneRemediationSpecApplyConfiguration) WithMinHealthyPeriodSeconds(value int32) *KubeadmControlPlaneRemediationSpecApplyConfiguration { + b.MinHealthyPeriodSeconds = &value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanerolloutbeforespec.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanerolloutbeforespec.go new file mode 100644 index 000000000000..27aa3d2609f1 --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanerolloutbeforespec.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// KubeadmControlPlaneRolloutBeforeSpecApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneRolloutBeforeSpec type for use +// with apply. +// +// KubeadmControlPlaneRolloutBeforeSpec describes when a rollout should be performed on the KCP machines. +type KubeadmControlPlaneRolloutBeforeSpecApplyConfiguration struct { + // certificatesExpiryDays indicates a rollout needs to be performed if the + // certificates of the machine will expire within the specified days. + // The minimum for this field is 7. + CertificatesExpiryDays *int32 `json:"certificatesExpiryDays,omitempty"` +} + +// KubeadmControlPlaneRolloutBeforeSpecApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneRolloutBeforeSpec type for use with +// apply. +func KubeadmControlPlaneRolloutBeforeSpec() *KubeadmControlPlaneRolloutBeforeSpecApplyConfiguration { + return &KubeadmControlPlaneRolloutBeforeSpecApplyConfiguration{} +} + +// WithCertificatesExpiryDays sets the CertificatesExpiryDays field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CertificatesExpiryDays field is set to the value of the last call. +func (b *KubeadmControlPlaneRolloutBeforeSpecApplyConfiguration) WithCertificatesExpiryDays(value int32) *KubeadmControlPlaneRolloutBeforeSpecApplyConfiguration { + b.CertificatesExpiryDays = &value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanerolloutspec.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanerolloutspec.go new file mode 100644 index 000000000000..e410ddbad289 --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanerolloutspec.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// KubeadmControlPlaneRolloutSpecApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneRolloutSpec type for use +// with apply. +// +// KubeadmControlPlaneRolloutSpec allows you to configure the behaviour of rolling updates to the control plane Machines. +// It allows you to require that all Machines are replaced before or after a certain time, +// and allows you to define the strategy used during rolling replacements. +type KubeadmControlPlaneRolloutSpecApplyConfiguration struct { + // before is a field to indicate a rollout should be performed + // if the specified criteria is met. + Before *KubeadmControlPlaneRolloutBeforeSpecApplyConfiguration `json:"before,omitempty"` + // after is a field to indicate a rollout should be performed + // after the specified time even if no changes have been made to the + // KubeadmControlPlane. + // Example: In the YAML the time can be specified in the RFC3339 format. + // To specify the rolloutAfter target as March 9, 2023, at 9 am UTC + // use "2023-03-09T09:00:00Z". + After *v1.Time `json:"after,omitempty"` + // strategy specifies how to roll out control plane Machines. + Strategy *KubeadmControlPlaneRolloutStrategyApplyConfiguration `json:"strategy,omitempty"` +} + +// KubeadmControlPlaneRolloutSpecApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneRolloutSpec type for use with +// apply. +func KubeadmControlPlaneRolloutSpec() *KubeadmControlPlaneRolloutSpecApplyConfiguration { + return &KubeadmControlPlaneRolloutSpecApplyConfiguration{} +} + +// WithBefore sets the Before field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Before field is set to the value of the last call. +func (b *KubeadmControlPlaneRolloutSpecApplyConfiguration) WithBefore(value *KubeadmControlPlaneRolloutBeforeSpecApplyConfiguration) *KubeadmControlPlaneRolloutSpecApplyConfiguration { + b.Before = value + return b +} + +// WithAfter sets the After field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the After field is set to the value of the last call. +func (b *KubeadmControlPlaneRolloutSpecApplyConfiguration) WithAfter(value v1.Time) *KubeadmControlPlaneRolloutSpecApplyConfiguration { + b.After = &value + return b +} + +// WithStrategy sets the Strategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Strategy field is set to the value of the last call. +func (b *KubeadmControlPlaneRolloutSpecApplyConfiguration) WithStrategy(value *KubeadmControlPlaneRolloutStrategyApplyConfiguration) *KubeadmControlPlaneRolloutSpecApplyConfiguration { + b.Strategy = value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanerolloutstrategy.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanerolloutstrategy.go new file mode 100644 index 000000000000..57181ec97232 --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanerolloutstrategy.go @@ -0,0 +1,60 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + kubeadmv1beta2 "sigs.k8s.io/cluster-api/api/controlplane/kubeadm/v1beta2" +) + +// KubeadmControlPlaneRolloutStrategyApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneRolloutStrategy type for use +// with apply. +// +// KubeadmControlPlaneRolloutStrategy describes how to replace existing machines +// with new ones. +type KubeadmControlPlaneRolloutStrategyApplyConfiguration struct { + // type of rollout. Currently the only supported strategy is + // "RollingUpdate". + // Default is RollingUpdate. + Type *kubeadmv1beta2.KubeadmControlPlaneRolloutStrategyType `json:"type,omitempty"` + // rollingUpdate is the rolling update config params. Present only if + // type = RollingUpdate. + RollingUpdate *KubeadmControlPlaneRolloutStrategyRollingUpdateApplyConfiguration `json:"rollingUpdate,omitempty"` +} + +// KubeadmControlPlaneRolloutStrategyApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneRolloutStrategy type for use with +// apply. +func KubeadmControlPlaneRolloutStrategy() *KubeadmControlPlaneRolloutStrategyApplyConfiguration { + return &KubeadmControlPlaneRolloutStrategyApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *KubeadmControlPlaneRolloutStrategyApplyConfiguration) WithType(value kubeadmv1beta2.KubeadmControlPlaneRolloutStrategyType) *KubeadmControlPlaneRolloutStrategyApplyConfiguration { + b.Type = &value + return b +} + +// WithRollingUpdate sets the RollingUpdate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RollingUpdate field is set to the value of the last call. +func (b *KubeadmControlPlaneRolloutStrategyApplyConfiguration) WithRollingUpdate(value *KubeadmControlPlaneRolloutStrategyRollingUpdateApplyConfiguration) *KubeadmControlPlaneRolloutStrategyApplyConfiguration { + b.RollingUpdate = value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanerolloutstrategyrollingupdate.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanerolloutstrategyrollingupdate.go new file mode 100644 index 000000000000..c3612e62d632 --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanerolloutstrategyrollingupdate.go @@ -0,0 +1,51 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// KubeadmControlPlaneRolloutStrategyRollingUpdateApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneRolloutStrategyRollingUpdate type for use +// with apply. +// +// KubeadmControlPlaneRolloutStrategyRollingUpdate is used to control the desired behavior of rolling update. +type KubeadmControlPlaneRolloutStrategyRollingUpdateApplyConfiguration struct { + // maxSurge is the maximum number of control planes that can be scheduled above or under the + // desired number of control planes. + // Value can be an absolute number 1 or 0. + // Defaults to 1. + // Example: when this is set to 1, the control plane can be scaled + // up immediately when the rolling update starts. + MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` +} + +// KubeadmControlPlaneRolloutStrategyRollingUpdateApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneRolloutStrategyRollingUpdate type for use with +// apply. +func KubeadmControlPlaneRolloutStrategyRollingUpdate() *KubeadmControlPlaneRolloutStrategyRollingUpdateApplyConfiguration { + return &KubeadmControlPlaneRolloutStrategyRollingUpdateApplyConfiguration{} +} + +// WithMaxSurge sets the MaxSurge field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxSurge field is set to the value of the last call. +func (b *KubeadmControlPlaneRolloutStrategyRollingUpdateApplyConfiguration) WithMaxSurge(value intstr.IntOrString) *KubeadmControlPlaneRolloutStrategyRollingUpdateApplyConfiguration { + b.MaxSurge = &value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanespec.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanespec.go new file mode 100644 index 000000000000..10fec3b7bd18 --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanespec.go @@ -0,0 +1,113 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + kubeadmv1beta2 "sigs.k8s.io/cluster-api/api/bootstrap/kubeadm/v1beta2" +) + +// KubeadmControlPlaneSpecApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneSpec type for use +// with apply. +// +// KubeadmControlPlaneSpec defines the desired state of KubeadmControlPlane. +type KubeadmControlPlaneSpecApplyConfiguration struct { + // replicas is the number of desired machines. Defaults to 1. When stacked etcd is used only + // odd numbers are permitted, as per [etcd best practice](https://etcd.io/docs/v3.3.12/faq/#why-an-odd-number-of-cluster-members). + // This is a pointer to distinguish between explicit zero and not specified. + Replicas *int32 `json:"replicas,omitempty"` + // version defines the desired Kubernetes version. + Version *string `json:"version,omitempty"` + // machineTemplate contains information about how machines + // should be shaped when creating or updating a control plane. + MachineTemplate *KubeadmControlPlaneMachineTemplateApplyConfiguration `json:"machineTemplate,omitempty"` + // kubeadmConfigSpec is a KubeadmConfigSpec + // to use for initializing and joining machines to the control plane. + KubeadmConfigSpec *kubeadmv1beta2.KubeadmConfigSpec `json:"kubeadmConfigSpec,omitempty"` + // rollout allows you to configure the behaviour of rolling updates to the control plane Machines. + // It allows you to require that all Machines are replaced before or after a certain time, + // and allows you to define the strategy used during rolling replacements. + Rollout *KubeadmControlPlaneRolloutSpecApplyConfiguration `json:"rollout,omitempty"` + // remediation controls how unhealthy Machines are remediated. + Remediation *KubeadmControlPlaneRemediationSpecApplyConfiguration `json:"remediation,omitempty"` + // machineNaming allows changing the naming pattern used when creating Machines. + // InfraMachines & KubeadmConfigs will use the same name as the corresponding Machines. + MachineNaming *MachineNamingSpecApplyConfiguration `json:"machineNaming,omitempty"` +} + +// KubeadmControlPlaneSpecApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneSpec type for use with +// apply. +func KubeadmControlPlaneSpec() *KubeadmControlPlaneSpecApplyConfiguration { + return &KubeadmControlPlaneSpecApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *KubeadmControlPlaneSpecApplyConfiguration) WithReplicas(value int32) *KubeadmControlPlaneSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithVersion sets the Version field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Version field is set to the value of the last call. +func (b *KubeadmControlPlaneSpecApplyConfiguration) WithVersion(value string) *KubeadmControlPlaneSpecApplyConfiguration { + b.Version = &value + return b +} + +// WithMachineTemplate sets the MachineTemplate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MachineTemplate field is set to the value of the last call. +func (b *KubeadmControlPlaneSpecApplyConfiguration) WithMachineTemplate(value *KubeadmControlPlaneMachineTemplateApplyConfiguration) *KubeadmControlPlaneSpecApplyConfiguration { + b.MachineTemplate = value + return b +} + +// WithKubeadmConfigSpec sets the KubeadmConfigSpec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KubeadmConfigSpec field is set to the value of the last call. +func (b *KubeadmControlPlaneSpecApplyConfiguration) WithKubeadmConfigSpec(value kubeadmv1beta2.KubeadmConfigSpec) *KubeadmControlPlaneSpecApplyConfiguration { + b.KubeadmConfigSpec = &value + return b +} + +// WithRollout sets the Rollout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rollout field is set to the value of the last call. +func (b *KubeadmControlPlaneSpecApplyConfiguration) WithRollout(value *KubeadmControlPlaneRolloutSpecApplyConfiguration) *KubeadmControlPlaneSpecApplyConfiguration { + b.Rollout = value + return b +} + +// WithRemediation sets the Remediation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Remediation field is set to the value of the last call. +func (b *KubeadmControlPlaneSpecApplyConfiguration) WithRemediation(value *KubeadmControlPlaneRemediationSpecApplyConfiguration) *KubeadmControlPlaneSpecApplyConfiguration { + b.Remediation = value + return b +} + +// WithMachineNaming sets the MachineNaming field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MachineNaming field is set to the value of the last call. +func (b *KubeadmControlPlaneSpecApplyConfiguration) WithMachineNaming(value *MachineNamingSpecApplyConfiguration) *KubeadmControlPlaneSpecApplyConfiguration { + b.MachineNaming = value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanestatus.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanestatus.go new file mode 100644 index 000000000000..104b662553dd --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanestatus.go @@ -0,0 +1,160 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// KubeadmControlPlaneStatusApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneStatus type for use +// with apply. +// +// KubeadmControlPlaneStatus defines the observed state of KubeadmControlPlane. +type KubeadmControlPlaneStatusApplyConfiguration struct { + // conditions represents the observations of a KubeadmControlPlane's current state. + // Known condition types are Available, CertificatesAvailable, EtcdClusterAvailable, MachinesReady, MachinesUpToDate, + // ScalingUp, ScalingDown, Remediating, Deleting, Paused. + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + // initialization provides observations of the KubeadmControlPlane initialization process. + // NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Machine provisioning. + Initialization *KubeadmControlPlaneInitializationStatusApplyConfiguration `json:"initialization,omitempty"` + // selector is the label selector in string format to avoid introspection + // by clients, and is used to provide the CRD-based integration for the + // scale subresource and additional integrations for things like kubectl + // describe.. The string will be in the same format as the query-param syntax. + // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors + Selector *string `json:"selector,omitempty"` + // replicas is the total number of non-terminated machines targeted by this control plane + // (their labels match the selector). + Replicas *int32 `json:"replicas,omitempty"` + // readyReplicas is the number of ready replicas for this KubeadmControlPlane. A machine is considered ready when Machine's Ready condition is true. + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + // availableReplicas is the number of available replicas targeted by this KubeadmControlPlane. A machine is considered available when Machine's Available condition is true. + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + // upToDateReplicas is the number of up-to-date replicas targeted by this KubeadmControlPlane. A machine is considered up-to-date when Machine's UpToDate condition is true. + UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` + // version represents the minimum Kubernetes version for the control plane machines + // in the cluster. + Version *string `json:"version,omitempty"` + // observedGeneration is the latest generation observed by the controller. + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + // lastRemediation stores info about last remediation performed. + LastRemediation *LastRemediationStatusApplyConfiguration `json:"lastRemediation,omitempty"` + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + Deprecated *KubeadmControlPlaneDeprecatedStatusApplyConfiguration `json:"deprecated,omitempty"` +} + +// KubeadmControlPlaneStatusApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneStatus type for use with +// apply. +func KubeadmControlPlaneStatus() *KubeadmControlPlaneStatusApplyConfiguration { + return &KubeadmControlPlaneStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *KubeadmControlPlaneStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *KubeadmControlPlaneStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithInitialization sets the Initialization field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Initialization field is set to the value of the last call. +func (b *KubeadmControlPlaneStatusApplyConfiguration) WithInitialization(value *KubeadmControlPlaneInitializationStatusApplyConfiguration) *KubeadmControlPlaneStatusApplyConfiguration { + b.Initialization = value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *KubeadmControlPlaneStatusApplyConfiguration) WithSelector(value string) *KubeadmControlPlaneStatusApplyConfiguration { + b.Selector = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *KubeadmControlPlaneStatusApplyConfiguration) WithReplicas(value int32) *KubeadmControlPlaneStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *KubeadmControlPlaneStatusApplyConfiguration) WithReadyReplicas(value int32) *KubeadmControlPlaneStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *KubeadmControlPlaneStatusApplyConfiguration) WithAvailableReplicas(value int32) *KubeadmControlPlaneStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithUpToDateReplicas sets the UpToDateReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpToDateReplicas field is set to the value of the last call. +func (b *KubeadmControlPlaneStatusApplyConfiguration) WithUpToDateReplicas(value int32) *KubeadmControlPlaneStatusApplyConfiguration { + b.UpToDateReplicas = &value + return b +} + +// WithVersion sets the Version field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Version field is set to the value of the last call. +func (b *KubeadmControlPlaneStatusApplyConfiguration) WithVersion(value string) *KubeadmControlPlaneStatusApplyConfiguration { + b.Version = &value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *KubeadmControlPlaneStatusApplyConfiguration) WithObservedGeneration(value int64) *KubeadmControlPlaneStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithLastRemediation sets the LastRemediation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastRemediation field is set to the value of the last call. +func (b *KubeadmControlPlaneStatusApplyConfiguration) WithLastRemediation(value *LastRemediationStatusApplyConfiguration) *KubeadmControlPlaneStatusApplyConfiguration { + b.LastRemediation = value + return b +} + +// WithDeprecated sets the Deprecated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deprecated field is set to the value of the last call. +func (b *KubeadmControlPlaneStatusApplyConfiguration) WithDeprecated(value *KubeadmControlPlaneDeprecatedStatusApplyConfiguration) *KubeadmControlPlaneStatusApplyConfiguration { + b.Deprecated = value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanev1beta1deprecatedstatus.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanev1beta1deprecatedstatus.go new file mode 100644 index 000000000000..efc69b6d9f99 --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/kubeadmcontrolplanev1beta1deprecatedstatus.go @@ -0,0 +1,118 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + errors "sigs.k8s.io/cluster-api/errors" +) + +// KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration represents a declarative configuration of the KubeadmControlPlaneV1Beta1DeprecatedStatus type for use +// with apply. +// +// KubeadmControlPlaneV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration struct { + // conditions defines current service state of the KubeadmControlPlane. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + Conditions *corev1beta2.Conditions `json:"conditions,omitempty"` + // failureReason indicates that there is a terminal problem reconciling the + // state, and will be set to a token value suitable for + // programmatic interpretation. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + FailureReason *errors.KubeadmControlPlaneStatusError `json:"failureReason,omitempty"` + // failureMessage indicates that there is a terminal problem reconciling the + // state, and will be set to a descriptive error message. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + FailureMessage *string `json:"failureMessage,omitempty"` + // updatedReplicas is the total number of non-terminated machines targeted by this control plane + // that have the desired template spec. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` + // readyReplicas is the total number of fully running and ready control plane machines. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + // unavailableReplicas is the total number of unavailable machines targeted by this control plane. + // This is the total number of machines that are still required for + // the deployment to have 100% available capacity. They may either + // be machines that are running but not yet ready or machines + // that still have not been created. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` +} + +// KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration constructs a declarative configuration of the KubeadmControlPlaneV1Beta1DeprecatedStatus type for use with +// apply. +func KubeadmControlPlaneV1Beta1DeprecatedStatus() *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration { + return &KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration{} +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration) WithConditions(value corev1beta2.Conditions) *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration { + b.Conditions = &value + return b +} + +// WithFailureReason sets the FailureReason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureReason field is set to the value of the last call. +func (b *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration) WithFailureReason(value errors.KubeadmControlPlaneStatusError) *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration { + b.FailureReason = &value + return b +} + +// WithFailureMessage sets the FailureMessage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureMessage field is set to the value of the last call. +func (b *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration) WithFailureMessage(value string) *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration { + b.FailureMessage = &value + return b +} + +// WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpdatedReplicas field is set to the value of the last call. +func (b *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration) WithUpdatedReplicas(value int32) *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration { + b.UpdatedReplicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration) WithReadyReplicas(value int32) *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithUnavailableReplicas sets the UnavailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnavailableReplicas field is set to the value of the last call. +func (b *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration) WithUnavailableReplicas(value int32) *KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration { + b.UnavailableReplicas = &value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/lastremediationstatus.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/lastremediationstatus.go new file mode 100644 index 000000000000..be87d29a12c5 --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/lastremediationstatus.go @@ -0,0 +1,69 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// LastRemediationStatusApplyConfiguration represents a declarative configuration of the LastRemediationStatus type for use +// with apply. +// +// LastRemediationStatus stores info about last remediation performed. +// NOTE: if for any reason information about last remediation are lost, RetryCount is going to restart from 0 and thus +// more remediations than expected might happen. +type LastRemediationStatusApplyConfiguration struct { + // machine is the machine name of the latest machine being remediated. + Machine *string `json:"machine,omitempty"` + // time is when last remediation happened. It is represented in RFC3339 form and is in UTC. + Time *v1.Time `json:"time,omitempty"` + // retryCount used to keep track of remediation retry for the last remediated machine. + // A retry happens when a machine that was created as a replacement for an unhealthy machine also fails. + RetryCount *int32 `json:"retryCount,omitempty"` +} + +// LastRemediationStatusApplyConfiguration constructs a declarative configuration of the LastRemediationStatus type for use with +// apply. +func LastRemediationStatus() *LastRemediationStatusApplyConfiguration { + return &LastRemediationStatusApplyConfiguration{} +} + +// WithMachine sets the Machine field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Machine field is set to the value of the last call. +func (b *LastRemediationStatusApplyConfiguration) WithMachine(value string) *LastRemediationStatusApplyConfiguration { + b.Machine = &value + return b +} + +// WithTime sets the Time field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Time field is set to the value of the last call. +func (b *LastRemediationStatusApplyConfiguration) WithTime(value v1.Time) *LastRemediationStatusApplyConfiguration { + b.Time = &value + return b +} + +// WithRetryCount sets the RetryCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RetryCount field is set to the value of the last call. +func (b *LastRemediationStatusApplyConfiguration) WithRetryCount(value int32) *LastRemediationStatusApplyConfiguration { + b.RetryCount = &value + return b +} diff --git a/pkg/generated/applyconfiguration/kubeadm/v1beta2/machinenamingspec.go b/pkg/generated/applyconfiguration/kubeadm/v1beta2/machinenamingspec.go new file mode 100644 index 000000000000..97d727055af5 --- /dev/null +++ b/pkg/generated/applyconfiguration/kubeadm/v1beta2/machinenamingspec.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// MachineNamingSpecApplyConfiguration represents a declarative configuration of the MachineNamingSpec type for use +// with apply. +// +// MachineNamingSpec allows changing the naming pattern used when creating Machines. +// InfraMachines & KubeadmConfigs will use the same name as the corresponding Machines. +type MachineNamingSpecApplyConfiguration struct { + // template defines the template to use for generating the names of the Machine objects. + // If not defined, it will fallback to `{{ .kubeadmControlPlane.name }}-{{ .random }}`. + // If the generated name string exceeds 63 characters, it will be trimmed to 58 characters and will + // get concatenated with a random suffix of length 5. + // Length of the template string must not exceed 256 characters. + // The template allows the following variables `.cluster.name`, `.kubeadmControlPlane.name` and `.random`. + // The variable `.cluster.name` retrieves the name of the cluster object that owns the Machines being created. + // The variable `.kubeadmControlPlane.name` retrieves the name of the KubeadmControlPlane object that owns the Machines being created. + // The variable `.random` is substituted with random alphanumeric string, without vowels, of length 5. This variable is required + // part of the template. If not provided, validation will fail. + Template *string `json:"template,omitempty"` +} + +// MachineNamingSpecApplyConfiguration constructs a declarative configuration of the MachineNamingSpec type for use with +// apply. +func MachineNamingSpec() *MachineNamingSpecApplyConfiguration { + return &MachineNamingSpecApplyConfiguration{} +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *MachineNamingSpecApplyConfiguration) WithTemplate(value string) *MachineNamingSpecApplyConfiguration { + b.Template = &value + return b +} diff --git a/pkg/generated/applyconfiguration/utils.go b/pkg/generated/applyconfiguration/utils.go new file mode 100644 index 000000000000..a7d2ac2879a6 --- /dev/null +++ b/pkg/generated/applyconfiguration/utils.go @@ -0,0 +1,384 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package applyconfiguration + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1beta2 "sigs.k8s.io/cluster-api/api/addons/v1beta2" + kubeadmv1beta2 "sigs.k8s.io/cluster-api/api/controlplane/kubeadm/v1beta2" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + addonsv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/addons/v1beta2" + applyconfigurationcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + internal "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/internal" + applyconfigurationkubeadmv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/kubeadm/v1beta2" +) + +// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no +// apply configuration type exists for the given GroupVersionKind. +func ForKind(kind schema.GroupVersionKind) interface{} { + switch kind { + // Group=addons.cluster.x-k8s.io, Version=v1beta2 + case v1beta2.SchemeGroupVersion.WithKind("ClusterResourceSet"): + return &addonsv1beta2.ClusterResourceSetApplyConfiguration{} + case v1beta2.SchemeGroupVersion.WithKind("ClusterResourceSetBinding"): + return &addonsv1beta2.ClusterResourceSetBindingApplyConfiguration{} + case v1beta2.SchemeGroupVersion.WithKind("ClusterResourceSetBindingSpec"): + return &addonsv1beta2.ClusterResourceSetBindingSpecApplyConfiguration{} + case v1beta2.SchemeGroupVersion.WithKind("ClusterResourceSetDeprecatedStatus"): + return &addonsv1beta2.ClusterResourceSetDeprecatedStatusApplyConfiguration{} + case v1beta2.SchemeGroupVersion.WithKind("ClusterResourceSetSpec"): + return &addonsv1beta2.ClusterResourceSetSpecApplyConfiguration{} + case v1beta2.SchemeGroupVersion.WithKind("ClusterResourceSetStatus"): + return &addonsv1beta2.ClusterResourceSetStatusApplyConfiguration{} + case v1beta2.SchemeGroupVersion.WithKind("ClusterResourceSetV1Beta1DeprecatedStatus"): + return &addonsv1beta2.ClusterResourceSetV1Beta1DeprecatedStatusApplyConfiguration{} + case v1beta2.SchemeGroupVersion.WithKind("ResourceBinding"): + return &addonsv1beta2.ResourceBindingApplyConfiguration{} + case v1beta2.SchemeGroupVersion.WithKind("ResourceRef"): + return &addonsv1beta2.ResourceRefApplyConfiguration{} + case v1beta2.SchemeGroupVersion.WithKind("ResourceSetBinding"): + return &addonsv1beta2.ResourceSetBindingApplyConfiguration{} + + // Group=cluster.x-k8s.io, Version=v1beta2 + case corev1beta2.SchemeGroupVersion.WithKind("APIEndpoint"): + return &applyconfigurationcorev1beta2.APIEndpointApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("Bootstrap"): + return &applyconfigurationcorev1beta2.BootstrapApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("Cluster"): + return &applyconfigurationcorev1beta2.ClusterApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterAvailabilityGate"): + return &applyconfigurationcorev1beta2.ClusterAvailabilityGateApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClass"): + return &applyconfigurationcorev1beta2.ClusterClassApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassDeprecatedStatus"): + return &applyconfigurationcorev1beta2.ClusterClassDeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassPatch"): + return &applyconfigurationcorev1beta2.ClusterClassPatchApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassRef"): + return &applyconfigurationcorev1beta2.ClusterClassRefApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassSpec"): + return &applyconfigurationcorev1beta2.ClusterClassSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassStatus"): + return &applyconfigurationcorev1beta2.ClusterClassStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassStatusVariable"): + return &applyconfigurationcorev1beta2.ClusterClassStatusVariableApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassStatusVariableDefinition"): + return &applyconfigurationcorev1beta2.ClusterClassStatusVariableDefinitionApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassTemplateReference"): + return &applyconfigurationcorev1beta2.ClusterClassTemplateReferenceApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassUpgrade"): + return &applyconfigurationcorev1beta2.ClusterClassUpgradeApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassUpgradeExternal"): + return &applyconfigurationcorev1beta2.ClusterClassUpgradeExternalApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassV1Beta1DeprecatedStatus"): + return &applyconfigurationcorev1beta2.ClusterClassV1Beta1DeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassVariable"): + return &applyconfigurationcorev1beta2.ClusterClassVariableApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterClassVariableMetadata"): + return &applyconfigurationcorev1beta2.ClusterClassVariableMetadataApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterControlPlaneStatus"): + return &applyconfigurationcorev1beta2.ClusterControlPlaneStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterDeprecatedStatus"): + return &applyconfigurationcorev1beta2.ClusterDeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterInitializationStatus"): + return &applyconfigurationcorev1beta2.ClusterInitializationStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterNetwork"): + return &applyconfigurationcorev1beta2.ClusterNetworkApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterSpec"): + return &applyconfigurationcorev1beta2.ClusterSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterStatus"): + return &applyconfigurationcorev1beta2.ClusterStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterV1Beta1DeprecatedStatus"): + return &applyconfigurationcorev1beta2.ClusterV1Beta1DeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ClusterVariable"): + return &applyconfigurationcorev1beta2.ClusterVariableApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("Condition"): + return &applyconfigurationcorev1beta2.ConditionApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ContractVersionedObjectReference"): + return &applyconfigurationcorev1beta2.ContractVersionedObjectReferenceApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneClass"): + return &applyconfigurationcorev1beta2.ControlPlaneClassApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneClassHealthCheck"): + return &applyconfigurationcorev1beta2.ControlPlaneClassHealthCheckApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneClassHealthCheckChecks"): + return &applyconfigurationcorev1beta2.ControlPlaneClassHealthCheckChecksApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneClassHealthCheckRemediation"): + return &applyconfigurationcorev1beta2.ControlPlaneClassHealthCheckRemediationApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneClassHealthCheckRemediationTriggerIf"): + return &applyconfigurationcorev1beta2.ControlPlaneClassHealthCheckRemediationTriggerIfApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneClassMachineDeletionSpec"): + return &applyconfigurationcorev1beta2.ControlPlaneClassMachineDeletionSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneClassMachineInfrastructureTemplate"): + return &applyconfigurationcorev1beta2.ControlPlaneClassMachineInfrastructureTemplateApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneClassNamingSpec"): + return &applyconfigurationcorev1beta2.ControlPlaneClassNamingSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneTopology"): + return &applyconfigurationcorev1beta2.ControlPlaneTopologyApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneTopologyHealthCheck"): + return &applyconfigurationcorev1beta2.ControlPlaneTopologyHealthCheckApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneTopologyHealthCheckChecks"): + return &applyconfigurationcorev1beta2.ControlPlaneTopologyHealthCheckChecksApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneTopologyHealthCheckRemediation"): + return &applyconfigurationcorev1beta2.ControlPlaneTopologyHealthCheckRemediationApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneTopologyHealthCheckRemediationTriggerIf"): + return &applyconfigurationcorev1beta2.ControlPlaneTopologyHealthCheckRemediationTriggerIfApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneTopologyMachineDeletionSpec"): + return &applyconfigurationcorev1beta2.ControlPlaneTopologyMachineDeletionSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ControlPlaneVariables"): + return &applyconfigurationcorev1beta2.ControlPlaneVariablesApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ExternalPatchDefinition"): + return &applyconfigurationcorev1beta2.ExternalPatchDefinitionApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("FailureDomain"): + return &applyconfigurationcorev1beta2.FailureDomainApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("InfrastructureClass"): + return &applyconfigurationcorev1beta2.InfrastructureClassApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("InfrastructureClassNamingSpec"): + return &applyconfigurationcorev1beta2.InfrastructureClassNamingSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("JSONPatch"): + return &applyconfigurationcorev1beta2.JSONPatchApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("JSONPatchValue"): + return &applyconfigurationcorev1beta2.JSONPatchValueApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("JSONSchemaProps"): + return &applyconfigurationcorev1beta2.JSONSchemaPropsApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("Machine"): + return &applyconfigurationcorev1beta2.MachineApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineAddress"): + return &applyconfigurationcorev1beta2.MachineAddressApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeletionSpec"): + return &applyconfigurationcorev1beta2.MachineDeletionSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeletionStatus"): + return &applyconfigurationcorev1beta2.MachineDeletionStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeployment"): + return &applyconfigurationcorev1beta2.MachineDeploymentApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentClass"): + return &applyconfigurationcorev1beta2.MachineDeploymentClassApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentClassBootstrapTemplate"): + return &applyconfigurationcorev1beta2.MachineDeploymentClassBootstrapTemplateApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentClassHealthCheck"): + return &applyconfigurationcorev1beta2.MachineDeploymentClassHealthCheckApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentClassHealthCheckChecks"): + return &applyconfigurationcorev1beta2.MachineDeploymentClassHealthCheckChecksApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentClassHealthCheckRemediation"): + return &applyconfigurationcorev1beta2.MachineDeploymentClassHealthCheckRemediationApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentClassHealthCheckRemediationTriggerIf"): + return &applyconfigurationcorev1beta2.MachineDeploymentClassHealthCheckRemediationTriggerIfApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentClassInfrastructureTemplate"): + return &applyconfigurationcorev1beta2.MachineDeploymentClassInfrastructureTemplateApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentClassMachineDeletionSpec"): + return &applyconfigurationcorev1beta2.MachineDeploymentClassMachineDeletionSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentClassNamingSpec"): + return &applyconfigurationcorev1beta2.MachineDeploymentClassNamingSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentClassRolloutSpec"): + return &applyconfigurationcorev1beta2.MachineDeploymentClassRolloutSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentClassRolloutStrategy"): + return &applyconfigurationcorev1beta2.MachineDeploymentClassRolloutStrategyApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentClassRolloutStrategyRollingUpdate"): + return &applyconfigurationcorev1beta2.MachineDeploymentClassRolloutStrategyRollingUpdateApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentDeletionSpec"): + return &applyconfigurationcorev1beta2.MachineDeploymentDeletionSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentDeprecatedStatus"): + return &applyconfigurationcorev1beta2.MachineDeploymentDeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentRemediationSpec"): + return &applyconfigurationcorev1beta2.MachineDeploymentRemediationSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentRolloutSpec"): + return &applyconfigurationcorev1beta2.MachineDeploymentRolloutSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentRolloutStrategy"): + return &applyconfigurationcorev1beta2.MachineDeploymentRolloutStrategyApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentRolloutStrategyRollingUpdate"): + return &applyconfigurationcorev1beta2.MachineDeploymentRolloutStrategyRollingUpdateApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentSpec"): + return &applyconfigurationcorev1beta2.MachineDeploymentSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentStatus"): + return &applyconfigurationcorev1beta2.MachineDeploymentStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentTopology"): + return &applyconfigurationcorev1beta2.MachineDeploymentTopologyApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentTopologyHealthCheck"): + return &applyconfigurationcorev1beta2.MachineDeploymentTopologyHealthCheckApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentTopologyHealthCheckChecks"): + return &applyconfigurationcorev1beta2.MachineDeploymentTopologyHealthCheckChecksApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentTopologyHealthCheckRemediation"): + return &applyconfigurationcorev1beta2.MachineDeploymentTopologyHealthCheckRemediationApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentTopologyHealthCheckRemediationTriggerIf"): + return &applyconfigurationcorev1beta2.MachineDeploymentTopologyHealthCheckRemediationTriggerIfApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentTopologyMachineDeletionSpec"): + return &applyconfigurationcorev1beta2.MachineDeploymentTopologyMachineDeletionSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentTopologyRolloutSpec"): + return &applyconfigurationcorev1beta2.MachineDeploymentTopologyRolloutSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentTopologyRolloutStrategy"): + return &applyconfigurationcorev1beta2.MachineDeploymentTopologyRolloutStrategyApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentTopologyRolloutStrategyRollingUpdate"): + return &applyconfigurationcorev1beta2.MachineDeploymentTopologyRolloutStrategyRollingUpdateApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentV1Beta1DeprecatedStatus"): + return &applyconfigurationcorev1beta2.MachineDeploymentV1Beta1DeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeploymentVariables"): + return &applyconfigurationcorev1beta2.MachineDeploymentVariablesApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineDeprecatedStatus"): + return &applyconfigurationcorev1beta2.MachineDeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineHealthCheck"): + return &applyconfigurationcorev1beta2.MachineHealthCheckApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineHealthCheckChecks"): + return &applyconfigurationcorev1beta2.MachineHealthCheckChecksApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineHealthCheckDeprecatedStatus"): + return &applyconfigurationcorev1beta2.MachineHealthCheckDeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineHealthCheckRemediation"): + return &applyconfigurationcorev1beta2.MachineHealthCheckRemediationApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineHealthCheckRemediationTemplateReference"): + return &applyconfigurationcorev1beta2.MachineHealthCheckRemediationTemplateReferenceApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineHealthCheckRemediationTriggerIf"): + return &applyconfigurationcorev1beta2.MachineHealthCheckRemediationTriggerIfApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineHealthCheckSpec"): + return &applyconfigurationcorev1beta2.MachineHealthCheckSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineHealthCheckStatus"): + return &applyconfigurationcorev1beta2.MachineHealthCheckStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineHealthCheckV1Beta1DeprecatedStatus"): + return &applyconfigurationcorev1beta2.MachineHealthCheckV1Beta1DeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineInitializationStatus"): + return &applyconfigurationcorev1beta2.MachineInitializationStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineNamingSpec"): + return &applyconfigurationcorev1beta2.MachineNamingSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineNodeReference"): + return &applyconfigurationcorev1beta2.MachineNodeReferenceApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePool"): + return &applyconfigurationcorev1beta2.MachinePoolApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolClass"): + return &applyconfigurationcorev1beta2.MachinePoolClassApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolClassBootstrapTemplate"): + return &applyconfigurationcorev1beta2.MachinePoolClassBootstrapTemplateApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolClassInfrastructureTemplate"): + return &applyconfigurationcorev1beta2.MachinePoolClassInfrastructureTemplateApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolClassMachineDeletionSpec"): + return &applyconfigurationcorev1beta2.MachinePoolClassMachineDeletionSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolClassNamingSpec"): + return &applyconfigurationcorev1beta2.MachinePoolClassNamingSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolDeprecatedStatus"): + return &applyconfigurationcorev1beta2.MachinePoolDeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolInitializationStatus"): + return &applyconfigurationcorev1beta2.MachinePoolInitializationStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolSpec"): + return &applyconfigurationcorev1beta2.MachinePoolSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolStatus"): + return &applyconfigurationcorev1beta2.MachinePoolStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolTopology"): + return &applyconfigurationcorev1beta2.MachinePoolTopologyApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolTopologyMachineDeletionSpec"): + return &applyconfigurationcorev1beta2.MachinePoolTopologyMachineDeletionSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolV1Beta1DeprecatedStatus"): + return &applyconfigurationcorev1beta2.MachinePoolV1Beta1DeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachinePoolVariables"): + return &applyconfigurationcorev1beta2.MachinePoolVariablesApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineReadinessGate"): + return &applyconfigurationcorev1beta2.MachineReadinessGateApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineSet"): + return &applyconfigurationcorev1beta2.MachineSetApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineSetDeletionSpec"): + return &applyconfigurationcorev1beta2.MachineSetDeletionSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineSetDeprecatedStatus"): + return &applyconfigurationcorev1beta2.MachineSetDeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineSetSpec"): + return &applyconfigurationcorev1beta2.MachineSetSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineSetStatus"): + return &applyconfigurationcorev1beta2.MachineSetStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineSetV1Beta1DeprecatedStatus"): + return &applyconfigurationcorev1beta2.MachineSetV1Beta1DeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineSpec"): + return &applyconfigurationcorev1beta2.MachineSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineStatus"): + return &applyconfigurationcorev1beta2.MachineStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineTaint"): + return &applyconfigurationcorev1beta2.MachineTaintApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineTemplateSpec"): + return &applyconfigurationcorev1beta2.MachineTemplateSpecApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("MachineV1Beta1DeprecatedStatus"): + return &applyconfigurationcorev1beta2.MachineV1Beta1DeprecatedStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("NetworkRanges"): + return &applyconfigurationcorev1beta2.NetworkRangesApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ObjectMeta"): + return &applyconfigurationcorev1beta2.ObjectMetaApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("PatchDefinition"): + return &applyconfigurationcorev1beta2.PatchDefinitionApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("PatchSelector"): + return &applyconfigurationcorev1beta2.PatchSelectorApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("PatchSelectorMatch"): + return &applyconfigurationcorev1beta2.PatchSelectorMatchApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("PatchSelectorMatchMachineDeploymentClass"): + return &applyconfigurationcorev1beta2.PatchSelectorMatchMachineDeploymentClassApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("PatchSelectorMatchMachinePoolClass"): + return &applyconfigurationcorev1beta2.PatchSelectorMatchMachinePoolClassApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("Topology"): + return &applyconfigurationcorev1beta2.TopologyApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("UnhealthyMachineCondition"): + return &applyconfigurationcorev1beta2.UnhealthyMachineConditionApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("UnhealthyNodeCondition"): + return &applyconfigurationcorev1beta2.UnhealthyNodeConditionApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("ValidationRule"): + return &applyconfigurationcorev1beta2.ValidationRuleApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("VariableSchema"): + return &applyconfigurationcorev1beta2.VariableSchemaApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("VariableSchemaMetadata"): + return &applyconfigurationcorev1beta2.VariableSchemaMetadataApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("WorkersClass"): + return &applyconfigurationcorev1beta2.WorkersClassApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("WorkersStatus"): + return &applyconfigurationcorev1beta2.WorkersStatusApplyConfiguration{} + case corev1beta2.SchemeGroupVersion.WithKind("WorkersTopology"): + return &applyconfigurationcorev1beta2.WorkersTopologyApplyConfiguration{} + + // Group=controlplane.cluster.x-k8s.io, Version=v1beta2 + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlane"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneDeprecatedStatus"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneDeprecatedStatusApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneInitializationStatus"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneInitializationStatusApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneMachineTemplate"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneMachineTemplateApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneMachineTemplateDeletionSpec"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneMachineTemplateDeletionSpecApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneMachineTemplateSpec"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneMachineTemplateSpecApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneRemediationSpec"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneRemediationSpecApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneRolloutBeforeSpec"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneRolloutBeforeSpecApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneRolloutSpec"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneRolloutSpecApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneRolloutStrategy"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneRolloutStrategyApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneRolloutStrategyRollingUpdate"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneRolloutStrategyRollingUpdateApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneSpec"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneSpecApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneStatus"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneStatusApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlaneV1Beta1DeprecatedStatus"): + return &applyconfigurationkubeadmv1beta2.KubeadmControlPlaneV1Beta1DeprecatedStatusApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("LastRemediationStatus"): + return &applyconfigurationkubeadmv1beta2.LastRemediationStatusApplyConfiguration{} + case kubeadmv1beta2.SchemeGroupVersion.WithKind("MachineNamingSpec"): + return &applyconfigurationkubeadmv1beta2.MachineNamingSpecApplyConfiguration{} + + } + return nil +} + +func NewTypeConverter(scheme *runtime.Scheme) managedfields.TypeConverter { + return managedfields.NewSchemeTypeConverter(scheme, internal.Parser()) +} diff --git a/pkg/generated/client/clientset/clientset.go b/pkg/generated/client/clientset/clientset.go new file mode 100644 index 000000000000..17a1f14a2031 --- /dev/null +++ b/pkg/generated/client/clientset/clientset.go @@ -0,0 +1,158 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package clientset + +import ( + fmt "fmt" + http "net/http" + + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" + addonsv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/addons/v1beta2" + clusterv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/core/v1beta2" + controlplanev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/kubeadm/v1beta2" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + AddonsV1beta2() addonsv1beta2.AddonsV1beta2Interface + ClusterV1beta2() clusterv1beta2.ClusterV1beta2Interface + ControlplaneV1beta2() controlplanev1beta2.ControlplaneV1beta2Interface + ControlplaneV1beta2() controlplanev1beta2.ControlplaneV1beta2Interface +} + +// Clientset contains the clients for groups. +type Clientset struct { + *discovery.DiscoveryClient + addonsV1beta2 *addonsv1beta2.AddonsV1beta2Client + clusterV1beta2 *clusterv1beta2.ClusterV1beta2Client + controlplaneV1beta2 *controlplanev1beta2.ControlplaneV1beta2Client + controlplaneV1beta2 *controlplanev1beta2.ControlplaneV1beta2Client +} + +// AddonsV1beta2 retrieves the AddonsV1beta2Client +func (c *Clientset) AddonsV1beta2() addonsv1beta2.AddonsV1beta2Interface { + return c.addonsV1beta2 +} + +// ClusterV1beta2 retrieves the ClusterV1beta2Client +func (c *Clientset) ClusterV1beta2() clusterv1beta2.ClusterV1beta2Interface { + return c.clusterV1beta2 +} + +// ControlplaneV1beta2 retrieves the ControlplaneV1beta2Client +func (c *Clientset) ControlplaneV1beta2() controlplanev1beta2.ControlplaneV1beta2Interface { + return c.controlplaneV1beta2 +} + +// ControlplaneV1beta2 retrieves the ControlplaneV1beta2Client +func (c *Clientset) ControlplaneV1beta2() controlplanev1beta2.ControlplaneV1beta2Interface { + return c.controlplaneV1beta2 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.addonsV1beta2, err = addonsv1beta2.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.clusterV1beta2, err = clusterv1beta2.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.controlplaneV1beta2, err = controlplanev1beta2.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.controlplaneV1beta2, err = controlplanev1beta2.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.addonsV1beta2 = addonsv1beta2.New(c) + cs.clusterV1beta2 = clusterv1beta2.New(c) + cs.controlplaneV1beta2 = controlplanev1beta2.New(c) + cs.controlplaneV1beta2 = controlplanev1beta2.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/pkg/generated/client/clientset/fake/clientset_generated.go b/pkg/generated/client/clientset/fake/clientset_generated.go new file mode 100644 index 000000000000..8fcdb1138b37 --- /dev/null +++ b/pkg/generated/client/clientset/fake/clientset_generated.go @@ -0,0 +1,161 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" + applyconfiguration "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration" + clientset "sigs.k8s.io/cluster-api/pkg/generated/client/clientset" + addonsv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/addons/v1beta2" + fakeaddonsv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/addons/v1beta2/fake" + clusterv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/core/v1beta2" + fakeclusterv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/core/v1beta2/fake" + controlplanev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/kubeadm/v1beta2" + fakecontrolplanev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/kubeadm/v1beta2/fake" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +// +// Deprecated: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + var opts metav1.ListOptions + if watchAction, ok := action.(testing.WatchActionImpl); ok { + opts = watchAction.ListOptions + } + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns, opts) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +// IsWatchListSemanticsSupported informs the reflector that this client +// doesn't support WatchList semantics. +// +// This is a synthetic method whose sole purpose is to satisfy the optional +// interface check performed by the reflector. +// Returning true signals that WatchList can NOT be used. +// No additional logic is implemented here. +func (c *Clientset) IsWatchListSemanticsUnSupported() bool { + return true +} + +// NewClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewClientset(objects ...runtime.Object) *Clientset { + o := testing.NewFieldManagedObjectTracker( + scheme, + codecs.UniversalDecoder(), + applyconfiguration.NewTypeConverter(scheme), + ) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + var opts metav1.ListOptions + if watchAction, ok := action.(testing.WatchActionImpl); ok { + opts = watchAction.ListOptions + } + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns, opts) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// AddonsV1beta2 retrieves the AddonsV1beta2Client +func (c *Clientset) AddonsV1beta2() addonsv1beta2.AddonsV1beta2Interface { + return &fakeaddonsv1beta2.FakeAddonsV1beta2{Fake: &c.Fake} +} + +// ClusterV1beta2 retrieves the ClusterV1beta2Client +func (c *Clientset) ClusterV1beta2() clusterv1beta2.ClusterV1beta2Interface { + return &fakeclusterv1beta2.FakeClusterV1beta2{Fake: &c.Fake} +} + +// ControlplaneV1beta2 retrieves the ControlplaneV1beta2Client +func (c *Clientset) ControlplaneV1beta2() controlplanev1beta2.ControlplaneV1beta2Interface { + return &fakecontrolplanev1beta2.FakeControlplaneV1beta2{Fake: &c.Fake} +} + +// ControlplaneV1beta2 retrieves the ControlplaneV1beta2Client +func (c *Clientset) ControlplaneV1beta2() controlplanev1beta2.ControlplaneV1beta2Interface { + return &fakecontrolplanev1beta2.FakeControlplaneV1beta2{Fake: &c.Fake} +} diff --git a/pkg/generated/client/clientset/fake/doc.go b/pkg/generated/client/clientset/fake/doc.go new file mode 100644 index 000000000000..9b99e7167091 --- /dev/null +++ b/pkg/generated/client/clientset/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/pkg/generated/client/clientset/fake/register.go b/pkg/generated/client/clientset/fake/register.go new file mode 100644 index 000000000000..060dcb2a005a --- /dev/null +++ b/pkg/generated/client/clientset/fake/register.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + addonsv1beta2 "sigs.k8s.io/cluster-api/api/addons/v1beta2" + controlplanev1beta2 "sigs.k8s.io/cluster-api/api/controlplane/kubeadm/v1beta2" + clusterv1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + addonsv1beta2.AddToScheme, + clusterv1beta2.AddToScheme, + controlplanev1beta2.AddToScheme, + controlplanev1beta2.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/pkg/generated/client/clientset/scheme/doc.go b/pkg/generated/client/clientset/scheme/doc.go new file mode 100644 index 000000000000..7dc3756168fa --- /dev/null +++ b/pkg/generated/client/clientset/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/pkg/generated/client/clientset/scheme/register.go b/pkg/generated/client/clientset/scheme/register.go new file mode 100644 index 000000000000..51f5badb58d7 --- /dev/null +++ b/pkg/generated/client/clientset/scheme/register.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + addonsv1beta2 "sigs.k8s.io/cluster-api/api/addons/v1beta2" + controlplanev1beta2 "sigs.k8s.io/cluster-api/api/controlplane/kubeadm/v1beta2" + clusterv1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + addonsv1beta2.AddToScheme, + clusterv1beta2.AddToScheme, + controlplanev1beta2.AddToScheme, + controlplanev1beta2.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/pkg/generated/client/clientset/typed/addons/v1beta2/addons_client.go b/pkg/generated/client/clientset/typed/addons/v1beta2/addons_client.go new file mode 100644 index 000000000000..1eb19ab3c40d --- /dev/null +++ b/pkg/generated/client/clientset/typed/addons/v1beta2/addons_client.go @@ -0,0 +1,106 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + http "net/http" + + rest "k8s.io/client-go/rest" + addonsv1beta2 "sigs.k8s.io/cluster-api/api/addons/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +type AddonsV1beta2Interface interface { + RESTClient() rest.Interface + ClusterResourceSetsGetter + ClusterResourceSetBindingsGetter +} + +// AddonsV1beta2Client is used to interact with features provided by the addons.cluster.x-k8s.io group. +type AddonsV1beta2Client struct { + restClient rest.Interface +} + +func (c *AddonsV1beta2Client) ClusterResourceSets(namespace string) ClusterResourceSetInterface { + return newClusterResourceSets(c, namespace) +} + +func (c *AddonsV1beta2Client) ClusterResourceSetBindings(namespace string) ClusterResourceSetBindingInterface { + return newClusterResourceSetBindings(c, namespace) +} + +// NewForConfig creates a new AddonsV1beta2Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*AddonsV1beta2Client, error) { + config := *c + setConfigDefaults(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new AddonsV1beta2Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AddonsV1beta2Client, error) { + config := *c + setConfigDefaults(&config) + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &AddonsV1beta2Client{client}, nil +} + +// NewForConfigOrDie creates a new AddonsV1beta2Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *AddonsV1beta2Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new AddonsV1beta2Client for the given RESTClient. +func New(c rest.Interface) *AddonsV1beta2Client { + return &AddonsV1beta2Client{c} +} + +func setConfigDefaults(config *rest.Config) { + gv := addonsv1beta2.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *AddonsV1beta2Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/generated/client/clientset/typed/addons/v1beta2/clusterresourceset.go b/pkg/generated/client/clientset/typed/addons/v1beta2/clusterresourceset.go new file mode 100644 index 000000000000..cdc98c657490 --- /dev/null +++ b/pkg/generated/client/clientset/typed/addons/v1beta2/clusterresourceset.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + addonsv1beta2 "sigs.k8s.io/cluster-api/api/addons/v1beta2" + applyconfigurationaddonsv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/addons/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +// ClusterResourceSetsGetter has a method to return a ClusterResourceSetInterface. +// A group's client should implement this interface. +type ClusterResourceSetsGetter interface { + ClusterResourceSets(namespace string) ClusterResourceSetInterface +} + +// ClusterResourceSetInterface has methods to work with ClusterResourceSet resources. +type ClusterResourceSetInterface interface { + Create(ctx context.Context, clusterResourceSet *addonsv1beta2.ClusterResourceSet, opts v1.CreateOptions) (*addonsv1beta2.ClusterResourceSet, error) + Update(ctx context.Context, clusterResourceSet *addonsv1beta2.ClusterResourceSet, opts v1.UpdateOptions) (*addonsv1beta2.ClusterResourceSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, clusterResourceSet *addonsv1beta2.ClusterResourceSet, opts v1.UpdateOptions) (*addonsv1beta2.ClusterResourceSet, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*addonsv1beta2.ClusterResourceSet, error) + List(ctx context.Context, opts v1.ListOptions) (*addonsv1beta2.ClusterResourceSetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *addonsv1beta2.ClusterResourceSet, err error) + Apply(ctx context.Context, clusterResourceSet *applyconfigurationaddonsv1beta2.ClusterResourceSetApplyConfiguration, opts v1.ApplyOptions) (result *addonsv1beta2.ClusterResourceSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, clusterResourceSet *applyconfigurationaddonsv1beta2.ClusterResourceSetApplyConfiguration, opts v1.ApplyOptions) (result *addonsv1beta2.ClusterResourceSet, err error) + ClusterResourceSetExpansion +} + +// clusterResourceSets implements ClusterResourceSetInterface +type clusterResourceSets struct { + *gentype.ClientWithListAndApply[*addonsv1beta2.ClusterResourceSet, *addonsv1beta2.ClusterResourceSetList, *applyconfigurationaddonsv1beta2.ClusterResourceSetApplyConfiguration] +} + +// newClusterResourceSets returns a ClusterResourceSets +func newClusterResourceSets(c *AddonsV1beta2Client, namespace string) *clusterResourceSets { + return &clusterResourceSets{ + gentype.NewClientWithListAndApply[*addonsv1beta2.ClusterResourceSet, *addonsv1beta2.ClusterResourceSetList, *applyconfigurationaddonsv1beta2.ClusterResourceSetApplyConfiguration]( + "clusterresourcesets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *addonsv1beta2.ClusterResourceSet { return &addonsv1beta2.ClusterResourceSet{} }, + func() *addonsv1beta2.ClusterResourceSetList { return &addonsv1beta2.ClusterResourceSetList{} }, + ), + } +} diff --git a/pkg/generated/client/clientset/typed/addons/v1beta2/clusterresourcesetbinding.go b/pkg/generated/client/clientset/typed/addons/v1beta2/clusterresourcesetbinding.go new file mode 100644 index 000000000000..94a0efa7e986 --- /dev/null +++ b/pkg/generated/client/clientset/typed/addons/v1beta2/clusterresourcesetbinding.go @@ -0,0 +1,72 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + addonsv1beta2 "sigs.k8s.io/cluster-api/api/addons/v1beta2" + applyconfigurationaddonsv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/addons/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +// ClusterResourceSetBindingsGetter has a method to return a ClusterResourceSetBindingInterface. +// A group's client should implement this interface. +type ClusterResourceSetBindingsGetter interface { + ClusterResourceSetBindings(namespace string) ClusterResourceSetBindingInterface +} + +// ClusterResourceSetBindingInterface has methods to work with ClusterResourceSetBinding resources. +type ClusterResourceSetBindingInterface interface { + Create(ctx context.Context, clusterResourceSetBinding *addonsv1beta2.ClusterResourceSetBinding, opts v1.CreateOptions) (*addonsv1beta2.ClusterResourceSetBinding, error) + Update(ctx context.Context, clusterResourceSetBinding *addonsv1beta2.ClusterResourceSetBinding, opts v1.UpdateOptions) (*addonsv1beta2.ClusterResourceSetBinding, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*addonsv1beta2.ClusterResourceSetBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*addonsv1beta2.ClusterResourceSetBindingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *addonsv1beta2.ClusterResourceSetBinding, err error) + Apply(ctx context.Context, clusterResourceSetBinding *applyconfigurationaddonsv1beta2.ClusterResourceSetBindingApplyConfiguration, opts v1.ApplyOptions) (result *addonsv1beta2.ClusterResourceSetBinding, err error) + ClusterResourceSetBindingExpansion +} + +// clusterResourceSetBindings implements ClusterResourceSetBindingInterface +type clusterResourceSetBindings struct { + *gentype.ClientWithListAndApply[*addonsv1beta2.ClusterResourceSetBinding, *addonsv1beta2.ClusterResourceSetBindingList, *applyconfigurationaddonsv1beta2.ClusterResourceSetBindingApplyConfiguration] +} + +// newClusterResourceSetBindings returns a ClusterResourceSetBindings +func newClusterResourceSetBindings(c *AddonsV1beta2Client, namespace string) *clusterResourceSetBindings { + return &clusterResourceSetBindings{ + gentype.NewClientWithListAndApply[*addonsv1beta2.ClusterResourceSetBinding, *addonsv1beta2.ClusterResourceSetBindingList, *applyconfigurationaddonsv1beta2.ClusterResourceSetBindingApplyConfiguration]( + "clusterresourcesetbindings", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *addonsv1beta2.ClusterResourceSetBinding { return &addonsv1beta2.ClusterResourceSetBinding{} }, + func() *addonsv1beta2.ClusterResourceSetBindingList { + return &addonsv1beta2.ClusterResourceSetBindingList{} + }, + ), + } +} diff --git a/pkg/generated/client/clientset/typed/addons/v1beta2/doc.go b/pkg/generated/client/clientset/typed/addons/v1beta2/doc.go new file mode 100644 index 000000000000..56518ef7f2ab --- /dev/null +++ b/pkg/generated/client/clientset/typed/addons/v1beta2/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta2 diff --git a/pkg/generated/client/clientset/typed/addons/v1beta2/fake/doc.go b/pkg/generated/client/clientset/typed/addons/v1beta2/fake/doc.go new file mode 100644 index 000000000000..16f44399065e --- /dev/null +++ b/pkg/generated/client/clientset/typed/addons/v1beta2/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/generated/client/clientset/typed/addons/v1beta2/fake/fake_addons_client.go b/pkg/generated/client/clientset/typed/addons/v1beta2/fake/fake_addons_client.go new file mode 100644 index 000000000000..b725210fb9d9 --- /dev/null +++ b/pkg/generated/client/clientset/typed/addons/v1beta2/fake/fake_addons_client.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/addons/v1beta2" +) + +type FakeAddonsV1beta2 struct { + *testing.Fake +} + +func (c *FakeAddonsV1beta2) ClusterResourceSets(namespace string) v1beta2.ClusterResourceSetInterface { + return newFakeClusterResourceSets(c, namespace) +} + +func (c *FakeAddonsV1beta2) ClusterResourceSetBindings(namespace string) v1beta2.ClusterResourceSetBindingInterface { + return newFakeClusterResourceSetBindings(c, namespace) +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeAddonsV1beta2) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/generated/client/clientset/typed/addons/v1beta2/fake/fake_clusterresourceset.go b/pkg/generated/client/clientset/typed/addons/v1beta2/fake/fake_clusterresourceset.go new file mode 100644 index 000000000000..f837e8b102cb --- /dev/null +++ b/pkg/generated/client/clientset/typed/addons/v1beta2/fake/fake_clusterresourceset.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + gentype "k8s.io/client-go/gentype" + v1beta2 "sigs.k8s.io/cluster-api/api/addons/v1beta2" + addonsv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/addons/v1beta2" + typedaddonsv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/addons/v1beta2" +) + +// fakeClusterResourceSets implements ClusterResourceSetInterface +type fakeClusterResourceSets struct { + *gentype.FakeClientWithListAndApply[*v1beta2.ClusterResourceSet, *v1beta2.ClusterResourceSetList, *addonsv1beta2.ClusterResourceSetApplyConfiguration] + Fake *FakeAddonsV1beta2 +} + +func newFakeClusterResourceSets(fake *FakeAddonsV1beta2, namespace string) typedaddonsv1beta2.ClusterResourceSetInterface { + return &fakeClusterResourceSets{ + gentype.NewFakeClientWithListAndApply[*v1beta2.ClusterResourceSet, *v1beta2.ClusterResourceSetList, *addonsv1beta2.ClusterResourceSetApplyConfiguration]( + fake.Fake, + namespace, + v1beta2.SchemeGroupVersion.WithResource("clusterresourcesets"), + v1beta2.SchemeGroupVersion.WithKind("ClusterResourceSet"), + func() *v1beta2.ClusterResourceSet { return &v1beta2.ClusterResourceSet{} }, + func() *v1beta2.ClusterResourceSetList { return &v1beta2.ClusterResourceSetList{} }, + func(dst, src *v1beta2.ClusterResourceSetList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.ClusterResourceSetList) []*v1beta2.ClusterResourceSet { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1beta2.ClusterResourceSetList, items []*v1beta2.ClusterResourceSet) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/generated/client/clientset/typed/addons/v1beta2/fake/fake_clusterresourcesetbinding.go b/pkg/generated/client/clientset/typed/addons/v1beta2/fake/fake_clusterresourcesetbinding.go new file mode 100644 index 000000000000..973ad5322193 --- /dev/null +++ b/pkg/generated/client/clientset/typed/addons/v1beta2/fake/fake_clusterresourcesetbinding.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + gentype "k8s.io/client-go/gentype" + v1beta2 "sigs.k8s.io/cluster-api/api/addons/v1beta2" + addonsv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/addons/v1beta2" + typedaddonsv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/addons/v1beta2" +) + +// fakeClusterResourceSetBindings implements ClusterResourceSetBindingInterface +type fakeClusterResourceSetBindings struct { + *gentype.FakeClientWithListAndApply[*v1beta2.ClusterResourceSetBinding, *v1beta2.ClusterResourceSetBindingList, *addonsv1beta2.ClusterResourceSetBindingApplyConfiguration] + Fake *FakeAddonsV1beta2 +} + +func newFakeClusterResourceSetBindings(fake *FakeAddonsV1beta2, namespace string) typedaddonsv1beta2.ClusterResourceSetBindingInterface { + return &fakeClusterResourceSetBindings{ + gentype.NewFakeClientWithListAndApply[*v1beta2.ClusterResourceSetBinding, *v1beta2.ClusterResourceSetBindingList, *addonsv1beta2.ClusterResourceSetBindingApplyConfiguration]( + fake.Fake, + namespace, + v1beta2.SchemeGroupVersion.WithResource("clusterresourcesetbindings"), + v1beta2.SchemeGroupVersion.WithKind("ClusterResourceSetBinding"), + func() *v1beta2.ClusterResourceSetBinding { return &v1beta2.ClusterResourceSetBinding{} }, + func() *v1beta2.ClusterResourceSetBindingList { return &v1beta2.ClusterResourceSetBindingList{} }, + func(dst, src *v1beta2.ClusterResourceSetBindingList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.ClusterResourceSetBindingList) []*v1beta2.ClusterResourceSetBinding { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1beta2.ClusterResourceSetBindingList, items []*v1beta2.ClusterResourceSetBinding) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/generated/client/clientset/typed/addons/v1beta2/generated_expansion.go b/pkg/generated/client/clientset/typed/addons/v1beta2/generated_expansion.go new file mode 100644 index 000000000000..a8fd2bc3c5d8 --- /dev/null +++ b/pkg/generated/client/clientset/typed/addons/v1beta2/generated_expansion.go @@ -0,0 +1,23 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +type ClusterResourceSetExpansion interface{} + +type ClusterResourceSetBindingExpansion interface{} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/cluster.go b/pkg/generated/client/clientset/typed/core/v1beta2/cluster.go new file mode 100644 index 000000000000..6b225bba9480 --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/cluster.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + applyconfigurationcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +// ClustersGetter has a method to return a ClusterInterface. +// A group's client should implement this interface. +type ClustersGetter interface { + Clusters(namespace string) ClusterInterface +} + +// ClusterInterface has methods to work with Cluster resources. +type ClusterInterface interface { + Create(ctx context.Context, cluster *corev1beta2.Cluster, opts v1.CreateOptions) (*corev1beta2.Cluster, error) + Update(ctx context.Context, cluster *corev1beta2.Cluster, opts v1.UpdateOptions) (*corev1beta2.Cluster, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, cluster *corev1beta2.Cluster, opts v1.UpdateOptions) (*corev1beta2.Cluster, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*corev1beta2.Cluster, error) + List(ctx context.Context, opts v1.ListOptions) (*corev1beta2.ClusterList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1beta2.Cluster, err error) + Apply(ctx context.Context, cluster *applyconfigurationcorev1beta2.ClusterApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.Cluster, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, cluster *applyconfigurationcorev1beta2.ClusterApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.Cluster, err error) + ClusterExpansion +} + +// clusters implements ClusterInterface +type clusters struct { + *gentype.ClientWithListAndApply[*corev1beta2.Cluster, *corev1beta2.ClusterList, *applyconfigurationcorev1beta2.ClusterApplyConfiguration] +} + +// newClusters returns a Clusters +func newClusters(c *ClusterV1beta2Client, namespace string) *clusters { + return &clusters{ + gentype.NewClientWithListAndApply[*corev1beta2.Cluster, *corev1beta2.ClusterList, *applyconfigurationcorev1beta2.ClusterApplyConfiguration]( + "clusters", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1beta2.Cluster { return &corev1beta2.Cluster{} }, + func() *corev1beta2.ClusterList { return &corev1beta2.ClusterList{} }, + ), + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/clusterclass.go b/pkg/generated/client/clientset/typed/core/v1beta2/clusterclass.go new file mode 100644 index 000000000000..cd74e009663d --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/clusterclass.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + applyconfigurationcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +// ClusterClassesGetter has a method to return a ClusterClassInterface. +// A group's client should implement this interface. +type ClusterClassesGetter interface { + ClusterClasses(namespace string) ClusterClassInterface +} + +// ClusterClassInterface has methods to work with ClusterClass resources. +type ClusterClassInterface interface { + Create(ctx context.Context, clusterClass *corev1beta2.ClusterClass, opts v1.CreateOptions) (*corev1beta2.ClusterClass, error) + Update(ctx context.Context, clusterClass *corev1beta2.ClusterClass, opts v1.UpdateOptions) (*corev1beta2.ClusterClass, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, clusterClass *corev1beta2.ClusterClass, opts v1.UpdateOptions) (*corev1beta2.ClusterClass, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*corev1beta2.ClusterClass, error) + List(ctx context.Context, opts v1.ListOptions) (*corev1beta2.ClusterClassList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1beta2.ClusterClass, err error) + Apply(ctx context.Context, clusterClass *applyconfigurationcorev1beta2.ClusterClassApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.ClusterClass, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, clusterClass *applyconfigurationcorev1beta2.ClusterClassApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.ClusterClass, err error) + ClusterClassExpansion +} + +// clusterClasses implements ClusterClassInterface +type clusterClasses struct { + *gentype.ClientWithListAndApply[*corev1beta2.ClusterClass, *corev1beta2.ClusterClassList, *applyconfigurationcorev1beta2.ClusterClassApplyConfiguration] +} + +// newClusterClasses returns a ClusterClasses +func newClusterClasses(c *ClusterV1beta2Client, namespace string) *clusterClasses { + return &clusterClasses{ + gentype.NewClientWithListAndApply[*corev1beta2.ClusterClass, *corev1beta2.ClusterClassList, *applyconfigurationcorev1beta2.ClusterClassApplyConfiguration]( + "clusterclasses", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1beta2.ClusterClass { return &corev1beta2.ClusterClass{} }, + func() *corev1beta2.ClusterClassList { return &corev1beta2.ClusterClassList{} }, + ), + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/core_client.go b/pkg/generated/client/clientset/typed/core/v1beta2/core_client.go new file mode 100644 index 000000000000..fd308bea213c --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/core_client.go @@ -0,0 +1,131 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + http "net/http" + + rest "k8s.io/client-go/rest" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +type ClusterV1beta2Interface interface { + RESTClient() rest.Interface + ClustersGetter + ClusterClassesGetter + MachinesGetter + MachineDeploymentsGetter + MachineHealthChecksGetter + MachinePoolsGetter + MachineSetsGetter +} + +// ClusterV1beta2Client is used to interact with features provided by the cluster.x-k8s.io group. +type ClusterV1beta2Client struct { + restClient rest.Interface +} + +func (c *ClusterV1beta2Client) Clusters(namespace string) ClusterInterface { + return newClusters(c, namespace) +} + +func (c *ClusterV1beta2Client) ClusterClasses(namespace string) ClusterClassInterface { + return newClusterClasses(c, namespace) +} + +func (c *ClusterV1beta2Client) Machines(namespace string) MachineInterface { + return newMachines(c, namespace) +} + +func (c *ClusterV1beta2Client) MachineDeployments(namespace string) MachineDeploymentInterface { + return newMachineDeployments(c, namespace) +} + +func (c *ClusterV1beta2Client) MachineHealthChecks(namespace string) MachineHealthCheckInterface { + return newMachineHealthChecks(c, namespace) +} + +func (c *ClusterV1beta2Client) MachinePools(namespace string) MachinePoolInterface { + return newMachinePools(c, namespace) +} + +func (c *ClusterV1beta2Client) MachineSets(namespace string) MachineSetInterface { + return newMachineSets(c, namespace) +} + +// NewForConfig creates a new ClusterV1beta2Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*ClusterV1beta2Client, error) { + config := *c + setConfigDefaults(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new ClusterV1beta2Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ClusterV1beta2Client, error) { + config := *c + setConfigDefaults(&config) + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &ClusterV1beta2Client{client}, nil +} + +// NewForConfigOrDie creates a new ClusterV1beta2Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ClusterV1beta2Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ClusterV1beta2Client for the given RESTClient. +func New(c rest.Interface) *ClusterV1beta2Client { + return &ClusterV1beta2Client{c} +} + +func setConfigDefaults(config *rest.Config) { + gv := corev1beta2.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ClusterV1beta2Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/doc.go b/pkg/generated/client/clientset/typed/core/v1beta2/doc.go new file mode 100644 index 000000000000..56518ef7f2ab --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta2 diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/fake/doc.go b/pkg/generated/client/clientset/typed/core/v1beta2/fake/doc.go new file mode 100644 index 000000000000..16f44399065e --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_cluster.go b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_cluster.go new file mode 100644 index 000000000000..5e2e5ed02875 --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_cluster.go @@ -0,0 +1,51 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + gentype "k8s.io/client-go/gentype" + v1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + corev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + typedcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/core/v1beta2" +) + +// fakeClusters implements ClusterInterface +type fakeClusters struct { + *gentype.FakeClientWithListAndApply[*v1beta2.Cluster, *v1beta2.ClusterList, *corev1beta2.ClusterApplyConfiguration] + Fake *FakeClusterV1beta2 +} + +func newFakeClusters(fake *FakeClusterV1beta2, namespace string) typedcorev1beta2.ClusterInterface { + return &fakeClusters{ + gentype.NewFakeClientWithListAndApply[*v1beta2.Cluster, *v1beta2.ClusterList, *corev1beta2.ClusterApplyConfiguration]( + fake.Fake, + namespace, + v1beta2.SchemeGroupVersion.WithResource("clusters"), + v1beta2.SchemeGroupVersion.WithKind("Cluster"), + func() *v1beta2.Cluster { return &v1beta2.Cluster{} }, + func() *v1beta2.ClusterList { return &v1beta2.ClusterList{} }, + func(dst, src *v1beta2.ClusterList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.ClusterList) []*v1beta2.Cluster { return gentype.ToPointerSlice(list.Items) }, + func(list *v1beta2.ClusterList, items []*v1beta2.Cluster) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_clusterclass.go b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_clusterclass.go new file mode 100644 index 000000000000..87a6aaffc5fc --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_clusterclass.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + gentype "k8s.io/client-go/gentype" + v1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + corev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + typedcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/core/v1beta2" +) + +// fakeClusterClasses implements ClusterClassInterface +type fakeClusterClasses struct { + *gentype.FakeClientWithListAndApply[*v1beta2.ClusterClass, *v1beta2.ClusterClassList, *corev1beta2.ClusterClassApplyConfiguration] + Fake *FakeClusterV1beta2 +} + +func newFakeClusterClasses(fake *FakeClusterV1beta2, namespace string) typedcorev1beta2.ClusterClassInterface { + return &fakeClusterClasses{ + gentype.NewFakeClientWithListAndApply[*v1beta2.ClusterClass, *v1beta2.ClusterClassList, *corev1beta2.ClusterClassApplyConfiguration]( + fake.Fake, + namespace, + v1beta2.SchemeGroupVersion.WithResource("clusterclasses"), + v1beta2.SchemeGroupVersion.WithKind("ClusterClass"), + func() *v1beta2.ClusterClass { return &v1beta2.ClusterClass{} }, + func() *v1beta2.ClusterClassList { return &v1beta2.ClusterClassList{} }, + func(dst, src *v1beta2.ClusterClassList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.ClusterClassList) []*v1beta2.ClusterClass { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1beta2.ClusterClassList, items []*v1beta2.ClusterClass) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_core_client.go b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_core_client.go new file mode 100644 index 000000000000..5dfcfa0eedfb --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_core_client.go @@ -0,0 +1,64 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/core/v1beta2" +) + +type FakeClusterV1beta2 struct { + *testing.Fake +} + +func (c *FakeClusterV1beta2) Clusters(namespace string) v1beta2.ClusterInterface { + return newFakeClusters(c, namespace) +} + +func (c *FakeClusterV1beta2) ClusterClasses(namespace string) v1beta2.ClusterClassInterface { + return newFakeClusterClasses(c, namespace) +} + +func (c *FakeClusterV1beta2) Machines(namespace string) v1beta2.MachineInterface { + return newFakeMachines(c, namespace) +} + +func (c *FakeClusterV1beta2) MachineDeployments(namespace string) v1beta2.MachineDeploymentInterface { + return newFakeMachineDeployments(c, namespace) +} + +func (c *FakeClusterV1beta2) MachineHealthChecks(namespace string) v1beta2.MachineHealthCheckInterface { + return newFakeMachineHealthChecks(c, namespace) +} + +func (c *FakeClusterV1beta2) MachinePools(namespace string) v1beta2.MachinePoolInterface { + return newFakeMachinePools(c, namespace) +} + +func (c *FakeClusterV1beta2) MachineSets(namespace string) v1beta2.MachineSetInterface { + return newFakeMachineSets(c, namespace) +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeClusterV1beta2) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machine.go b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machine.go new file mode 100644 index 000000000000..67c98a668d0d --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machine.go @@ -0,0 +1,51 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + gentype "k8s.io/client-go/gentype" + v1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + corev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + typedcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/core/v1beta2" +) + +// fakeMachines implements MachineInterface +type fakeMachines struct { + *gentype.FakeClientWithListAndApply[*v1beta2.Machine, *v1beta2.MachineList, *corev1beta2.MachineApplyConfiguration] + Fake *FakeClusterV1beta2 +} + +func newFakeMachines(fake *FakeClusterV1beta2, namespace string) typedcorev1beta2.MachineInterface { + return &fakeMachines{ + gentype.NewFakeClientWithListAndApply[*v1beta2.Machine, *v1beta2.MachineList, *corev1beta2.MachineApplyConfiguration]( + fake.Fake, + namespace, + v1beta2.SchemeGroupVersion.WithResource("machines"), + v1beta2.SchemeGroupVersion.WithKind("Machine"), + func() *v1beta2.Machine { return &v1beta2.Machine{} }, + func() *v1beta2.MachineList { return &v1beta2.MachineList{} }, + func(dst, src *v1beta2.MachineList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.MachineList) []*v1beta2.Machine { return gentype.ToPointerSlice(list.Items) }, + func(list *v1beta2.MachineList, items []*v1beta2.Machine) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machinedeployment.go b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machinedeployment.go new file mode 100644 index 000000000000..23eed8164772 --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machinedeployment.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + gentype "k8s.io/client-go/gentype" + v1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + corev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + typedcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/core/v1beta2" +) + +// fakeMachineDeployments implements MachineDeploymentInterface +type fakeMachineDeployments struct { + *gentype.FakeClientWithListAndApply[*v1beta2.MachineDeployment, *v1beta2.MachineDeploymentList, *corev1beta2.MachineDeploymentApplyConfiguration] + Fake *FakeClusterV1beta2 +} + +func newFakeMachineDeployments(fake *FakeClusterV1beta2, namespace string) typedcorev1beta2.MachineDeploymentInterface { + return &fakeMachineDeployments{ + gentype.NewFakeClientWithListAndApply[*v1beta2.MachineDeployment, *v1beta2.MachineDeploymentList, *corev1beta2.MachineDeploymentApplyConfiguration]( + fake.Fake, + namespace, + v1beta2.SchemeGroupVersion.WithResource("machinedeployments"), + v1beta2.SchemeGroupVersion.WithKind("MachineDeployment"), + func() *v1beta2.MachineDeployment { return &v1beta2.MachineDeployment{} }, + func() *v1beta2.MachineDeploymentList { return &v1beta2.MachineDeploymentList{} }, + func(dst, src *v1beta2.MachineDeploymentList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.MachineDeploymentList) []*v1beta2.MachineDeployment { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1beta2.MachineDeploymentList, items []*v1beta2.MachineDeployment) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machinehealthcheck.go b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machinehealthcheck.go new file mode 100644 index 000000000000..84177f4b551b --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machinehealthcheck.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + gentype "k8s.io/client-go/gentype" + v1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + corev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + typedcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/core/v1beta2" +) + +// fakeMachineHealthChecks implements MachineHealthCheckInterface +type fakeMachineHealthChecks struct { + *gentype.FakeClientWithListAndApply[*v1beta2.MachineHealthCheck, *v1beta2.MachineHealthCheckList, *corev1beta2.MachineHealthCheckApplyConfiguration] + Fake *FakeClusterV1beta2 +} + +func newFakeMachineHealthChecks(fake *FakeClusterV1beta2, namespace string) typedcorev1beta2.MachineHealthCheckInterface { + return &fakeMachineHealthChecks{ + gentype.NewFakeClientWithListAndApply[*v1beta2.MachineHealthCheck, *v1beta2.MachineHealthCheckList, *corev1beta2.MachineHealthCheckApplyConfiguration]( + fake.Fake, + namespace, + v1beta2.SchemeGroupVersion.WithResource("machinehealthchecks"), + v1beta2.SchemeGroupVersion.WithKind("MachineHealthCheck"), + func() *v1beta2.MachineHealthCheck { return &v1beta2.MachineHealthCheck{} }, + func() *v1beta2.MachineHealthCheckList { return &v1beta2.MachineHealthCheckList{} }, + func(dst, src *v1beta2.MachineHealthCheckList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.MachineHealthCheckList) []*v1beta2.MachineHealthCheck { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1beta2.MachineHealthCheckList, items []*v1beta2.MachineHealthCheck) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machinepool.go b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machinepool.go new file mode 100644 index 000000000000..351e553380fd --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machinepool.go @@ -0,0 +1,51 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + gentype "k8s.io/client-go/gentype" + v1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + corev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + typedcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/core/v1beta2" +) + +// fakeMachinePools implements MachinePoolInterface +type fakeMachinePools struct { + *gentype.FakeClientWithListAndApply[*v1beta2.MachinePool, *v1beta2.MachinePoolList, *corev1beta2.MachinePoolApplyConfiguration] + Fake *FakeClusterV1beta2 +} + +func newFakeMachinePools(fake *FakeClusterV1beta2, namespace string) typedcorev1beta2.MachinePoolInterface { + return &fakeMachinePools{ + gentype.NewFakeClientWithListAndApply[*v1beta2.MachinePool, *v1beta2.MachinePoolList, *corev1beta2.MachinePoolApplyConfiguration]( + fake.Fake, + namespace, + v1beta2.SchemeGroupVersion.WithResource("machinepools"), + v1beta2.SchemeGroupVersion.WithKind("MachinePool"), + func() *v1beta2.MachinePool { return &v1beta2.MachinePool{} }, + func() *v1beta2.MachinePoolList { return &v1beta2.MachinePoolList{} }, + func(dst, src *v1beta2.MachinePoolList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.MachinePoolList) []*v1beta2.MachinePool { return gentype.ToPointerSlice(list.Items) }, + func(list *v1beta2.MachinePoolList, items []*v1beta2.MachinePool) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machineset.go b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machineset.go new file mode 100644 index 000000000000..2ab6ee2fd1d9 --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/fake/fake_machineset.go @@ -0,0 +1,51 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + gentype "k8s.io/client-go/gentype" + v1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + corev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + typedcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/core/v1beta2" +) + +// fakeMachineSets implements MachineSetInterface +type fakeMachineSets struct { + *gentype.FakeClientWithListAndApply[*v1beta2.MachineSet, *v1beta2.MachineSetList, *corev1beta2.MachineSetApplyConfiguration] + Fake *FakeClusterV1beta2 +} + +func newFakeMachineSets(fake *FakeClusterV1beta2, namespace string) typedcorev1beta2.MachineSetInterface { + return &fakeMachineSets{ + gentype.NewFakeClientWithListAndApply[*v1beta2.MachineSet, *v1beta2.MachineSetList, *corev1beta2.MachineSetApplyConfiguration]( + fake.Fake, + namespace, + v1beta2.SchemeGroupVersion.WithResource("machinesets"), + v1beta2.SchemeGroupVersion.WithKind("MachineSet"), + func() *v1beta2.MachineSet { return &v1beta2.MachineSet{} }, + func() *v1beta2.MachineSetList { return &v1beta2.MachineSetList{} }, + func(dst, src *v1beta2.MachineSetList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.MachineSetList) []*v1beta2.MachineSet { return gentype.ToPointerSlice(list.Items) }, + func(list *v1beta2.MachineSetList, items []*v1beta2.MachineSet) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/generated_expansion.go b/pkg/generated/client/clientset/typed/core/v1beta2/generated_expansion.go new file mode 100644 index 000000000000..de2d98d5cd17 --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/generated_expansion.go @@ -0,0 +1,33 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +type ClusterExpansion interface{} + +type ClusterClassExpansion interface{} + +type MachineExpansion interface{} + +type MachineDeploymentExpansion interface{} + +type MachineHealthCheckExpansion interface{} + +type MachinePoolExpansion interface{} + +type MachineSetExpansion interface{} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/machine.go b/pkg/generated/client/clientset/typed/core/v1beta2/machine.go new file mode 100644 index 000000000000..7cd9109775a7 --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/machine.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + applyconfigurationcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +// MachinesGetter has a method to return a MachineInterface. +// A group's client should implement this interface. +type MachinesGetter interface { + Machines(namespace string) MachineInterface +} + +// MachineInterface has methods to work with Machine resources. +type MachineInterface interface { + Create(ctx context.Context, machine *corev1beta2.Machine, opts v1.CreateOptions) (*corev1beta2.Machine, error) + Update(ctx context.Context, machine *corev1beta2.Machine, opts v1.UpdateOptions) (*corev1beta2.Machine, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, machine *corev1beta2.Machine, opts v1.UpdateOptions) (*corev1beta2.Machine, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*corev1beta2.Machine, error) + List(ctx context.Context, opts v1.ListOptions) (*corev1beta2.MachineList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1beta2.Machine, err error) + Apply(ctx context.Context, machine *applyconfigurationcorev1beta2.MachineApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.Machine, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, machine *applyconfigurationcorev1beta2.MachineApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.Machine, err error) + MachineExpansion +} + +// machines implements MachineInterface +type machines struct { + *gentype.ClientWithListAndApply[*corev1beta2.Machine, *corev1beta2.MachineList, *applyconfigurationcorev1beta2.MachineApplyConfiguration] +} + +// newMachines returns a Machines +func newMachines(c *ClusterV1beta2Client, namespace string) *machines { + return &machines{ + gentype.NewClientWithListAndApply[*corev1beta2.Machine, *corev1beta2.MachineList, *applyconfigurationcorev1beta2.MachineApplyConfiguration]( + "machines", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1beta2.Machine { return &corev1beta2.Machine{} }, + func() *corev1beta2.MachineList { return &corev1beta2.MachineList{} }, + ), + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/machinedeployment.go b/pkg/generated/client/clientset/typed/core/v1beta2/machinedeployment.go new file mode 100644 index 000000000000..8ebc59e53716 --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/machinedeployment.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + applyconfigurationcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +// MachineDeploymentsGetter has a method to return a MachineDeploymentInterface. +// A group's client should implement this interface. +type MachineDeploymentsGetter interface { + MachineDeployments(namespace string) MachineDeploymentInterface +} + +// MachineDeploymentInterface has methods to work with MachineDeployment resources. +type MachineDeploymentInterface interface { + Create(ctx context.Context, machineDeployment *corev1beta2.MachineDeployment, opts v1.CreateOptions) (*corev1beta2.MachineDeployment, error) + Update(ctx context.Context, machineDeployment *corev1beta2.MachineDeployment, opts v1.UpdateOptions) (*corev1beta2.MachineDeployment, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, machineDeployment *corev1beta2.MachineDeployment, opts v1.UpdateOptions) (*corev1beta2.MachineDeployment, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*corev1beta2.MachineDeployment, error) + List(ctx context.Context, opts v1.ListOptions) (*corev1beta2.MachineDeploymentList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1beta2.MachineDeployment, err error) + Apply(ctx context.Context, machineDeployment *applyconfigurationcorev1beta2.MachineDeploymentApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.MachineDeployment, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, machineDeployment *applyconfigurationcorev1beta2.MachineDeploymentApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.MachineDeployment, err error) + MachineDeploymentExpansion +} + +// machineDeployments implements MachineDeploymentInterface +type machineDeployments struct { + *gentype.ClientWithListAndApply[*corev1beta2.MachineDeployment, *corev1beta2.MachineDeploymentList, *applyconfigurationcorev1beta2.MachineDeploymentApplyConfiguration] +} + +// newMachineDeployments returns a MachineDeployments +func newMachineDeployments(c *ClusterV1beta2Client, namespace string) *machineDeployments { + return &machineDeployments{ + gentype.NewClientWithListAndApply[*corev1beta2.MachineDeployment, *corev1beta2.MachineDeploymentList, *applyconfigurationcorev1beta2.MachineDeploymentApplyConfiguration]( + "machinedeployments", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1beta2.MachineDeployment { return &corev1beta2.MachineDeployment{} }, + func() *corev1beta2.MachineDeploymentList { return &corev1beta2.MachineDeploymentList{} }, + ), + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/machinehealthcheck.go b/pkg/generated/client/clientset/typed/core/v1beta2/machinehealthcheck.go new file mode 100644 index 000000000000..6c060b3a1c85 --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/machinehealthcheck.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + applyconfigurationcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +// MachineHealthChecksGetter has a method to return a MachineHealthCheckInterface. +// A group's client should implement this interface. +type MachineHealthChecksGetter interface { + MachineHealthChecks(namespace string) MachineHealthCheckInterface +} + +// MachineHealthCheckInterface has methods to work with MachineHealthCheck resources. +type MachineHealthCheckInterface interface { + Create(ctx context.Context, machineHealthCheck *corev1beta2.MachineHealthCheck, opts v1.CreateOptions) (*corev1beta2.MachineHealthCheck, error) + Update(ctx context.Context, machineHealthCheck *corev1beta2.MachineHealthCheck, opts v1.UpdateOptions) (*corev1beta2.MachineHealthCheck, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, machineHealthCheck *corev1beta2.MachineHealthCheck, opts v1.UpdateOptions) (*corev1beta2.MachineHealthCheck, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*corev1beta2.MachineHealthCheck, error) + List(ctx context.Context, opts v1.ListOptions) (*corev1beta2.MachineHealthCheckList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1beta2.MachineHealthCheck, err error) + Apply(ctx context.Context, machineHealthCheck *applyconfigurationcorev1beta2.MachineHealthCheckApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.MachineHealthCheck, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, machineHealthCheck *applyconfigurationcorev1beta2.MachineHealthCheckApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.MachineHealthCheck, err error) + MachineHealthCheckExpansion +} + +// machineHealthChecks implements MachineHealthCheckInterface +type machineHealthChecks struct { + *gentype.ClientWithListAndApply[*corev1beta2.MachineHealthCheck, *corev1beta2.MachineHealthCheckList, *applyconfigurationcorev1beta2.MachineHealthCheckApplyConfiguration] +} + +// newMachineHealthChecks returns a MachineHealthChecks +func newMachineHealthChecks(c *ClusterV1beta2Client, namespace string) *machineHealthChecks { + return &machineHealthChecks{ + gentype.NewClientWithListAndApply[*corev1beta2.MachineHealthCheck, *corev1beta2.MachineHealthCheckList, *applyconfigurationcorev1beta2.MachineHealthCheckApplyConfiguration]( + "machinehealthchecks", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1beta2.MachineHealthCheck { return &corev1beta2.MachineHealthCheck{} }, + func() *corev1beta2.MachineHealthCheckList { return &corev1beta2.MachineHealthCheckList{} }, + ), + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/machinepool.go b/pkg/generated/client/clientset/typed/core/v1beta2/machinepool.go new file mode 100644 index 000000000000..d8a2b98ea419 --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/machinepool.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + applyconfigurationcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +// MachinePoolsGetter has a method to return a MachinePoolInterface. +// A group's client should implement this interface. +type MachinePoolsGetter interface { + MachinePools(namespace string) MachinePoolInterface +} + +// MachinePoolInterface has methods to work with MachinePool resources. +type MachinePoolInterface interface { + Create(ctx context.Context, machinePool *corev1beta2.MachinePool, opts v1.CreateOptions) (*corev1beta2.MachinePool, error) + Update(ctx context.Context, machinePool *corev1beta2.MachinePool, opts v1.UpdateOptions) (*corev1beta2.MachinePool, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, machinePool *corev1beta2.MachinePool, opts v1.UpdateOptions) (*corev1beta2.MachinePool, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*corev1beta2.MachinePool, error) + List(ctx context.Context, opts v1.ListOptions) (*corev1beta2.MachinePoolList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1beta2.MachinePool, err error) + Apply(ctx context.Context, machinePool *applyconfigurationcorev1beta2.MachinePoolApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.MachinePool, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, machinePool *applyconfigurationcorev1beta2.MachinePoolApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.MachinePool, err error) + MachinePoolExpansion +} + +// machinePools implements MachinePoolInterface +type machinePools struct { + *gentype.ClientWithListAndApply[*corev1beta2.MachinePool, *corev1beta2.MachinePoolList, *applyconfigurationcorev1beta2.MachinePoolApplyConfiguration] +} + +// newMachinePools returns a MachinePools +func newMachinePools(c *ClusterV1beta2Client, namespace string) *machinePools { + return &machinePools{ + gentype.NewClientWithListAndApply[*corev1beta2.MachinePool, *corev1beta2.MachinePoolList, *applyconfigurationcorev1beta2.MachinePoolApplyConfiguration]( + "machinepools", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1beta2.MachinePool { return &corev1beta2.MachinePool{} }, + func() *corev1beta2.MachinePoolList { return &corev1beta2.MachinePoolList{} }, + ), + } +} diff --git a/pkg/generated/client/clientset/typed/core/v1beta2/machineset.go b/pkg/generated/client/clientset/typed/core/v1beta2/machineset.go new file mode 100644 index 000000000000..1413566fc2d0 --- /dev/null +++ b/pkg/generated/client/clientset/typed/core/v1beta2/machineset.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" + applyconfigurationcorev1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/core/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +// MachineSetsGetter has a method to return a MachineSetInterface. +// A group's client should implement this interface. +type MachineSetsGetter interface { + MachineSets(namespace string) MachineSetInterface +} + +// MachineSetInterface has methods to work with MachineSet resources. +type MachineSetInterface interface { + Create(ctx context.Context, machineSet *corev1beta2.MachineSet, opts v1.CreateOptions) (*corev1beta2.MachineSet, error) + Update(ctx context.Context, machineSet *corev1beta2.MachineSet, opts v1.UpdateOptions) (*corev1beta2.MachineSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, machineSet *corev1beta2.MachineSet, opts v1.UpdateOptions) (*corev1beta2.MachineSet, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*corev1beta2.MachineSet, error) + List(ctx context.Context, opts v1.ListOptions) (*corev1beta2.MachineSetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1beta2.MachineSet, err error) + Apply(ctx context.Context, machineSet *applyconfigurationcorev1beta2.MachineSetApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.MachineSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, machineSet *applyconfigurationcorev1beta2.MachineSetApplyConfiguration, opts v1.ApplyOptions) (result *corev1beta2.MachineSet, err error) + MachineSetExpansion +} + +// machineSets implements MachineSetInterface +type machineSets struct { + *gentype.ClientWithListAndApply[*corev1beta2.MachineSet, *corev1beta2.MachineSetList, *applyconfigurationcorev1beta2.MachineSetApplyConfiguration] +} + +// newMachineSets returns a MachineSets +func newMachineSets(c *ClusterV1beta2Client, namespace string) *machineSets { + return &machineSets{ + gentype.NewClientWithListAndApply[*corev1beta2.MachineSet, *corev1beta2.MachineSetList, *applyconfigurationcorev1beta2.MachineSetApplyConfiguration]( + "machinesets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1beta2.MachineSet { return &corev1beta2.MachineSet{} }, + func() *corev1beta2.MachineSetList { return &corev1beta2.MachineSetList{} }, + ), + } +} diff --git a/pkg/generated/client/clientset/typed/kubeadm/v1beta2/doc.go b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/doc.go new file mode 100644 index 000000000000..56518ef7f2ab --- /dev/null +++ b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta2 diff --git a/pkg/generated/client/clientset/typed/kubeadm/v1beta2/fake/doc.go b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/fake/doc.go new file mode 100644 index 000000000000..16f44399065e --- /dev/null +++ b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/generated/client/clientset/typed/kubeadm/v1beta2/fake/fake_kubeadm_client.go b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/fake/fake_kubeadm_client.go new file mode 100644 index 000000000000..2efe4a972492 --- /dev/null +++ b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/fake/fake_kubeadm_client.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/kubeadm/v1beta2" +) + +type FakeControlplaneV1beta2 struct { + *testing.Fake +} + +func (c *FakeControlplaneV1beta2) KubeadmControlPlanes(namespace string) v1beta2.KubeadmControlPlaneInterface { + return newFakeKubeadmControlPlanes(c, namespace) +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeControlplaneV1beta2) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/generated/client/clientset/typed/kubeadm/v1beta2/fake/fake_kubeadmcontrolplane.go b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/fake/fake_kubeadmcontrolplane.go new file mode 100644 index 000000000000..f4efcf41390c --- /dev/null +++ b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/fake/fake_kubeadmcontrolplane.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + gentype "k8s.io/client-go/gentype" + v1beta2 "sigs.k8s.io/cluster-api/api/controlplane/kubeadm/v1beta2" + kubeadmv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/kubeadm/v1beta2" + typedkubeadmv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/typed/kubeadm/v1beta2" +) + +// fakeKubeadmControlPlanes implements KubeadmControlPlaneInterface +type fakeKubeadmControlPlanes struct { + *gentype.FakeClientWithListAndApply[*v1beta2.KubeadmControlPlane, *v1beta2.KubeadmControlPlaneList, *kubeadmv1beta2.KubeadmControlPlaneApplyConfiguration] + Fake *FakeControlplaneV1beta2 +} + +func newFakeKubeadmControlPlanes(fake *FakeControlplaneV1beta2, namespace string) typedkubeadmv1beta2.KubeadmControlPlaneInterface { + return &fakeKubeadmControlPlanes{ + gentype.NewFakeClientWithListAndApply[*v1beta2.KubeadmControlPlane, *v1beta2.KubeadmControlPlaneList, *kubeadmv1beta2.KubeadmControlPlaneApplyConfiguration]( + fake.Fake, + namespace, + v1beta2.SchemeGroupVersion.WithResource("kubeadmcontrolplanes"), + v1beta2.SchemeGroupVersion.WithKind("KubeadmControlPlane"), + func() *v1beta2.KubeadmControlPlane { return &v1beta2.KubeadmControlPlane{} }, + func() *v1beta2.KubeadmControlPlaneList { return &v1beta2.KubeadmControlPlaneList{} }, + func(dst, src *v1beta2.KubeadmControlPlaneList) { dst.ListMeta = src.ListMeta }, + func(list *v1beta2.KubeadmControlPlaneList) []*v1beta2.KubeadmControlPlane { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1beta2.KubeadmControlPlaneList, items []*v1beta2.KubeadmControlPlane) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/generated/client/clientset/typed/kubeadm/v1beta2/generated_expansion.go b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/generated_expansion.go new file mode 100644 index 000000000000..313fe2fcd191 --- /dev/null +++ b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +type KubeadmControlPlaneExpansion interface{} diff --git a/pkg/generated/client/clientset/typed/kubeadm/v1beta2/kubeadm_client.go b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/kubeadm_client.go new file mode 100644 index 000000000000..221bc68df48d --- /dev/null +++ b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/kubeadm_client.go @@ -0,0 +1,101 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + http "net/http" + + rest "k8s.io/client-go/rest" + kubeadmv1beta2 "sigs.k8s.io/cluster-api/api/controlplane/kubeadm/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +type ControlplaneV1beta2Interface interface { + RESTClient() rest.Interface + KubeadmControlPlanesGetter +} + +// ControlplaneV1beta2Client is used to interact with features provided by the controlplane.cluster.x-k8s.io group. +type ControlplaneV1beta2Client struct { + restClient rest.Interface +} + +func (c *ControlplaneV1beta2Client) KubeadmControlPlanes(namespace string) KubeadmControlPlaneInterface { + return newKubeadmControlPlanes(c, namespace) +} + +// NewForConfig creates a new ControlplaneV1beta2Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*ControlplaneV1beta2Client, error) { + config := *c + setConfigDefaults(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new ControlplaneV1beta2Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ControlplaneV1beta2Client, error) { + config := *c + setConfigDefaults(&config) + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &ControlplaneV1beta2Client{client}, nil +} + +// NewForConfigOrDie creates a new ControlplaneV1beta2Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ControlplaneV1beta2Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ControlplaneV1beta2Client for the given RESTClient. +func New(c rest.Interface) *ControlplaneV1beta2Client { + return &ControlplaneV1beta2Client{c} +} + +func setConfigDefaults(config *rest.Config) { + gv := kubeadmv1beta2.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ControlplaneV1beta2Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/generated/client/clientset/typed/kubeadm/v1beta2/kubeadmcontrolplane.go b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/kubeadmcontrolplane.go new file mode 100644 index 000000000000..259a28747311 --- /dev/null +++ b/pkg/generated/client/clientset/typed/kubeadm/v1beta2/kubeadmcontrolplane.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta2 + +import ( + context "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + kubeadmv1beta2 "sigs.k8s.io/cluster-api/api/controlplane/kubeadm/v1beta2" + applyconfigurationkubeadmv1beta2 "sigs.k8s.io/cluster-api/pkg/generated/applyconfiguration/kubeadm/v1beta2" + scheme "sigs.k8s.io/cluster-api/pkg/generated/client/clientset/scheme" +) + +// KubeadmControlPlanesGetter has a method to return a KubeadmControlPlaneInterface. +// A group's client should implement this interface. +type KubeadmControlPlanesGetter interface { + KubeadmControlPlanes(namespace string) KubeadmControlPlaneInterface +} + +// KubeadmControlPlaneInterface has methods to work with KubeadmControlPlane resources. +type KubeadmControlPlaneInterface interface { + Create(ctx context.Context, kubeadmControlPlane *kubeadmv1beta2.KubeadmControlPlane, opts v1.CreateOptions) (*kubeadmv1beta2.KubeadmControlPlane, error) + Update(ctx context.Context, kubeadmControlPlane *kubeadmv1beta2.KubeadmControlPlane, opts v1.UpdateOptions) (*kubeadmv1beta2.KubeadmControlPlane, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, kubeadmControlPlane *kubeadmv1beta2.KubeadmControlPlane, opts v1.UpdateOptions) (*kubeadmv1beta2.KubeadmControlPlane, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubeadmv1beta2.KubeadmControlPlane, error) + List(ctx context.Context, opts v1.ListOptions) (*kubeadmv1beta2.KubeadmControlPlaneList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubeadmv1beta2.KubeadmControlPlane, err error) + Apply(ctx context.Context, kubeadmControlPlane *applyconfigurationkubeadmv1beta2.KubeadmControlPlaneApplyConfiguration, opts v1.ApplyOptions) (result *kubeadmv1beta2.KubeadmControlPlane, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, kubeadmControlPlane *applyconfigurationkubeadmv1beta2.KubeadmControlPlaneApplyConfiguration, opts v1.ApplyOptions) (result *kubeadmv1beta2.KubeadmControlPlane, err error) + KubeadmControlPlaneExpansion +} + +// kubeadmControlPlanes implements KubeadmControlPlaneInterface +type kubeadmControlPlanes struct { + *gentype.ClientWithListAndApply[*kubeadmv1beta2.KubeadmControlPlane, *kubeadmv1beta2.KubeadmControlPlaneList, *applyconfigurationkubeadmv1beta2.KubeadmControlPlaneApplyConfiguration] +} + +// newKubeadmControlPlanes returns a KubeadmControlPlanes +func newKubeadmControlPlanes(c *ControlplaneV1beta2Client, namespace string) *kubeadmControlPlanes { + return &kubeadmControlPlanes{ + gentype.NewClientWithListAndApply[*kubeadmv1beta2.KubeadmControlPlane, *kubeadmv1beta2.KubeadmControlPlaneList, *applyconfigurationkubeadmv1beta2.KubeadmControlPlaneApplyConfiguration]( + "kubeadmcontrolplanes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *kubeadmv1beta2.KubeadmControlPlane { return &kubeadmv1beta2.KubeadmControlPlane{} }, + func() *kubeadmv1beta2.KubeadmControlPlaneList { return &kubeadmv1beta2.KubeadmControlPlaneList{} }, + ), + } +}