diff --git a/Gopkg.lock b/Gopkg.lock index 8d349b1b5e..3f46f53ab2 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -485,7 +485,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", @@ -505,11 +505,11 @@ "pkg/util", ] pruneopts = "T" - revision = "d8958b539e331bf5ebb056b7f872541e13fb8e01" + revision = "0b649f443f830353db113f92aa86db2d4d34943a" [[projects]] branch = "master" - digest = "1:c51e502153acd32f728210817c40fc8e1d6851d2b64a0be0b5c0186ee32218ac" + digest = "1:38bc22ffe0f83b9fdbf37dc2bc7e203f3e200f989e2975d699d84de739fc2a0e" name = "github.com/openshift/cluster-api-actuator-pkg" packages = [ "pkg/e2e/autoscaler", @@ -520,7 +520,7 @@ "pkg/types", ] pruneopts = "" - revision = "286578aa9fd0510b7c37fbd4b4ab9c0eab7b03eb" + revision = "120c730b28bcc62907240620828f616edbdae802" [[projects]] branch = "master" @@ -1257,6 +1257,7 @@ "github.com/openshift/cluster-api-actuator-pkg/pkg/manifests", "github.com/openshift/cluster-api-actuator-pkg/pkg/types", "github.com/openshift/cluster-api/pkg/apis", + "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/controller/error", 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 13955cb251..e4cf2d3f87 100644 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/Gopkg.lock +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/Gopkg.lock @@ -372,7 +372,7 @@ [[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 +388,7 @@ "pkg/util", ] pruneopts = "" - revision = "d8958b539e331bf5ebb056b7f872541e13fb8e01" + revision = "0b649f443f830353db113f92aa86db2d4d34943a" [[projects]] branch = "master" @@ -1062,6 +1062,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/pkg/e2e/framework/clusterapi.go b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/clusterapi.go index 5e048feb7a..6b02fde547 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 c5ae5c37c0..cc63ca775b 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/manifests/manifests.go b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/manifests/manifests.go index dceb3efc16..4464ec3586 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 3fc6c32d0d..8d83f8566d 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 134a63abb6..0000000000 --- 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 ec66da1256..53fa8da84e 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 be7c3feb1d..bf29a1ab31 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 2947c9b846..0000000000 --- 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 6fcca0ee85..89bc237143 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 c1044bd6ab..0000000000 --- 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 c94b1ce47e..8ca4a1eb4d 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 e4cc014464..2c3b1dd105 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 93e8491575..9401510600 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 b26301d595..1f51b6f6f5 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 65f99f6c14..e1e05411ba 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 292c42f02c..0000000000 --- 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 870a0b17b6..33c7c903b3 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 dd58545475..7483f79527 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 1a509ddaff..0000000000 --- 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 8333c80081..ce5f9aa666 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 006b431d2b..20a5e72841 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 6ddd372e64..f66e557d9e 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 e216e749bd..3809d8673c 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 8198698842..fe3fa1c543 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 f9e28aada0..b6416e098a 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 e986773f07..a97f281188 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 2bc0ed85a6..3ff2333d8b 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 421179ef26..6be5f38703 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 57e1ec1b54..3a2b7ca241 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 ff5deffd39..7960fbec41 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 }