diff --git a/Gopkg.lock b/Gopkg.lock index ab605c22792..bdbdb991ff3 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -396,11 +396,9 @@ revision = "a7448c816a2ac09a48321432daa7303eb6ff92c9" [[projects]] - digest = "1:5543d01772b4474e08f1554ea53cf3eb12660deed37470888cfc1cd66748cab0" + digest = "1:35a1d3d1166a3a74d696180e74d6fd0e5179747d2626ca4586bdc9ca45641544" name = "github.com/openshift/cluster-api" packages = [ - "pkg/apis/cluster/common", - "pkg/apis/cluster/v1alpha1", "pkg/apis/machine/common", "pkg/apis/machine/v1beta1", ] @@ -408,12 +406,11 @@ revision = "91fca585a85b163ddfd119fd09c128c9feadddca" [[projects]] - branch = "master" - digest = "1:0889fa501ce44d01602f3721bbc52529bfe35469410b34d117c45916d43b1b22" + digest = "1:46e54b01e18842945bd92e687a237d891fbc5ee3224f460eb47b55454837862f" name = "github.com/openshift/cluster-api-provider-libvirt" packages = ["pkg/apis/libvirtproviderconfig/v1alpha1"] pruneopts = "NUT" - revision = "da6aa0a3931761842527816a79f1072129f2cea3" + revision = "c23986b36a2521cd69ac22d7adb74a22bca9f7aa" [[projects]] branch = "master" @@ -929,7 +926,6 @@ "github.com/openshift/client-go/config/clientset/versioned", "github.com/openshift/client-go/route/clientset/versioned", "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1alpha1", - "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1", "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1", "github.com/openshift/library-go/pkg/config/clusteroperator/v1helpers", "github.com/pborman/uuid", @@ -967,6 +963,7 @@ "k8s.io/utils/pointer", "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1", "sigs.k8s.io/cluster-api-provider-openstack/pkg/apis/openstackproviderconfig/v1alpha1", + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1", ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index c999a67bd55..a1e38a906d1 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -63,7 +63,7 @@ ignored = [ [[constraint]] name = "github.com/openshift/cluster-api-provider-libvirt" - branch = "master" + revision = "c23986b36a2521cd69ac22d7adb74a22bca9f7aa" [[constraint]] name = "github.com/pkg/errors" diff --git a/pkg/asset/cluster/tfvars.go b/pkg/asset/cluster/tfvars.go index 2068476cc29..4b76ea7b6ff 100644 --- a/pkg/asset/cluster/tfvars.go +++ b/pkg/asset/cluster/tfvars.go @@ -117,7 +117,7 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error { }) case libvirt.Name: data, err = libvirttfvars.TFVars( - mastersAsset.MachinesDeprecated[0].Spec.ProviderSpec.Value.Object.(*libvirtprovider.LibvirtMachineProviderConfig), + mastersAsset.Machines[0].Spec.ProviderSpec.Value.Object.(*libvirtprovider.LibvirtMachineProviderConfig), string(*rhcosImage), &installConfig.Config.Networking.MachineCIDR.IPNet, installConfig.Config.Platform.Libvirt.Network.IfName, diff --git a/pkg/asset/machines/libvirt/machines.go b/pkg/asset/machines/libvirt/machines.go index 909e08a51ae..789e867e8b8 100644 --- a/pkg/asset/machines/libvirt/machines.go +++ b/pkg/asset/machines/libvirt/machines.go @@ -5,16 +5,16 @@ import ( "fmt" libvirtprovider "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1alpha1" + machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - clusterapi "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "github.com/openshift/installer/pkg/types" "github.com/openshift/installer/pkg/types/libvirt" ) // Machines returns a list of machines for a machinepool. -func Machines(clusterID string, config *types.InstallConfig, pool *types.MachinePool, role, userDataSecret string) ([]clusterapi.Machine, error) { +func Machines(clusterID string, config *types.InstallConfig, pool *types.MachinePool, role, userDataSecret string) ([]machineapi.Machine, error) { if configPlatform := config.Platform.Name(); configPlatform != libvirt.Name { return nil, fmt.Errorf("non-Libvirt configuration: %q", configPlatform) } @@ -29,9 +29,9 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine total = *pool.Replicas } provider := provider(clustername, config.Networking.MachineCIDR.String(), platform, userDataSecret) - var machines []clusterapi.Machine + var machines []machineapi.Machine for idx := int64(0); idx < total; idx++ { - machine := clusterapi.Machine{ + machine := machineapi.Machine{ TypeMeta: metav1.TypeMeta{ APIVersion: "cluster.k8s.io/v1alpha1", Kind: "Machine", @@ -45,8 +45,8 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine "sigs.k8s.io/cluster-api-machine-type": role, }, }, - Spec: clusterapi.MachineSpec{ - ProviderSpec: clusterapi.ProviderSpec{ + Spec: machineapi.MachineSpec{ + ProviderSpec: machineapi.ProviderSpec{ Value: &runtime.RawExtension{Object: provider}, }, // we don't need to set Versions, because we control those via cluster operators. diff --git a/pkg/asset/machines/libvirt/machinesets.go b/pkg/asset/machines/libvirt/machinesets.go index cbbfd98c19d..31b03cdafc2 100644 --- a/pkg/asset/machines/libvirt/machinesets.go +++ b/pkg/asset/machines/libvirt/machinesets.go @@ -4,17 +4,17 @@ package libvirt import ( "fmt" + machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" - clusterapi "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "github.com/openshift/installer/pkg/types" "github.com/openshift/installer/pkg/types/libvirt" ) // MachineSets returns a list of machinesets for a machinepool. -func MachineSets(clusterID string, config *types.InstallConfig, pool *types.MachinePool, role, userDataSecret string) ([]clusterapi.MachineSet, error) { +func MachineSets(clusterID string, config *types.InstallConfig, pool *types.MachinePool, role, userDataSecret string) ([]machineapi.MachineSet, error) { if configPlatform := config.Platform.Name(); configPlatform != libvirt.Name { return nil, fmt.Errorf("non-Libvirt configuration: %q", configPlatform) } @@ -34,7 +34,7 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach provider := provider(clustername, config.Networking.MachineCIDR.String(), platform, userDataSecret) name := fmt.Sprintf("%s-%s-%d", clustername, pool.Name, 0) - mset := clusterapi.MachineSet{ + mset := machineapi.MachineSet{ TypeMeta: metav1.TypeMeta{ APIVersion: "cluster.k8s.io/v1alpha1", Kind: "MachineSet", @@ -48,7 +48,7 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach "sigs.k8s.io/cluster-api-machine-type": role, }, }, - Spec: clusterapi.MachineSetSpec{ + Spec: machineapi.MachineSetSpec{ Replicas: pointer.Int32Ptr(int32(total)), Selector: metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -56,7 +56,7 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach "sigs.k8s.io/cluster-api-cluster": clustername, }, }, - Template: clusterapi.MachineTemplateSpec{ + Template: machineapi.MachineTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "sigs.k8s.io/cluster-api-machineset": name, @@ -65,8 +65,8 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach "sigs.k8s.io/cluster-api-machine-type": role, }, }, - Spec: clusterapi.MachineSpec{ - ProviderSpec: clusterapi.ProviderSpec{ + Spec: machineapi.MachineSpec{ + ProviderSpec: machineapi.ProviderSpec{ Value: &runtime.RawExtension{Object: provider}, }, // we don't need to set Versions, because we control those via cluster operators. @@ -75,5 +75,5 @@ func MachineSets(clusterID string, config *types.InstallConfig, pool *types.Mach }, } - return []clusterapi.MachineSet{mset}, nil + return []machineapi.MachineSet{mset}, nil } diff --git a/pkg/asset/machines/master.go b/pkg/asset/machines/master.go index 6ecb48d648e..11d88e03676 100644 --- a/pkg/asset/machines/master.go +++ b/pkg/asset/machines/master.go @@ -91,7 +91,7 @@ func (m *Master) Generate(dependencies asset.Parents) error { mpool.Set(ic.Platform.Libvirt.DefaultMachinePlatform) mpool.Set(pool.Platform.Libvirt) pool.Platform.Libvirt = &mpool - m.MachinesDeprecated, err = libvirt.Machines(clusterID.ClusterID, ic, &pool, "master", "master-user-data") + m.Machines, err = libvirt.Machines(clusterID.ClusterID, ic, &pool, "master", "master-user-data") if err != nil { return errors.Wrap(err, "failed to create master machine objects") } diff --git a/pkg/asset/machines/worker.go b/pkg/asset/machines/worker.go index e2667ea8ccb..40d8a0a5dae 100644 --- a/pkg/asset/machines/worker.go +++ b/pkg/asset/machines/worker.go @@ -125,7 +125,7 @@ func (w *Worker) Generate(dependencies asset.Parents) error { return errors.Wrap(err, "failed to create worker machine objects") } - list := listFromMachineDeprecated(sets) + list := listFromMachineSets(sets) raw, err := yaml.Marshal(list) if err != nil { return errors.Wrap(err, "failed to marshal") @@ -147,7 +147,7 @@ func (w *Worker) Generate(dependencies asset.Parents) error { return errors.Wrap(err, "failed to create master machine objects") } - list := listFromMachineDeprecated(sets) + list := listFromMachineSetsDeprecated(sets) w.MachineSetRaw, err = yaml.Marshal(list) if err != nil { return errors.Wrap(err, "failed to marshal") @@ -188,7 +188,7 @@ func listFromMachineSets(objs []machineapi.MachineSet) *metav1.List { return list } -func listFromMachineDeprecated(objs []clusterapi.MachineSet) *metav1.List { +func listFromMachineSetsDeprecated(objs []clusterapi.MachineSet) *metav1.List { list := &metav1.List{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1", diff --git a/vendor/github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1alpha1/libvirtmachineproviderconfig_types.go b/vendor/github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1alpha1/libvirtmachineproviderconfig_types.go index 4080d48d6c7..4cbad81d78e 100644 --- a/vendor/github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1alpha1/libvirtmachineproviderconfig_types.go +++ b/vendor/github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1alpha1/libvirtmachineproviderconfig_types.go @@ -14,7 +14,7 @@ const ( MachineTypeLabel = "sigs.k8s.io/cluster-api-machine-type" ) -// LibvirtMachineProviderConfig is the type that will be embedded in a Machine.Spec.ProviderConfig field +// LibvirtMachineProviderConfig is the type that will be embedded in a Machine.Spec.ProviderSpec field // for an Libvirt instance. // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type LibvirtMachineProviderConfig struct { @@ -55,7 +55,7 @@ type Volume struct { VolumeName string `json:"volumeName"` } -// LibvirtClusterProviderConfig is the type that will be embedded in a Cluster.Spec.ProviderConfig field. +// LibvirtClusterProviderConfig is the type that will be embedded in a Cluster.Spec.ProviderSpec field. // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type LibvirtClusterProviderConfig struct { metav1.TypeMeta `json:",inline"` diff --git a/vendor/github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1alpha1/register.go b/vendor/github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1alpha1/register.go index a0b3bf4387c..b0e4d149f24 100644 --- a/vendor/github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1alpha1/register.go +++ b/vendor/github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1alpha1/register.go @@ -17,7 +17,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer" "sigs.k8s.io/controller-runtime/pkg/runtime/scheme" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" ) var ( @@ -58,8 +58,8 @@ func NewCodec() (*LibvirtProviderConfigCodec, error) { return &codec, nil } -// DecodeFromProviderConfig decodes a serialised ProviderConfig into an object -func (codec *LibvirtProviderConfigCodec) DecodeFromProviderConfig(providerConfig clusterv1alpha1.ProviderSpec, out runtime.Object) error { +// DecodeFromProviderSpec decodes a serialised ProviderConfig into an object +func (codec *LibvirtProviderConfigCodec) DecodeFromProviderSpec(providerConfig machinev1.ProviderSpec, out runtime.Object) error { if providerConfig.Value != nil { _, _, err := codec.decoder.Decode(providerConfig.Value.Raw, nil, out) if err != nil { @@ -69,13 +69,13 @@ func (codec *LibvirtProviderConfigCodec) DecodeFromProviderConfig(providerConfig return nil } -// EncodeToProviderConfig encodes an object into a serialised ProviderConfig -func (codec *LibvirtProviderConfigCodec) EncodeToProviderConfig(in runtime.Object) (*clusterv1alpha1.ProviderSpec, error) { +// EncodeToProviderSpec encodes an object into a serialised ProviderConfig +func (codec *LibvirtProviderConfigCodec) EncodeToProviderSpec(in runtime.Object) (*machinev1.ProviderSpec, error) { var buf bytes.Buffer if err := codec.encoder.Encode(in, &buf); err != nil { return nil, fmt.Errorf("encoding failed: %v", err) } - return &clusterv1alpha1.ProviderSpec{ + return &machinev1.ProviderSpec{ Value: &runtime.RawExtension{Raw: buf.Bytes()}, }, nil } diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/consts.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/consts.go deleted file mode 100644 index 287480250d5..00000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/consts.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2018 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 common - -// Constants aren't automatically generated for unversioned packages. -// Instead share the same constant for all versioned packages -type MachineStatusError string - -const ( - // Represents that the combination of configuration in the MachineSpec - // is not supported by this cluster. This is not a transient error, but - // indicates a state that must be fixed before progress can be made. - // - // Example: the ProviderSpec specifies an instance type that doesn't exist, - InvalidConfigurationMachineError MachineStatusError = "InvalidConfiguration" - - // This indicates that the MachineSpec has been updated in a way that - // is not supported for reconciliation on this cluster. The spec may be - // completely valid from a configuration standpoint, but the controller - // does not support changing the real world state to match the new - // spec. - // - // Example: the responsible controller is not capable of changing the - // container runtime from docker to rkt. - UnsupportedChangeMachineError MachineStatusError = "UnsupportedChange" - - // This generally refers to exceeding one's quota in a cloud provider, - // or running out of physical machines in an on-premise environment. - InsufficientResourcesMachineError MachineStatusError = "InsufficientResources" - - // There was an error while trying to create a Node to match this - // Machine. This may indicate a transient problem that will be fixed - // automatically with time, such as a service outage, or a terminal - // error during creation that doesn't match a more specific - // MachineStatusError value. - // - // Example: timeout trying to connect to GCE. - CreateMachineError MachineStatusError = "CreateError" - - // An error was encountered while trying to delete the Node that this - // Machine represents. This could be a transient or terminal error, but - // will only be observable if the provider's Machine controller has - // added a finalizer to the object to more gracefully handle deletions. - // - // Example: cannot resolve EC2 IP address. - DeleteMachineError MachineStatusError = "DeleteError" - - // This error indicates that the machine did not join the cluster - // as a new node within the expected timeframe after instance - // creation at the provider succeeded - // - // Example use case: A controller that deletes Machines which do - // not result in a Node joining the cluster within a given timeout - // and that are managed by a MachineSet - JoinClusterTimeoutMachineError = "JoinClusterTimeoutError" -) - -type ClusterStatusError string - -const ( - // InvalidConfigurationClusterError indicates that the cluster - // configuration is invalid. - InvalidConfigurationClusterError ClusterStatusError = "InvalidConfiguration" - - // UnsupportedChangeClusterError indicates that the cluster - // spec has been updated in an unsupported way. That cannot be - // reconciled. - UnsupportedChangeClusterError ClusterStatusError = "UnsupportedChange" - - // CreateClusterError indicates that an error was encountered - // when trying to create the cluster. - CreateClusterError ClusterStatusError = "CreateError" - - // UpdateClusterError indicates that an error was encountered - // when trying to update the cluster. - UpdateClusterError ClusterStatusError = "UpdateError" - - // DeleteClusterError indicates that an error was encountered - // when trying to delete the cluster. - DeleteClusterError ClusterStatusError = "DeleteError" -) - -type MachineSetStatusError string - -const ( - // Represents that the combination of configuration in the MachineTemplateSpec - // is not supported by this cluster. This is not a transient error, but - // indicates a state that must be fixed before progress can be made. - // - // Example: the ProviderSpec specifies an instance type that doesn't exist. - InvalidConfigurationMachineSetError MachineSetStatusError = "InvalidConfiguration" -) - -type MachineDeploymentStrategyType string - -const ( - // Replace the old MachineSet by new one using rolling update - // i.e. gradually scale down the old MachineSet and scale up the new one. - RollingUpdateMachineDeploymentStrategyType MachineDeploymentStrategyType = "RollingUpdate" -) diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/plugins.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/plugins.go deleted file mode 100644 index 8c2083d88c0..00000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/plugins.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2018 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 common - -import ( - "sync" - - "github.com/pkg/errors" - "k8s.io/klog" -) - -var ( - providersMutex sync.Mutex - providers = make(map[string]interface{}) -) - -// RegisterClusterProvisioner registers a ClusterProvisioner by name. This -// is expected to happen during app startup. -func RegisterClusterProvisioner(name string, provisioner interface{}) { - providersMutex.Lock() - defer providersMutex.Unlock() - if _, found := providers[name]; found { - klog.Fatalf("Cluster provisioner %q was registered twice", name) - } - klog.V(1).Infof("Registered cluster provisioner %q", name) - providers[name] = provisioner -} - -func ClusterProvisioner(name string) (interface{}, error) { - providersMutex.Lock() - defer providersMutex.Unlock() - provisioner, found := providers[name] - if !found { - return nil, errors.Errorf("unable to find provisioner for %s", name) - } - return provisioner, nil -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go deleted file mode 100644 index dae8b49cebe..00000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go +++ /dev/null @@ -1,165 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - - "github.com/openshift/cluster-api/pkg/apis/cluster/common" - "k8s.io/apimachinery/pkg/util/validation/field" -) - -const ClusterFinalizer = "cluster.cluster.k8s.io" - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -/// [Cluster] -// Cluster is the Schema for the clusters API -// +k8s:openapi-gen=true -// +kubebuilder:subresource:status -type Cluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterSpec `json:"spec,omitempty"` - Status ClusterStatus `json:"status,omitempty"` -} - -/// [Cluster] - -/// [ClusterSpec] -// ClusterSpec defines the desired state of Cluster -type ClusterSpec struct { - // Cluster network configuration - ClusterNetwork ClusterNetworkingConfig `json:"clusterNetwork"` - - // Provider-specific serialized configuration to use during - // cluster creation. It is recommended that providers maintain - // their own versioned API types that should be - // serialized/deserialized from this field. - // +optional - ProviderSpec ProviderSpec `json:"providerSpec,omitempty"` -} - -/// [ClusterSpec] - -/// [ClusterNetworkingConfig] -// ClusterNetworkingConfig specifies the different networking -// parameters for a cluster. -type ClusterNetworkingConfig struct { - // The network ranges from which service VIPs are allocated. - Services NetworkRanges `json:"services"` - - // The network ranges from which Pod networks are allocated. - Pods NetworkRanges `json:"pods"` - - // Domain name for services. - ServiceDomain string `json:"serviceDomain"` -} - -/// [ClusterNetworkingConfig] - -/// [NetworkRanges] -// NetworkRanges represents ranges of network addresses. -type NetworkRanges struct { - CIDRBlocks []string `json:"cidrBlocks"` -} - -/// [NetworkRanges] - -/// [ClusterStatus] -// ClusterStatus defines the observed state of Cluster -type ClusterStatus struct { - // APIEndpoint represents the endpoint to communicate with the IP. - // +optional - APIEndpoints []APIEndpoint `json:"apiEndpoints,omitempty"` - - // NB: Eventually we will redefine ErrorReason as ClusterStatusError once the - // following issue is fixed. - // https://github.com/kubernetes-incubator/apiserver-builder/issues/176 - - // If set, indicates that there is a problem reconciling the - // state, and will be set to a token value suitable for - // programmatic interpretation. - // +optional - ErrorReason common.ClusterStatusError `json:"errorReason,omitempty"` - - // If set, indicates that there is a problem reconciling the - // state, and will be set to a descriptive error message. - // +optional - ErrorMessage string `json:"errorMessage,omitempty"` - - // Provider-specific status. - // It is recommended that providers maintain their - // own versioned API types that should be - // serialized/deserialized from this field. - // +optional - ProviderStatus *runtime.RawExtension `json:"providerStatus,omitempty"` -} - -/// [ClusterStatus] - -/// [APIEndpoint] -// APIEndpoint represents a reachable Kubernetes API endpoint. -type APIEndpoint struct { - // The hostname on which the API server is serving. - Host string `json:"host"` - - // The port on which the API server is serving. - Port int `json:"port"` -} - -/// [APIEndpoint] - -func (o *Cluster) Validate() field.ErrorList { - errors := field.ErrorList{} - // perform validation here and add to errors using field.Invalid - if o.Spec.ClusterNetwork.ServiceDomain == "" { - errors = append(errors, field.Invalid( - field.NewPath("Spec", "ClusterNetwork", "ServiceDomain"), - o.Spec.ClusterNetwork.ServiceDomain, - "invalid cluster configuration: missing Cluster.Spec.ClusterNetwork.ServiceDomain")) - } - if len(o.Spec.ClusterNetwork.Pods.CIDRBlocks) == 0 { - errors = append(errors, field.Invalid( - field.NewPath("Spec", "ClusterNetwork", "Pods"), - o.Spec.ClusterNetwork.Pods, - "invalid cluster configuration: missing Cluster.Spec.ClusterNetwork.Pods")) - } - if len(o.Spec.ClusterNetwork.Services.CIDRBlocks) == 0 { - errors = append(errors, field.Invalid( - field.NewPath("Spec", "ClusterNetwork", "Services"), - o.Spec.ClusterNetwork.Services, - "invalid cluster configuration: missing Cluster.Spec.ClusterNetwork.Services")) - } - return errors -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterList contains a list of Cluster -type ClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Cluster `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Cluster{}, &ClusterList{}) -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/common_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/common_types.go deleted file mode 100644 index 7a9c647fe29..00000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/common_types.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// ProviderSpec defines the configuration to use during node creation. -type ProviderSpec struct { - - // No more than one of the following may be specified. - - // Value is an inlined, serialized representation of the resource - // configuration. It is recommended that providers maintain their own - // versioned API types that should be serialized/deserialized from this - // field, akin to component config. - // +optional - Value *runtime.RawExtension `json:"value,omitempty"` - - // Source for the provider configuration. Cannot be used if value is - // not empty. - // +optional - ValueFrom *ProviderSpecSource `json:"valueFrom,omitempty"` -} - -// ProviderSpecSource represents a source for the provider-specific -// resource configuration. -type ProviderSpecSource struct { - // The machine class from which the provider config should be sourced. - // +optional - MachineClass *MachineClassRef `json:"machineClass,omitempty"` -} - -// MachineClassRef is a reference to the MachineClass object. Controllers should find the right MachineClass using this reference. -type MachineClassRef struct { - // +optional - *corev1.ObjectReference `json:",inline"` - - // Provider is the name of the cloud-provider which MachineClass is intended for. - // +optional - Provider string `json:"provider,omitempty"` -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/defaults.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/defaults.go deleted file mode 100644 index a64e64ab375..00000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/defaults.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -import ( - "github.com/openshift/cluster-api/pkg/apis/cluster/common" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" -) - -// PopulateDefaultsMachineDeployment fills in default field values -// Currently it is called after reading objects, but it could be called in an admission webhook also -func PopulateDefaultsMachineDeployment(d *MachineDeployment) { - if d.Spec.Replicas == nil { - d.Spec.Replicas = new(int32) - *d.Spec.Replicas = 1 - } - - if d.Spec.MinReadySeconds == nil { - d.Spec.MinReadySeconds = new(int32) - *d.Spec.MinReadySeconds = 0 - } - - if d.Spec.RevisionHistoryLimit == nil { - d.Spec.RevisionHistoryLimit = new(int32) - *d.Spec.RevisionHistoryLimit = 1 - } - - if d.Spec.ProgressDeadlineSeconds == nil { - d.Spec.ProgressDeadlineSeconds = new(int32) - *d.Spec.ProgressDeadlineSeconds = 600 - } - - if d.Spec.Strategy == nil { - d.Spec.Strategy = &MachineDeploymentStrategy{} - } - - if d.Spec.Strategy.Type == "" { - d.Spec.Strategy.Type = common.RollingUpdateMachineDeploymentStrategyType - } - - // Default RollingUpdate strategy only if strategy type is RollingUpdate. - if d.Spec.Strategy.Type == common.RollingUpdateMachineDeploymentStrategyType { - if d.Spec.Strategy.RollingUpdate == nil { - d.Spec.Strategy.RollingUpdate = &MachineRollingUpdateDeployment{} - } - if d.Spec.Strategy.RollingUpdate.MaxSurge == nil { - ios1 := intstr.FromInt(1) - d.Spec.Strategy.RollingUpdate.MaxSurge = &ios1 - } - if d.Spec.Strategy.RollingUpdate.MaxUnavailable == nil { - ios0 := intstr.FromInt(0) - d.Spec.Strategy.RollingUpdate.MaxUnavailable = &ios0 - } - } - - if len(d.Namespace) == 0 { - d.Namespace = metav1.NamespaceDefault - } -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/doc.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/doc.go deleted file mode 100644 index 9bd92e43525..00000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 contains API Schema definitions for the cluster v1alpha1 API group -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/pkg/apis/cluster -// +k8s:defaulter-gen=TypeMeta -// +groupName=cluster.k8s.io -package v1alpha1 diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go deleted file mode 100644 index 6c6cc4a3c25..00000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go +++ /dev/null @@ -1,227 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - - "github.com/openshift/cluster-api/pkg/apis/cluster/common" -) - -// Finalizer is set on PrepareForCreate callback -const MachineFinalizer = "machine.cluster.k8s.io" - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -/// [Machine] -// Machine is the Schema for the machines API -// +k8s:openapi-gen=true -// +kubebuilder:subresource:status -type Machine struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachineSpec `json:"spec,omitempty"` - Status MachineStatus `json:"status,omitempty"` -} - -/// [Machine] - -/// [MachineSpec] -// MachineSpec defines the desired state of Machine -type MachineSpec struct { - // ObjectMeta will autopopulate the Node created. Use this to - // indicate what labels, annotations, name prefix, etc., should be used - // when creating the Node. - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Taints is the full, authoritative list of taints to apply to the corresponding - // Node. This list will overwrite any modifications made to the Node on - // an ongoing basis. - // +optional - Taints []corev1.Taint `json:"taints,omitempty"` - - // ProviderSpec details Provider-specific configuration to use during node creation. - // +optional - ProviderSpec ProviderSpec `json:"providerSpec"` - - // Versions of key software to use. This field is optional at cluster - // creation time, and omitting the field indicates that the cluster - // installation tool should select defaults for the user. These - // defaults may differ based on the cluster installer, but the tool - // should populate the values it uses when persisting Machine objects. - // A Machine spec missing this field at runtime is invalid. - // +optional - Versions MachineVersionInfo `json:"versions,omitempty"` - - // ConfigSource is used to populate in the associated Node for dynamic kubelet config. This - // field already exists in Node, so any updates to it in the Machine - // spec will be automatically copied to the linked NodeRef from the - // status. The rest of dynamic kubelet config support should then work - // as-is. - // +optional - ConfigSource *corev1.NodeConfigSource `json:"configSource,omitempty"` -} - -/// [MachineSpec] - -/// [MachineStatus] -// MachineStatus defines the observed state of Machine -type MachineStatus struct { - // NodeRef will point to the corresponding Node if it exists. - // +optional - NodeRef *corev1.ObjectReference `json:"nodeRef,omitempty"` - - // LastUpdated identifies when this status was last observed. - // +optional - LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` - - // Versions specifies the current versions of software on the corresponding Node (if it - // exists). This is provided for a few reasons: - // - // 1) It is more convenient than checking the NodeRef, traversing it to - // the Node, and finding the appropriate field in Node.Status.NodeInfo - // (which uses different field names and formatting). - // 2) It removes some of the dependency on the structure of the Node, - // so that if the structure of Node.Status.NodeInfo changes, only - // machine controllers need to be updated, rather than every client - // of the Machines API. - // 3) There is no other simple way to check the control plane - // version. A client would have to connect directly to the apiserver - // running on the target node in order to find out its version. - // +optional - Versions *MachineVersionInfo `json:"versions,omitempty"` - - // ErrorReason will be set in the event that there is a terminal problem - // reconciling the Machine and will contain a succinct value suitable - // for machine interpretation. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the Machine's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of Machines - // can be added as events to the Machine object and/or logged in the - // controller's output. - // +optional - ErrorReason *common.MachineStatusError `json:"errorReason,omitempty"` - - // ErrorMessage will be set in the event that there is a terminal problem - // reconciling the Machine and will contain a more verbose string suitable - // for logging and human consumption. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the Machine's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of Machines - // can be added as events to the Machine object and/or logged in the - // controller's output. - // +optional - ErrorMessage *string `json:"errorMessage,omitempty"` - - // ProviderStatus details a Provider-specific status. - // It is recommended that providers maintain their - // own versioned API types that should be - // serialized/deserialized from this field. - // +optional - ProviderStatus *runtime.RawExtension `json:"providerStatus,omitempty"` - - // Addresses is a list of addresses assigned to the machine. Queried from cloud provider, if available. - // +optional - Addresses []corev1.NodeAddress `json:"addresses,omitempty"` - - // Conditions lists the conditions synced from the node conditions of the corresponding node-object. - // Machine-controller is responsible for keeping conditions up-to-date. - // MachineSet controller will be taking these conditions as a signal to decide if - // machine is healthy or needs to be replaced. - // Refer: https://kubernetes.io/docs/concepts/architecture/nodes/#condition - // +optional - Conditions []corev1.NodeCondition `json:"conditions,omitempty"` - - // LastOperation describes the last-operation performed by the machine-controller. - // This API should be useful as a history in terms of the latest operation performed on the - // specific machine. It should also convey the state of the latest-operation for example if - // it is still on-going, failed or completed successfully. - // +optional - LastOperation *LastOperation `json:"lastOperation,omitempty"` - - // Phase represents the current phase of machine actuation. - // E.g. Pending, Running, Terminating, Failed etc. - // +optional - Phase *string `json:"phase,omitempty"` -} - -// LastOperation represents the detail of the last performed operation on the MachineObject. -type LastOperation struct { - // Description is the human-readable description of the last operation. - Description *string `json:"description,omitempty"` - - // LastUpdated is the timestamp at which LastOperation API was last-updated. - LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` - - // State is the current status of the last performed operation. - // E.g. Processing, Failed, Successful etc - State *string `json:"state,omitempty"` - - // Type is the type of operation which was last performed. - // E.g. Create, Delete, Update etc - Type *string `json:"type,omitempty"` -} - -/// [MachineStatus] - -/// [MachineVersionInfo] -type MachineVersionInfo struct { - // Kubelet is the semantic version of kubelet to run - Kubelet string `json:"kubelet"` - - // ControlPlane is the semantic version of the Kubernetes control plane to - // run. This should only be populated when the machine is a - // control plane. - // +optional - ControlPlane string `json:"controlPlane,omitempty"` -} - -/// [MachineVersionInfo] - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// MachineList contains a list of Machine -type MachineList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Machine `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Machine{}, &MachineList{}) -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineclass_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineclass_types.go deleted file mode 100644 index 7844f6cfa46..00000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineclass_types.go +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -/// [MachineClass] -// MachineClass can be used to templatize and re-use provider configuration -// across multiple Machines / MachineSets / MachineDeployments. -// +k8s:openapi-gen=true -// +resource:path=machineclasses -type MachineClass struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // The total capacity available on this machine type (cpu/memory/disk). - // - // WARNING: It is up to the creator of the MachineClass to ensure that - // this field is consistent with the underlying machine that will - // be provisioned when this class is used, to inform higher level - // automation (e.g. the cluster autoscaler). - // TODO(hardikdr) Add allocatable field once requirements are clear from autoscaler-clusterapi // integration topic. - // Capacity corev1.ResourceList `json:"capacity"` - - // How much capacity is actually allocatable on this machine. - // Must be equal to or less than the capacity, and when less - // indicates the resources reserved for system overhead. - // - // WARNING: It is up to the creator of the MachineClass to ensure that - // this field is consistent with the underlying machine that will - // be provisioned when this class is used, to inform higher level - // automation (e.g. the cluster autoscaler). - // TODO(hardikdr) Add allocatable field once requirements are clear from autoscaler-clusterapi // integration topic. - // Allocatable corev1.ResourceList `json:"allocatable"` - - // Provider-specific configuration to use during node creation. - ProviderSpec runtime.RawExtension `json:"providerSpec"` - - // TODO: should this use an api.ObjectReference to a 'MachineTemplate' instead? - // A link to the MachineTemplate that will be used to create provider - // specific configuration for Machines of this class. - // MachineTemplate corev1.ObjectReference `json:machineTemplate` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// MachineClassList contains a list of MachineClasses -type MachineClassList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachineClass `json:"items"` -} - -func init() { - SchemeBuilder.Register(&MachineClass{}, &MachineClassList{}) -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go deleted file mode 100644 index be0cc25ff6d..00000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go +++ /dev/null @@ -1,194 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" - - "github.com/openshift/cluster-api/pkg/apis/cluster/common" -) - -/// [MachineDeploymentSpec] -// MachineDeploymentSpec defines the desired state of MachineDeployment -type MachineDeploymentSpec struct { - // Number of desired machines. Defaults to 1. - // This is a pointer to distinguish between explicit zero and not specified. - Replicas *int32 `json:"replicas,omitempty"` - - // Label selector for machines. Existing MachineSets whose machines are - // selected by this will be the ones affected by this deployment. - // It must match the machine template's labels. - Selector metav1.LabelSelector `json:"selector"` - - // Template describes the machines that will be created. - Template MachineTemplateSpec `json:"template"` - - // The deployment strategy to use to replace existing machines with - // new ones. - // +optional - Strategy *MachineDeploymentStrategy `json:"strategy,omitempty"` - - // Minimum number of seconds for which a newly created machine should - // be ready. - // Defaults to 0 (machine will be considered available as soon as it - // is ready) - // +optional - MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` - - // The number of old MachineSets to retain to allow rollback. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 1. - // +optional - RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` - - // Indicates that the deployment is paused. - // +optional - Paused bool `json:"paused,omitempty"` - - // The maximum time in seconds for a deployment to make progress before it - // is considered to be failed. The deployment controller will continue to - // process failed deployments and a condition with a ProgressDeadlineExceeded - // reason will be surfaced in the deployment status. Note that progress will - // not be estimated during the time a deployment is paused. Defaults to 600s. - ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` -} - -/// [MachineDeploymentSpec] - -/// [MachineDeploymentStrategy] -// MachineDeploymentStrategy describes how to replace existing machines -// with new ones. -type MachineDeploymentStrategy struct { - // Type of deployment. Currently the only supported strategy is - // "RollingUpdate". - // Default is RollingUpdate. - // +optional - Type common.MachineDeploymentStrategyType `json:"type,omitempty"` - - // Rolling update config params. Present only if - // MachineDeploymentStrategyType = RollingUpdate. - // +optional - RollingUpdate *MachineRollingUpdateDeployment `json:"rollingUpdate,omitempty"` -} - -/// [MachineDeploymentStrategy] - -/// [MachineRollingUpdateDeployment] -// Spec to control the desired behavior of rolling update. -type MachineRollingUpdateDeployment struct { - // The maximum number of machines that can be unavailable during the update. - // Value can be an absolute number (ex: 5) or a percentage of desired - // machines (ex: 10%). - // Absolute number is calculated from percentage by rounding down. - // This can not be 0 if MaxSurge is 0. - // Defaults to 0. - // Example: when this is set to 30%, the old MachineSet can be scaled - // down to 70% of desired machines immediately when the rolling update - // starts. Once new machines are ready, old MachineSet can be scaled - // down further, followed by scaling up the new MachineSet, ensuring - // that the total number of machines available at all times - // during the update is at least 70% of desired machines. - // +optional - MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"` - - // The maximum number of machines that can be scheduled above the - // desired number of machines. - // Value can be an absolute number (ex: 5) or a percentage of - // desired machines (ex: 10%). - // This can not be 0 if MaxUnavailable is 0. - // Absolute number is calculated from percentage by rounding up. - // Defaults to 1. - // Example: when this is set to 30%, the new MachineSet can be scaled - // up immediately when the rolling update starts, such that the total - // number of old and new machines do not exceed 130% of desired - // machines. Once old machines have been killed, new MachineSet can - // be scaled up further, ensuring that total number of machines running - // at any time during the update is at most 130% of desired machines. - // +optional - MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"` -} - -/// [MachineRollingUpdateDeployment] - -/// [MachineDeploymentStatus] -// MachineDeploymentStatus defines the observed state of MachineDeployment -type MachineDeploymentStatus struct { - // The generation observed by the deployment controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"` - - // Total number of non-terminated machines targeted by this deployment - // (their labels match the selector). - // +optional - Replicas int32 `json:"replicas,omitempty" protobuf:"varint,2,opt,name=replicas"` - - // Total number of non-terminated machines targeted by this deployment - // that have the desired template spec. - // +optional - UpdatedReplicas int32 `json:"updatedReplicas,omitempty" protobuf:"varint,3,opt,name=updatedReplicas"` - - // Total number of ready machines targeted by this deployment. - // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,7,opt,name=readyReplicas"` - - // Total number of available machines (ready for at least minReadySeconds) - // targeted by this deployment. - // +optional - AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,4,opt,name=availableReplicas"` - - // Total number of unavailable machines targeted by this deployment. - // This is the total number of machines that are still required for - // the deployment to have 100% available capacity. They may either - // be machines that are running but not yet available or machines - // that still have not been created. - // +optional - UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"` -} - -/// [MachineDeploymentStatus] - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -/// [MachineDeployment] -// MachineDeployment is the Schema for the machinedeployments API -// +k8s:openapi-gen=true -// +kubebuilder:subresource:status -// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector -type MachineDeployment struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachineDeploymentSpec `json:"spec,omitempty"` - Status MachineDeploymentStatus `json:"status,omitempty"` -} - -/// [MachineDeployment] - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// MachineDeploymentList contains a list of MachineDeployment -type MachineDeploymentList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachineDeployment `json:"items"` -} - -func init() { - SchemeBuilder.Register(&MachineDeployment{}, &MachineDeploymentList{}) -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go deleted file mode 100644 index 95644395ace..00000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go +++ /dev/null @@ -1,187 +0,0 @@ -/* -Copyright 2018 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 v1alpha1 - -import ( - "log" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" - - "github.com/openshift/cluster-api/pkg/apis/cluster/common" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/validation/field" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -/// [MachineSet] -// MachineSet ensures that a specified number of machines replicas are running at any given time. -// +k8s:openapi-gen=true -// +kubebuilder:subresource:status -// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector -type MachineSet struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachineSetSpec `json:"spec,omitempty"` - Status MachineSetStatus `json:"status,omitempty"` -} - -/// [MachineSet] - -/// [MachineSetSpec] -// MachineSetSpec defines the desired state of MachineSet -type MachineSetSpec struct { - // Replicas is the number of desired replicas. - // This is a pointer to distinguish between explicit zero and unspecified. - // Defaults to 1. - // +optional - Replicas *int32 `json:"replicas,omitempty"` - - // MinReadySeconds is the minimum number of seconds for which a newly created machine should be ready. - // Defaults to 0 (machine will be considered available as soon as it is ready) - // +optional - MinReadySeconds int32 `json:"minReadySeconds,omitempty"` - - // Selector is a label query over machines that should match the replica count. - // Label keys and values that must match in order to be controlled by this MachineSet. - // It must match the machine template's labels. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - Selector metav1.LabelSelector `json:"selector"` - - // Template is the object that describes the machine that will be created if - // insufficient replicas are detected. - // +optional - Template MachineTemplateSpec `json:"template,omitempty"` -} - -/// [MachineSetSpec] // doxygen marker - -/// [MachineTemplateSpec] // doxygen marker -// MachineTemplateSpec describes the data needed to create a Machine from a template -type MachineTemplateSpec struct { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Specification of the desired behavior of the machine. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status - // +optional - Spec MachineSpec `json:"spec,omitempty"` -} - -/// [MachineTemplateSpec] - -/// [MachineSetStatus] -// MachineSetStatus defines the observed state of MachineSet -type MachineSetStatus struct { - // Replicas is the most recently observed number of replicas. - Replicas int32 `json:"replicas"` - - // The number of replicas that have labels matching the labels of the machine template of the MachineSet. - // +optional - FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"` - - // The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready". - // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty"` - - // The number of available replicas (ready for at least minReadySeconds) for this MachineSet. - // +optional - AvailableReplicas int32 `json:"availableReplicas,omitempty"` - - // ObservedGeneration reflects the generation of the most recently observed MachineSet. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // In the event that there is a terminal problem reconciling the - // replicas, both ErrorReason and ErrorMessage will be set. ErrorReason - // will be populated with a succinct value suitable for machine - // interpretation, while ErrorMessage will contain a more verbose - // string suitable for logging and human consumption. - // - // These fields should not be set for transitive errors that a - // controller faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the MachineTemplate's spec or the configuration of - // the machine controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the machine controller, or the - // responsible machine controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of Machines - // can be added as events to the MachineSet object and/or logged in the - // controller's output. - // +optional - ErrorReason *common.MachineSetStatusError `json:"errorReason,omitempty"` - // +optional - ErrorMessage *string `json:"errorMessage,omitempty"` -} - -/// [MachineSetStatus] - -func (machineSet *MachineSet) Validate() field.ErrorList { - errors := field.ErrorList{} - - // validate spec.selector and spec.template.labels - fldPath := field.NewPath("spec") - errors = append(errors, metav1validation.ValidateLabelSelector(&machineSet.Spec.Selector, fldPath.Child("selector"))...) - if len(machineSet.Spec.Selector.MatchLabels)+len(machineSet.Spec.Selector.MatchExpressions) == 0 { - errors = append(errors, field.Invalid(fldPath.Child("selector"), machineSet.Spec.Selector, "empty selector is not valid for MachineSet.")) - } - selector, err := metav1.LabelSelectorAsSelector(&machineSet.Spec.Selector) - if err != nil { - errors = append(errors, field.Invalid(fldPath.Child("selector"), machineSet.Spec.Selector, "invalid label selector.")) - } else { - labels := labels.Set(machineSet.Spec.Template.Labels) - if !selector.Matches(labels) { - errors = append(errors, field.Invalid(fldPath.Child("template", "metadata", "labels"), machineSet.Spec.Template.Labels, "`selector` does not match template `labels`")) - } - } - - return errors -} - -// DefaultingFunction sets default MachineSet field values -func (obj *MachineSet) Default() { - log.Printf("Defaulting fields for MachineSet %s\n", obj.Name) - - if obj.Spec.Replicas == nil { - obj.Spec.Replicas = new(int32) - *obj.Spec.Replicas = 1 - } - - if len(obj.Namespace) == 0 { - obj.Namespace = metav1.NamespaceDefault - } -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// MachineSetList contains a list of MachineSet -type MachineSetList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachineSet `json:"items"` -} - -func init() { - SchemeBuilder.Register(&MachineSet{}, &MachineSetList{}) -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/register.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/register.go deleted file mode 100644 index d4b8529670d..00000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/register.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2018 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. -*/ - -// NOTE: Boilerplate only. Ignore this file. - -// Package v1alpha1 contains API Schema definitions for the cluster v1alpha1 API group -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/pkg/apis/cluster -// +k8s:defaulter-gen=TypeMeta -// +groupName=cluster.k8s.io -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/runtime/scheme" -) - -var ( - // SchemeGroupVersion is group version used to register these objects - SchemeGroupVersion = schema.GroupVersion{Group: "cluster.k8s.io", Version: "v1alpha1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} - - // Required by pkg/client/... - // TODO(pwittrock): Remove this after removing pkg/client/... - AddToScheme = SchemeBuilder.AddToScheme -) - -// Required by pkg/client/listers/... -// TODO(pwittrock): Remove this after removing pkg/client/... -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index fd8e1f63a9c..00000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,821 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2018 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 main. DO NOT EDIT. - -package v1alpha1 - -import ( - common "github.com/openshift/cluster-api/pkg/apis/cluster/common" - v1 "k8s.io/api/core/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - intstr "k8s.io/apimachinery/pkg/util/intstr" -) - -// 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 - return -} - -// 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 *Cluster) DeepCopyInto(out *Cluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. -func (in *Cluster) DeepCopy() *Cluster { - if in == nil { - return nil - } - out := new(Cluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Cluster) 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 *ClusterList) DeepCopyInto(out *ClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. -func (in *ClusterList) DeepCopy() *ClusterList { - if in == nil { - return nil - } - out := new(ClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterList) 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 *ClusterNetworkingConfig) DeepCopyInto(out *ClusterNetworkingConfig) { - *out = *in - in.Services.DeepCopyInto(&out.Services) - in.Pods.DeepCopyInto(&out.Pods) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterNetworkingConfig. -func (in *ClusterNetworkingConfig) DeepCopy() *ClusterNetworkingConfig { - if in == nil { - return nil - } - out := new(ClusterNetworkingConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { - *out = *in - in.ClusterNetwork.DeepCopyInto(&out.ClusterNetwork) - in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. -func (in *ClusterSpec) DeepCopy() *ClusterSpec { - if in == nil { - return nil - } - out := new(ClusterSpec) - in.DeepCopyInto(out) - return out -} - -// 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 - if in.APIEndpoints != nil { - in, out := &in.APIEndpoints, &out.APIEndpoints - *out = make([]APIEndpoint, len(*in)) - copy(*out, *in) - } - if in.ProviderStatus != nil { - in, out := &in.ProviderStatus, &out.ProviderStatus - *out = new(runtime.RawExtension) - (*in).DeepCopyInto(*out) - } - return -} - -// 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 -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LastOperation) DeepCopyInto(out *LastOperation) { - *out = *in - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.LastUpdated != nil { - in, out := &in.LastUpdated, &out.LastUpdated - *out = (*in).DeepCopy() - } - if in.State != nil { - in, out := &in.State, &out.State - *out = new(string) - **out = **in - } - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LastOperation. -func (in *LastOperation) DeepCopy() *LastOperation { - if in == nil { - return nil - } - out := new(LastOperation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Machine) DeepCopyInto(out *Machine) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine. -func (in *Machine) DeepCopy() *Machine { - if in == nil { - return nil - } - out := new(Machine) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Machine) 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 *MachineClass) DeepCopyInto(out *MachineClass) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineClass. -func (in *MachineClass) DeepCopy() *MachineClass { - if in == nil { - return nil - } - out := new(MachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineClass) 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 *MachineClassList) DeepCopyInto(out *MachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineClassList. -func (in *MachineClassList) DeepCopy() *MachineClassList { - if in == nil { - return nil - } - out := new(MachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineClassList) 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 *MachineClassRef) DeepCopyInto(out *MachineClassRef) { - *out = *in - if in.ObjectReference != nil { - in, out := &in.ObjectReference, &out.ObjectReference - *out = new(v1.ObjectReference) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineClassRef. -func (in *MachineClassRef) DeepCopy() *MachineClassRef { - if in == nil { - return nil - } - out := new(MachineClassRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeployment) DeepCopyInto(out *MachineDeployment) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeployment. -func (in *MachineDeployment) DeepCopy() *MachineDeployment { - if in == nil { - return nil - } - out := new(MachineDeployment) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineDeployment) 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 *MachineDeploymentList) DeepCopyInto(out *MachineDeploymentList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineDeployment, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentList. -func (in *MachineDeploymentList) DeepCopy() *MachineDeploymentList { - if in == nil { - return nil - } - out := new(MachineDeploymentList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineDeploymentList) 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 *MachineDeploymentSpec) DeepCopyInto(out *MachineDeploymentSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - in.Selector.DeepCopyInto(&out.Selector) - in.Template.DeepCopyInto(&out.Template) - if in.Strategy != nil { - in, out := &in.Strategy, &out.Strategy - *out = new(MachineDeploymentStrategy) - (*in).DeepCopyInto(*out) - } - if in.MinReadySeconds != nil { - in, out := &in.MinReadySeconds, &out.MinReadySeconds - *out = new(int32) - **out = **in - } - if in.RevisionHistoryLimit != nil { - in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit - *out = new(int32) - **out = **in - } - if in.ProgressDeadlineSeconds != nil { - in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentSpec. -func (in *MachineDeploymentSpec) DeepCopy() *MachineDeploymentSpec { - if in == nil { - return nil - } - out := new(MachineDeploymentSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentStatus) DeepCopyInto(out *MachineDeploymentStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStatus. -func (in *MachineDeploymentStatus) DeepCopy() *MachineDeploymentStatus { - if in == nil { - return nil - } - out := new(MachineDeploymentStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentStrategy) DeepCopyInto(out *MachineDeploymentStrategy) { - *out = *in - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(MachineRollingUpdateDeployment) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStrategy. -func (in *MachineDeploymentStrategy) DeepCopy() *MachineDeploymentStrategy { - if in == nil { - return nil - } - out := new(MachineDeploymentStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineList) DeepCopyInto(out *MachineList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Machine, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineList. -func (in *MachineList) DeepCopy() *MachineList { - if in == nil { - return nil - } - out := new(MachineList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineList) 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 *MachineRollingUpdateDeployment) DeepCopyInto(out *MachineRollingUpdateDeployment) { - *out = *in - if in.MaxUnavailable != nil { - in, out := &in.MaxUnavailable, &out.MaxUnavailable - *out = new(intstr.IntOrString) - **out = **in - } - if in.MaxSurge != nil { - in, out := &in.MaxSurge, &out.MaxSurge - *out = new(intstr.IntOrString) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineRollingUpdateDeployment. -func (in *MachineRollingUpdateDeployment) DeepCopy() *MachineRollingUpdateDeployment { - if in == nil { - return nil - } - out := new(MachineRollingUpdateDeployment) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSet) DeepCopyInto(out *MachineSet) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSet. -func (in *MachineSet) DeepCopy() *MachineSet { - if in == nil { - return nil - } - out := new(MachineSet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineSet) 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 *MachineSetList) DeepCopyInto(out *MachineSetList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineSet, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetList. -func (in *MachineSetList) DeepCopy() *MachineSetList { - if in == nil { - return nil - } - out := new(MachineSetList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineSetList) 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 *MachineSetSpec) DeepCopyInto(out *MachineSetSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - in.Selector.DeepCopyInto(&out.Selector) - in.Template.DeepCopyInto(&out.Template) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetSpec. -func (in *MachineSetSpec) DeepCopy() *MachineSetSpec { - if in == nil { - return nil - } - out := new(MachineSetSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSetStatus) DeepCopyInto(out *MachineSetStatus) { - *out = *in - if in.ErrorReason != nil { - in, out := &in.ErrorReason, &out.ErrorReason - *out = new(common.MachineSetStatusError) - **out = **in - } - if in.ErrorMessage != nil { - in, out := &in.ErrorMessage, &out.ErrorMessage - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetStatus. -func (in *MachineSetStatus) DeepCopy() *MachineSetStatus { - if in == nil { - return nil - } - out := new(MachineSetStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSpec) DeepCopyInto(out *MachineSpec) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Taints != nil { - in, out := &in.Taints, &out.Taints - *out = make([]v1.Taint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) - out.Versions = in.Versions - if in.ConfigSource != nil { - in, out := &in.ConfigSource, &out.ConfigSource - *out = new(v1.NodeConfigSource) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpec. -func (in *MachineSpec) DeepCopy() *MachineSpec { - if in == nil { - return nil - } - out := new(MachineSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { - *out = *in - if in.NodeRef != nil { - in, out := &in.NodeRef, &out.NodeRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.LastUpdated != nil { - in, out := &in.LastUpdated, &out.LastUpdated - *out = (*in).DeepCopy() - } - if in.Versions != nil { - in, out := &in.Versions, &out.Versions - *out = new(MachineVersionInfo) - **out = **in - } - if in.ErrorReason != nil { - in, out := &in.ErrorReason, &out.ErrorReason - *out = new(common.MachineStatusError) - **out = **in - } - if in.ErrorMessage != nil { - in, out := &in.ErrorMessage, &out.ErrorMessage - *out = new(string) - **out = **in - } - if in.ProviderStatus != nil { - in, out := &in.ProviderStatus, &out.ProviderStatus - *out = new(runtime.RawExtension) - (*in).DeepCopyInto(*out) - } - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]v1.NodeAddress, len(*in)) - copy(*out, *in) - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.NodeCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.LastOperation != nil { - in, out := &in.LastOperation, &out.LastOperation - *out = new(LastOperation) - (*in).DeepCopyInto(*out) - } - if in.Phase != nil { - in, out := &in.Phase, &out.Phase - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatus. -func (in *MachineStatus) DeepCopy() *MachineStatus { - if in == nil { - return nil - } - out := new(MachineStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineTemplateSpec) DeepCopyInto(out *MachineTemplateSpec) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineTemplateSpec. -func (in *MachineTemplateSpec) DeepCopy() *MachineTemplateSpec { - if in == nil { - return nil - } - out := new(MachineTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineVersionInfo) DeepCopyInto(out *MachineVersionInfo) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineVersionInfo. -func (in *MachineVersionInfo) DeepCopy() *MachineVersionInfo { - if in == nil { - return nil - } - out := new(MachineVersionInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NetworkRanges) DeepCopyInto(out *NetworkRanges) { - *out = *in - if in.CIDRBlocks != nil { - in, out := &in.CIDRBlocks, &out.CIDRBlocks - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkRanges. -func (in *NetworkRanges) DeepCopy() *NetworkRanges { - if in == nil { - return nil - } - out := new(NetworkRanges) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProviderSpec) DeepCopyInto(out *ProviderSpec) { - *out = *in - if in.Value != nil { - in, out := &in.Value, &out.Value - *out = new(runtime.RawExtension) - (*in).DeepCopyInto(*out) - } - if in.ValueFrom != nil { - in, out := &in.ValueFrom, &out.ValueFrom - *out = new(ProviderSpecSource) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderSpec. -func (in *ProviderSpec) DeepCopy() *ProviderSpec { - if in == nil { - return nil - } - out := new(ProviderSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProviderSpecSource) DeepCopyInto(out *ProviderSpecSource) { - *out = *in - if in.MachineClass != nil { - in, out := &in.MachineClass, &out.MachineClass - *out = new(MachineClassRef) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderSpecSource. -func (in *ProviderSpecSource) DeepCopy() *ProviderSpecSource { - if in == nil { - return nil - } - out := new(ProviderSpecSource) - in.DeepCopyInto(out) - return out -}