From 4b04803d4e57b6e241b0061f7daa78545ab3a369 Mon Sep 17 00:00:00 2001 From: Enxebre Date: Fri, 3 May 2019 10:07:20 +0200 Subject: [PATCH 1/2] Revendor to fetch https://github.com/openshift/cluster-api/pull/35 and https://github.com/openshift/cluster-api-actuator-pkg/pull/78 --- Gopkg.lock | 9 +- .../cluster-api-actuator-pkg/Gopkg.lock | 10 +- .../cluster-api-actuator-pkg/Gopkg.toml | 2 +- .../hack/ci-integration.sh | 4 +- .../pkg/e2e/autoscaler/autoscaler.go | 1 - .../pkg/e2e/framework/clusterapi.go | 2 +- .../pkg/e2e/framework/clusters.go | 8 +- .../pkg/e2e/infra/infra.go | 4 +- .../pkg/e2e/operators/utils.go | 2 +- .../pkg/manifests/manifests.go | 6 +- .../pkg/apis/machine/v1beta1/BUILD.bazel | 2 - .../pkg/apis/machine/v1beta1/cluster_types.go | 165 --------------- .../machine/v1beta1/zz_generated.deepcopy.go | 160 --------------- .../typed/machine/v1beta1/BUILD.bazel | 1 - .../typed/machine/v1beta1/cluster.go | 191 ------------------ .../typed/machine/v1beta1/fake/BUILD.bazel | 1 - .../machine/v1beta1/fake/fake_cluster.go | 140 ------------- .../v1beta1/fake/fake_machine_client.go | 4 - .../machine/v1beta1/generated_expansion.go | 2 - .../typed/machine/v1beta1/machine_client.go | 5 - .../externalversions/generic.go | 2 - .../machine/v1beta1/BUILD.bazel | 1 - .../machine/v1beta1/cluster.go | 89 -------- .../machine/v1beta1/interface.go | 7 - .../machine/v1beta1/BUILD.bazel | 1 - .../machine/v1beta1/cluster.go | 94 --------- .../machine/v1beta1/expansion_generated.go | 8 - .../pkg/controller/machine/BUILD.bazel | 1 + .../pkg/controller/machine/actuator.go | 9 +- .../pkg/controller/machine/controller.go | 5 +- .../pkg/controller/machine/testactuator.go | 9 +- .../controller/machinedeployment/BUILD.bazel | 1 + .../machinedeployment/controller.go | 5 +- .../pkg/controller/machineset/BUILD.bazel | 1 + .../pkg/controller/machineset/controller.go | 5 +- .../example/actuators/machine/BUILD.bazel | 1 + .../actuators/machine/machineactuator.go | 11 +- 37 files changed, 54 insertions(+), 915 deletions(-) delete mode 100644 vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/cluster_types.go delete mode 100644 vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/cluster.go delete mode 100644 vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_cluster.go delete mode 100644 vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/cluster.go delete mode 100644 vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/cluster.go diff --git a/Gopkg.lock b/Gopkg.lock index 32a533b29..4270c2aa0 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -412,7 +412,7 @@ [[projects]] branch = "openshift-4.0-cluster-api-0.0.0-alpha.4" - digest = "1:43b90c55a82c4be0bb8524534a92f2c7bd909e041a51e7b1ed6d52300978ef6a" + digest = "1:4700944f85b629a06b45a541430c0e6d3e7fe8bf1d757511448e27c7b0e5f701" name = "github.com/openshift/cluster-api" packages = [ "pkg/apis", @@ -434,11 +434,11 @@ "pkg/util", ] pruneopts = "T" - revision = "d8958b539e331bf5ebb056b7f872541e13fb8e01" + revision = "0b649f443f830353db113f92aa86db2d4d34943a" [[projects]] branch = "master" - digest = "1:e5a3d16ae5e88ee05f61a5f098d510e726633f2ba33d4edefb565182f62679fb" + digest = "1:ef8aa91d781d10937321173c6f482a1ce4fda450df095a2409e490eb178afcc9" name = "github.com/openshift/cluster-api-actuator-pkg" packages = [ "pkg/e2e/framework", @@ -446,7 +446,7 @@ "pkg/types", ] pruneopts = "T" - revision = "286578aa9fd0510b7c37fbd4b4ab9c0eab7b03eb" + revision = "dc2d4c7f4e839792f76b43e4844a5f87a09300b2" [[projects]] branch = "master" @@ -1177,6 +1177,7 @@ "github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework", "github.com/openshift/cluster-api-actuator-pkg/pkg/manifests", "github.com/openshift/cluster-api/pkg/apis", + "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1", "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1", "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset", "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1", diff --git a/vendor/github.com/openshift/cluster-api-actuator-pkg/Gopkg.lock b/vendor/github.com/openshift/cluster-api-actuator-pkg/Gopkg.lock index 13955cb25..33b0a0779 100644 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/Gopkg.lock +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/Gopkg.lock @@ -364,15 +364,16 @@ version = "v1.4.2" [[projects]] - digest = "1:853f9ec7a92a4b87a9b660e838731623d098613ef3bd5443b8331790ff7bef10" + branch = "master" + digest = "1:1267d3ab59b1de9f72b0bd74615c0926814806fbf2a6136cffc0fe1ee66a22f4" name = "github.com/openshift/api" packages = ["config/v1"] pruneopts = "" - revision = "8e476cb7322e59919cbb6482fd076ec5a214df25" + revision = "77b8897ec79a562e85920134fc65b63300c4d27a" [[projects]] branch = "openshift-4.0-cluster-api-0.0.0-alpha.4" - digest = "1:70aff930abe993c5b2c11128f615ac7ad529e99d82ee3fb13e41e2afac30a38c" + digest = "1:094eb37dfdc149e4b46a1f8ba2f0a01d2e14973b20ae758038ab66aef16b75ae" name = "github.com/openshift/cluster-api" packages = [ "pkg/apis/cluster/common", @@ -388,7 +389,7 @@ "pkg/util", ] pruneopts = "" - revision = "d8958b539e331bf5ebb056b7f872541e13fb8e01" + revision = "0b649f443f830353db113f92aa86db2d4d34943a" [[projects]] branch = "master" @@ -1062,6 +1063,7 @@ "github.com/onsi/ginkgo", "github.com/onsi/gomega", "github.com/openshift/api/config/v1", + "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1", "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1", "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset", "github.com/openshift/cluster-api/pkg/controller/node", diff --git a/vendor/github.com/openshift/cluster-api-actuator-pkg/Gopkg.toml b/vendor/github.com/openshift/cluster-api-actuator-pkg/Gopkg.toml index 3f6235648..184352c5c 100644 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/Gopkg.toml +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/Gopkg.toml @@ -43,7 +43,7 @@ required = [ [[constraint]] name = "github.com/openshift/api" - revision = "8e476cb7322e59919cbb6482fd076ec5a214df25" + branch = "master" [[constraint]] name = "github.com/openshift/cluster-api" diff --git a/vendor/github.com/openshift/cluster-api-actuator-pkg/hack/ci-integration.sh b/vendor/github.com/openshift/cluster-api-actuator-pkg/hack/ci-integration.sh index 66db62562..96e53373d 100755 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/hack/ci-integration.sh +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/hack/ci-integration.sh @@ -1,8 +1,8 @@ #!/bin/sh go test -timeout 90m \ - -v github.com/openshift/cluster-api-actuator-pkg/pkg/e2e \ + -v ./pkg/e2e \ -kubeconfig ${KUBECONFIG:-~/.kube/config} \ -machine-api-namespace ${NAMESPACE:-openshift-machine-api} \ -args -v 5 -logtostderr \ - $@ + "$@" diff --git a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/autoscaler/autoscaler.go b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/autoscaler/autoscaler.go index 99c83f010..012cd89f7 100644 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/autoscaler/autoscaler.go +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/autoscaler/autoscaler.go @@ -316,7 +316,6 @@ var _ = g.Describe("[Feature:Machines] Autoscaler should", func() { initialNumberOfReplicas0 := pointer.Int32PtrDerefOr(targetMachineSet0.Spec.Replicas, e2e.DefaultMachineSetReplicas) initialNumberOfReplicas1 := pointer.Int32PtrDerefOr(targetMachineSet1.Spec.Replicas, e2e.DefaultMachineSetReplicas) glog.Infof("initialNumberOfReplicas0 %d, initialNumberOfReplicas1 %d", initialNumberOfReplicas0, initialNumberOfReplicas1) - o.Expect(initialNumberOfReplicas0).To(o.BeNumerically("==", initialNumberOfReplicas1)) g.By("Creating workload") err = client.Create(context.TODO(), newWorkLoad()) diff --git a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/clusterapi.go b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/clusterapi.go index 5e048feb7..6b02fde54 100644 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/clusterapi.go +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/clusterapi.go @@ -73,7 +73,7 @@ func (f *Framework) DeployClusterAPIStack(clusterAPINamespace, actuatorPrivateKe f.By("Waiting until cluster objects can be listed") err = wait.Poll(PollInterval, PoolClusterAPIDeploymentTimeout, func() (bool, error) { // Any namespace will do just to that one can list cluster objects - _, err := f.CAPIClient.MachineV1beta1().Clusters("default").List(metav1.ListOptions{}) + _, err := f.CAPIClient.ClusterV1alpha1().Clusters("default").List(metav1.ListOptions{}) if err != nil { glog.V(2).Infof("unable to list clusters: %v", err) return false, nil diff --git a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/clusters.go b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/clusters.go index c5ae5c37c..cc63ca775 100644 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/clusters.go +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/clusters.go @@ -5,15 +5,15 @@ import ( "github.com/golang/glog" - machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" ) -func (f *Framework) CreateClusterAndWait(cluster *machinev1beta1.Cluster) { +func (f *Framework) CreateClusterAndWait(cluster *clusterv1alpha1.Cluster) { f.By(fmt.Sprintf("Creating %q cluster", cluster.Name)) err := wait.Poll(PollInterval, PoolTimeout, func() (bool, error) { - _, err := f.CAPIClient.MachineV1beta1().Clusters(cluster.Namespace).Create(cluster) + _, err := f.CAPIClient.ClusterV1alpha1().Clusters(cluster.Namespace).Create(cluster) if err != nil { glog.V(2).Infof("error creating cluster: %v", err) return false, nil @@ -23,7 +23,7 @@ func (f *Framework) CreateClusterAndWait(cluster *machinev1beta1.Cluster) { f.ErrNotExpected(err) err = wait.Poll(PollInterval, PoolTimeout, func() (bool, error) { - _, err := f.CAPIClient.MachineV1beta1().Clusters(cluster.Namespace).Get(cluster.Name, metav1.GetOptions{}) + _, err := f.CAPIClient.ClusterV1alpha1().Clusters(cluster.Namespace).Get(cluster.Name, metav1.GetOptions{}) if err != nil { return false, nil } diff --git a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/infra/infra.go b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/infra/infra.go index 6bddb342a..661120e9a 100644 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/infra/infra.go +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/infra/infra.go @@ -269,7 +269,7 @@ var _ = g.Describe("[Feature:Machines] Managed cluster should", func() { machineSets, err := e2e.GetMachineSets(context.TODO(), client) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(len(machineSets)).To(o.BeNumerically(">", 2)) + o.Expect(len(machineSets)).To(o.BeNumerically(">=", 2)) machineSet := machineSets[0] initialReplicasMachineSet := int(pointer.Int32PtrDerefOr(machineSet.Spec.Replicas, e2e.DefaultMachineSetReplicas)) scaleOut := 3 @@ -309,7 +309,7 @@ var _ = g.Describe("[Feature:Machines] Managed cluster should", func() { g.By("getting worker machineSets") machineSets, err := e2e.GetMachineSets(context.TODO(), client) o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(len(machineSets)).To(o.BeNumerically(">", 2)) + o.Expect(len(machineSets)).To(o.BeNumerically(">=", 2)) machineSet0 := machineSets[0] initialReplicasMachineSet0 := int(pointer.Int32PtrDerefOr(machineSet0.Spec.Replicas, e2e.DefaultMachineSetReplicas)) machineSet1 := machineSets[1] diff --git a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/operators/utils.go b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/operators/utils.go index 29adce076..fcd48f39c 100644 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/operators/utils.go +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/operators/utils.go @@ -84,7 +84,7 @@ func isStatusAvailable(client runtimeclient.Client, name string) bool { glog.Errorf("Condition: %q is true", osconfigv1.OperatorProgressing) return false, nil } - if cov1helpers.IsStatusConditionTrue(clusterOperator.Status.Conditions, osconfigv1.OperatorFailing) || cov1helpers.IsStatusConditionTrue(clusterOperator.Status.Conditions, osconfigv1.OperatorDegraded) { + if cov1helpers.IsStatusConditionTrue(clusterOperator.Status.Conditions, osconfigv1.OperatorDegraded) { glog.Errorf("Condition: %q is true", osconfigv1.OperatorDegraded) return false, nil } diff --git a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/manifests/manifests.go b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/manifests/manifests.go index dceb3efc1..4464ec358 100644 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/manifests/manifests.go +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/manifests/manifests.go @@ -24,14 +24,14 @@ func ClusterCRDManifest() *v1beta1.CustomResourceDefinition { APIVersion: "apiextensions.k8s.io/v1beta1", }, ObjectMeta: metav1.ObjectMeta{ - Name: "clusters.machine.openshift.io", + Name: "clusters.cluster.k8s.io", Labels: map[string]string{ "controller-tools.k8s.io": "1.0", }, }, Spec: v1beta1.CustomResourceDefinitionSpec{ - Group: "machine.openshift.io", - Version: "v1beta1", + Group: "cluster.k8s.io", + Version: "v1alpha1", Names: v1beta1.CustomResourceDefinitionNames{ Plural: "clusters", Kind: "Cluster", diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/BUILD.bazel index 3fc6c32d0..8d83f8566 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/BUILD.bazel @@ -3,7 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ - "cluster_types.go", "common_types.go", "defaults.go", "doc.go", @@ -33,7 +32,6 @@ go_library( go_test( name = "go_default_test", srcs = [ - "cluster_types_test.go", "machine_types_test.go", "machinedeployment_types_test.go", "machineset_types_test.go", diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/cluster_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/cluster_types.go deleted file mode 100644 index 134a63abb..000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/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 v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - - "github.com/openshift/cluster-api/pkg/apis/machine/common" - "k8s.io/apimachinery/pkg/util/validation/field" -) - -const ClusterFinalizer = "cluster.machine.openshift.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/machine/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/zz_generated.deepcopy.go index ec66da125..53fa8da84 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/zz_generated.deepcopy.go @@ -27,145 +27,6 @@ import ( 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 @@ -702,27 +563,6 @@ func (in *MachineTemplateSpec) DeepCopy() *MachineTemplateSpec { 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 diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/BUILD.bazel index be7c3feb1..bf29a1ab3 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/BUILD.bazel @@ -3,7 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = [ - "cluster.go", "doc.go", "generated_expansion.go", "machine.go", diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/cluster.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/cluster.go deleted file mode 100644 index 2947c9b84..000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/cluster.go +++ /dev/null @@ -1,191 +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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "time" - - v1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" - scheme "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// ClustersGetter has a method to return a ClusterInterface. -// A group's client should implement this interface. -type ClustersGetter interface { - Clusters(namespace string) ClusterInterface -} - -// ClusterInterface has methods to work with Cluster resources. -type ClusterInterface interface { - Create(*v1beta1.Cluster) (*v1beta1.Cluster, error) - Update(*v1beta1.Cluster) (*v1beta1.Cluster, error) - UpdateStatus(*v1beta1.Cluster) (*v1beta1.Cluster, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Cluster, error) - List(opts v1.ListOptions) (*v1beta1.ClusterList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Cluster, err error) - ClusterExpansion -} - -// clusters implements ClusterInterface -type clusters struct { - client rest.Interface - ns string -} - -// newClusters returns a Clusters -func newClusters(c *MachineV1beta1Client, namespace string) *clusters { - return &clusters{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. -func (c *clusters) Get(name string, options v1.GetOptions) (result *v1beta1.Cluster, err error) { - result = &v1beta1.Cluster{} - err = c.client.Get(). - Namespace(c.ns). - Resource("clusters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Clusters that match those selectors. -func (c *clusters) List(opts v1.ListOptions) (result *v1beta1.ClusterList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ClusterList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("clusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusters. -func (c *clusters) Watch(opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("clusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch() -} - -// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *clusters) Create(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) { - result = &v1beta1.Cluster{} - err = c.client.Post(). - Namespace(c.ns). - Resource("clusters"). - Body(cluster). - Do(). - Into(result) - return -} - -// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *clusters) Update(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) { - result = &v1beta1.Cluster{} - err = c.client.Put(). - Namespace(c.ns). - Resource("clusters"). - Name(cluster.Name). - Body(cluster). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *clusters) UpdateStatus(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) { - result = &v1beta1.Cluster{} - err = c.client.Put(). - Namespace(c.ns). - Resource("clusters"). - Name(cluster.Name). - SubResource("status"). - Body(cluster). - Do(). - Into(result) - return -} - -// Delete takes name of the cluster and deletes it. Returns an error if one occurs. -func (c *clusters) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("clusters"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("clusters"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Timeout(timeout). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched cluster. -func (c *clusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Cluster, err error) { - result = &v1beta1.Cluster{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("clusters"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/BUILD.bazel index 6fcca0ee8..89bc23714 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/BUILD.bazel @@ -4,7 +4,6 @@ go_library( name = "go_default_library", srcs = [ "doc.go", - "fake_cluster.go", "fake_machine.go", "fake_machine_client.go", "fake_machineclass.go", diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_cluster.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_cluster.go deleted file mode 100644 index c1044bd6a..000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_cluster.go +++ /dev/null @@ -1,140 +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. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeClusters implements ClusterInterface -type FakeClusters struct { - Fake *FakeMachineV1beta1 - ns string -} - -var clustersResource = schema.GroupVersionResource{Group: "machine.openshift.io", Version: "v1beta1", Resource: "clusters"} - -var clustersKind = schema.GroupVersionKind{Group: "machine.openshift.io", Version: "v1beta1", Kind: "Cluster"} - -// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. -func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1beta1.Cluster, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(clustersResource, c.ns, name), &v1beta1.Cluster{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Cluster), err -} - -// List takes label and field selectors, and returns the list of Clusters that match those selectors. -func (c *FakeClusters) List(opts v1.ListOptions) (result *v1beta1.ClusterList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(clustersResource, clustersKind, c.ns, opts), &v1beta1.ClusterList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ClusterList{ListMeta: obj.(*v1beta1.ClusterList).ListMeta} - for _, item := range obj.(*v1beta1.ClusterList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusters. -func (c *FakeClusters) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(clustersResource, c.ns, opts)) - -} - -// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *FakeClusters) Create(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(clustersResource, c.ns, cluster), &v1beta1.Cluster{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Cluster), err -} - -// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *FakeClusters) Update(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(clustersResource, c.ns, cluster), &v1beta1.Cluster{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Cluster), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusters) UpdateStatus(cluster *v1beta1.Cluster) (*v1beta1.Cluster, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(clustersResource, "status", c.ns, cluster), &v1beta1.Cluster{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Cluster), err -} - -// Delete takes name of the cluster and deletes it. Returns an error if one occurs. -func (c *FakeClusters) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(clustersResource, c.ns, name), &v1beta1.Cluster{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(clustersResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1beta1.ClusterList{}) - return err -} - -// Patch applies the patch and returns the patched cluster. -func (c *FakeClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Cluster, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, pt, data, subresources...), &v1beta1.Cluster{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.Cluster), err -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machine_client.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machine_client.go index c94b1ce47..8ca4a1eb4 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machine_client.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machine_client.go @@ -28,10 +28,6 @@ type FakeMachineV1beta1 struct { *testing.Fake } -func (c *FakeMachineV1beta1) Clusters(namespace string) v1beta1.ClusterInterface { - return &FakeClusters{c, namespace} -} - func (c *FakeMachineV1beta1) Machines(namespace string) v1beta1.MachineInterface { return &FakeMachines{c, namespace} } diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/generated_expansion.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/generated_expansion.go index e4cc01446..2c3b1dd10 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/generated_expansion.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/generated_expansion.go @@ -18,8 +18,6 @@ limitations under the License. package v1beta1 -type ClusterExpansion interface{} - type MachineExpansion interface{} type MachineClassExpansion interface{} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machine_client.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machine_client.go index 93e849157..940151060 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machine_client.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machine_client.go @@ -27,7 +27,6 @@ import ( type MachineV1beta1Interface interface { RESTClient() rest.Interface - ClustersGetter MachinesGetter MachineClassesGetter MachineDeploymentsGetter @@ -39,10 +38,6 @@ type MachineV1beta1Client struct { restClient rest.Interface } -func (c *MachineV1beta1Client) Clusters(namespace string) ClusterInterface { - return newClusters(c, namespace) -} - func (c *MachineV1beta1Client) Machines(namespace string) MachineInterface { return newMachines(c, namespace) } diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/generic.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/generic.go index b26301d59..1f51b6f6f 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/generic.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/generic.go @@ -66,8 +66,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha1().MachineSets().Informer()}, nil // Group=machine.openshift.io, Version=v1beta1 - case v1beta1.SchemeGroupVersion.WithResource("clusters"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Machine().V1beta1().Clusters().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("machines"): return &genericInformer{resource: resource.GroupResource(), informer: f.Machine().V1beta1().Machines().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("machineclasses"): diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/BUILD.bazel index 65f99f6c1..e1e05411b 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/BUILD.bazel @@ -3,7 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = [ - "cluster.go", "interface.go", "machine.go", "machineclass.go", diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/cluster.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/cluster.go deleted file mode 100644 index 292c42f02..000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/cluster.go +++ /dev/null @@ -1,89 +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. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1beta1 - -import ( - time "time" - - machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" - clientset "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" - internalinterfaces "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" - v1beta1 "github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// ClusterInformer provides access to a shared informer and lister for -// Clusters. -type ClusterInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1beta1.ClusterLister -} - -type clusterInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewClusterInformer constructs a new informer for Cluster type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewClusterInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredClusterInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredClusterInformer constructs a new informer for Cluster type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredClusterInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.MachineV1beta1().Clusters(namespace).List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.MachineV1beta1().Clusters(namespace).Watch(options) - }, - }, - &machinev1beta1.Cluster{}, - resyncPeriod, - indexers, - ) -} - -func (f *clusterInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredClusterInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *clusterInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&machinev1beta1.Cluster{}, f.defaultInformer) -} - -func (f *clusterInformer) Lister() v1beta1.ClusterLister { - return v1beta1.NewClusterLister(f.Informer().GetIndexer()) -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/interface.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/interface.go index 870a0b17b..33c7c903b 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/interface.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/interface.go @@ -24,8 +24,6 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { - // Clusters returns a ClusterInformer. - Clusters() ClusterInformer // Machines returns a MachineInformer. Machines() MachineInformer // MachineClasses returns a MachineClassInformer. @@ -47,11 +45,6 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// Clusters returns a ClusterInformer. -func (v *version) Clusters() ClusterInformer { - return &clusterInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // Machines returns a MachineInformer. func (v *version) Machines() MachineInformer { return &machineInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/BUILD.bazel index dd5854547..7483f7952 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/BUILD.bazel @@ -3,7 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = [ - "cluster.go", "expansion_generated.go", "machine.go", "machineclass.go", diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/cluster.go b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/cluster.go deleted file mode 100644 index 1a509ddaf..000000000 --- a/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/cluster.go +++ /dev/null @@ -1,94 +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. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ClusterLister helps list Clusters. -type ClusterLister interface { - // List lists all Clusters in the indexer. - List(selector labels.Selector) (ret []*v1beta1.Cluster, err error) - // Clusters returns an object that can list and get Clusters. - Clusters(namespace string) ClusterNamespaceLister - ClusterListerExpansion -} - -// clusterLister implements the ClusterLister interface. -type clusterLister struct { - indexer cache.Indexer -} - -// NewClusterLister returns a new ClusterLister. -func NewClusterLister(indexer cache.Indexer) ClusterLister { - return &clusterLister{indexer: indexer} -} - -// List lists all Clusters in the indexer. -func (s *clusterLister) List(selector labels.Selector) (ret []*v1beta1.Cluster, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Cluster)) - }) - return ret, err -} - -// Clusters returns an object that can list and get Clusters. -func (s *clusterLister) Clusters(namespace string) ClusterNamespaceLister { - return clusterNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// ClusterNamespaceLister helps list and get Clusters. -type ClusterNamespaceLister interface { - // List lists all Clusters in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1beta1.Cluster, err error) - // Get retrieves the Cluster from the indexer for a given namespace and name. - Get(name string) (*v1beta1.Cluster, error) - ClusterNamespaceListerExpansion -} - -// clusterNamespaceLister implements the ClusterNamespaceLister -// interface. -type clusterNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Clusters in the indexer for a given namespace. -func (s clusterNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Cluster, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Cluster)) - }) - return ret, err -} - -// Get retrieves the Cluster from the indexer for a given namespace and name. -func (s clusterNamespaceLister) Get(name string) (*v1beta1.Cluster, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("cluster"), name) - } - return obj.(*v1beta1.Cluster), nil -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/expansion_generated.go b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/expansion_generated.go index 8333c8008..ce5f9aa66 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/expansion_generated.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/expansion_generated.go @@ -18,14 +18,6 @@ limitations under the License. package v1beta1 -// ClusterListerExpansion allows custom methods to be added to -// ClusterLister. -type ClusterListerExpansion interface{} - -// ClusterNamespaceListerExpansion allows custom methods to be added to -// ClusterNamespaceLister. -type ClusterNamespaceListerExpansion interface{} - // MachineListerExpansion allows custom methods to be added to // MachineLister. type MachineListerExpansion interface{} diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/BUILD.bazel index 006b431d2..20a5e7284 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/BUILD.bazel @@ -10,6 +10,7 @@ go_library( importpath = "github.com/openshift/cluster-api/pkg/controller/machine", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/cluster/v1alpha1:go_default_library", "//pkg/apis/machine/v1beta1:go_default_library", "//pkg/controller/error:go_default_library", "//pkg/util:go_default_library", diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/actuator.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/actuator.go index 6ddd372e6..f66e557d9 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/actuator.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/actuator.go @@ -19,6 +19,7 @@ package machine import ( "context" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" ) @@ -27,13 +28,13 @@ import ( // methods should be idempotent unless otherwise specified. type Actuator interface { // Create the machine. - Create(context.Context, *machinev1.Cluster, *machinev1.Machine) error + Create(context.Context, *clusterv1.Cluster, *machinev1.Machine) error // Delete the machine. If no error is returned, it is assumed that all dependent resources have been cleaned up. - Delete(context.Context, *machinev1.Cluster, *machinev1.Machine) error + Delete(context.Context, *clusterv1.Cluster, *machinev1.Machine) error // Update the machine to the provided definition. - Update(context.Context, *machinev1.Cluster, *machinev1.Machine) error + Update(context.Context, *clusterv1.Cluster, *machinev1.Machine) error // Checks if the machine currently exists. - Exists(context.Context, *machinev1.Cluster, *machinev1.Machine) (bool, error) + Exists(context.Context, *clusterv1.Cluster, *machinev1.Machine) (bool, error) } /// [Actuator] diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go index e216e749b..3809d8673 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go @@ -23,6 +23,7 @@ import ( "time" "github.com/go-log/log/info" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" controllerError "github.com/openshift/cluster-api/pkg/controller/error" "github.com/openshift/cluster-api/pkg/util" @@ -286,13 +287,13 @@ func (r *ReconcileMachine) drainNode(machine *machinev1.Machine) error { return nil } -func (r *ReconcileMachine) getCluster(ctx context.Context, machine *machinev1.Machine) (*machinev1.Cluster, error) { +func (r *ReconcileMachine) getCluster(ctx context.Context, machine *machinev1.Machine) (*clusterv1.Cluster, error) { if machine.Labels[machinev1.MachineClusterLabelName] == "" { klog.Infof("Machine %q in namespace %q doesn't specify %q label, assuming nil cluster", machine.Name, machine.Namespace, machinev1.MachineClusterLabelName) return nil, nil } - cluster := &machinev1.Cluster{} + cluster := &clusterv1.Cluster{} key := client.ObjectKey{ Namespace: machine.Namespace, Name: machine.Labels[machinev1.MachineClusterLabelName], diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/testactuator.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/testactuator.go index 819869884..fe3fa1c54 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/testactuator.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/testactuator.go @@ -20,6 +20,7 @@ import ( "context" "sync" + "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" ) @@ -39,7 +40,7 @@ type TestActuator struct { Lock sync.Mutex } -func (a *TestActuator) Create(context.Context, *v1beta1.Cluster, *v1beta1.Machine) error { +func (a *TestActuator) Create(context.Context, *v1alpha1.Cluster, *v1beta1.Machine) error { defer func() { if a.BlockOnCreate { <-a.unblock @@ -52,7 +53,7 @@ func (a *TestActuator) Create(context.Context, *v1beta1.Cluster, *v1beta1.Machin return nil } -func (a *TestActuator) Delete(context.Context, *v1beta1.Cluster, *v1beta1.Machine) error { +func (a *TestActuator) Delete(context.Context, *v1alpha1.Cluster, *v1beta1.Machine) error { defer func() { if a.BlockOnDelete { <-a.unblock @@ -65,7 +66,7 @@ func (a *TestActuator) Delete(context.Context, *v1beta1.Cluster, *v1beta1.Machin return nil } -func (a *TestActuator) Update(ctx context.Context, c *v1beta1.Cluster, machine *v1beta1.Machine) error { +func (a *TestActuator) Update(ctx context.Context, c *v1alpha1.Cluster, machine *v1beta1.Machine) error { defer func() { if a.BlockOnUpdate { <-a.unblock @@ -77,7 +78,7 @@ func (a *TestActuator) Update(ctx context.Context, c *v1beta1.Cluster, machine * return nil } -func (a *TestActuator) Exists(context.Context, *v1beta1.Cluster, *v1beta1.Machine) (bool, error) { +func (a *TestActuator) Exists(context.Context, *v1alpha1.Cluster, *v1beta1.Machine) (bool, error) { defer func() { if a.BlockOnExists { <-a.unblock diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/BUILD.bazel index f9e28aada..b6416e098 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/BUILD.bazel @@ -10,6 +10,7 @@ go_library( importpath = "github.com/openshift/cluster-api/pkg/controller/machinedeployment", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/cluster/v1alpha1:go_default_library", "//pkg/apis/machine/common:go_default_library", "//pkg/apis/machine/v1beta1:go_default_library", "//pkg/controller/machinedeployment/util:go_default_library", diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go index e986773f0..a97f28118 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go @@ -20,6 +20,7 @@ import ( "context" "reflect" + "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" "github.com/openshift/cluster-api/pkg/apis/machine/common" "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" "github.com/openshift/cluster-api/pkg/util" @@ -269,13 +270,13 @@ func (r *ReconcileMachineDeployment) reconcile(ctx context.Context, d *v1beta1.M return reconcile.Result{}, errors.Errorf("unexpected deployment strategy type: %s", d.Spec.Strategy.Type) } -func (r *ReconcileMachineDeployment) getCluster(d *v1beta1.MachineDeployment) (*v1beta1.Cluster, error) { +func (r *ReconcileMachineDeployment) getCluster(d *v1beta1.MachineDeployment) (*v1alpha1.Cluster, error) { if d.Spec.Template.Labels[v1beta1.MachineClusterLabelName] == "" { klog.Infof("Deployment %q in namespace %q doesn't specify %q label, assuming nil cluster", d.Name, d.Namespace, v1beta1.MachineClusterLabelName) return nil, nil } - cluster := &v1beta1.Cluster{} + cluster := &v1alpha1.Cluster{} key := client.ObjectKey{ Namespace: d.Namespace, Name: d.Spec.Template.Labels[v1beta1.MachineClusterLabelName], diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/BUILD.bazel index 2bc0ed85a..3ff2333d8 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/BUILD.bazel @@ -11,6 +11,7 @@ go_library( importpath = "github.com/openshift/cluster-api/pkg/controller/machineset", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/cluster/v1alpha1:go_default_library", "//pkg/apis/machine/v1beta1:go_default_library", "//pkg/controller/noderefutil:go_default_library", "//pkg/util:go_default_library", diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go index 421179ef2..6be5f3870 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go @@ -24,6 +24,7 @@ import ( "sync" "time" + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" "github.com/openshift/cluster-api/pkg/util" "github.com/pkg/errors" @@ -291,13 +292,13 @@ func (r *ReconcileMachineSet) reconcile(ctx context.Context, machineSet *machine return reconcile.Result{}, nil } -func (r *ReconcileMachineSet) getCluster(ms *machinev1beta1.MachineSet) (*machinev1beta1.Cluster, error) { +func (r *ReconcileMachineSet) getCluster(ms *machinev1beta1.MachineSet) (*clusterv1alpha1.Cluster, error) { if ms.Spec.Template.Labels[machinev1beta1.MachineClusterLabelName] == "" { klog.Infof("MachineSet %q in namespace %q doesn't specify %q label, assuming nil cluster", ms.Name, ms.Namespace, machinev1beta1.MachineClusterLabelName) return nil, nil } - cluster := &machinev1beta1.Cluster{} + cluster := &clusterv1alpha1.Cluster{} key := client.ObjectKey{ Namespace: ms.Namespace, Name: ms.Spec.Template.Labels[machinev1beta1.MachineClusterLabelName], diff --git a/vendor/github.com/openshift/cluster-api/pkg/provider/example/actuators/machine/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/provider/example/actuators/machine/BUILD.bazel index 57e1ec1b5..3a2b7ca24 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/provider/example/actuators/machine/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/provider/example/actuators/machine/BUILD.bazel @@ -6,6 +6,7 @@ go_library( importpath = "github.com/openshift/cluster-api/pkg/provider/example/actuators/machine", visibility = ["//visibility:public"], deps = [ + "//pkg/apis/cluster/v1alpha1:go_default_library", "//pkg/apis/machine/v1beta1:go_default_library", "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", diff --git a/vendor/github.com/openshift/cluster-api/pkg/provider/example/actuators/machine/machineactuator.go b/vendor/github.com/openshift/cluster-api/pkg/provider/example/actuators/machine/machineactuator.go index ff5deffd3..7960fbec4 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/provider/example/actuators/machine/machineactuator.go +++ b/vendor/github.com/openshift/cluster-api/pkg/provider/example/actuators/machine/machineactuator.go @@ -19,7 +19,8 @@ package machine import ( "context" - clusterv1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" clusterv1alpha1 "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/client-go/tools/record" @@ -40,25 +41,25 @@ func NewMachineActuator(clusterV1alpha1 clusterv1alpha1.ClusterV1alpha1Interface } // Create creates a machine -func (a *Actuator) Create(ctx context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) error { +func (a *Actuator) Create(ctx context.Context, cluster *clusterv1.Cluster, machine *machinev1.Machine) error { a.recorder.Event(machine, corev1.EventTypeWarning, "cluster-api", "machineactuator Create invoked") return nil } // Delete deletes a machine -func (a *Actuator) Delete(ctx context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) error { +func (a *Actuator) Delete(ctx context.Context, cluster *clusterv1.Cluster, machine *machinev1.Machine) error { a.recorder.Event(machine, corev1.EventTypeWarning, "cluster-api", "machineactuator Delete invoked") return nil } // Update updates a machine -func (a *Actuator) Update(ctx context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) error { +func (a *Actuator) Update(ctx context.Context, cluster *clusterv1.Cluster, machine *machinev1.Machine) error { a.recorder.Event(machine, corev1.EventTypeWarning, "cluster-api", "machineactuator Update invoked") return nil } // Exists test for the existence of a machine -func (a *Actuator) Exists(ctx context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) (bool, error) { +func (a *Actuator) Exists(ctx context.Context, cluster *clusterv1.Cluster, machine *machinev1.Machine) (bool, error) { a.recorder.Event(machine, corev1.EventTypeWarning, "cluster-api", "machineactuator Exists invoked") return false, nil } From 46e00f1b5c6ae39a798b1f06eb460c39810b7ae7 Mon Sep 17 00:00:00 2001 From: Enxebre Date: Fri, 3 May 2019 10:09:26 +0200 Subject: [PATCH 2/2] Adapt actuator to use cluster from cluster.k8s.io https://github.com/openshift/cluster-api/pull/35 dropped the cluster object from machine.openshift.io as the cluster object is still required programatically via actuator interface this uses the one under cluster.k8s.io --- cmd/libvirt-actuator/main.go | 12 ++++----- cmd/libvirt-actuator/utils/utils.go | 5 ++-- .../libvirt/actuators/machine/actuator.go | 9 ++++--- .../actuators/machine/actuator_test.go | 27 ++++++++++--------- pkg/cloud/libvirt/actuators/machine/stubs.go | 5 ++-- test/machines/machines_test.go | 22 +++++++-------- 6 files changed, 42 insertions(+), 38 deletions(-) diff --git a/cmd/libvirt-actuator/main.go b/cmd/libvirt-actuator/main.go index 816bb333e..c3fc8e453 100644 --- a/cmd/libvirt-actuator/main.go +++ b/cmd/libvirt-actuator/main.go @@ -25,7 +25,7 @@ import ( apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" "k8s.io/apimachinery/pkg/util/wait" "github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework" @@ -212,17 +212,17 @@ func bootstrapCommand() *cobra.Command { machinePrefix := cmd.Flag("environment-id").Value.String() - testCluster := &machinev1.Cluster{ + testCluster := &clusterv1.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: machinePrefix, Namespace: testNamespace.Name, }, - Spec: machinev1.ClusterSpec{ - ClusterNetwork: machinev1.ClusterNetworkingConfig{ - Services: machinev1.NetworkRanges{ + Spec: clusterv1.ClusterSpec{ + ClusterNetwork: clusterv1.ClusterNetworkingConfig{ + Services: clusterv1.NetworkRanges{ CIDRBlocks: []string{"10.0.0.1/24"}, }, - Pods: machinev1.NetworkRanges{ + Pods: clusterv1.NetworkRanges{ CIDRBlocks: []string{"10.0.0.1/24"}, }, ServiceDomain: "example.com", diff --git a/cmd/libvirt-actuator/utils/utils.go b/cmd/libvirt-actuator/utils/utils.go index 041f29095..2c0068171 100644 --- a/cmd/libvirt-actuator/utils/utils.go +++ b/cmd/libvirt-actuator/utils/utils.go @@ -13,12 +13,13 @@ import ( machineactuator "github.com/openshift/cluster-api-provider-libvirt/pkg/cloud/libvirt/actuators/machine" libvirtclient "github.com/openshift/cluster-api-provider-libvirt/pkg/cloud/libvirt/client" "github.com/openshift/cluster-api-provider-libvirt/test" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" kubernetesfake "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/tools/record" ) -func ReadClusterResources(clusterLoc, machineLoc, userDataLoc string) (*machinev1.Cluster, *machinev1.Machine, *apiv1.Secret, error) { +func ReadClusterResources(clusterLoc, machineLoc, userDataLoc string) (*clusterv1.Cluster, *machinev1.Machine, *apiv1.Secret, error) { machine := &machinev1.Machine{} { bytes, err := ioutil.ReadFile(machineLoc) @@ -31,7 +32,7 @@ func ReadClusterResources(clusterLoc, machineLoc, userDataLoc string) (*machinev } } - cluster := &machinev1.Cluster{} + cluster := &clusterv1.Cluster{} { bytes, err := ioutil.ReadFile(clusterLoc) if err != nil { diff --git a/pkg/cloud/libvirt/actuators/machine/actuator.go b/pkg/cloud/libvirt/actuators/machine/actuator.go index 9c023c111..8c3f03a94 100644 --- a/pkg/cloud/libvirt/actuators/machine/actuator.go +++ b/pkg/cloud/libvirt/actuators/machine/actuator.go @@ -30,6 +30,7 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/record" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" clusterclient "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" apierrors "github.com/openshift/cluster-api/pkg/errors" @@ -109,7 +110,7 @@ func (a *Actuator) handleMachineError(machine *machinev1.Machine, err *apierrors } // Create creates a machine and is invoked by the Machine Controller -func (a *Actuator) Create(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) error { +func (a *Actuator) Create(context context.Context, cluster *clusterv1.Cluster, machine *machinev1.Machine) error { glog.Infof("Creating machine %q", machine.Name) errWrapper := errorWrapper{machine: machine} @@ -149,7 +150,7 @@ func (a *Actuator) Create(context context.Context, cluster *machinev1.Cluster, m } // Delete deletes a machine and is invoked by the Machine Controller -func (a *Actuator) Delete(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) error { +func (a *Actuator) Delete(context context.Context, cluster *clusterv1.Cluster, machine *machinev1.Machine) error { glog.Infof("Deleting machine %q", machine.Name) machineProviderConfig, err := ProviderConfigMachine(a.codec, &machine.Spec) @@ -176,7 +177,7 @@ func (a *Actuator) Delete(context context.Context, cluster *machinev1.Cluster, m } // Update updates a machine and is invoked by the Machine Controller -func (a *Actuator) Update(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) error { +func (a *Actuator) Update(context context.Context, cluster *clusterv1.Cluster, machine *machinev1.Machine) error { glog.Infof("Updating machine %v", machine.Name) errWrapper := errorWrapper{machine: machine} @@ -209,7 +210,7 @@ func (a *Actuator) Update(context context.Context, cluster *machinev1.Cluster, m } // Exists test for the existance of a machine and is invoked by the Machine Controller -func (a *Actuator) Exists(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) (bool, error) { +func (a *Actuator) Exists(context context.Context, cluster *clusterv1.Cluster, machine *machinev1.Machine) (bool, error) { glog.Infof("Checking if machine %v exists.", machine.Name) errWrapper := errorWrapper{machine: machine} diff --git a/pkg/cloud/libvirt/actuators/machine/actuator_test.go b/pkg/cloud/libvirt/actuators/machine/actuator_test.go index 60b2458f1..47eb16f0c 100644 --- a/pkg/cloud/libvirt/actuators/machine/actuator_test.go +++ b/pkg/cloud/libvirt/actuators/machine/actuator_test.go @@ -11,6 +11,7 @@ import ( libvirtclient "github.com/openshift/cluster-api-provider-libvirt/pkg/cloud/libvirt/client" mocklibvirt "github.com/openshift/cluster-api-provider-libvirt/pkg/cloud/libvirt/client/mock" fakeclusterclientset "github.com/openshift/cluster-api-provider-libvirt/test" + clusterv1beta1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" kubernetesfake "k8s.io/client-go/kubernetes/fake" @@ -48,7 +49,7 @@ func TestMachineEvents(t *testing.T) { name string machine *machinev1beta1.Machine error string - operation func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) + operation func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) event string createVolumeErr error deleteVolumeErr error @@ -62,7 +63,7 @@ func TestMachineEvents(t *testing.T) { { name: "Create machine event failed (invalid configuration)", machine: machineInvalidProviderConfig, - operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) { + operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) { actuator.Create(context.TODO(), cluster, machine) }, event: "Warning FailedCreate InvalidConfiguration", @@ -71,7 +72,7 @@ func TestMachineEvents(t *testing.T) { name: "Create machine event failed (error creating libvirt client)", machine: machine, error: libvirtClientError, - operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) { + operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) { actuator.Create(context.TODO(), cluster, machine) }, event: "Warning FailedCreate CreateError", @@ -80,7 +81,7 @@ func TestMachineEvents(t *testing.T) { name: "Create machine event failed (error creating volume)", machine: machine, createVolumeErr: fmt.Errorf("error"), - operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) { + operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) { actuator.Create(context.TODO(), cluster, machine) }, event: "Warning FailedCreate CreateError", @@ -89,7 +90,7 @@ func TestMachineEvents(t *testing.T) { name: "Create machine event failed (error creating domain)", machine: machine, createDomainErr: fmt.Errorf("error"), - operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) { + operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) { actuator.Create(context.TODO(), cluster, machine) }, event: "Warning FailedCreate CreateError", @@ -98,7 +99,7 @@ func TestMachineEvents(t *testing.T) { name: "Create machine event failed (error looking up domain)", machine: machine, lookupDomainErr: fmt.Errorf("error"), - operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) { + operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) { actuator.Create(context.TODO(), cluster, machine) }, event: "Warning FailedCreate CreateError", @@ -106,7 +107,7 @@ func TestMachineEvents(t *testing.T) { { name: "Create machine event succeed", machine: machine, - operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) { + operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) { actuator.Create(context.TODO(), cluster, machine) }, event: "Normal Created Created Machine libvirt-actuator-testing-machine", @@ -114,7 +115,7 @@ func TestMachineEvents(t *testing.T) { { name: "Delete machine event failed (invalid configuration)", machine: machineInvalidProviderConfig, - operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) { + operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) { actuator.Delete(context.TODO(), cluster, machine) }, event: "Warning FailedDelete InvalidConfiguration", @@ -123,7 +124,7 @@ func TestMachineEvents(t *testing.T) { name: "Delete machine event failed (error creating libvirt client)", machine: machine, error: libvirtClientError, - operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) { + operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) { actuator.Delete(context.TODO(), cluster, machine) }, event: "Warning FailedDelete DeleteError", @@ -132,7 +133,7 @@ func TestMachineEvents(t *testing.T) { name: "Delete machine event failed (error getting domain)", machine: machine, domainExistsErr: fmt.Errorf("error"), - operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) { + operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) { actuator.Delete(context.TODO(), cluster, machine) }, event: "Warning FailedDelete DeleteError", @@ -142,7 +143,7 @@ func TestMachineEvents(t *testing.T) { machine: machine, domainExists: true, deleteDomainErr: fmt.Errorf("error"), - operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) { + operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) { actuator.Delete(context.TODO(), cluster, machine) }, event: "Warning FailedDelete DeleteError", @@ -152,7 +153,7 @@ func TestMachineEvents(t *testing.T) { machine: machine, domainExists: true, deleteVolumeErr: fmt.Errorf("error"), - operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) { + operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) { actuator.Delete(context.TODO(), cluster, machine) }, event: "Warning FailedDelete DeleteError", @@ -161,7 +162,7 @@ func TestMachineEvents(t *testing.T) { name: "Delete machine event succeeds", machine: machine, domainExists: true, - operation: func(actuator *Actuator, cluster *machinev1beta1.Cluster, machine *machinev1beta1.Machine) { + operation: func(actuator *Actuator, cluster *clusterv1beta1.Cluster, machine *machinev1beta1.Machine) { actuator.Delete(context.TODO(), cluster, machine) }, event: "Normal Deleted Deleted Machine libvirt-actuator-testing-machine", diff --git a/pkg/cloud/libvirt/actuators/machine/stubs.go b/pkg/cloud/libvirt/actuators/machine/stubs.go index 6ca529233..c9603588d 100644 --- a/pkg/cloud/libvirt/actuators/machine/stubs.go +++ b/pkg/cloud/libvirt/actuators/machine/stubs.go @@ -6,6 +6,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" providerconfigv1 "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1beta1" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" ) @@ -65,8 +66,8 @@ func stubMachine() (*machinev1.Machine, error) { return machine, nil } -func stubCluster() *machinev1.Cluster { - return &machinev1.Cluster{ +func stubCluster() *clusterv1.Cluster { + return &clusterv1.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: clusterID, Namespace: defaultNamespace, diff --git a/test/machines/machines_test.go b/test/machines/machines_test.go index d530353b4..821499e21 100644 --- a/test/machines/machines_test.go +++ b/test/machines/machines_test.go @@ -17,7 +17,7 @@ import ( "github.com/openshift/cluster-api-actuator-pkg/pkg/manifests" "github.com/openshift/cluster-api-provider-libvirt/test/utils" - machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -124,17 +124,17 @@ var _ = framework.SigKubeDescribe("Machines", func() { clusterID = "cluster-" + string(uuid.NewUUID()) } - cluster := &machinev1beta1.Cluster{ + cluster := &clusterv1alpha1.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: clusterID, Namespace: testNamespace.Name, }, - Spec: machinev1beta1.ClusterSpec{ - ClusterNetwork: machinev1beta1.ClusterNetworkingConfig{ - Services: machinev1beta1.NetworkRanges{ + Spec: clusterv1alpha1.ClusterSpec{ + ClusterNetwork: clusterv1alpha1.ClusterNetworkingConfig{ + Services: clusterv1alpha1.NetworkRanges{ CIDRBlocks: []string{"10.0.0.1/24"}, }, - Pods: machinev1beta1.NetworkRanges{ + Pods: clusterv1alpha1.NetworkRanges{ CIDRBlocks: []string{"10.0.0.1/24"}, }, ServiceDomain: "example.com", @@ -186,17 +186,17 @@ var _ = framework.SigKubeDescribe("Machines", func() { clusterID = "cluster-" + clusterUUID[:8] } - cluster := &machinev1beta1.Cluster{ + cluster := &clusterv1alpha1.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: clusterID, Namespace: testNamespace.Name, }, - Spec: machinev1beta1.ClusterSpec{ - ClusterNetwork: machinev1beta1.ClusterNetworkingConfig{ - Services: machinev1beta1.NetworkRanges{ + Spec: clusterv1alpha1.ClusterSpec{ + ClusterNetwork: clusterv1alpha1.ClusterNetworkingConfig{ + Services: clusterv1alpha1.NetworkRanges{ CIDRBlocks: []string{"10.0.0.1/24"}, }, - Pods: machinev1beta1.NetworkRanges{ + Pods: clusterv1alpha1.NetworkRanges{ CIDRBlocks: []string{"10.0.0.1/24"}, }, ServiceDomain: "example.com",