diff --git a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/condition_consts.go b/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/condition_consts.go deleted file mode 100644 index a2721f0c4..000000000 --- a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/condition_consts.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2021 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 v1beta1 - -import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - -// Conditions and condition Reasons for the KubeadmConfig object. - -const ( - // DataSecretAvailableCondition documents the status of the bootstrap secret generation process. - // - // NOTE: When the DataSecret generation starts the process completes immediately and within the - // same reconciliation, so the user will always see a transition from Wait to Generated without having - // evidence that BootstrapSecret generation is started/in progress. - DataSecretAvailableCondition clusterv1.ConditionType = "DataSecretAvailable" - - // WaitingForClusterInfrastructureReason (Severity=Info) document a bootstrap secret generation process - // waiting for the cluster infrastructure to be ready. - // - // NOTE: Having the cluster infrastructure ready is a pre-condition for starting to create machines; - // the KubeadmConfig controller ensure this pre-condition is satisfied. - WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure" - - // DataSecretGenerationFailedReason (Severity=Warning) documents a KubeadmConfig controller detecting - // an error while generating a data secret; those kind of errors are usually due to misconfigurations - // and user intervention is required to get them fixed. - DataSecretGenerationFailedReason = "DataSecretGenerationFailed" -) - -const ( - // CertificatesAvailableCondition documents that cluster certificates are available. - // - // NOTE: Cluster certificates are generated only for the KubeadmConfig object linked to the initial control plane - // machine, if the cluster is not using a control plane ref object, if the certificates are not provided - // by the users. - // IMPORTANT: This condition won't be re-created after clusterctl move. - CertificatesAvailableCondition clusterv1.ConditionType = "CertificatesAvailable" - - // CertificatesGenerationFailedReason (Severity=Warning) documents a KubeadmConfig controller detecting - // an error while generating certificates; those kind of errors are usually temporary and the controller - // automatically recover from them. - CertificatesGenerationFailedReason = "CertificatesGenerationFailed" - - // CertificatesCorruptedReason (Severity=Error) documents a KubeadmConfig controller detecting - // an error while retrieving certificates for a joining node. - CertificatesCorruptedReason = "CertificatesCorrupted" -) diff --git a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/conversion.go b/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/conversion.go deleted file mode 100644 index 35f773e41..000000000 --- a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/conversion.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2021 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 v1beta1 - -func (*KubeadmConfig) Hub() {} -func (*KubeadmConfigList) Hub() {} -func (*KubeadmConfigTemplate) Hub() {} -func (*KubeadmConfigTemplateList) Hub() {} - -func (*ClusterConfiguration) Hub() {} -func (*ClusterStatus) Hub() {} -func (*InitConfiguration) Hub() {} -func (*JoinConfiguration) Hub() {} diff --git a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/doc.go b/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/doc.go deleted file mode 100644 index d55ab5609..000000000 --- a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright 2021 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 v1beta1 diff --git a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/groupversion_info.go b/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/groupversion_info.go deleted file mode 100644 index cbd72aecb..000000000 --- a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/groupversion_info.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2021 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 v1beta1 contains API Schema definitions for the kubeadm v1beta1 API group -// +kubebuilder:object:generate=true -// +groupName=bootstrap.cluster.x-k8s.io -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "bootstrap.cluster.x-k8s.io", Version: "v1beta1"} - - // schemeBuilder is used to add go types to the GroupVersionKind scheme. - schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = schemeBuilder.AddToScheme - - objectTypes = []runtime.Object{} -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(GroupVersion, objectTypes...) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} diff --git a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/kubeadm_types.go b/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/kubeadm_types.go deleted file mode 100644 index 653b4da55..000000000 --- a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/kubeadm_types.go +++ /dev/null @@ -1,606 +0,0 @@ -/* -Copyright 2021 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 v1beta1 - -import ( - "encoding/json" - "fmt" - "strings" - - "github.com/pkg/errors" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - bootstrapapi "k8s.io/cluster-bootstrap/token/api" - bootstraputil "k8s.io/cluster-bootstrap/token/util" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// InitConfiguration contains a list of elements that is specific "kubeadm init"-only runtime -// information. -type InitConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // BootstrapTokens is respected at `kubeadm init` time and describes a set of Bootstrap Tokens to create. - // This information IS NOT uploaded to the kubeadm cluster configmap, partly because of its sensitive nature - // +optional - BootstrapTokens []BootstrapToken `json:"bootstrapTokens,omitempty"` - - // NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - // When used in the context of control plane nodes, NodeRegistration should remain consistent - // across both InitConfiguration and JoinConfiguration - // +optional - NodeRegistration NodeRegistrationOptions `json:"nodeRegistration,omitempty"` - - // LocalAPIEndpoint represents the endpoint of the API server instance that's deployed on this control plane node - // In HA setups, this differs from ClusterConfiguration.ControlPlaneEndpoint in the sense that ControlPlaneEndpoint - // is the global endpoint for the cluster, which then loadbalances the requests to each individual API server. This - // configuration object lets you customize what IP/DNS name and port the local API server advertises it's accessible - // on. By default, kubeadm tries to auto-detect the IP of the default interface and use that, but in case that process - // fails you may set the desired value here. - // +optional - LocalAPIEndpoint APIEndpoint `json:"localAPIEndpoint,omitempty"` - - // SkipPhases is a list of phases to skip during command execution. - // The list of phases can be obtained with the "kubeadm init --help" command. - // This option takes effect only on Kubernetes >=1.22.0. - // +optional - SkipPhases []string `json:"skipPhases,omitempty"` - - // Patches contains options related to applying patches to components deployed by kubeadm during - // "kubeadm init". The minimum kubernetes version needed to support Patches is v1.22 - // +optional - Patches *Patches `json:"patches,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterConfiguration contains cluster-wide configuration for a kubeadm cluster. -type ClusterConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // Etcd holds configuration for etcd. - // NB: This value defaults to a Local (stacked) etcd - // +optional - Etcd Etcd `json:"etcd,omitempty"` - - // Networking holds configuration for the networking topology of the cluster. - // NB: This value defaults to the Cluster object spec.clusterNetwork. - // +optional - Networking Networking `json:"networking,omitempty"` - - // KubernetesVersion is the target version of the control plane. - // NB: This value defaults to the Machine object spec.version - // +optional - KubernetesVersion string `json:"kubernetesVersion,omitempty"` - - // ControlPlaneEndpoint sets a stable IP address or DNS name for the control plane; it - // can be a valid IP address or a RFC-1123 DNS subdomain, both with optional TCP port. - // In case the ControlPlaneEndpoint is not specified, the AdvertiseAddress + BindPort - // are used; in case the ControlPlaneEndpoint is specified but without a TCP port, - // the BindPort is used. - // Possible usages are: - // e.g. In a cluster with more than one control plane instances, this field should be - // assigned the address of the external load balancer in front of the - // control plane instances. - // e.g. in environments with enforced node recycling, the ControlPlaneEndpoint - // could be used for assigning a stable DNS to the control plane. - // NB: This value defaults to the first value in the Cluster object status.apiEndpoints array. - // +optional - ControlPlaneEndpoint string `json:"controlPlaneEndpoint,omitempty"` - - // APIServer contains extra settings for the API server control plane component - // +optional - APIServer APIServer `json:"apiServer,omitempty"` - - // ControllerManager contains extra settings for the controller manager control plane component - // +optional - ControllerManager ControlPlaneComponent `json:"controllerManager,omitempty"` - - // Scheduler contains extra settings for the scheduler control plane component - // +optional - Scheduler ControlPlaneComponent `json:"scheduler,omitempty"` - - // DNS defines the options for the DNS add-on installed in the cluster. - // +optional - DNS DNS `json:"dns,omitempty"` - - // CertificatesDir specifies where to store or look for all required certificates. - // NB: if not provided, this will default to `/etc/kubernetes/pki` - // +optional - CertificatesDir string `json:"certificatesDir,omitempty"` - - // ImageRepository sets the container registry to pull images from. - // * If not set, the default registry of kubeadm will be used, i.e. - // * registry.k8s.io (new registry): >= v1.22.17, >= v1.23.15, >= v1.24.9, >= v1.25.0 - // * k8s.gcr.io (old registry): all older versions - // Please note that when imageRepository is not set we don't allow upgrades to - // versions >= v1.22.0 which use the old registry (k8s.gcr.io). Please use - // a newer patch version with the new registry instead (i.e. >= v1.22.17, - // >= v1.23.15, >= v1.24.9, >= v1.25.0). - // * If the version is a CI build (kubernetes version starts with `ci/` or `ci-cross/`) - // `gcr.io/k8s-staging-ci-images` will be used as a default for control plane components - // and for kube-proxy, while `registry.k8s.io` will be used for all the other images. - // +optional - ImageRepository string `json:"imageRepository,omitempty"` - - // FeatureGates enabled by the user. - // +optional - FeatureGates map[string]bool `json:"featureGates,omitempty"` - - // The cluster name - // +optional - ClusterName string `json:"clusterName,omitempty"` -} - -// ControlPlaneComponent holds settings common to control plane component of the cluster. -type ControlPlaneComponent struct { - // ExtraArgs is an extra set of flags to pass to the control plane component. - // TODO: This is temporary and ideally we would like to switch all components to - // use ComponentConfig + ConfigMaps. - // +optional - ExtraArgs map[string]string `json:"extraArgs,omitempty"` - - // ExtraVolumes is an extra set of host volumes, mounted to the control plane component. - // +optional - ExtraVolumes []HostPathMount `json:"extraVolumes,omitempty"` -} - -// APIServer holds settings necessary for API server deployments in the cluster. -type APIServer struct { - ControlPlaneComponent `json:",inline"` - - // CertSANs sets extra Subject Alternative Names for the API Server signing cert. - // +optional - CertSANs []string `json:"certSANs,omitempty"` - - // TimeoutForControlPlane controls the timeout that we use for API server to appear - // +optional - TimeoutForControlPlane *metav1.Duration `json:"timeoutForControlPlane,omitempty"` -} - -// DNS defines the DNS addon that should be used in the cluster. -type DNS struct { - // ImageMeta allows to customize the image used for the DNS component - ImageMeta `json:",inline"` -} - -// ImageMeta allows to customize the image used for components that are not -// originated from the Kubernetes/Kubernetes release process. -type ImageMeta struct { - // ImageRepository sets the container registry to pull images from. - // if not set, the ImageRepository defined in ClusterConfiguration will be used instead. - // +optional - ImageRepository string `json:"imageRepository,omitempty"` - - // ImageTag allows to specify a tag for the image. - // In case this value is set, kubeadm does not change automatically the version of the above components during upgrades. - // +optional - ImageTag string `json:"imageTag,omitempty"` - - //TODO: evaluate if we need also a ImageName based on user feedbacks -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterStatus contains the cluster status. The ClusterStatus will be stored in the kubeadm-config -// ConfigMap in the cluster, and then updated by kubeadm when additional control plane instance joins or leaves the cluster. -// -// Deprecated: ClusterStatus has been removed from kubeadm v1beta3 API; This type is preserved only to support -// conversion to older versions of the kubeadm API. -type ClusterStatus struct { - metav1.TypeMeta `json:",inline"` - - // APIEndpoints currently available in the cluster, one for each control plane/api server instance. - // The key of the map is the IP of the host's default interface - APIEndpoints map[string]APIEndpoint `json:"apiEndpoints"` -} - -// APIEndpoint struct contains elements of API server instance deployed on a node. -type APIEndpoint struct { - // AdvertiseAddress sets the IP address for the API server to advertise. - // +optional - AdvertiseAddress string `json:"advertiseAddress,omitempty"` - - // BindPort sets the secure port for the API Server to bind to. - // Defaults to 6443. - // +optional - BindPort int32 `json:"bindPort,omitempty"` -} - -// NodeRegistrationOptions holds fields that relate to registering a new control-plane or node to the cluster, either via "kubeadm init" or "kubeadm join". -// Note: The NodeRegistrationOptions struct has to be kept in sync with the structs in MarshalJSON. -type NodeRegistrationOptions struct { - - // Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation. - // This field is also used in the CommonName field of the kubelet's client certificate to the API server. - // Defaults to the hostname of the node if not provided. - // +optional - Name string `json:"name,omitempty"` - - // CRISocket is used to retrieve container runtime info. This information will be annotated to the Node API object, for later re-use - // +optional - CRISocket string `json:"criSocket,omitempty"` - - // Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process - // it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an - // empty slice, i.e. `taints: []` in the YAML file. This field is solely used for Node registration. - // +optional - Taints []corev1.Taint `json:"taints,omitempty"` - - // KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file - // kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap - // Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. - // +optional - KubeletExtraArgs map[string]string `json:"kubeletExtraArgs,omitempty"` - - // IgnorePreflightErrors provides a slice of pre-flight errors to be ignored when the current node is registered. - // +optional - IgnorePreflightErrors []string `json:"ignorePreflightErrors,omitempty"` - - // ImagePullPolicy specifies the policy for image pulling - // during kubeadm "init" and "join" operations. The value of - // this field must be one of "Always", "IfNotPresent" or - // "Never". Defaults to "IfNotPresent". This can be used only - // with Kubernetes version equal to 1.22 and later. - // +kubebuilder:validation:Enum=Always;IfNotPresent;Never - // +optional - ImagePullPolicy string `json:"imagePullPolicy,omitempty"` -} - -// MarshalJSON marshals NodeRegistrationOptions in a way that an empty slice in Taints is preserved. -// Taints are then rendered as: -// * nil => omitted from the marshalled JSON -// * [] => rendered as empty array (`[]`) -// * [regular-array] => rendered as usual -// We have to do this as the regular Golang JSON marshalling would just omit -// the empty slice (xref: https://github.com/golang/go/issues/22480). -// Note: We can't re-use the original struct as that would lead to an infinite recursion. -// Note: The structs in this func have to be kept in sync with the NodeRegistrationOptions struct. -func (n *NodeRegistrationOptions) MarshalJSON() ([]byte, error) { - // Marshal an empty Taints slice array without omitempty so it's preserved. - if n.Taints != nil && len(n.Taints) == 0 { - return json.Marshal(struct { - Name string `json:"name,omitempty"` - CRISocket string `json:"criSocket,omitempty"` - Taints []corev1.Taint `json:"taints"` - KubeletExtraArgs map[string]string `json:"kubeletExtraArgs,omitempty"` - IgnorePreflightErrors []string `json:"ignorePreflightErrors,omitempty"` - ImagePullPolicy string `json:"imagePullPolicy,omitempty"` - }{ - Name: n.Name, - CRISocket: n.CRISocket, - Taints: n.Taints, - KubeletExtraArgs: n.KubeletExtraArgs, - IgnorePreflightErrors: n.IgnorePreflightErrors, - ImagePullPolicy: n.ImagePullPolicy, - }) - } - - // If Taints is nil or not empty we can use omitempty. - return json.Marshal(struct { - Name string `json:"name,omitempty"` - CRISocket string `json:"criSocket,omitempty"` - Taints []corev1.Taint `json:"taints,omitempty"` - KubeletExtraArgs map[string]string `json:"kubeletExtraArgs,omitempty"` - IgnorePreflightErrors []string `json:"ignorePreflightErrors,omitempty"` - ImagePullPolicy string `json:"imagePullPolicy,omitempty"` - }{ - Name: n.Name, - CRISocket: n.CRISocket, - Taints: n.Taints, - KubeletExtraArgs: n.KubeletExtraArgs, - IgnorePreflightErrors: n.IgnorePreflightErrors, - ImagePullPolicy: n.ImagePullPolicy, - }) -} - -// Networking contains elements describing cluster's networking configuration. -type Networking struct { - // ServiceSubnet is the subnet used by k8s services. - // Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.pods.cidrBlocks, or - // to "10.96.0.0/12" if that's unset. - // +optional - ServiceSubnet string `json:"serviceSubnet,omitempty"` - // PodSubnet is the subnet used by pods. - // If unset, the API server will not allocate CIDR ranges for every node. - // Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.services.cidrBlocks if that is set - // +optional - PodSubnet string `json:"podSubnet,omitempty"` - // DNSDomain is the dns domain used by k8s services. Defaults to "cluster.local". - // +optional - DNSDomain string `json:"dnsDomain,omitempty"` -} - -// BootstrapToken describes one bootstrap token, stored as a Secret in the cluster. -type BootstrapToken struct { - // Token is used for establishing bidirectional trust between nodes and control-planes. - // Used for joining nodes in the cluster. - Token *BootstrapTokenString `json:"token"` - // Description sets a human-friendly message why this token exists and what it's used - // for, so other administrators can know its purpose. - // +optional - Description string `json:"description,omitempty"` - // TTL defines the time to live for this token. Defaults to 24h. - // Expires and TTL are mutually exclusive. - // +optional - TTL *metav1.Duration `json:"ttl,omitempty"` - // Expires specifies the timestamp when this token expires. Defaults to being set - // dynamically at runtime based on the TTL. Expires and TTL are mutually exclusive. - // +optional - Expires *metav1.Time `json:"expires,omitempty"` - // Usages describes the ways in which this token can be used. Can by default be used - // for establishing bidirectional trust, but that can be changed here. - // +optional - Usages []string `json:"usages,omitempty"` - // Groups specifies the extra groups that this token will authenticate as when/if - // used for authentication - // +optional - Groups []string `json:"groups,omitempty"` -} - -// Etcd contains elements describing Etcd configuration. -type Etcd struct { - - // Local provides configuration knobs for configuring the local etcd instance - // Local and External are mutually exclusive - // +optional - Local *LocalEtcd `json:"local,omitempty"` - - // External describes how to connect to an external etcd cluster - // Local and External are mutually exclusive - // +optional - External *ExternalEtcd `json:"external,omitempty"` -} - -// LocalEtcd describes that kubeadm should run an etcd cluster locally. -type LocalEtcd struct { - // ImageMeta allows to customize the container used for etcd - ImageMeta `json:",inline"` - - // DataDir is the directory etcd will place its data. - // Defaults to "/var/lib/etcd". - // +optional - DataDir string `json:"dataDir,omitempty"` - - // ExtraArgs are extra arguments provided to the etcd binary - // when run inside a static pod. - // +optional - ExtraArgs map[string]string `json:"extraArgs,omitempty"` - - // ServerCertSANs sets extra Subject Alternative Names for the etcd server signing cert. - // +optional - ServerCertSANs []string `json:"serverCertSANs,omitempty"` - // PeerCertSANs sets extra Subject Alternative Names for the etcd peer signing cert. - // +optional - PeerCertSANs []string `json:"peerCertSANs,omitempty"` -} - -// ExternalEtcd describes an external etcd cluster. -// Kubeadm has no knowledge of where certificate files live and they must be supplied. -type ExternalEtcd struct { - // Endpoints of etcd members. Required for ExternalEtcd. - Endpoints []string `json:"endpoints"` - - // CAFile is an SSL Certificate Authority file used to secure etcd communication. - // Required if using a TLS connection. - CAFile string `json:"caFile"` - - // CertFile is an SSL certification file used to secure etcd communication. - // Required if using a TLS connection. - CertFile string `json:"certFile"` - - // KeyFile is an SSL key file used to secure etcd communication. - // Required if using a TLS connection. - KeyFile string `json:"keyFile"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// JoinConfiguration contains elements describing a particular node. -type JoinConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - // When used in the context of control plane nodes, NodeRegistration should remain consistent - // across both InitConfiguration and JoinConfiguration - // +optional - NodeRegistration NodeRegistrationOptions `json:"nodeRegistration,omitempty"` - - // CACertPath is the path to the SSL certificate authority used to - // secure comunications between node and control-plane. - // Defaults to "/etc/kubernetes/pki/ca.crt". - // +optional - // TODO: revisit when there is defaulting from k/k - CACertPath string `json:"caCertPath,omitempty"` - - // Discovery specifies the options for the kubelet to use during the TLS Bootstrap process - // +optional - // TODO: revisit when there is defaulting from k/k - Discovery Discovery `json:"discovery,omitempty"` - - // ControlPlane defines the additional control plane instance to be deployed on the joining node. - // If nil, no additional control plane instance will be deployed. - // +optional - ControlPlane *JoinControlPlane `json:"controlPlane,omitempty"` - - // SkipPhases is a list of phases to skip during command execution. - // The list of phases can be obtained with the "kubeadm init --help" command. - // This option takes effect only on Kubernetes >=1.22.0. - // +optional - SkipPhases []string `json:"skipPhases,omitempty"` - - // Patches contains options related to applying patches to components deployed by kubeadm during - // "kubeadm join". The minimum kubernetes version needed to support Patches is v1.22 - // +optional - Patches *Patches `json:"patches,omitempty"` -} - -// JoinControlPlane contains elements describing an additional control plane instance to be deployed on the joining node. -type JoinControlPlane struct { - // LocalAPIEndpoint represents the endpoint of the API server instance to be deployed on this node. - // +optional - LocalAPIEndpoint APIEndpoint `json:"localAPIEndpoint,omitempty"` -} - -// Discovery specifies the options for the kubelet to use during the TLS Bootstrap process. -type Discovery struct { - // BootstrapToken is used to set the options for bootstrap token based discovery - // BootstrapToken and File are mutually exclusive - // +optional - BootstrapToken *BootstrapTokenDiscovery `json:"bootstrapToken,omitempty"` - - // File is used to specify a file or URL to a kubeconfig file from which to load cluster information - // BootstrapToken and File are mutually exclusive - // +optional - File *FileDiscovery `json:"file,omitempty"` - - // TLSBootstrapToken is a token used for TLS bootstrapping. - // If .BootstrapToken is set, this field is defaulted to .BootstrapToken.Token, but can be overridden. - // If .File is set, this field **must be set** in case the KubeConfigFile does not contain any other authentication information - // +optional - TLSBootstrapToken string `json:"tlsBootstrapToken,omitempty"` - - // Timeout modifies the discovery timeout - // +optional - Timeout *metav1.Duration `json:"timeout,omitempty"` -} - -// BootstrapTokenDiscovery is used to set the options for bootstrap token based discovery. -type BootstrapTokenDiscovery struct { - // Token is a token used to validate cluster information - // fetched from the control-plane. - Token string `json:"token"` - - // APIServerEndpoint is an IP or domain name to the API server from which info will be fetched. - // +optional - APIServerEndpoint string `json:"apiServerEndpoint,omitempty"` - - // CACertHashes specifies a set of public key pins to verify - // when token-based discovery is used. The root CA found during discovery - // must match one of these values. Specifying an empty set disables root CA - // pinning, which can be unsafe. Each hash is specified as ":", - // where the only currently supported type is "sha256". This is a hex-encoded - // SHA-256 hash of the Subject Public Key Info (SPKI) object in DER-encoded - // ASN.1. These hashes can be calculated using, for example, OpenSSL: - // openssl x509 -pubkey -in ca.crt openssl rsa -pubin -outform der 2>&/dev/null | openssl dgst -sha256 -hex - // +optional - CACertHashes []string `json:"caCertHashes,omitempty"` - - // UnsafeSkipCAVerification allows token-based discovery - // without CA verification via CACertHashes. This can weaken - // the security of kubeadm since other nodes can impersonate the control-plane. - // +optional - UnsafeSkipCAVerification bool `json:"unsafeSkipCAVerification,omitempty"` -} - -// FileDiscovery is used to specify a file or URL to a kubeconfig file from which to load cluster information. -type FileDiscovery struct { - // KubeConfigPath is used to specify the actual file path or URL to the kubeconfig file from which to load cluster information - KubeConfigPath string `json:"kubeConfigPath"` -} - -// HostPathMount contains elements describing volumes that are mounted from the -// host. -type HostPathMount struct { - // Name of the volume inside the pod template. - Name string `json:"name"` - // HostPath is the path in the host that will be mounted inside - // the pod. - HostPath string `json:"hostPath"` - // MountPath is the path inside the pod where hostPath will be mounted. - MountPath string `json:"mountPath"` - // ReadOnly controls write access to the volume - // +optional - ReadOnly bool `json:"readOnly,omitempty"` - // PathType is the type of the HostPath. - // +optional - PathType corev1.HostPathType `json:"pathType,omitempty"` -} - -// BootstrapTokenString is a token of the format abcdef.abcdef0123456789 that is used -// for both validation of the practically of the API server from a joining node's point -// of view and as an authentication method for the node in the bootstrap phase of -// "kubeadm join". This token is and should be short-lived. -// -// +kubebuilder:validation:Type=string -type BootstrapTokenString struct { - ID string `json:"-"` - Secret string `json:"-"` -} - -// MarshalJSON implements the json.Marshaler interface. -func (bts BootstrapTokenString) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf("%q", bts.String())), nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface. -func (bts *BootstrapTokenString) UnmarshalJSON(b []byte) error { - // If the token is represented as "", just return quickly without an error - if len(b) == 0 { - return nil - } - - // Remove unnecessary " characters coming from the JSON parser - token := strings.ReplaceAll(string(b), `"`, ``) - // Convert the string Token to a BootstrapTokenString object - newbts, err := NewBootstrapTokenString(token) - if err != nil { - return err - } - bts.ID = newbts.ID - bts.Secret = newbts.Secret - return nil -} - -// String returns the string representation of the BootstrapTokenString. -func (bts BootstrapTokenString) String() string { - if len(bts.ID) > 0 && len(bts.Secret) > 0 { - return bootstraputil.TokenFromIDAndSecret(bts.ID, bts.Secret) - } - return "" -} - -// NewBootstrapTokenString converts the given Bootstrap Token as a string -// to the BootstrapTokenString object used for serialization/deserialization -// and internal usage. It also automatically validates that the given token -// is of the right format. -func NewBootstrapTokenString(token string) (*BootstrapTokenString, error) { - substrs := bootstraputil.BootstrapTokenRegexp.FindStringSubmatch(token) - // TODO: Add a constant for the 3 value here, and explain better why it's needed (other than because how the regexp parsin works) - if len(substrs) != 3 { - return nil, errors.Errorf("the bootstrap token %q was not of the form %q", token, bootstrapapi.BootstrapTokenPattern) - } - - return &BootstrapTokenString{ID: substrs[1], Secret: substrs[2]}, nil -} - -// Patches contains options related to applying patches to components deployed by kubeadm. -type Patches struct { - // Directory is a path to a directory that contains files named "target[suffix][+patchtype].extension". - // For example, "kube-apiserver0+merge.yaml" or just "etcd.json". "target" can be one of - // "kube-apiserver", "kube-controller-manager", "kube-scheduler", "etcd". "patchtype" can be one - // of "strategic" "merge" or "json" and they match the patch formats supported by kubectl. - // The default "patchtype" is "strategic". "extension" must be either "json" or "yaml". - // "suffix" is an optional string that can be used to determine which patches are applied - // first alpha-numerically. - // These files can be written into the target directory via KubeadmConfig.Files which - // specifies additional files to be created on the machine, either with content inline or - // by referencing a secret. - // +optional - Directory string `json:"directory,omitempty"` -} diff --git a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/kubeadmconfig_types.go b/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/kubeadmconfig_types.go deleted file mode 100644 index 70b9c133b..000000000 --- a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/kubeadmconfig_types.go +++ /dev/null @@ -1,648 +0,0 @@ -/* -Copyright 2021 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 v1beta1 - -import ( - "fmt" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/validation/field" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/cluster-api/feature" -) - -// Format specifies the output format of the bootstrap data -// +kubebuilder:validation:Enum=cloud-config;ignition -type Format string - -const ( - // CloudConfig make the bootstrap data to be of cloud-config format. - CloudConfig Format = "cloud-config" - - // Ignition make the bootstrap data to be of Ignition format. - Ignition Format = "ignition" -) - -var ( - cannotUseWithIgnition = fmt.Sprintf("not supported when spec.format is set to: %q", Ignition) - conflictingFileSourceMsg = "only one of content or contentFrom may be specified for a single file" - conflictingUserSourceMsg = "only one of passwd or passwdFrom may be specified for a single user" - kubeadmBootstrapFormatIgnitionFeatureDisabledMsg = "can be set only if the KubeadmBootstrapFormatIgnition feature gate is enabled" - missingSecretNameMsg = "secret file source must specify non-empty secret name" - missingSecretKeyMsg = "secret file source must specify non-empty secret key" - pathConflictMsg = "path property must be unique among all files" -) - -// KubeadmConfigSpec defines the desired state of KubeadmConfig. -// Either ClusterConfiguration and InitConfiguration should be defined or the JoinConfiguration should be defined. -type KubeadmConfigSpec struct { - // ClusterConfiguration along with InitConfiguration are the configurations necessary for the init command - // +optional - ClusterConfiguration *ClusterConfiguration `json:"clusterConfiguration,omitempty"` - - // InitConfiguration along with ClusterConfiguration are the configurations necessary for the init command - // +optional - InitConfiguration *InitConfiguration `json:"initConfiguration,omitempty"` - - // JoinConfiguration is the kubeadm configuration for the join command - // +optional - JoinConfiguration *JoinConfiguration `json:"joinConfiguration,omitempty"` - - // Files specifies extra files to be passed to user_data upon creation. - // +optional - Files []File `json:"files,omitempty"` - - // DiskSetup specifies options for the creation of partition tables and file systems on devices. - // +optional - DiskSetup *DiskSetup `json:"diskSetup,omitempty"` - - // Mounts specifies a list of mount points to be setup. - // +optional - Mounts []MountPoints `json:"mounts,omitempty"` - - // PreKubeadmCommands specifies extra commands to run before kubeadm runs - // +optional - PreKubeadmCommands []string `json:"preKubeadmCommands,omitempty"` - - // PostKubeadmCommands specifies extra commands to run after kubeadm runs - // +optional - PostKubeadmCommands []string `json:"postKubeadmCommands,omitempty"` - - // Users specifies extra users to add - // +optional - Users []User `json:"users,omitempty"` - - // NTP specifies NTP configuration - // +optional - NTP *NTP `json:"ntp,omitempty"` - - // Format specifies the output format of the bootstrap data - // +optional - Format Format `json:"format,omitempty"` - - // Verbosity is the number for the kubeadm log level verbosity. - // It overrides the `--v` flag in kubeadm commands. - // +optional - Verbosity *int32 `json:"verbosity,omitempty"` - - // UseExperimentalRetryJoin replaces a basic kubeadm command with a shell - // script with retries for joins. - // - // This is meant to be an experimental temporary workaround on some environments - // where joins fail due to timing (and other issues). The long term goal is to add retries to - // kubeadm proper and use that functionality. - // - // This will add about 40KB to userdata - // - // For more information, refer to https://github.com/kubernetes-sigs/cluster-api/pull/2763#discussion_r397306055. - // +optional - // - // Deprecated: This experimental fix is no longer needed and this field will be removed in a future release. - // When removing also remove from staticcheck exclude-rules for SA1019 in golangci.yml - UseExperimentalRetryJoin bool `json:"useExperimentalRetryJoin,omitempty"` - - // Ignition contains Ignition specific configuration. - // +optional - Ignition *IgnitionSpec `json:"ignition,omitempty"` -} - -// Default defaults a KubeadmConfigSpec. -func (c *KubeadmConfigSpec) Default() { - if c.Format == "" { - c.Format = CloudConfig - } - if c.InitConfiguration != nil && c.InitConfiguration.NodeRegistration.ImagePullPolicy == "" { - c.InitConfiguration.NodeRegistration.ImagePullPolicy = "IfNotPresent" - } - if c.JoinConfiguration != nil && c.JoinConfiguration.NodeRegistration.ImagePullPolicy == "" { - c.JoinConfiguration.NodeRegistration.ImagePullPolicy = "IfNotPresent" - } -} - -// Validate ensures the KubeadmConfigSpec is valid. -func (c *KubeadmConfigSpec) Validate(pathPrefix *field.Path) field.ErrorList { - var allErrs field.ErrorList - - allErrs = append(allErrs, c.validateFiles(pathPrefix)...) - allErrs = append(allErrs, c.validateUsers(pathPrefix)...) - allErrs = append(allErrs, c.validateIgnition(pathPrefix)...) - - return allErrs -} - -func (c *KubeadmConfigSpec) validateFiles(pathPrefix *field.Path) field.ErrorList { - var allErrs field.ErrorList - - knownPaths := map[string]struct{}{} - - for i := range c.Files { - file := c.Files[i] - if file.Content != "" && file.ContentFrom != nil { - allErrs = append( - allErrs, - field.Invalid( - pathPrefix.Child("files").Index(i), - file, - conflictingFileSourceMsg, - ), - ) - } - // n.b.: if we ever add types besides Secret as a ContentFrom - // Source, we must add webhook validation here for one of the - // sources being non-nil. - if file.ContentFrom != nil { - if file.ContentFrom.Secret.Name == "" { - allErrs = append( - allErrs, - field.Required( - pathPrefix.Child("files").Index(i).Child("contentFrom", "secret", "name"), - missingSecretNameMsg, - ), - ) - } - if file.ContentFrom.Secret.Key == "" { - allErrs = append( - allErrs, - field.Required( - pathPrefix.Child("files").Index(i).Child("contentFrom", "secret", "key"), - missingSecretKeyMsg, - ), - ) - } - } - _, conflict := knownPaths[file.Path] - if conflict { - allErrs = append( - allErrs, - field.Invalid( - pathPrefix.Child("files").Index(i).Child("path"), - file, - pathConflictMsg, - ), - ) - } - knownPaths[file.Path] = struct{}{} - } - - return allErrs -} - -func (c *KubeadmConfigSpec) validateUsers(pathPrefix *field.Path) field.ErrorList { - var allErrs field.ErrorList - - for i := range c.Users { - user := c.Users[i] - if user.Passwd != nil && user.PasswdFrom != nil { - allErrs = append( - allErrs, - field.Invalid( - pathPrefix.Child("users").Index(i), - user, - conflictingUserSourceMsg, - ), - ) - } - // n.b.: if we ever add types besides Secret as a PasswdFrom - // Source, we must add webhook validation here for one of the - // sources being non-nil. - if user.PasswdFrom != nil { - if user.PasswdFrom.Secret.Name == "" { - allErrs = append( - allErrs, - field.Required( - pathPrefix.Child("users").Index(i).Child("passwdFrom", "secret", "name"), - missingSecretNameMsg, - ), - ) - } - if user.PasswdFrom.Secret.Key == "" { - allErrs = append( - allErrs, - field.Required( - pathPrefix.Child("users").Index(i).Child("passwdFrom", "secret", "key"), - missingSecretKeyMsg, - ), - ) - } - } - } - - return allErrs -} - -func (c *KubeadmConfigSpec) validateIgnition(pathPrefix *field.Path) field.ErrorList { - var allErrs field.ErrorList - - if !feature.Gates.Enabled(feature.KubeadmBootstrapFormatIgnition) { - if c.Format == Ignition { - allErrs = append(allErrs, field.Forbidden( - pathPrefix.Child("format"), kubeadmBootstrapFormatIgnitionFeatureDisabledMsg)) - } - - if c.Ignition != nil { - allErrs = append(allErrs, field.Forbidden( - pathPrefix.Child("ignition"), kubeadmBootstrapFormatIgnitionFeatureDisabledMsg)) - } - - return allErrs - } - - if c.Format != Ignition { - if c.Ignition != nil { - allErrs = append( - allErrs, - field.Invalid( - pathPrefix.Child("format"), - c.Format, - fmt.Sprintf("must be set to %q if spec.ignition is set", Ignition), - ), - ) - } - - return allErrs - } - - for i, user := range c.Users { - if user.Inactive != nil && *user.Inactive { - allErrs = append( - allErrs, - field.Forbidden( - pathPrefix.Child("users").Index(i).Child("inactive"), - cannotUseWithIgnition, - ), - ) - } - } - - if c.UseExperimentalRetryJoin { - allErrs = append( - allErrs, - field.Forbidden( - pathPrefix.Child("useExperimentalRetryJoin"), - cannotUseWithIgnition, - ), - ) - } - - for i, file := range c.Files { - if file.Encoding == Gzip || file.Encoding == GzipBase64 { - allErrs = append( - allErrs, - field.Forbidden( - pathPrefix.Child("files").Index(i).Child("encoding"), - cannotUseWithIgnition, - ), - ) - } - } - - if c.DiskSetup == nil { - return allErrs - } - - for i, partition := range c.DiskSetup.Partitions { - if partition.TableType != nil && *partition.TableType != "gpt" { - allErrs = append( - allErrs, - field.Invalid( - pathPrefix.Child("diskSetup", "partitions").Index(i).Child("tableType"), - *partition.TableType, - fmt.Sprintf( - "only partition type %q is supported when spec.format is set to %q", - "gpt", - Ignition, - ), - ), - ) - } - } - - for i, fs := range c.DiskSetup.Filesystems { - if fs.ReplaceFS != nil { - allErrs = append( - allErrs, - field.Forbidden( - pathPrefix.Child("diskSetup", "filesystems").Index(i).Child("replaceFS"), - cannotUseWithIgnition, - ), - ) - } - - if fs.Partition != nil { - allErrs = append( - allErrs, - field.Forbidden( - pathPrefix.Child("diskSetup", "filesystems").Index(i).Child("partition"), - cannotUseWithIgnition, - ), - ) - } - } - - return allErrs -} - -// IgnitionSpec contains Ignition specific configuration. -type IgnitionSpec struct { - // ContainerLinuxConfig contains CLC specific configuration. - // +optional - ContainerLinuxConfig *ContainerLinuxConfig `json:"containerLinuxConfig,omitempty"` -} - -// ContainerLinuxConfig contains CLC-specific configuration. -// -// We use a structured type here to allow adding additional fields, for example 'version'. -type ContainerLinuxConfig struct { - // AdditionalConfig contains additional configuration to be merged with the Ignition - // configuration generated by the bootstrapper controller. More info: https://coreos.github.io/ignition/operator-notes/#config-merging - // - // The data format is documented here: https://kinvolk.io/docs/flatcar-container-linux/latest/provisioning/cl-config/ - // +optional - AdditionalConfig string `json:"additionalConfig,omitempty"` - - // Strict controls if AdditionalConfig should be strictly parsed. If so, warnings are treated as errors. - // +optional - Strict bool `json:"strict,omitempty"` -} - -// KubeadmConfigStatus defines the observed state of KubeadmConfig. -type KubeadmConfigStatus struct { - // Ready indicates the BootstrapData field is ready to be consumed - // +optional - Ready bool `json:"ready"` - - // DataSecretName is the name of the secret that stores the bootstrap data script. - // +optional - DataSecretName *string `json:"dataSecretName,omitempty"` - - // FailureReason will be set on non-retryable errors - // +optional - FailureReason string `json:"failureReason,omitempty"` - - // FailureMessage will be set on non-retryable errors - // +optional - FailureMessage string `json:"failureMessage,omitempty"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Conditions defines current service state of the KubeadmConfig. - // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=kubeadmconfigs,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['cluster\\.x-k8s\\.io/cluster-name']",description="Cluster" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of KubeadmConfig" - -// KubeadmConfig is the Schema for the kubeadmconfigs API. -type KubeadmConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec KubeadmConfigSpec `json:"spec,omitempty"` - Status KubeadmConfigStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (c *KubeadmConfig) GetConditions() clusterv1.Conditions { - return c.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (c *KubeadmConfig) SetConditions(conditions clusterv1.Conditions) { - c.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// KubeadmConfigList contains a list of KubeadmConfig. -type KubeadmConfigList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []KubeadmConfig `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &KubeadmConfig{}, &KubeadmConfigList{}) -} - -// Encoding specifies the cloud-init file encoding. -// +kubebuilder:validation:Enum=base64;gzip;gzip+base64 -type Encoding string - -const ( - // Base64 implies the contents of the file are encoded as base64. - Base64 Encoding = "base64" - // Gzip implies the contents of the file are encoded with gzip. - Gzip Encoding = "gzip" - // GzipBase64 implies the contents of the file are first base64 encoded and then gzip encoded. - GzipBase64 Encoding = "gzip+base64" -) - -// File defines the input for generating write_files in cloud-init. -type File struct { - // Path specifies the full path on disk where to store the file. - Path string `json:"path"` - - // Owner specifies the ownership of the file, e.g. "root:root". - // +optional - Owner string `json:"owner,omitempty"` - - // Permissions specifies the permissions to assign to the file, e.g. "0640". - // +optional - Permissions string `json:"permissions,omitempty"` - - // Encoding specifies the encoding of the file contents. - // +optional - Encoding Encoding `json:"encoding,omitempty"` - - // Append specifies whether to append Content to existing file if Path exists. - // +optional - Append bool `json:"append,omitempty"` - - // Content is the actual content of the file. - // +optional - Content string `json:"content,omitempty"` - - // ContentFrom is a referenced source of content to populate the file. - // +optional - ContentFrom *FileSource `json:"contentFrom,omitempty"` -} - -// FileSource is a union of all possible external source types for file data. -// Only one field may be populated in any given instance. Developers adding new -// sources of data for target systems should add them here. -type FileSource struct { - // Secret represents a secret that should populate this file. - Secret SecretFileSource `json:"secret"` -} - -// SecretFileSource adapts a Secret into a FileSource. -// -// The contents of the target Secret's Data field will be presented -// as files using the keys in the Data field as the file names. -type SecretFileSource struct { - // Name of the secret in the KubeadmBootstrapConfig's namespace to use. - Name string `json:"name"` - - // Key is the key in the secret's data map for this value. - Key string `json:"key"` -} - -// PasswdSource is a union of all possible external source types for passwd data. -// Only one field may be populated in any given instance. Developers adding new -// sources of data for target systems should add them here. -type PasswdSource struct { - // Secret represents a secret that should populate this password. - Secret SecretPasswdSource `json:"secret"` -} - -// SecretPasswdSource adapts a Secret into a PasswdSource. -// -// The contents of the target Secret's Data field will be presented -// as passwd using the keys in the Data field as the file names. -type SecretPasswdSource struct { - // Name of the secret in the KubeadmBootstrapConfig's namespace to use. - Name string `json:"name"` - - // Key is the key in the secret's data map for this value. - Key string `json:"key"` -} - -// User defines the input for a generated user in cloud-init. -type User struct { - // Name specifies the user name - Name string `json:"name"` - - // Gecos specifies the gecos to use for the user - // +optional - Gecos *string `json:"gecos,omitempty"` - - // Groups specifies the additional groups for the user - // +optional - Groups *string `json:"groups,omitempty"` - - // HomeDir specifies the home directory to use for the user - // +optional - HomeDir *string `json:"homeDir,omitempty"` - - // Inactive specifies whether to mark the user as inactive - // +optional - Inactive *bool `json:"inactive,omitempty"` - - // Shell specifies the user's shell - // +optional - Shell *string `json:"shell,omitempty"` - - // Passwd specifies a hashed password for the user - // +optional - Passwd *string `json:"passwd,omitempty"` - - // PasswdFrom is a referenced source of passwd to populate the passwd. - // +optional - PasswdFrom *PasswdSource `json:"passwdFrom,omitempty"` - - // PrimaryGroup specifies the primary group for the user - // +optional - PrimaryGroup *string `json:"primaryGroup,omitempty"` - - // LockPassword specifies if password login should be disabled - // +optional - LockPassword *bool `json:"lockPassword,omitempty"` - - // Sudo specifies a sudo role for the user - // +optional - Sudo *string `json:"sudo,omitempty"` - - // SSHAuthorizedKeys specifies a list of ssh authorized keys for the user - // +optional - SSHAuthorizedKeys []string `json:"sshAuthorizedKeys,omitempty"` -} - -// NTP defines input for generated ntp in cloud-init. -type NTP struct { - // Servers specifies which NTP servers to use - // +optional - Servers []string `json:"servers,omitempty"` - - // Enabled specifies whether NTP should be enabled - // +optional - Enabled *bool `json:"enabled,omitempty"` -} - -// DiskSetup defines input for generated disk_setup and fs_setup in cloud-init. -type DiskSetup struct { - // Partitions specifies the list of the partitions to setup. - // +optional - Partitions []Partition `json:"partitions,omitempty"` - - // Filesystems specifies the list of file systems to setup. - // +optional - Filesystems []Filesystem `json:"filesystems,omitempty"` -} - -// Partition defines how to create and layout a partition. -type Partition struct { - // Device is the name of the device. - Device string `json:"device"` - // Layout specifies the device layout. - // If it is true, a single partition will be created for the entire device. - // When layout is false, it means don't partition or ignore existing partitioning. - Layout bool `json:"layout"` - // Overwrite describes whether to skip checks and create the partition if a partition or filesystem is found on the device. - // Use with caution. Default is 'false'. - // +optional - Overwrite *bool `json:"overwrite,omitempty"` - // TableType specifies the tupe of partition table. The following are supported: - // 'mbr': default and setups a MS-DOS partition table - // 'gpt': setups a GPT partition table - // +optional - TableType *string `json:"tableType,omitempty"` -} - -// Filesystem defines the file systems to be created. -type Filesystem struct { - // Device specifies the device name - Device string `json:"device"` - // Filesystem specifies the file system type. - Filesystem string `json:"filesystem"` - // Label specifies the file system label to be used. If set to None, no label is used. - Label string `json:"label"` - // Partition specifies the partition to use. The valid options are: "auto|any", "auto", "any", "none", and , where NUM is the actual partition number. - // +optional - Partition *string `json:"partition,omitempty"` - // Overwrite defines whether or not to overwrite any existing filesystem. - // If true, any pre-existing file system will be destroyed. Use with Caution. - // +optional - Overwrite *bool `json:"overwrite,omitempty"` - // ReplaceFS is a special directive, used for Microsoft Azure that instructs cloud-init to replace a file system of . - // NOTE: unless you define a label, this requires the use of the 'any' partition directive. - // +optional - ReplaceFS *string `json:"replaceFS,omitempty"` - // ExtraOpts defined extra options to add to the command for creating the file system. - // +optional - ExtraOpts []string `json:"extraOpts,omitempty"` -} - -// MountPoints defines input for generated mounts in cloud-init. -type MountPoints []string diff --git a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/kubeadmconfigtemplate_types.go b/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/kubeadmconfigtemplate_types.go deleted file mode 100644 index 4326cb459..000000000 --- a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/kubeadmconfigtemplate_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2021 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 v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" -) - -// KubeadmConfigTemplateSpec defines the desired state of KubeadmConfigTemplate. -type KubeadmConfigTemplateSpec struct { - Template KubeadmConfigTemplateResource `json:"template"` -} - -// KubeadmConfigTemplateResource defines the Template structure. -type KubeadmConfigTemplateResource struct { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"` - - Spec KubeadmConfigSpec `json:"spec,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=kubeadmconfigtemplates,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of KubeadmConfigTemplate" - -// KubeadmConfigTemplate is the Schema for the kubeadmconfigtemplates API. -type KubeadmConfigTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec KubeadmConfigTemplateSpec `json:"spec,omitempty"` -} - -// +kubebuilder:object:root=true - -// KubeadmConfigTemplateList contains a list of KubeadmConfigTemplate. -type KubeadmConfigTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []KubeadmConfigTemplate `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &KubeadmConfigTemplate{}, &KubeadmConfigTemplateList{}) -} diff --git a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/zz_generated.deepcopy.go b/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index 425b90eda..000000000 --- a/api/external/sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,1153 +0,0 @@ -//go:build !ignore_autogenerated - -/* -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 controller-gen. DO NOT EDIT. - -package v1beta1 - -import ( - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. -func (in *APIEndpoint) DeepCopy() *APIEndpoint { - if in == nil { - return nil - } - out := new(APIEndpoint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIServer) DeepCopyInto(out *APIServer) { - *out = *in - in.ControlPlaneComponent.DeepCopyInto(&out.ControlPlaneComponent) - if in.CertSANs != nil { - in, out := &in.CertSANs, &out.CertSANs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.TimeoutForControlPlane != nil { - in, out := &in.TimeoutForControlPlane, &out.TimeoutForControlPlane - *out = new(v1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServer. -func (in *APIServer) DeepCopy() *APIServer { - if in == nil { - return nil - } - out := new(APIServer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BootstrapToken) DeepCopyInto(out *BootstrapToken) { - *out = *in - if in.Token != nil { - in, out := &in.Token, &out.Token - *out = new(BootstrapTokenString) - **out = **in - } - if in.TTL != nil { - in, out := &in.TTL, &out.TTL - *out = new(v1.Duration) - **out = **in - } - if in.Expires != nil { - in, out := &in.Expires, &out.Expires - *out = (*in).DeepCopy() - } - if in.Usages != nil { - in, out := &in.Usages, &out.Usages - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Groups != nil { - in, out := &in.Groups, &out.Groups - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapToken. -func (in *BootstrapToken) DeepCopy() *BootstrapToken { - if in == nil { - return nil - } - out := new(BootstrapToken) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BootstrapTokenDiscovery) DeepCopyInto(out *BootstrapTokenDiscovery) { - *out = *in - if in.CACertHashes != nil { - in, out := &in.CACertHashes, &out.CACertHashes - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapTokenDiscovery. -func (in *BootstrapTokenDiscovery) DeepCopy() *BootstrapTokenDiscovery { - if in == nil { - return nil - } - out := new(BootstrapTokenDiscovery) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BootstrapTokenString) DeepCopyInto(out *BootstrapTokenString) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapTokenString. -func (in *BootstrapTokenString) DeepCopy() *BootstrapTokenString { - if in == nil { - return nil - } - out := new(BootstrapTokenString) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterConfiguration) DeepCopyInto(out *ClusterConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - in.Etcd.DeepCopyInto(&out.Etcd) - out.Networking = in.Networking - in.APIServer.DeepCopyInto(&out.APIServer) - in.ControllerManager.DeepCopyInto(&out.ControllerManager) - in.Scheduler.DeepCopyInto(&out.Scheduler) - out.DNS = in.DNS - if in.FeatureGates != nil { - in, out := &in.FeatureGates, &out.FeatureGates - *out = make(map[string]bool, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfiguration. -func (in *ClusterConfiguration) DeepCopy() *ClusterConfiguration { - if in == nil { - return nil - } - out := new(ClusterConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.APIEndpoints != nil { - in, out := &in.APIEndpoints, &out.APIEndpoints - *out = make(map[string]APIEndpoint, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. -func (in *ClusterStatus) DeepCopy() *ClusterStatus { - if in == nil { - return nil - } - out := new(ClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterStatus) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ContainerLinuxConfig) DeepCopyInto(out *ContainerLinuxConfig) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerLinuxConfig. -func (in *ContainerLinuxConfig) DeepCopy() *ContainerLinuxConfig { - if in == nil { - return nil - } - out := new(ContainerLinuxConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ControlPlaneComponent) DeepCopyInto(out *ControlPlaneComponent) { - *out = *in - if in.ExtraArgs != nil { - in, out := &in.ExtraArgs, &out.ExtraArgs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ExtraVolumes != nil { - in, out := &in.ExtraVolumes, &out.ExtraVolumes - *out = make([]HostPathMount, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneComponent. -func (in *ControlPlaneComponent) DeepCopy() *ControlPlaneComponent { - if in == nil { - return nil - } - out := new(ControlPlaneComponent) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DNS) DeepCopyInto(out *DNS) { - *out = *in - out.ImageMeta = in.ImageMeta -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNS. -func (in *DNS) DeepCopy() *DNS { - if in == nil { - return nil - } - out := new(DNS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Discovery) DeepCopyInto(out *Discovery) { - *out = *in - if in.BootstrapToken != nil { - in, out := &in.BootstrapToken, &out.BootstrapToken - *out = new(BootstrapTokenDiscovery) - (*in).DeepCopyInto(*out) - } - if in.File != nil { - in, out := &in.File, &out.File - *out = new(FileDiscovery) - **out = **in - } - if in.Timeout != nil { - in, out := &in.Timeout, &out.Timeout - *out = new(v1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Discovery. -func (in *Discovery) DeepCopy() *Discovery { - if in == nil { - return nil - } - out := new(Discovery) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DiskSetup) DeepCopyInto(out *DiskSetup) { - *out = *in - if in.Partitions != nil { - in, out := &in.Partitions, &out.Partitions - *out = make([]Partition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Filesystems != nil { - in, out := &in.Filesystems, &out.Filesystems - *out = make([]Filesystem, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskSetup. -func (in *DiskSetup) DeepCopy() *DiskSetup { - if in == nil { - return nil - } - out := new(DiskSetup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Etcd) DeepCopyInto(out *Etcd) { - *out = *in - if in.Local != nil { - in, out := &in.Local, &out.Local - *out = new(LocalEtcd) - (*in).DeepCopyInto(*out) - } - if in.External != nil { - in, out := &in.External, &out.External - *out = new(ExternalEtcd) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Etcd. -func (in *Etcd) DeepCopy() *Etcd { - if in == nil { - return nil - } - out := new(Etcd) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalEtcd) DeepCopyInto(out *ExternalEtcd) { - *out = *in - if in.Endpoints != nil { - in, out := &in.Endpoints, &out.Endpoints - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalEtcd. -func (in *ExternalEtcd) DeepCopy() *ExternalEtcd { - if in == nil { - return nil - } - out := new(ExternalEtcd) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *File) DeepCopyInto(out *File) { - *out = *in - if in.ContentFrom != nil { - in, out := &in.ContentFrom, &out.ContentFrom - *out = new(FileSource) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new File. -func (in *File) DeepCopy() *File { - if in == nil { - return nil - } - out := new(File) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FileDiscovery) DeepCopyInto(out *FileDiscovery) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileDiscovery. -func (in *FileDiscovery) DeepCopy() *FileDiscovery { - if in == nil { - return nil - } - out := new(FileDiscovery) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FileSource) DeepCopyInto(out *FileSource) { - *out = *in - out.Secret = in.Secret -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileSource. -func (in *FileSource) DeepCopy() *FileSource { - if in == nil { - return nil - } - out := new(FileSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Filesystem) DeepCopyInto(out *Filesystem) { - *out = *in - if in.Partition != nil { - in, out := &in.Partition, &out.Partition - *out = new(string) - **out = **in - } - if in.Overwrite != nil { - in, out := &in.Overwrite, &out.Overwrite - *out = new(bool) - **out = **in - } - if in.ReplaceFS != nil { - in, out := &in.ReplaceFS, &out.ReplaceFS - *out = new(string) - **out = **in - } - if in.ExtraOpts != nil { - in, out := &in.ExtraOpts, &out.ExtraOpts - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filesystem. -func (in *Filesystem) DeepCopy() *Filesystem { - if in == nil { - return nil - } - out := new(Filesystem) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HostPathMount) DeepCopyInto(out *HostPathMount) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostPathMount. -func (in *HostPathMount) DeepCopy() *HostPathMount { - if in == nil { - return nil - } - out := new(HostPathMount) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IgnitionSpec) DeepCopyInto(out *IgnitionSpec) { - *out = *in - if in.ContainerLinuxConfig != nil { - in, out := &in.ContainerLinuxConfig, &out.ContainerLinuxConfig - *out = new(ContainerLinuxConfig) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgnitionSpec. -func (in *IgnitionSpec) DeepCopy() *IgnitionSpec { - if in == nil { - return nil - } - out := new(IgnitionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageMeta) DeepCopyInto(out *ImageMeta) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageMeta. -func (in *ImageMeta) DeepCopy() *ImageMeta { - if in == nil { - return nil - } - out := new(ImageMeta) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InitConfiguration) DeepCopyInto(out *InitConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.BootstrapTokens != nil { - in, out := &in.BootstrapTokens, &out.BootstrapTokens - *out = make([]BootstrapToken, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.NodeRegistration.DeepCopyInto(&out.NodeRegistration) - out.LocalAPIEndpoint = in.LocalAPIEndpoint - if in.SkipPhases != nil { - in, out := &in.SkipPhases, &out.SkipPhases - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Patches != nil { - in, out := &in.Patches, &out.Patches - *out = new(Patches) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InitConfiguration. -func (in *InitConfiguration) DeepCopy() *InitConfiguration { - if in == nil { - return nil - } - out := new(InitConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *InitConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JoinConfiguration) DeepCopyInto(out *JoinConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - in.NodeRegistration.DeepCopyInto(&out.NodeRegistration) - in.Discovery.DeepCopyInto(&out.Discovery) - if in.ControlPlane != nil { - in, out := &in.ControlPlane, &out.ControlPlane - *out = new(JoinControlPlane) - **out = **in - } - if in.SkipPhases != nil { - in, out := &in.SkipPhases, &out.SkipPhases - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Patches != nil { - in, out := &in.Patches, &out.Patches - *out = new(Patches) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoinConfiguration. -func (in *JoinConfiguration) DeepCopy() *JoinConfiguration { - if in == nil { - return nil - } - out := new(JoinConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *JoinConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JoinControlPlane) DeepCopyInto(out *JoinControlPlane) { - *out = *in - out.LocalAPIEndpoint = in.LocalAPIEndpoint -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoinControlPlane. -func (in *JoinControlPlane) DeepCopy() *JoinControlPlane { - if in == nil { - return nil - } - out := new(JoinControlPlane) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmConfig) DeepCopyInto(out *KubeadmConfig) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfig. -func (in *KubeadmConfig) DeepCopy() *KubeadmConfig { - if in == nil { - return nil - } - out := new(KubeadmConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeadmConfig) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmConfigList) DeepCopyInto(out *KubeadmConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KubeadmConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigList. -func (in *KubeadmConfigList) DeepCopy() *KubeadmConfigList { - if in == nil { - return nil - } - out := new(KubeadmConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeadmConfigList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmConfigSpec) DeepCopyInto(out *KubeadmConfigSpec) { - *out = *in - if in.ClusterConfiguration != nil { - in, out := &in.ClusterConfiguration, &out.ClusterConfiguration - *out = new(ClusterConfiguration) - (*in).DeepCopyInto(*out) - } - if in.InitConfiguration != nil { - in, out := &in.InitConfiguration, &out.InitConfiguration - *out = new(InitConfiguration) - (*in).DeepCopyInto(*out) - } - if in.JoinConfiguration != nil { - in, out := &in.JoinConfiguration, &out.JoinConfiguration - *out = new(JoinConfiguration) - (*in).DeepCopyInto(*out) - } - if in.Files != nil { - in, out := &in.Files, &out.Files - *out = make([]File, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.DiskSetup != nil { - in, out := &in.DiskSetup, &out.DiskSetup - *out = new(DiskSetup) - (*in).DeepCopyInto(*out) - } - if in.Mounts != nil { - in, out := &in.Mounts, &out.Mounts - *out = make([]MountPoints, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = make(MountPoints, len(*in)) - copy(*out, *in) - } - } - } - if in.PreKubeadmCommands != nil { - in, out := &in.PreKubeadmCommands, &out.PreKubeadmCommands - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.PostKubeadmCommands != nil { - in, out := &in.PostKubeadmCommands, &out.PostKubeadmCommands - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Users != nil { - in, out := &in.Users, &out.Users - *out = make([]User, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.NTP != nil { - in, out := &in.NTP, &out.NTP - *out = new(NTP) - (*in).DeepCopyInto(*out) - } - if in.Verbosity != nil { - in, out := &in.Verbosity, &out.Verbosity - *out = new(int32) - **out = **in - } - if in.Ignition != nil { - in, out := &in.Ignition, &out.Ignition - *out = new(IgnitionSpec) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigSpec. -func (in *KubeadmConfigSpec) DeepCopy() *KubeadmConfigSpec { - if in == nil { - return nil - } - out := new(KubeadmConfigSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmConfigStatus) DeepCopyInto(out *KubeadmConfigStatus) { - *out = *in - if in.DataSecretName != nil { - in, out := &in.DataSecretName, &out.DataSecretName - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigStatus. -func (in *KubeadmConfigStatus) DeepCopy() *KubeadmConfigStatus { - if in == nil { - return nil - } - out := new(KubeadmConfigStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmConfigTemplate) DeepCopyInto(out *KubeadmConfigTemplate) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigTemplate. -func (in *KubeadmConfigTemplate) DeepCopy() *KubeadmConfigTemplate { - if in == nil { - return nil - } - out := new(KubeadmConfigTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeadmConfigTemplate) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmConfigTemplateList) DeepCopyInto(out *KubeadmConfigTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KubeadmConfigTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigTemplateList. -func (in *KubeadmConfigTemplateList) DeepCopy() *KubeadmConfigTemplateList { - if in == nil { - return nil - } - out := new(KubeadmConfigTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeadmConfigTemplateList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmConfigTemplateResource) DeepCopyInto(out *KubeadmConfigTemplateResource) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigTemplateResource. -func (in *KubeadmConfigTemplateResource) DeepCopy() *KubeadmConfigTemplateResource { - if in == nil { - return nil - } - out := new(KubeadmConfigTemplateResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmConfigTemplateSpec) DeepCopyInto(out *KubeadmConfigTemplateSpec) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigTemplateSpec. -func (in *KubeadmConfigTemplateSpec) DeepCopy() *KubeadmConfigTemplateSpec { - if in == nil { - return nil - } - out := new(KubeadmConfigTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LocalEtcd) DeepCopyInto(out *LocalEtcd) { - *out = *in - out.ImageMeta = in.ImageMeta - if in.ExtraArgs != nil { - in, out := &in.ExtraArgs, &out.ExtraArgs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ServerCertSANs != nil { - in, out := &in.ServerCertSANs, &out.ServerCertSANs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.PeerCertSANs != nil { - in, out := &in.PeerCertSANs, &out.PeerCertSANs - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalEtcd. -func (in *LocalEtcd) DeepCopy() *LocalEtcd { - if in == nil { - return nil - } - out := new(LocalEtcd) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in MountPoints) DeepCopyInto(out *MountPoints) { - { - in := &in - *out = make(MountPoints, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MountPoints. -func (in MountPoints) DeepCopy() MountPoints { - if in == nil { - return nil - } - out := new(MountPoints) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NTP) DeepCopyInto(out *NTP) { - *out = *in - if in.Servers != nil { - in, out := &in.Servers, &out.Servers - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NTP. -func (in *NTP) DeepCopy() *NTP { - if in == nil { - return nil - } - out := new(NTP) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Networking) DeepCopyInto(out *Networking) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Networking. -func (in *Networking) DeepCopy() *Networking { - if in == nil { - return nil - } - out := new(Networking) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeRegistrationOptions) DeepCopyInto(out *NodeRegistrationOptions) { - *out = *in - if in.Taints != nil { - in, out := &in.Taints, &out.Taints - *out = make([]corev1.Taint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.KubeletExtraArgs != nil { - in, out := &in.KubeletExtraArgs, &out.KubeletExtraArgs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.IgnorePreflightErrors != nil { - in, out := &in.IgnorePreflightErrors, &out.IgnorePreflightErrors - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeRegistrationOptions. -func (in *NodeRegistrationOptions) DeepCopy() *NodeRegistrationOptions { - if in == nil { - return nil - } - out := new(NodeRegistrationOptions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Partition) DeepCopyInto(out *Partition) { - *out = *in - if in.Overwrite != nil { - in, out := &in.Overwrite, &out.Overwrite - *out = new(bool) - **out = **in - } - if in.TableType != nil { - in, out := &in.TableType, &out.TableType - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Partition. -func (in *Partition) DeepCopy() *Partition { - if in == nil { - return nil - } - out := new(Partition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PasswdSource) DeepCopyInto(out *PasswdSource) { - *out = *in - out.Secret = in.Secret -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PasswdSource. -func (in *PasswdSource) DeepCopy() *PasswdSource { - if in == nil { - return nil - } - out := new(PasswdSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Patches) DeepCopyInto(out *Patches) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Patches. -func (in *Patches) DeepCopy() *Patches { - if in == nil { - return nil - } - out := new(Patches) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecretFileSource) DeepCopyInto(out *SecretFileSource) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretFileSource. -func (in *SecretFileSource) DeepCopy() *SecretFileSource { - if in == nil { - return nil - } - out := new(SecretFileSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecretPasswdSource) DeepCopyInto(out *SecretPasswdSource) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretPasswdSource. -func (in *SecretPasswdSource) DeepCopy() *SecretPasswdSource { - if in == nil { - return nil - } - out := new(SecretPasswdSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *User) DeepCopyInto(out *User) { - *out = *in - if in.Gecos != nil { - in, out := &in.Gecos, &out.Gecos - *out = new(string) - **out = **in - } - if in.Groups != nil { - in, out := &in.Groups, &out.Groups - *out = new(string) - **out = **in - } - if in.HomeDir != nil { - in, out := &in.HomeDir, &out.HomeDir - *out = new(string) - **out = **in - } - if in.Inactive != nil { - in, out := &in.Inactive, &out.Inactive - *out = new(bool) - **out = **in - } - if in.Shell != nil { - in, out := &in.Shell, &out.Shell - *out = new(string) - **out = **in - } - if in.Passwd != nil { - in, out := &in.Passwd, &out.Passwd - *out = new(string) - **out = **in - } - if in.PasswdFrom != nil { - in, out := &in.PasswdFrom, &out.PasswdFrom - *out = new(PasswdSource) - **out = **in - } - if in.PrimaryGroup != nil { - in, out := &in.PrimaryGroup, &out.PrimaryGroup - *out = new(string) - **out = **in - } - if in.LockPassword != nil { - in, out := &in.LockPassword, &out.LockPassword - *out = new(bool) - **out = **in - } - if in.Sudo != nil { - in, out := &in.Sudo, &out.Sudo - *out = new(string) - **out = **in - } - if in.SSHAuthorizedKeys != nil { - in, out := &in.SSHAuthorizedKeys, &out.SSHAuthorizedKeys - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User. -func (in *User) DeepCopy() *User { - if in == nil { - return nil - } - out := new(User) - in.DeepCopyInto(out) - return out -} diff --git a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/condition_consts.go b/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/condition_consts.go deleted file mode 100644 index 92db126e9..000000000 --- a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/condition_consts.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2021 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 v1beta1 - -import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - -// Conditions and condition Reasons for the DockerMachine object. - -const ( - // ContainerProvisionedCondition documents the status of the provisioning of the container - // generated by a DockerMachine. - // - // NOTE: When the container provisioning starts the process completes almost immediately and within - // the same reconciliation, so the user will always see a transition from Wait to Provisioned without - // having evidence that the operation is started/is in progress. - ContainerProvisionedCondition clusterv1.ConditionType = "ContainerProvisioned" - - // WaitingForClusterInfrastructureReason (Severity=Info) documents a DockerMachine waiting for the cluster - // infrastructure to be ready before starting to create the container that provides the DockerMachine - // infrastructure. - WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure" - - // WaitingForBootstrapDataReason (Severity=Info) documents a DockerMachine waiting for the bootstrap - // script to be ready before starting to create the container that provides the DockerMachine infrastructure. - WaitingForBootstrapDataReason = "WaitingForBootstrapData" - - // ContainerProvisioningFailedReason (Severity=Warning) documents a DockerMachine controller detecting - // an error while provisioning the container that provides the DockerMachine infrastructure; those kind of - // errors are usually transient and failed provisioning are automatically re-tried by the controller. - ContainerProvisioningFailedReason = "ContainerProvisioningFailed" - - // ContainerDeletedReason (Severity=Error) documents a DockerMachine controller detecting - // the underlying container has been deleted unexpectedly. - ContainerDeletedReason = "ContainerDeleted" -) - -const ( - // BootstrapExecSucceededCondition provides an observation of the DockerMachine bootstrap process. - // It is set based on successful execution of bootstrap commands and on the existence of - // the /run/cluster-api/bootstrap-success.complete file. - // The condition gets generated after ContainerProvisionedCondition is True. - // - // NOTE as a difference from other providers, container provisioning and bootstrap are directly managed - // by the DockerMachine controller (not by cloud-init). - BootstrapExecSucceededCondition clusterv1.ConditionType = "BootstrapExecSucceeded" - - // BootstrappingReason documents (Severity=Info) a DockerMachine currently executing the bootstrap - // script that creates the Kubernetes node on the newly provisioned machine infrastructure. - BootstrappingReason = "Bootstrapping" - - // BootstrapFailedReason documents (Severity=Warning) a DockerMachine controller detecting an error while - // bootstrapping the Kubernetes node on the machine just provisioned; those kind of errors are usually - // transient and failed bootstrap are automatically re-tried by the controller. - BootstrapFailedReason = "BootstrapFailed" -) - -// Conditions and condition Reasons for the DockerCluster object. - -const ( - // LoadBalancerAvailableCondition documents the availability of the container that implements the cluster load balancer. - // - // NOTE: When the load balancer provisioning starts the process completes almost immediately and within - // the same reconciliation, so the user will always see a transition from no condition to available without - // having evidence that the operation is started/is in progress. - LoadBalancerAvailableCondition clusterv1.ConditionType = "LoadBalancerAvailable" - - // LoadBalancerProvisioningFailedReason (Severity=Warning) documents a DockerCluster controller detecting - // an error while provisioning the container that provides the cluster load balancer.; those kind of - // errors are usually transient and failed provisioning are automatically re-tried by the controller. - LoadBalancerProvisioningFailedReason = "LoadBalancerProvisioningFailed" -) diff --git a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/conversion.go b/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/conversion.go deleted file mode 100644 index ee6316e46..000000000 --- a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/conversion.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2021 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 v1beta1 - -func (*DockerCluster) Hub() {} -func (*DockerClusterList) Hub() {} -func (*DockerClusterTemplate) Hub() {} -func (*DockerClusterTemplateList) Hub() {} -func (*DockerMachine) Hub() {} -func (*DockerMachineList) Hub() {} -func (*DockerMachineTemplate) Hub() {} -func (*DockerMachineTemplateList) Hub() {} diff --git a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/doc.go b/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/doc.go deleted file mode 100644 index d55ab5609..000000000 --- a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright 2021 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 v1beta1 diff --git a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/dockercluster_types.go b/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/dockercluster_types.go deleted file mode 100644 index dd14f9184..000000000 --- a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/dockercluster_types.go +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 2021 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 v1beta1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" -) - -const ( - // ClusterFinalizer allows DockerClusterReconciler to clean up resources associated with DockerCluster before - // removing it from the apiserver. - ClusterFinalizer = "dockercluster.infrastructure.cluster.x-k8s.io" -) - -// DockerClusterSpec defines the desired state of DockerCluster. -type DockerClusterSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. - // +optional - ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint"` - - // FailureDomains are usually not defined in the spec. - // The docker provider is special since failure domains don't mean anything in a local docker environment. - // Instead, the docker cluster controller will simply copy these into the Status and allow the Cluster API - // controllers to do what they will with the defined failure domains. - // +optional - FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` - - // LoadBalancer allows defining configurations for the cluster load balancer. - // +optional - LoadBalancer DockerLoadBalancer `json:"loadBalancer,omitempty"` -} - -// DockerLoadBalancer allows defining configurations for the cluster load balancer. -type DockerLoadBalancer struct { - // ImageMeta allows customizing the image used for the cluster load balancer. - ImageMeta `json:",inline"` - - // CustomHAProxyConfigTemplateRef allows you to replace the default HAProxy config file. - // This field is a reference to a config map that contains the configuration template. The key of the config map should be equal to 'value'. - // The content of the config map will be processed and will replace the default HAProxy config file. Please use it with caution, as there are - // no checks to ensure the validity of the configuration. This template will support the following variables that will be passed by the controller: - // $IPv6 (bool) indicates if the cluster is IPv6, $FrontendControlPlanePort (string) indicates the frontend control plane port, - // $BackendControlPlanePort (string) indicates the backend control plane port, $BackendServers (map[string]string) indicates the backend server - // where the key is the server name and the value is the address. This map is dynamic and is updated every time a new control plane - // node is added or removed. The template will also support the JoinHostPort function to join the host and port of the backend server. - // +optional - CustomHAProxyConfigTemplateRef *corev1.LocalObjectReference `json:"customHAProxyConfigTemplateRef,omitempty"` -} - -// ImageMeta allows customizing the image used for components that are not -// originated from the Kubernetes/Kubernetes release process. -type ImageMeta struct { - // ImageRepository sets the container registry to pull the haproxy image from. - // if not set, "kindest" will be used instead. - // +optional - ImageRepository string `json:"imageRepository,omitempty"` - - // ImageTag allows to specify a tag for the haproxy image. - // if not set, "v20210715-a6da3463" will be used instead. - // +optional - ImageTag string `json:"imageTag,omitempty"` -} - -// DockerClusterStatus defines the observed state of DockerCluster. -type DockerClusterStatus struct { - // Ready denotes that the docker cluster (infrastructure) is ready. - // +optional - Ready bool `json:"ready"` - - // FailureDomains don't mean much in CAPD since it's all local, but we can see how the rest of cluster API - // will use this if we populate it. - // +optional - FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` - - // Conditions defines current service state of the DockerCluster. - // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` -} - -// APIEndpoint represents a reachable Kubernetes API endpoint. -type APIEndpoint struct { - // Host is the hostname on which the API server is serving. - Host string `json:"host"` - - // Port is the port on which the API server is serving. - // Defaults to 6443 if not set. - Port int `json:"port"` -} - -// +kubebuilder:resource:path=dockerclusters,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:storageversion -// +kubebuilder:object:root=true -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['cluster\\.x-k8s\\.io/cluster-name']",description="Cluster" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerCluster" - -// DockerCluster is the Schema for the dockerclusters API. -type DockerCluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec DockerClusterSpec `json:"spec,omitempty"` - Status DockerClusterStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (c *DockerCluster) GetConditions() clusterv1.Conditions { - return c.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (c *DockerCluster) SetConditions(conditions clusterv1.Conditions) { - c.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// DockerClusterList contains a list of DockerCluster. -type DockerClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DockerCluster `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &DockerCluster{}, &DockerClusterList{}) -} diff --git a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_types.go b/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_types.go deleted file mode 100644 index 3dc77d87e..000000000 --- a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/dockerclustertemplate_types.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2021 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 v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" -) - -// DockerClusterTemplateSpec defines the desired state of DockerClusterTemplate. -type DockerClusterTemplateSpec struct { - Template DockerClusterTemplateResource `json:"template"` -} - -// +kubebuilder:resource:path=dockerclustertemplates,scope=Namespaced,categories=cluster-api -// +kubebuilder:object:root=true -// +kubebuilder:storageversion -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerClusterTemplate" - -// DockerClusterTemplate is the Schema for the dockerclustertemplates API. -type DockerClusterTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec DockerClusterTemplateSpec `json:"spec,omitempty"` -} - -// +kubebuilder:object:root=true - -// DockerClusterTemplateList contains a list of DockerClusterTemplate. -type DockerClusterTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DockerClusterTemplate `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &DockerClusterTemplate{}, &DockerClusterTemplateList{}) -} - -// DockerClusterTemplateResource describes the data needed to create a DockerCluster from a template. -type DockerClusterTemplateResource struct { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"` - Spec DockerClusterSpec `json:"spec"` -} diff --git a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/dockermachine_types.go b/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/dockermachine_types.go deleted file mode 100644 index 7fbba3276..000000000 --- a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/dockermachine_types.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright 2021 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 v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" -) - -const ( - // MachineFinalizer allows ReconcileDockerMachine to clean up resources associated with DockerMachine before - // removing it from the apiserver. - MachineFinalizer = "dockermachine.infrastructure.cluster.x-k8s.io" -) - -// DockerMachineSpec defines the desired state of DockerMachine. -type DockerMachineSpec struct { - // ProviderID will be the container name in ProviderID format (docker:////) - // +optional - ProviderID *string `json:"providerID,omitempty"` - - // CustomImage allows customizing the container image that is used for - // running the machine - // +optional - CustomImage string `json:"customImage,omitempty"` - - // PreLoadImages allows to pre-load images in a newly created machine. This can be used to - // speed up tests by avoiding e.g. to download CNI images on all the containers. - // +optional - PreLoadImages []string `json:"preLoadImages,omitempty"` - - // ExtraMounts describes additional mount points for the node container - // These may be used to bind a hostPath - // +optional - ExtraMounts []Mount `json:"extraMounts,omitempty"` - - // Bootstrapped is true when the kubeadm bootstrapping has been run - // against this machine - // - // Deprecated: This field will be removed in the next apiVersion. - // When removing also remove from staticcheck exclude-rules for SA1019 in golangci.yml. - // +optional - Bootstrapped bool `json:"bootstrapped,omitempty"` -} - -// Mount specifies a host volume to mount into a container. -// This is a simplified version of kind v1alpha4.Mount types. -type Mount struct { - // Path of the mount within the container. - ContainerPath string `json:"containerPath,omitempty"` - - // Path of the mount on the host. If the hostPath doesn't exist, then runtimes - // should report error. If the hostpath is a symbolic link, runtimes should - // follow the symlink and mount the real destination to container. - HostPath string `json:"hostPath,omitempty"` - - // If set, the mount is read-only. - // +optional - Readonly bool `json:"readOnly,omitempty"` -} - -// DockerMachineStatus defines the observed state of DockerMachine. -type DockerMachineStatus struct { - // Ready denotes that the machine (docker container) is ready - // +optional - Ready bool `json:"ready"` - - // LoadBalancerConfigured denotes that the machine has been - // added to the load balancer - // +optional - LoadBalancerConfigured bool `json:"loadBalancerConfigured"` - - // Addresses contains the associated addresses for the docker machine. - // +optional - Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"` - - // Conditions defines current service state of the DockerMachine. - // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:resource:path=dockermachines,scope=Namespaced,categories=cluster-api -// +kubebuilder:object:root=true -// +kubebuilder:storageversion -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels['cluster\\.x-k8s\\.io/cluster-name']",description="Cluster" -// +kubebuilder:printcolumn:name="Machine",type="string",JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object which owns with this DockerMachine" -// +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID" -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Machine ready status" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerMachine" - -// DockerMachine is the Schema for the dockermachines API. -type DockerMachine struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec DockerMachineSpec `json:"spec,omitempty"` - Status DockerMachineStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (c *DockerMachine) GetConditions() clusterv1.Conditions { - return c.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (c *DockerMachine) SetConditions(conditions clusterv1.Conditions) { - c.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// DockerMachineList contains a list of DockerMachine. -type DockerMachineList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DockerMachine `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &DockerMachine{}, &DockerMachineList{}) -} diff --git a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/dockermachinetemplate_types.go b/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/dockermachinetemplate_types.go deleted file mode 100644 index 7993397db..000000000 --- a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/dockermachinetemplate_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2021 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 v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" -) - -// DockerMachineTemplateSpec defines the desired state of DockerMachineTemplate. -type DockerMachineTemplateSpec struct { - Template DockerMachineTemplateResource `json:"template"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=dockermachinetemplates,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerMachineTemplate" - -// DockerMachineTemplate is the Schema for the dockermachinetemplates API. -type DockerMachineTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec DockerMachineTemplateSpec `json:"spec,omitempty"` -} - -// +kubebuilder:object:root=true - -// DockerMachineTemplateList contains a list of DockerMachineTemplate. -type DockerMachineTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DockerMachineTemplate `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &DockerMachineTemplate{}, &DockerMachineTemplateList{}) -} - -// DockerMachineTemplateResource describes the data needed to create a DockerMachine from a template. -type DockerMachineTemplateResource struct { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"` - // Spec is the specification of the desired behavior of the machine. - Spec DockerMachineSpec `json:"spec"` -} diff --git a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/groupversion_info.go b/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/groupversion_info.go deleted file mode 100644 index 69fcc438b..000000000 --- a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/groupversion_info.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2021 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 v1beta1 contains API Schema definitions for the infrastructure v1beta1 API group -// +kubebuilder:object:generate=true -// +groupName=infrastructure.cluster.x-k8s.io -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta1"} - - // schemeBuilder is used to add go types to the GroupVersionKind scheme. - schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = schemeBuilder.AddToScheme - - objectTypes = []runtime.Object{} -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(GroupVersion, objectTypes...) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} diff --git a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/zz_generated.deepcopy.go b/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index 6ae7a8e47..000000000 --- a/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,503 +0,0 @@ -//go:build !ignore_autogenerated - -/* -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 controller-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" - apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. -func (in *APIEndpoint) DeepCopy() *APIEndpoint { - if in == nil { - return nil - } - out := new(APIEndpoint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerCluster) DeepCopyInto(out *DockerCluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerCluster. -func (in *DockerCluster) DeepCopy() *DockerCluster { - if in == nil { - return nil - } - out := new(DockerCluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerCluster) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerClusterList) DeepCopyInto(out *DockerClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerCluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterList. -func (in *DockerClusterList) DeepCopy() *DockerClusterList { - if in == nil { - return nil - } - out := new(DockerClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerClusterSpec) DeepCopyInto(out *DockerClusterSpec) { - *out = *in - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(apiv1beta1.FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - in.LoadBalancer.DeepCopyInto(&out.LoadBalancer) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterSpec. -func (in *DockerClusterSpec) DeepCopy() *DockerClusterSpec { - if in == nil { - return nil - } - out := new(DockerClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerClusterStatus) DeepCopyInto(out *DockerClusterStatus) { - *out = *in - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(apiv1beta1.FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterStatus. -func (in *DockerClusterStatus) DeepCopy() *DockerClusterStatus { - if in == nil { - return nil - } - out := new(DockerClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerClusterTemplate) DeepCopyInto(out *DockerClusterTemplate) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterTemplate. -func (in *DockerClusterTemplate) DeepCopy() *DockerClusterTemplate { - if in == nil { - return nil - } - out := new(DockerClusterTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerClusterTemplate) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerClusterTemplateList) DeepCopyInto(out *DockerClusterTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerClusterTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterTemplateList. -func (in *DockerClusterTemplateList) DeepCopy() *DockerClusterTemplateList { - if in == nil { - return nil - } - out := new(DockerClusterTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerClusterTemplateList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerClusterTemplateResource) DeepCopyInto(out *DockerClusterTemplateResource) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterTemplateResource. -func (in *DockerClusterTemplateResource) DeepCopy() *DockerClusterTemplateResource { - if in == nil { - return nil - } - out := new(DockerClusterTemplateResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerClusterTemplateSpec) DeepCopyInto(out *DockerClusterTemplateSpec) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterTemplateSpec. -func (in *DockerClusterTemplateSpec) DeepCopy() *DockerClusterTemplateSpec { - if in == nil { - return nil - } - out := new(DockerClusterTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerLoadBalancer) DeepCopyInto(out *DockerLoadBalancer) { - *out = *in - out.ImageMeta = in.ImageMeta - if in.CustomHAProxyConfigTemplateRef != nil { - in, out := &in.CustomHAProxyConfigTemplateRef, &out.CustomHAProxyConfigTemplateRef - *out = new(v1.LocalObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerLoadBalancer. -func (in *DockerLoadBalancer) DeepCopy() *DockerLoadBalancer { - if in == nil { - return nil - } - out := new(DockerLoadBalancer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachine) DeepCopyInto(out *DockerMachine) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachine. -func (in *DockerMachine) DeepCopy() *DockerMachine { - if in == nil { - return nil - } - out := new(DockerMachine) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerMachine) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachineList) DeepCopyInto(out *DockerMachineList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerMachine, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineList. -func (in *DockerMachineList) DeepCopy() *DockerMachineList { - if in == nil { - return nil - } - out := new(DockerMachineList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerMachineList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachineSpec) DeepCopyInto(out *DockerMachineSpec) { - *out = *in - if in.ProviderID != nil { - in, out := &in.ProviderID, &out.ProviderID - *out = new(string) - **out = **in - } - if in.PreLoadImages != nil { - in, out := &in.PreLoadImages, &out.PreLoadImages - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ExtraMounts != nil { - in, out := &in.ExtraMounts, &out.ExtraMounts - *out = make([]Mount, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineSpec. -func (in *DockerMachineSpec) DeepCopy() *DockerMachineSpec { - if in == nil { - return nil - } - out := new(DockerMachineSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachineStatus) DeepCopyInto(out *DockerMachineStatus) { - *out = *in - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]apiv1beta1.MachineAddress, len(*in)) - copy(*out, *in) - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineStatus. -func (in *DockerMachineStatus) DeepCopy() *DockerMachineStatus { - if in == nil { - return nil - } - out := new(DockerMachineStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachineTemplate) DeepCopyInto(out *DockerMachineTemplate) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineTemplate. -func (in *DockerMachineTemplate) DeepCopy() *DockerMachineTemplate { - if in == nil { - return nil - } - out := new(DockerMachineTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerMachineTemplate) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachineTemplateList) DeepCopyInto(out *DockerMachineTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerMachineTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineTemplateList. -func (in *DockerMachineTemplateList) DeepCopy() *DockerMachineTemplateList { - if in == nil { - return nil - } - out := new(DockerMachineTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerMachineTemplateList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachineTemplateResource) DeepCopyInto(out *DockerMachineTemplateResource) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineTemplateResource. -func (in *DockerMachineTemplateResource) DeepCopy() *DockerMachineTemplateResource { - if in == nil { - return nil - } - out := new(DockerMachineTemplateResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachineTemplateSpec) DeepCopyInto(out *DockerMachineTemplateSpec) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineTemplateSpec. -func (in *DockerMachineTemplateSpec) DeepCopy() *DockerMachineTemplateSpec { - if in == nil { - return nil - } - out := new(DockerMachineTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageMeta) DeepCopyInto(out *ImageMeta) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageMeta. -func (in *ImageMeta) DeepCopy() *ImageMeta { - if in == nil { - return nil - } - out := new(ImageMeta) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Mount) DeepCopyInto(out *Mount) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Mount. -func (in *Mount) DeepCopy() *Mount { - if in == nil { - return nil - } - out := new(Mount) - in.DeepCopyInto(out) - return out -} diff --git a/api/go.mod b/api/go.mod index 9ee9c496e..f40d6153d 100644 --- a/api/go.mod +++ b/api/go.mod @@ -8,20 +8,16 @@ go 1.21 require ( github.com/nutanix-cloud-native/prism-go-client v0.3.4 github.com/onsi/gomega v1.31.1 - github.com/pkg/errors v0.9.1 k8s.io/api v0.29.3 k8s.io/apiextensions-apiserver v0.29.3 k8s.io/apimachinery v0.29.3 - k8s.io/cluster-bootstrap v0.29.3 k8s.io/utils v0.0.0-20230726121419-3b25d923346b sigs.k8s.io/cluster-api v1.6.3 sigs.k8s.io/controller-runtime v0.17.2 ) require ( - github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect @@ -35,22 +31,15 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect + github.com/pkg/errors v0.9.1 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/component-base v0.29.3 // indirect k8s.io/klog/v2 v2.120.1 // indirect k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/api/go.sum b/api/go.sum index bcfd44886..1aa5ecc1d 100644 --- a/api/go.sum +++ b/api/go.sum @@ -62,16 +62,12 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.42.23/go.mod h1:gyRszuZ/icHmHAVE4gc/r+cfCmhA1AD+vqfWbgI+eHs= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bnkamalesh/webgo/v4 v4.1.11/go.mod h1:taIAonQTzao8G5rnB22WgKmQuIOWHpQ0n/YLAidBXlM= github.com/bnkamalesh/webgo/v6 v6.2.2/go.mod h1:2Y+dEdTp1xC/ra+3PAVZV6hh4sCI+iPK7mcHt+t9bfM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -301,8 +297,6 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.2.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= @@ -347,15 +341,7 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -826,10 +812,6 @@ k8s.io/apimachinery v0.24.3/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2U k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU= k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU= k8s.io/client-go v0.24.2/go.mod h1:zg4Xaoo+umDsfCWr4fCnmLEtQXyCNXCvJuSsglNcV30= -k8s.io/cluster-bootstrap v0.29.3 h1:DIMDZSN8gbFMy9CS2mAS2Iqq/fIUG783WN/1lqi5TF8= -k8s.io/cluster-bootstrap v0.29.3/go.mod h1:aPAg1VtXx3uRrx5qU2jTzR7p1rf18zLXWS+pGhiqPto= -k8s.io/component-base v0.29.3 h1:Oq9/nddUxlnrCuuR2K/jp6aflVvc0uDvxMzAWxnGzAo= -k8s.io/component-base v0.29.3/go.mod h1:Yuj33XXjuOk2BAaHsIGHhCKZQAgYKhqIxIjIr2UXYio= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= diff --git a/common/go.mod b/common/go.mod index 1f28504d5..8e04fd9ea 100644 --- a/common/go.mod +++ b/common/go.mod @@ -20,6 +20,7 @@ require ( k8s.io/apimachinery v0.29.3 k8s.io/utils v0.0.0-20230726121419-3b25d923346b sigs.k8s.io/cluster-api v1.6.3 + sigs.k8s.io/cluster-api/test v1.6.3 sigs.k8s.io/controller-runtime v0.17.2 ) diff --git a/common/go.sum b/common/go.sum index 7b4c077ce..c18f9d540 100644 --- a/common/go.sum +++ b/common/go.sum @@ -260,6 +260,8 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 h1:TgtAeesdhpm2S sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0/go.mod h1:VHVDI/KrK4fjnV61bE2g3sA7tiETLn8sooImelsCx3Y= sigs.k8s.io/cluster-api v1.6.3 h1:VOlPNg92PQLlhBVLc5pg+cbAuPvGOOBujeFLk9zgnoo= sigs.k8s.io/cluster-api v1.6.3/go.mod h1:4FzfgPPiYaFq8X9F9j2SvmggH/4OOLEDgVJuWDqKLig= +sigs.k8s.io/cluster-api/test v1.6.3 h1:ZCboLCTpKWzSbf+f7MpQT7EN8aeH9DNhJC1T9/vAuAM= +sigs.k8s.io/cluster-api/test v1.6.3/go.mod h1:AKs25dgW6AnyGaQBoWuXfWnBs+FT7vJmAI/aox64DEI= sigs.k8s.io/controller-runtime v0.17.2 h1:FwHwD1CTUemg0pW2otk7/U5/i5m2ymzvOXdbeGOUvw0= sigs.k8s.io/controller-runtime v0.17.2/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/common/pkg/capi/apis/schemes.go b/common/pkg/capi/apis/schemes.go index 1c84e7472..9acbed9f4 100644 --- a/common/pkg/capi/apis/schemes.go +++ b/common/pkg/capi/apis/schemes.go @@ -9,9 +9,9 @@ import ( capiv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" + capdv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" capav1 "github.com/d2iq-labs/capi-runtime-extensions/api/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - capdv1 "github.com/d2iq-labs/capi-runtime-extensions/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" ) func NewScheme(registerFuncs ...func(*runtime.Scheme) error) *runtime.Scheme { diff --git a/common/pkg/testutils/capitest/request/items.go b/common/pkg/testutils/capitest/request/items.go index fd5d6e0d1..af7cc9fc8 100644 --- a/common/pkg/testutils/capitest/request/items.go +++ b/common/pkg/testutils/capitest/request/items.go @@ -13,9 +13,9 @@ import ( bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" runtimehooksv1 "sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1" + capdv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" capav1 "github.com/d2iq-labs/capi-runtime-extensions/api/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" - capdv1 "github.com/d2iq-labs/capi-runtime-extensions/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" "github.com/d2iq-labs/capi-runtime-extensions/common/pkg/testutils/capitest/serializer" ) diff --git a/make/apis.mk b/make/apis.mk index 46f34dd2c..4d03f74ac 100644 --- a/make/apis.mk +++ b/make/apis.mk @@ -1,14 +1,30 @@ # Copyright 2023 D2iQ, Inc. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +# We import sigs.k8s.io/cluster-api, which itself imports sigs.k8s.io/controller-runtime, +# as well as other modules. +# +# Third-party CAPI providers, e.g. CAPA, CAPZ, etc, also depend on these modules, but +# usually at different versions. For this reason, importing both sigs.k8s.io/cluster-api +# and a third-party provider usually causes dependency conflicts. +# +# To avoid conflicts, we do not import third-party provider types. Instead, we "sync," +# i.e. copy, or vendor, the third-party provider types into the api/external directory. +# +# However, we do not sync the Kubeadm Control Plane or Kubeadm Bootstrap provider types, +# because they are developed in the sigs.k8s.io/cluster-api module, which we define as +# a dependency. +# +# We also do not sync the Docker infrastructure provider types, because they in the +# sigs.k8s.io/cluster-api/test module, which is developed in parallel with +# sigs.k8s.io/cluster-api. For that reason, we expect no dependency conflicts. + +# Add third-party CAPI provider types below + PROVIDER_MODULE_capa := sigs.k8s.io/cluster-api-provider-aws/v2 PROVIDER_API_PATH_capa := api PROVIDER_API_VERSION_capa := v1beta2 -PROVIDER_MODULE_capd := sigs.k8s.io/cluster-api/test -PROVIDER_API_PATH_capd := infrastructure/docker/api -PROVIDER_API_VERSION_capd := v1beta1 - PROVIDER_MODULE_caaph := sigs.k8s.io/cluster-api-addon-provider-helm PROVIDER_API_PATH_caaph := api PROVIDER_API_VERSION_caaph := v1alpha1 @@ -17,19 +33,14 @@ PROVIDER_MODULE_capx := github.com/nutanix-cloud-native/cluster-api-provider-nut PROVIDER_API_PATH_capx := api PROVIDER_API_VERSION_capx := v1beta1 -PROVIDER_MODULE_cabpk := sigs.k8s.io/cluster-api -PROVIDER_API_PATH_cabpk := bootstrap/kubeadm/api -PROVIDER_API_VERSION_cabpk := v1beta1 +# Add third-party CAPI provider types above -# It is not possible to resolve Kubernetes and controller-runtime modules for the different infrastructure providers -# without hitting dependency conflicts. -# Instead. sync their APIs into the api/external directory. .PHONY: apis.sync -apis.sync: ## Syncs infrastructure providers' APIs -apis.sync: $(addprefix api.sync.,capa capd caaph capx cabpk) go-fix.api mod-tidy.api +apis.sync: ## Syncs third-party CAPI providers' types +apis.sync: $(addprefix api.sync.,capa caaph capx) go-fix.api mod-tidy.api .PHONY: api.sync.% -api.sync.%: ## Syncs an infrastructure provider's API +api.sync.%: ## Syncs a third-party CAPI provider's API types api.sync.%: PROVIDER_MODULE_DIR=$(REPO_ROOT)/hack/third-party/$* api.sync.%: PROVIDER_API_DIR=api/external/$(PROVIDER_MODULE_$*)/$(PROVIDER_API_PATH_$*)/$(PROVIDER_API_VERSION_$*)/ api.sync.%: ; $(info $(M) syncing external API: $(PROVIDER_MODULE_$*)/$(PROVIDER_API_PATH_$*)/$(PROVIDER_API_VERSION_$*)) diff --git a/pkg/handlers/docker/mutation/customimage/inject_control_plane.go b/pkg/handlers/docker/mutation/customimage/inject_control_plane.go index 48cf40c7f..396abd2d0 100644 --- a/pkg/handlers/docker/mutation/customimage/inject_control_plane.go +++ b/pkg/handlers/docker/mutation/customimage/inject_control_plane.go @@ -11,10 +11,10 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtimehooksv1 "sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1" + capdv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - capdv1 "github.com/d2iq-labs/capi-runtime-extensions/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" "github.com/d2iq-labs/capi-runtime-extensions/api/v1alpha1" "github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/patches" "github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/patches/selectors" diff --git a/pkg/handlers/docker/mutation/customimage/inject_worker.go b/pkg/handlers/docker/mutation/customimage/inject_worker.go index 7a4df6380..5a2582cb4 100644 --- a/pkg/handlers/docker/mutation/customimage/inject_worker.go +++ b/pkg/handlers/docker/mutation/customimage/inject_worker.go @@ -11,10 +11,10 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtimehooksv1 "sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1" + capdv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - capdv1 "github.com/d2iq-labs/capi-runtime-extensions/api/external/sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" "github.com/d2iq-labs/capi-runtime-extensions/api/v1alpha1" "github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/patches" "github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/patches/selectors"