diff --git a/Dockerfile b/Dockerfile index c2b73a228a..ce6894616a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM registry.svc.ci.openshift.org/openshift/release:golang-1.10 AS builder WORKDIR /go/src/sigs.k8s.io/cluster-api-provider-aws COPY . . RUN go build -o ./machine-controller-manager ./cmd/manager -RUN go build -o ./manager ./vendor/sigs.k8s.io/cluster-api/cmd/manager +RUN go build -o ./manager ./vendor/github.com/openshift/cluster-api/cmd/manager FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base RUN INSTALL_PKGS=" \ diff --git a/Dockerfile.rhel7 b/Dockerfile.rhel7 index 0eda94a753..37b3a376ec 100644 --- a/Dockerfile.rhel7 +++ b/Dockerfile.rhel7 @@ -2,7 +2,7 @@ FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.10 AS builder WORKDIR /go/src/sigs.k8s.io/cluster-api-provider-aws COPY . . RUN go build -o ./machine-controller-manager ./cmd/manager -RUN go build -o ./manager ./vendor/sigs.k8s.io/cluster-api/cmd/manager +RUN go build -o ./manager ./vendor/github.com/openshift/cluster-api/cmd/manager FROM registry.svc.ci.openshift.org/ocp/4.0:base RUN INSTALL_PKGS=" \ diff --git a/Gopkg.lock b/Gopkg.lock index 7b04df797c..2b4b4eec12 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -384,6 +384,23 @@ revision = "7615b9433f86a8bdf29709bf288bc4fd0636a369" version = "v1.4.2" +[[projects]] + digest = "1:c49c9300cc3bcc68bc1380ac1bad9ccc190f4f53c58dc208d805eda92c3b9279" + name = "github.com/openshift/cluster-api" + packages = [ + "pkg/apis", + "pkg/apis/cluster/common", + "pkg/apis/cluster/v1alpha1", + "pkg/apis/machine/common", + "pkg/apis/machine/v1beta1", + "pkg/controller/error", + "pkg/controller/machine", + "pkg/errors", + "pkg/util", + ] + pruneopts = "T" + revision = "91fca585a85b163ddfd119fd09c128c9feadddca" + [[projects]] digest = "1:8a5594cfb48c87f2e1d54ac443bc466c98e74484e4da43647f995836788a94ad" name = "github.com/openshift/cluster-api-actuator-pkg" @@ -740,7 +757,6 @@ ] pruneopts = "T" revision = "2d6f90ab1293a1fb871cf149423ebb72aa7423aa" - version = "kubernetes-1.11.2" [[projects]] digest = "1:3fe3cb0c5e5a140f0b40c18796b884d3432efbd690b0bda8cbd838d38a3ea585" @@ -754,7 +770,6 @@ ] pruneopts = "T" revision = "408db4a50408e2149acbd657bceb2480c13cb0a4" - version = "kubernetes-1.11.2" [[projects]] digest = "1:e2035d60919705a125feeb8b13926383aff8817634b2c4550743c19ca21f3b08" @@ -807,7 +822,6 @@ ] pruneopts = "T" revision = "103fd098999dc9c0c88536f5c9ad2e5da39373ae" - version = "kubernetes-1.11.2" [[projects]] digest = "1:0a19f9bf56ecc683569299c8c2282ee3ac70d4e32eeb170d3265761bff8d5e12" @@ -882,11 +896,9 @@ ] pruneopts = "T" revision = "1f13a808da65775f22cbf47862c4e5898d8f4ca1" - version = "kubernetes-1.11.2" [[projects]] - branch = "master" - digest = "1:69bcba4f5b287e27653cea4d21005cd6611d7a297d2546ec25d62d7bbe21dfff" + digest = "1:8ab487a323486c8bbbaa3b689850487fdccc6cbea8690620e083b2d230a4447e" name = "k8s.io/code-generator" packages = [ "cmd/deepcopy-gen", @@ -894,7 +906,7 @@ "pkg/util", ] pruneopts = "T" - revision = "772c233fdd266aea152482f6d8381bf12b222cd7" + revision = "6702109cc68eb6fe6350b83e14407c8d7309fd1a" [[projects]] branch = "master" @@ -928,25 +940,6 @@ pruneopts = "T" revision = "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" -[[projects]] - branch = "master" - digest = "1:7dcbe4d792c3e524fd0e08722294b4553eefb2609a708a4470d1abcd87aa12a6" - name = "sigs.k8s.io/cluster-api" - packages = [ - "pkg/apis", - "pkg/apis/cluster/common", - "pkg/apis/cluster/v1alpha1", - "pkg/client/clientset_generated/clientset", - "pkg/client/clientset_generated/clientset/scheme", - "pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1", - "pkg/controller/error", - "pkg/controller/machine", - "pkg/errors", - "pkg/util", - ] - pruneopts = "T" - revision = "cba244b06de7d29777036551e6b32817878d1fcd" - [[projects]] digest = "1:ca3f51201a90f3a23bf35938ee910d2fb3095ece453cf56c8b723e935c194ebd" name = "sigs.k8s.io/controller-runtime" @@ -1040,6 +1033,11 @@ "github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework", "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/machine/v1beta1", + "github.com/openshift/cluster-api/pkg/controller/error", + "github.com/openshift/cluster-api/pkg/controller/machine", + "github.com/openshift/cluster-api/pkg/errors", "github.com/openshift/kubernetes-drain", "github.com/prometheus/common/log", "github.com/spf13/cobra", @@ -1066,11 +1064,7 @@ "k8s.io/client-go/rest", "k8s.io/client-go/tools/record", "k8s.io/code-generator/cmd/deepcopy-gen", - "sigs.k8s.io/cluster-api/pkg/apis", - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1", - "sigs.k8s.io/cluster-api/pkg/controller/error", - "sigs.k8s.io/cluster-api/pkg/controller/machine", - "sigs.k8s.io/cluster-api/pkg/errors", + "k8s.io/klog", "sigs.k8s.io/controller-runtime/pkg/client", "sigs.k8s.io/controller-runtime/pkg/client/config", "sigs.k8s.io/controller-runtime/pkg/client/fake", diff --git a/Gopkg.toml b/Gopkg.toml index b5b695d2d7..975c2a8d49 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -23,19 +23,41 @@ required = [ version = "v1.15.5" [[override]] - name = "sigs.k8s.io/cluster-api" - branch = "master" + name = "k8s.io/kube-aggregator" + branch = "release-1.10" [[override]] - #branch = "master" - name = "github.com/openshift/cluster-api-actuator-pkg" - revision = "6983d93876009e8c004dfe7868c1dece4a9d1137" + name = "github.com/openshift/cluster-api" + revision = "91fca585a85b163ddfd119fd09c128c9feadddca" -# STANZAS BELOW ARE GENERATED AND MAY BE WRITTEN - DO NOT MODIFY BELOW THIS LINE. +[[override]] + name = "k8s.io/code-generator" + # revision for tag "kubernetes-1.11.2" + revision = "6702109cc68eb6fe6350b83e14407c8d7309fd1a" -[[constraint]] - name="sigs.k8s.io/controller-runtime" - version="v0.1.1" +[[override]] + name = "k8s.io/api" + # revision for tag "kubernetes-1.11.2" + revision = "2d6f90ab1293a1fb871cf149423ebb72aa7423aa" + +[[override]] + name = "k8s.io/apiextensions-apiserver" + # revision for tag "kubernetes-1.11.2" + revision = "408db4a50408e2149acbd657bceb2480c13cb0a4" + +[[override]] + name = "k8s.io/apimachinery" + # revision for tag "kubernetes-1.11.2" + revision = "103fd098999dc9c0c88536f5c9ad2e5da39373ae" + +[[override]] + name = "k8s.io/client-go" + # revision for tag "kubernetes-1.11.2" + revision = "1f13a808da65775f22cbf47862c4e5898d8f4ca1" + +[[override]] + name = "sigs.k8s.io/controller-runtime" + version = "v0.1.4" [[constraint]] name="sigs.k8s.io/controller-tools" diff --git a/Makefile b/Makefile index e66c027af6..3fbdededd7 100644 --- a/Makefile +++ b/Makefile @@ -62,8 +62,8 @@ bin: .PHONY: build build: ## build binaries - $(DOCKER_CMD) go build $(GOGCFLAGS) -o bin/manager -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/manager - $(DOCKER_CMD) go build $(GOGCFLAGS) -o bin/machine-controller-manager -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/vendor/sigs.k8s.io/cluster-api/cmd/manager + $(DOCKER_CMD) go build $(GOGCFLAGS) -o bin/machine-controller-manager -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/manager + $(DOCKER_CMD) go build $(GOGCFLAGS) -o bin/manager -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/vendor/github.com/openshift/cluster-api/cmd/manager aws-actuator: $(DOCKER_CMD) go build $(GOGCFLAGS) -o bin/aws-actuator sigs.k8s.io/cluster-api-provider-aws/cmd/aws-actuator diff --git a/cmd/aws-actuator/main.go b/cmd/aws-actuator/main.go index 8c353c99b5..958900a49b 100644 --- a/cmd/aws-actuator/main.go +++ b/cmd/aws-actuator/main.go @@ -41,10 +41,10 @@ import ( "github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework" "github.com/openshift/cluster-api-actuator-pkg/pkg/manifests" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" machineactuator "sigs.k8s.io/cluster-api-provider-aws/pkg/actuators/machine" awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" testutils "sigs.k8s.io/cluster-api-provider-aws/test/utils" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) const ( @@ -56,7 +56,7 @@ const ( func init() { // Add types to scheme - clusterv1.AddToScheme(scheme.Scheme) + machinev1.AddToScheme(scheme.Scheme) rootCmd.PersistentFlags().StringP("machine", "m", "", "Machine manifest") rootCmd.PersistentFlags().StringP("cluster", "c", "", "Cluster manifest") @@ -240,17 +240,17 @@ func bootstrapCommand() *cobra.Command { }, } - testCluster := &clusterv1.Cluster{ + testCluster := &machinev1.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: machinePrefix, Namespace: testNamespace.Name, }, - Spec: clusterv1.ClusterSpec{ - ClusterNetwork: clusterv1.ClusterNetworkingConfig{ - Services: clusterv1.NetworkRanges{ + Spec: machinev1.ClusterSpec{ + ClusterNetwork: machinev1.ClusterNetworkingConfig{ + Services: machinev1.NetworkRanges{ CIDRBlocks: []string{"10.0.0.1/24"}, }, - Pods: clusterv1.NetworkRanges{ + Pods: machinev1.NetworkRanges{ CIDRBlocks: []string{"10.0.0.1/24"}, }, ServiceDomain: "example.com", diff --git a/cmd/aws-actuator/utils.go b/cmd/aws-actuator/utils.go index 78574b6b80..c34c8d7084 100644 --- a/cmd/aws-actuator/utils.go +++ b/cmd/aws-actuator/utils.go @@ -17,18 +17,18 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" machineactuator "sigs.k8s.io/cluster-api-provider-aws/pkg/actuators/machine" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) type manifestParams struct { ClusterID string } -func readMachineManifest(manifestParams *manifestParams, manifestLoc string) (*clusterv1.Machine, error) { - machine := &clusterv1.Machine{} +func readMachineManifest(manifestParams *manifestParams, manifestLoc string) (*machinev1.Machine, error) { + machine := &machinev1.Machine{} manifestBytes, err := ioutil.ReadFile(manifestLoc) if err != nil { return nil, fmt.Errorf("unable to read %v: %v", manifestLoc, err) @@ -51,13 +51,13 @@ func readMachineManifest(manifestParams *manifestParams, manifestLoc string) (*c return machine, nil } -func readClusterResources(manifestParams *manifestParams, clusterLoc, machineLoc, awsCredentialSecretLoc, userDataLoc string) (*clusterv1.Cluster, *clusterv1.Machine, *apiv1.Secret, *apiv1.Secret, error) { +func readClusterResources(manifestParams *manifestParams, clusterLoc, machineLoc, awsCredentialSecretLoc, userDataLoc string) (*machinev1.Cluster, *machinev1.Machine, *apiv1.Secret, *apiv1.Secret, error) { machine, err := readMachineManifest(manifestParams, machineLoc) if err != nil { return nil, nil, nil, nil, err } - cluster := &clusterv1.Cluster{} + cluster := &machinev1.Cluster{} bytes, err := ioutil.ReadFile(clusterLoc) if err != nil { return nil, nil, nil, nil, fmt.Errorf("cluster manifest %q: %v", clusterLoc, err) @@ -110,7 +110,7 @@ func createSecretAndWait(f *framework.Framework, secret *apiv1.Secret) error { } // CreateActuator creates actuator with fake clientsets -func createActuator(machine *clusterv1.Machine, awsCredentials, userData *apiv1.Secret) (*machineactuator.Actuator, error) { +func createActuator(machine *machinev1.Machine, awsCredentials, userData *apiv1.Secret) (*machineactuator.Actuator, error) { objList := []runtime.Object{machine} if awsCredentials != nil { objList = append(objList, awsCredentials) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index becb5d3234..4453bf5271 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -18,13 +18,13 @@ import ( "fmt" "github.com/golang/glog" + clusterapis "github.com/openshift/cluster-api/pkg/apis" + "github.com/openshift/cluster-api/pkg/controller/machine" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "k8s.io/klog" machineactuator "sigs.k8s.io/cluster-api-provider-aws/pkg/actuators/machine" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" - clusterapis "sigs.k8s.io/cluster-api/pkg/apis" - "sigs.k8s.io/cluster-api/pkg/controller/machine" "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/runtime/signals" diff --git a/pkg/actuators/machine/actuator.go b/pkg/actuators/machine/actuator.go index c5e91a9f06..90480d7cbc 100644 --- a/pkg/actuators/machine/actuator.go +++ b/pkg/actuators/machine/actuator.go @@ -32,10 +32,10 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + clustererror "github.com/openshift/cluster-api/pkg/controller/error" + apierrors "github.com/openshift/cluster-api/pkg/errors" providerconfigv1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - clustererror "sigs.k8s.io/cluster-api/pkg/controller/error" - apierrors "sigs.k8s.io/cluster-api/pkg/errors" "github.com/aws/aws-sdk-go/service/ec2" @@ -96,7 +96,7 @@ const ( // Set corresponding event based on error. It also returns the original error // for convenience, so callers can do "return handleMachineError(...)". -func (a *Actuator) handleMachineError(machine *clusterv1.Machine, err *apierrors.MachineError, eventAction string) error { +func (a *Actuator) handleMachineError(machine *machinev1.Machine, err *apierrors.MachineError, eventAction string) error { if eventAction != noEventAction { a.eventRecorder.Eventf(machine, corev1.EventTypeWarning, "Failed"+eventAction, "%v", err.Reason) } @@ -106,7 +106,7 @@ func (a *Actuator) handleMachineError(machine *clusterv1.Machine, err *apierrors } // Create runs a new EC2 instance -func (a *Actuator) Create(context context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) error { +func (a *Actuator) Create(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) error { glog.Info("creating machine") instance, err := a.CreateMachine(cluster, machine) if err != nil { @@ -120,7 +120,7 @@ func (a *Actuator) Create(context context.Context, cluster *clusterv1.Cluster, m return a.updateStatus(machine, instance) } -func (a *Actuator) updateMachineStatus(machine *clusterv1.Machine, awsStatus *providerconfigv1.AWSMachineProviderStatus, networkAddresses []corev1.NodeAddress) error { +func (a *Actuator) updateMachineStatus(machine *machinev1.Machine, awsStatus *providerconfigv1.AWSMachineProviderStatus, networkAddresses []corev1.NodeAddress) error { awsStatusRaw, err := a.codec.EncodeProviderStatus(awsStatus) if err != nil { glog.Errorf("error encoding AWS provider status: %v", err) @@ -157,7 +157,7 @@ func (a *Actuator) updateMachineStatus(machine *clusterv1.Machine, awsStatus *pr } // updateMachineProviderConditions updates conditions set within machine provider status. -func (a *Actuator) updateMachineProviderConditions(machine *clusterv1.Machine, conditionType providerconfigv1.AWSMachineProviderConditionType, reason string, msg string) error { +func (a *Actuator) updateMachineProviderConditions(machine *machinev1.Machine, conditionType providerconfigv1.AWSMachineProviderConditionType, reason string, msg string) error { glog.Info("updating machine conditions") @@ -177,7 +177,7 @@ func (a *Actuator) updateMachineProviderConditions(machine *clusterv1.Machine, c } // CreateMachine starts a new AWS instance as described by the cluster and machine resources -func (a *Actuator) CreateMachine(cluster *clusterv1.Cluster, machine *clusterv1.Machine) (*ec2.Instance, error) { +func (a *Actuator) CreateMachine(cluster *machinev1.Cluster, machine *machinev1.Machine) (*ec2.Instance, error) { machineProviderConfig, err := providerConfigFromMachine(a.client, machine, a.codec) if err != nil { return nil, a.handleMachineError(machine, apierrors.InvalidMachineConfiguration("error decoding MachineProviderConfig: %v", err), createEventAction) @@ -232,7 +232,7 @@ func (a *Actuator) CreateMachine(cluster *clusterv1.Cluster, machine *clusterv1. } // Delete deletes a machine and updates its finalizer -func (a *Actuator) Delete(context context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) error { +func (a *Actuator) Delete(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) error { glog.Info("deleting machine") if err := a.DeleteMachine(cluster, machine); err != nil { glog.Errorf("error deleting machine: %v", err) @@ -252,7 +252,7 @@ func (gl *glogLogger) Logf(format string, v ...interface{}) { } // DeleteMachine deletes an AWS instance -func (a *Actuator) DeleteMachine(cluster *clusterv1.Cluster, machine *clusterv1.Machine) error { +func (a *Actuator) DeleteMachine(cluster *machinev1.Cluster, machine *machinev1.Machine) error { // Drain node before deleting if machine.ObjectMeta.Annotations["openshift.io/drain-node"] == "True" && machine.Status.NodeRef != nil { glog.Infof("Draining node before delete") @@ -327,7 +327,7 @@ func (a *Actuator) DeleteMachine(cluster *clusterv1.Cluster, machine *clusterv1. // Update attempts to sync machine state with an existing instance. Today this just updates status // for details that may have changed. (IPs and hostnames) We do not currently support making any // changes to actual machines in AWS. Instead these will be replaced via MachineDeployments. -func (a *Actuator) Update(context context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) error { +func (a *Actuator) Update(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) error { glog.Info("updating machine") machineProviderConfig, err := providerConfigFromMachine(a.client, machine, a.codec) @@ -397,7 +397,7 @@ func (a *Actuator) Update(context context.Context, cluster *clusterv1.Cluster, m // Exists determines if the given machine currently exists. For AWS we query for instances in // running state, with a matching name tag, to determine a match. -func (a *Actuator) Exists(context context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) (bool, error) { +func (a *Actuator) Exists(context context.Context, cluster *machinev1.Cluster, machine *machinev1.Machine) (bool, error) { glog.Info("checking if machine exists") instances, err := a.getMachineInstances(cluster, machine) @@ -416,7 +416,7 @@ func (a *Actuator) Exists(context context.Context, cluster *clusterv1.Cluster, m } // Describe provides information about machine's instance(s) -func (a *Actuator) Describe(cluster *clusterv1.Cluster, machine *clusterv1.Machine) (*ec2.Instance, error) { +func (a *Actuator) Describe(cluster *machinev1.Cluster, machine *machinev1.Machine) (*ec2.Instance, error) { glog.Infof("checking if machine exists") instances, err := a.getMachineInstances(cluster, machine) @@ -432,7 +432,7 @@ func (a *Actuator) Describe(cluster *clusterv1.Cluster, machine *clusterv1.Machi return instances[0], nil } -func (a *Actuator) getMachineInstances(cluster *clusterv1.Cluster, machine *clusterv1.Machine) ([]*ec2.Instance, error) { +func (a *Actuator) getMachineInstances(cluster *machinev1.Cluster, machine *machinev1.Machine) ([]*ec2.Instance, error) { machineProviderConfig, err := providerConfigFromMachine(a.client, machine, a.codec) if err != nil { glog.Errorf("error decoding MachineProviderConfig: %v", err) @@ -493,7 +493,7 @@ func (a *Actuator) updateLoadBalancers(client awsclient.Client, providerConfig * } // updateStatus calculates the new machine status, checks if anything has changed, and updates if so. -func (a *Actuator) updateStatus(machine *clusterv1.Machine, instance *ec2.Instance) error { +func (a *Actuator) updateStatus(machine *machinev1.Machine, instance *ec2.Instance) error { glog.Info("updating status") @@ -563,7 +563,7 @@ func (a *Actuator) updateStatus(machine *clusterv1.Machine, instance *ec2.Instan return nil } -func getClusterID(machine *clusterv1.Machine) (string, bool) { +func getClusterID(machine *machinev1.Machine) (string, bool) { clusterID, ok := machine.Labels[providerconfigv1.ClusterIDLabel] return clusterID, ok } diff --git a/pkg/actuators/machine/actuator_test.go b/pkg/actuators/machine/actuator_test.go index 00b857b679..52ed5aa2da 100644 --- a/pkg/actuators/machine/actuator_test.go +++ b/pkg/actuators/machine/actuator_test.go @@ -13,10 +13,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" providerconfigv1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" mockaws "sigs.k8s.io/cluster-api-provider-aws/pkg/client/mock" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" @@ -27,7 +27,7 @@ import ( func init() { // Add types to scheme - clusterv1.AddToScheme(scheme.Scheme) + machinev1.AddToScheme(scheme.Scheme) } const ( @@ -60,9 +60,9 @@ func TestMachineEvents(t *testing.T) { cases := []struct { name string - machine *clusterv1.Machine + machine *machinev1.Machine error string - operation func(actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) + operation func(actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) event string describeInstancesOutput *ec2.DescribeInstancesOutput describeInstancesErr error @@ -74,7 +74,7 @@ func TestMachineEvents(t *testing.T) { { name: "Create machine event failed (invalid configuration)", machine: machineInvalidProviderConfig, - operation: func(actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.CreateMachine(cluster, machine) }, event: "Warning FailedCreate InvalidConfiguration", @@ -83,7 +83,7 @@ func TestMachineEvents(t *testing.T) { name: "Create machine event failed (error creating aws service)", machine: machine, error: awsServiceError, - operation: func(actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.CreateMachine(cluster, machine) }, event: "Warning FailedCreate CreateError", @@ -92,7 +92,7 @@ func TestMachineEvents(t *testing.T) { name: "Create machine event failed (error launching instance)", machine: machine, runInstancesErr: fmt.Errorf("error"), - operation: func(actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.CreateMachine(cluster, machine) }, event: "Warning FailedCreate CreateError", @@ -101,7 +101,7 @@ func TestMachineEvents(t *testing.T) { name: "Create machine event failed (error updating load balancers)", machine: machine, lbErr: fmt.Errorf("error"), - operation: func(actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.CreateMachine(cluster, machine) }, event: "Warning FailedCreate CreateError", @@ -109,7 +109,7 @@ func TestMachineEvents(t *testing.T) { { name: "Create machine event succeed", machine: machine, - operation: func(actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.CreateMachine(cluster, machine) }, event: "Normal Created Created Machine aws-actuator-testing-machine", @@ -117,7 +117,7 @@ func TestMachineEvents(t *testing.T) { { name: "Create worker machine event succeed", machine: workerMachine, - operation: func(actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.CreateMachine(cluster, machine) }, event: "Normal Created Created Machine aws-actuator-testing-machine", @@ -125,7 +125,7 @@ func TestMachineEvents(t *testing.T) { { name: "Delete machine event failed", machine: machineInvalidProviderConfig, - operation: func(actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.DeleteMachine(cluster, machine) }, event: "Warning FailedDelete InvalidConfiguration", @@ -133,7 +133,7 @@ func TestMachineEvents(t *testing.T) { { name: "Delete machine event succeed", machine: machine, - operation: func(actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.DeleteMachine(cluster, machine) }, event: "Normal Deleted Deleted machine aws-actuator-testing-machine", @@ -211,13 +211,13 @@ func TestActuator(t *testing.T) { t.Fatalf("unable to build codec: %v", err) } - getMachineStatus := func(objectClient client.Client, machine *clusterv1.Machine) (*providerconfigv1.AWSMachineProviderStatus, error) { + getMachineStatus := func(objectClient client.Client, machine *machinev1.Machine) (*providerconfigv1.AWSMachineProviderStatus, error) { // Get updated machine object from the cluster client key := types.NamespacedName{ Namespace: machine.Namespace, Name: machine.Name, } - updatedMachine := clusterv1.Machine{} + updatedMachine := machinev1.Machine{} err := objectClient.Get(context.Background(), client.ObjectKey(key), &updatedMachine) if err != nil { return nil, fmt.Errorf("unable to retrieve machine: %v", err) @@ -244,9 +244,9 @@ func TestActuator(t *testing.T) { cases := []struct { name string - machine *clusterv1.Machine + machine *machinev1.Machine error string - operation func(client client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) + operation func(client client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) describeInstancesOutput *ec2.DescribeInstancesOutput runInstancesErr error describeInstancesErr error @@ -256,7 +256,7 @@ func TestActuator(t *testing.T) { { name: "Create machine with success", machine: machine, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { createErr := actuator.Create(context.TODO(), cluster, machine) assert.NoError(t, createErr) @@ -296,7 +296,7 @@ func TestActuator(t *testing.T) { name: "Create machine with failure", machine: machine, runInstancesErr: fmt.Errorf("error"), - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { createErr := actuator.Create(context.TODO(), cluster, machine) assert.Error(t, createErr) @@ -311,28 +311,28 @@ func TestActuator(t *testing.T) { { name: "Update machine with success", machine: machine, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Update(context.TODO(), cluster, machine) }, }, { name: "Update machine failed (invalid configuration)", machine: machineInvalidProviderConfig, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Update(context.TODO(), cluster, machine) }, }, { name: "Update machine failed (error creating aws service)", error: awsServiceError, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Update(context.TODO(), cluster, machine) }, }, { name: "Update machine failed (error getting running instances)", describeInstancesErr: fmt.Errorf("error"), - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Update(context.TODO(), cluster, machine) }, }, @@ -345,7 +345,7 @@ func TestActuator(t *testing.T) { }, }, }, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Update(context.TODO(), cluster, machine) }, }, @@ -361,7 +361,7 @@ func TestActuator(t *testing.T) { }, }, }, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Update(context.TODO(), cluster, machine) }, }, @@ -376,7 +376,7 @@ func TestActuator(t *testing.T) { }, }, }, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Update(context.TODO(), cluster, machine) }, }, @@ -393,42 +393,42 @@ func TestActuator(t *testing.T) { }, }, terminateInstancesErr: fmt.Errorf("error"), - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Update(context.TODO(), cluster, machine) }, }, { name: "Update machine with failure (cluster ID missing)", machine: machineNoClusterID, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Update(context.TODO(), cluster, machine) }, }, { name: "Update machine failed (error updating load balancers)", lbErr: fmt.Errorf("error"), - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Update(context.TODO(), cluster, machine) }, }, { name: "Describe machine fails (error getting running instance)", describeInstancesErr: fmt.Errorf("error"), - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Describe(cluster, machine) }, }, { name: "Describe machine failed (invalid configuration)", machine: machineInvalidProviderConfig, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Describe(cluster, machine) }, }, { name: "Describe machine failed (error creating aws service)", error: awsServiceError, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Describe(cluster, machine) }, }, @@ -441,20 +441,20 @@ func TestActuator(t *testing.T) { }, }, }, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Describe(cluster, machine) }, }, { name: "Describe machine succeeds", - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Describe(cluster, machine) }, }, { name: "Exists machine failed (invalid configuration)", machine: machineInvalidProviderConfig, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Exists(context.TODO(), cluster, machine) }, }, @@ -467,28 +467,28 @@ func TestActuator(t *testing.T) { }, }, }, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Exists(context.TODO(), cluster, machine) }, }, { name: "Delete machine failed (invalid configuration)", machine: machineInvalidProviderConfig, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Delete(context.TODO(), cluster, machine) }, }, { name: "Delete machine failed (error creating aws service)", error: awsServiceError, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Delete(context.TODO(), cluster, machine) }, }, { name: "Delete machine failed (error getting running instances)", describeInstancesErr: fmt.Errorf("error"), - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Delete(context.TODO(), cluster, machine) }, }, @@ -501,14 +501,14 @@ func TestActuator(t *testing.T) { }, }, }, - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Delete(context.TODO(), cluster, machine) }, }, { name: "Delete machine failed (error terminating instances)", terminateInstancesErr: fmt.Errorf("error"), - operation: func(objectClient client.Client, actuator *Actuator, cluster *clusterv1.Cluster, machine *clusterv1.Machine) { + operation: func(objectClient client.Client, actuator *Actuator, cluster *machinev1.Cluster, machine *machinev1.Machine) { actuator.Delete(context.TODO(), cluster, machine) }, }, diff --git a/pkg/actuators/machine/awsclient.go b/pkg/actuators/machine/awsclient.go index d8d7dfdfa1..bffef54d8d 100644 --- a/pkg/actuators/machine/awsclient.go +++ b/pkg/actuators/machine/awsclient.go @@ -5,8 +5,8 @@ import ( "github.com/openshift/cluster-api-actuator-pkg/pkg/types" + machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // AwsClientWrapper implements CloudProviderClient for aws e2e framework @@ -23,7 +23,7 @@ func NewAwsClientWrapper(client awsclient.Client) *AwsClientWrapper { } // GetRunningInstances gets running instances (of a given cloud provider) managed by the machine object -func (client *AwsClientWrapper) GetRunningInstances(machine *clusterv1alpha1.Machine) ([]interface{}, error) { +func (client *AwsClientWrapper) GetRunningInstances(machine *machinev1beta1.Machine) ([]interface{}, error) { runningInstances, err := getRunningInstances(machine, client.client) if err != nil { return nil, err @@ -38,7 +38,7 @@ func (client *AwsClientWrapper) GetRunningInstances(machine *clusterv1alpha1.Mac } // GetPublicDNSName gets running instance public DNS name -func (client *AwsClientWrapper) GetPublicDNSName(machine *clusterv1alpha1.Machine) (string, error) { +func (client *AwsClientWrapper) GetPublicDNSName(machine *machinev1beta1.Machine) (string, error) { instance, err := getRunningInstance(machine, client.client) if err != nil { return "", err @@ -52,7 +52,7 @@ func (client *AwsClientWrapper) GetPublicDNSName(machine *clusterv1alpha1.Machin } // GetPrivateIP gets private IP -func (client *AwsClientWrapper) GetPrivateIP(machine *clusterv1alpha1.Machine) (string, error) { +func (client *AwsClientWrapper) GetPrivateIP(machine *machinev1beta1.Machine) (string, error) { instance, err := getRunningInstance(machine, client.client) if err != nil { return "", err @@ -66,7 +66,7 @@ func (client *AwsClientWrapper) GetPrivateIP(machine *clusterv1alpha1.Machine) ( } // GetSecurityGroups gets security groups -func (client *AwsClientWrapper) GetSecurityGroups(machine *clusterv1alpha1.Machine) ([]string, error) { +func (client *AwsClientWrapper) GetSecurityGroups(machine *machinev1beta1.Machine) ([]string, error) { instance, err := getRunningInstance(machine, client.client) if err != nil { return nil, err @@ -81,7 +81,7 @@ func (client *AwsClientWrapper) GetSecurityGroups(machine *clusterv1alpha1.Machi } // GetIAMRole gets IAM role -func (client *AwsClientWrapper) GetIAMRole(machine *clusterv1alpha1.Machine) (string, error) { +func (client *AwsClientWrapper) GetIAMRole(machine *machinev1beta1.Machine) (string, error) { instance, err := getRunningInstance(machine, client.client) if err != nil { return "", err @@ -93,7 +93,7 @@ func (client *AwsClientWrapper) GetIAMRole(machine *clusterv1alpha1.Machine) (st } // GetTags gets tags -func (client *AwsClientWrapper) GetTags(machine *clusterv1alpha1.Machine) (map[string]string, error) { +func (client *AwsClientWrapper) GetTags(machine *machinev1beta1.Machine) (map[string]string, error) { instance, err := getRunningInstance(machine, client.client) if err != nil { return nil, err @@ -106,7 +106,7 @@ func (client *AwsClientWrapper) GetTags(machine *clusterv1alpha1.Machine) (map[s } // GetSubnet gets subnet -func (client *AwsClientWrapper) GetSubnet(machine *clusterv1alpha1.Machine) (string, error) { +func (client *AwsClientWrapper) GetSubnet(machine *machinev1beta1.Machine) (string, error) { instance, err := getRunningInstance(machine, client.client) if err != nil { return "", err @@ -118,7 +118,7 @@ func (client *AwsClientWrapper) GetSubnet(machine *clusterv1alpha1.Machine) (str } // GetAvailabilityZone gets availability zone -func (client *AwsClientWrapper) GetAvailabilityZone(machine *clusterv1alpha1.Machine) (string, error) { +func (client *AwsClientWrapper) GetAvailabilityZone(machine *machinev1beta1.Machine) (string, error) { instance, err := getRunningInstance(machine, client.client) if err != nil { return "", err diff --git a/pkg/actuators/machine/instances.go b/pkg/actuators/machine/instances.go index 469f66660f..2190cc7776 100644 --- a/pkg/actuators/machine/instances.go +++ b/pkg/actuators/machine/instances.go @@ -8,8 +8,8 @@ import ( "github.com/golang/glog" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" providerconfigv1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" @@ -33,7 +33,7 @@ func removeDuplicatedTags(tags []*ec2.Tag) []*ec2.Tag { } // removeStoppedMachine removes all instances of a specific machine that are in a stopped state. -func removeStoppedMachine(machine *clusterv1.Machine, client awsclient.Client) error { +func removeStoppedMachine(machine *machinev1.Machine, client awsclient.Client) error { instances, err := getStoppedInstances(machine, client) if err != nil { glog.Errorf("error getting stopped instances: %v", err) @@ -214,7 +214,7 @@ func getBlockDeviceMappings(blockDeviceMappings []providerconfigv1.BlockDeviceMa return []*ec2.BlockDeviceMapping{&blockDeviceMapping}, nil } -func launchInstance(machine *clusterv1.Machine, machineProviderConfig *providerconfigv1.AWSMachineProviderConfig, userData []byte, client awsclient.Client) (*ec2.Instance, error) { +func launchInstance(machine *machinev1.Machine, machineProviderConfig *providerconfigv1.AWSMachineProviderConfig, userData []byte, client awsclient.Client) (*ec2.Instance, error) { amiID, err := getAMI(machineProviderConfig.AMI, client) if err != nil { return nil, fmt.Errorf("error getting AMI: %v,", err) diff --git a/pkg/actuators/machine/stubs.go b/pkg/actuators/machine/stubs.go index e4ede16fb3..aafa82b7bb 100644 --- a/pkg/actuators/machine/stubs.go +++ b/pkg/actuators/machine/stubs.go @@ -12,9 +12,9 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" providerconfigv1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" "sigs.k8s.io/cluster-api-provider-aws/test/utils" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) const ( @@ -96,7 +96,7 @@ func stubProviderConfig() *providerconfigv1.AWSMachineProviderConfig { } } -func stubMachine() (*clusterv1.Machine, error) { +func stubMachine() (*machinev1.Machine, error) { machinePc := stubProviderConfig() codec, err := providerconfigv1.NewCodec() @@ -108,7 +108,7 @@ func stubMachine() (*clusterv1.Machine, error) { return nil, fmt.Errorf("codec.EncodeProviderSpec failed: %v", err) } - machine := &clusterv1.Machine{ + machine := &machinev1.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: "aws-actuator-testing-machine", Namespace: defaultNamespace, @@ -119,7 +119,7 @@ func stubMachine() (*clusterv1.Machine, error) { }, }, - Spec: clusterv1.MachineSpec{ + Spec: machinev1.MachineSpec{ ProviderSpec: *providerSpec, }, } @@ -127,8 +127,8 @@ func stubMachine() (*clusterv1.Machine, error) { return machine, nil } -func stubCluster() *clusterv1.Cluster { - return &clusterv1.Cluster{ +func stubCluster() *machinev1.Cluster { + return &machinev1.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: clusterID, Namespace: defaultNamespace, diff --git a/pkg/actuators/machine/utils.go b/pkg/actuators/machine/utils.go index bd538427aa..09981e1f63 100644 --- a/pkg/actuators/machine/utils.go +++ b/pkg/actuators/machine/utils.go @@ -27,17 +27,17 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" "golang.org/x/net/context" "k8s.io/apimachinery/pkg/types" providerconfigv1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) // getRunningInstance returns the AWS instance for a given machine. If multiple instances match our machine, // the most recently launched will be returned. If no instance exists, an error will be returned. -func getRunningInstance(machine *clusterv1.Machine, client awsclient.Client) (*ec2.Instance, error) { +func getRunningInstance(machine *machinev1.Machine, client awsclient.Client) (*ec2.Instance, error) { instances, err := getRunningInstances(machine, client) if err != nil { return nil, err @@ -52,21 +52,21 @@ func getRunningInstance(machine *clusterv1.Machine, client awsclient.Client) (*e // getRunningInstances returns all running instances that have a tag matching our machine name, // and cluster ID. -func getRunningInstances(machine *clusterv1.Machine, client awsclient.Client) ([]*ec2.Instance, error) { +func getRunningInstances(machine *machinev1.Machine, client awsclient.Client) ([]*ec2.Instance, error) { runningInstanceStateFilter := []*string{aws.String(ec2.InstanceStateNameRunning), aws.String(ec2.InstanceStateNamePending)} return getInstances(machine, client, runningInstanceStateFilter) } // getStoppedInstances returns all stopped instances that have a tag matching our machine name, // and cluster ID. -func getStoppedInstances(machine *clusterv1.Machine, client awsclient.Client) ([]*ec2.Instance, error) { +func getStoppedInstances(machine *machinev1.Machine, client awsclient.Client) ([]*ec2.Instance, error) { stoppedInstanceStateFilter := []*string{aws.String(ec2.InstanceStateNameStopped), aws.String(ec2.InstanceStateNameStopping)} return getInstances(machine, client, stoppedInstanceStateFilter) } // getInstances returns all instances that have a tag matching our machine name, // and cluster ID. -func getInstances(machine *clusterv1.Machine, client awsclient.Client, instanceStateFilter []*string) ([]*ec2.Instance, error) { +func getInstances(machine *machinev1.Machine, client awsclient.Client, instanceStateFilter []*string) ([]*ec2.Instance, error) { machineName := machine.Name @@ -138,7 +138,7 @@ func terminateInstances(client awsclient.Client, instances []*ec2.Instance) erro // providerConfigFromMachine gets the machine provider config MachineSetSpec from the // specified cluster-api MachineSpec. -func providerConfigFromMachine(client client.Client, machine *clusterv1.Machine, codec *providerconfigv1.AWSProviderConfigCodec) (*providerconfigv1.AWSMachineProviderConfig, error) { +func providerConfigFromMachine(client client.Client, machine *machinev1.Machine, codec *providerconfigv1.AWSProviderConfigCodec) (*providerconfigv1.AWSMachineProviderConfig, error) { var providerSpecRawExtention runtime.RawExtension providerSpec := machine.Spec.ProviderSpec @@ -153,7 +153,7 @@ func providerConfigFromMachine(client client.Client, machine *clusterv1.Machine, if providerSpec.ValueFrom.MachineClass == nil { return nil, fmt.Errorf("unable to find MachineClass on Spec.ProviderSpec.ValueFrom") } - machineClass := &clusterv1.MachineClass{} + machineClass := &machinev1.MachineClass{} key := types.NamespacedName{ Namespace: providerSpec.ValueFrom.MachineClass.Namespace, Name: providerSpec.ValueFrom.MachineClass.Name, @@ -165,14 +165,14 @@ func providerConfigFromMachine(client client.Client, machine *clusterv1.Machine, } var config providerconfigv1.AWSMachineProviderConfig - if err := codec.DecodeProviderSpec(&clusterv1.ProviderSpec{Value: &providerSpecRawExtention}, &config); err != nil { + if err := codec.DecodeProviderSpec(&machinev1.ProviderSpec{Value: &providerSpecRawExtention}, &config); err != nil { return nil, err } return &config, nil } // isMaster returns true if the machine is part of a cluster's control plane -func isMaster(machine *clusterv1.Machine) bool { +func isMaster(machine *machinev1.Machine) bool { if machineType, exists := machine.ObjectMeta.Labels[providerconfigv1.MachineTypeLabel]; exists && machineType == "master" { return true } diff --git a/pkg/actuators/machine/utils_test.go b/pkg/actuators/machine/utils_test.go index 730595ab44..960c04cb58 100644 --- a/pkg/actuators/machine/utils_test.go +++ b/pkg/actuators/machine/utils_test.go @@ -4,17 +4,17 @@ import ( "reflect" "testing" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" providerconfigv1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) func init() { // Add types to scheme - clusterv1.AddToScheme(scheme.Scheme) + machinev1.AddToScheme(scheme.Scheme) } func TestProviderConfigFromMachine(t *testing.T) { @@ -55,7 +55,7 @@ func TestProviderConfigFromMachine(t *testing.T) { t.Error(err) } - machineClass := &clusterv1.MachineClass{ + machineClass := &machinev1.MachineClass{ ObjectMeta: metav1.ObjectMeta{ Namespace: "openshift-cluster-api", Name: "testClass", @@ -64,10 +64,10 @@ func TestProviderConfigFromMachine(t *testing.T) { } testCases := []struct { - machine *clusterv1.Machine + machine *machinev1.Machine }{ { - machine: &clusterv1.Machine{ + machine: &machinev1.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: "configFromSpecProviderConfigValue", Namespace: "", @@ -78,13 +78,13 @@ func TestProviderConfigFromMachine(t *testing.T) { TypeMeta: metav1.TypeMeta{ Kind: "Machine", }, - Spec: clusterv1.MachineSpec{ + Spec: machinev1.MachineSpec{ ProviderSpec: *encodedProviderSpec, }, }, }, { - machine: &clusterv1.Machine{ + machine: &machinev1.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: "configFromClass", Namespace: "", @@ -95,10 +95,10 @@ func TestProviderConfigFromMachine(t *testing.T) { TypeMeta: metav1.TypeMeta{ Kind: "Machine", }, - Spec: clusterv1.MachineSpec{ - ProviderSpec: clusterv1.ProviderSpec{ - ValueFrom: &clusterv1.ProviderSpecSource{ - MachineClass: &clusterv1.MachineClassRef{ + Spec: machinev1.MachineSpec{ + ProviderSpec: machinev1.ProviderSpec{ + ValueFrom: &machinev1.ProviderSpecSource{ + MachineClass: &machinev1.MachineClassRef{ ObjectReference: &corev1.ObjectReference{ Kind: "MachineClass", Name: "testClass", diff --git a/pkg/apis/awsproviderconfig/v1alpha1/register.go b/pkg/apis/awsproviderconfig/v1alpha1/register.go index 298aa7e27f..1217f5baa8 100644 --- a/pkg/apis/awsproviderconfig/v1alpha1/register.go +++ b/pkg/apis/awsproviderconfig/v1alpha1/register.go @@ -28,10 +28,10 @@ import ( "bytes" "fmt" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/runtime/scheme" ) @@ -74,7 +74,7 @@ func NewCodec() (*AWSProviderConfigCodec, error) { } // DecodeProviderSpec deserialises an object from the provider config -func (codec *AWSProviderConfigCodec) DecodeProviderSpec(providerSpec *clusterv1.ProviderSpec, out runtime.Object) error { +func (codec *AWSProviderConfigCodec) DecodeProviderSpec(providerSpec *machinev1.ProviderSpec, out runtime.Object) error { if providerSpec.Value != nil { _, _, err := codec.decoder.Decode(providerSpec.Value.Raw, nil, out) if err != nil { @@ -85,12 +85,12 @@ func (codec *AWSProviderConfigCodec) DecodeProviderSpec(providerSpec *clusterv1. } // EncodeProviderSpec serialises an object to the provider config -func (codec *AWSProviderConfigCodec) EncodeProviderSpec(in runtime.Object) (*clusterv1.ProviderSpec, error) { +func (codec *AWSProviderConfigCodec) EncodeProviderSpec(in runtime.Object) (*machinev1.ProviderSpec, error) { var buf bytes.Buffer if err := codec.encoder.Encode(in, &buf); err != nil { return nil, fmt.Errorf("encoding failed: %v", err) } - return &clusterv1.ProviderSpec{ + return &machinev1.ProviderSpec{ Value: &runtime.RawExtension{Raw: buf.Bytes()}, }, nil } diff --git a/test/e2e/main.go b/test/e2e/main.go index cdb4fb7539..11c38f8eb6 100644 --- a/test/e2e/main.go +++ b/test/e2e/main.go @@ -4,8 +4,8 @@ import ( "flag" "github.com/golang/glog" + capiv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" "k8s.io/client-go/kubernetes/scheme" - capiv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/config" ) diff --git a/test/e2e/provider_expectations.go b/test/e2e/provider_expectations.go index cd1946fba9..ed23bbdd89 100644 --- a/test/e2e/provider_expectations.go +++ b/test/e2e/provider_expectations.go @@ -8,11 +8,11 @@ import ( "fmt" "github.com/golang/glog" + capiv1beta1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" kappsapi "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" - capiv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -44,7 +44,7 @@ func (tc *testConfig) ExpectOneClusterObject() error { listOptions := client.ListOptions{ Namespace: namespace, } - clusterList := capiv1alpha1.ClusterList{} + clusterList := capiv1beta1.ClusterList{} err := wait.PollImmediate(1*time.Second, waitShort, func() (bool, error) { if err := tc.client.List(context.TODO(), &listOptions, &clusterList); err != nil { @@ -64,7 +64,7 @@ func (tc *testConfig) ExpectAllMachinesLinkedToANode() error { listOptions := client.ListOptions{ Namespace: namespace, } - machineList := capiv1alpha1.MachineList{} + machineList := capiv1beta1.MachineList{} nodeList := corev1.NodeList{} err := wait.PollImmediate(1*time.Second, waitShort, func() (bool, error) { @@ -107,7 +107,7 @@ func (tc *testConfig) ExpectNewNodeWhenDeletingMachine() error { listOptions := client.ListOptions{ Namespace: namespace, } - machineList := capiv1alpha1.MachineList{} + machineList := capiv1beta1.MachineList{} nodeList := corev1.NodeList{} glog.Info("Get machineList") @@ -136,7 +136,7 @@ func (tc *testConfig) ExpectNewNodeWhenDeletingMachine() error { clusterInitialTotalNodes := len(nodeList.Items) clusterInitialTotalMachines := len(machineList.Items) - var triagedWorkerMachine capiv1alpha1.Machine + var triagedWorkerMachine capiv1beta1.Machine var triagedWorkerNode corev1.Node MachineLoop: for _, m := range machineList.Items { @@ -204,13 +204,13 @@ func (tc *testConfig) ExpectNodeToBeDrainedBeforeDeletingMachine() error { Namespace: namespace, } - var machine capiv1alpha1.Machine + var machine capiv1beta1.Machine var nodeName string var node *corev1.Node glog.Info("Get machineList with at least one machine with NodeRef set") if err := wait.PollImmediate(1*time.Second, waitShort, func() (bool, error) { - machineList := capiv1alpha1.MachineList{} + machineList := capiv1beta1.MachineList{} if err := tc.client.List(context.TODO(), &listOptions, &machineList); err != nil { glog.Errorf("error querying api for machineList object: %v, retrying...", err) return false, nil diff --git a/test/integration/create_update_delete_test.go b/test/integration/create_update_delete_test.go index 92f1b6933d..0aab914587 100644 --- a/test/integration/create_update_delete_test.go +++ b/test/integration/create_update_delete_test.go @@ -8,15 +8,15 @@ import ( "strings" "testing" - //"sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake" + //"github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake" "sigs.k8s.io/controller-runtime/pkg/client/fake" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" machineactuator "sigs.k8s.io/cluster-api-provider-aws/pkg/actuators/machine" awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "github.com/ghodss/yaml" ) @@ -43,8 +43,8 @@ runcmd: - [ cat, /root/node_bootstrap/node_settings.yaml] ` -func testMachineAPIResources(clusterID string) (*clusterv1.Machine, *clusterv1.Cluster, *apiv1.Secret, *apiv1.Secret, error) { - machine := &clusterv1.Machine{} +func testMachineAPIResources(clusterID string) (*machinev1.Machine, *machinev1.Cluster, *apiv1.Secret, *apiv1.Secret, error) { + machine := &machinev1.Machine{} bytes, err := ioutil.ReadFile(path.Join(os.Getenv("GOPATH"), "/src/sigs.k8s.io/cluster-api-provider-aws/examples/machine.yaml")) if err != nil { @@ -76,7 +76,7 @@ func testMachineAPIResources(clusterID string) (*clusterv1.Machine, *clusterv1.C }, } - cluster := &clusterv1.Cluster{ + cluster := &machinev1.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: clusterID, Namespace: defaultNamespace, @@ -91,7 +91,7 @@ func TestCreateAndDeleteMachine(t *testing.T) { // kube client is needed to fetch aws credentials: // - kubeClient.CoreV1().Secrets(namespace).Get(secretName, metav1.GetOptions{}) // cluster client for updating machine statues - // - clusterClient.ClusterV1alpha1().Machines(machineCopy.Namespace).UpdateStatus(machineCopy) + // - clusterClient.machinev1alpha1().Machines(machineCopy.Namespace).UpdateStatus(machineCopy) if os.Getenv("GOPATH") == "" { t.Fatalf("GOPATH not set") diff --git a/test/machines/machines_test.go b/test/machines/machines_test.go index dd5bf5dae5..0d935633db 100644 --- a/test/machines/machines_test.go +++ b/test/machines/machines_test.go @@ -17,9 +17,9 @@ import ( "github.com/openshift/cluster-api-actuator-pkg/pkg/manifests" "sigs.k8s.io/cluster-api-provider-aws/test/utils" + MachineV1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" @@ -88,7 +88,7 @@ var _ = framework.SigKubeDescribe("Machines", func() { acw *machineutils.AwsClientWrapper awsClient awsclient.Client awsCredSecret *apiv1.Secret - cluster *clusterv1alpha1.Cluster + cluster *MachineV1beta1.Cluster clusterID string ) @@ -101,17 +101,17 @@ var _ = framework.SigKubeDescribe("Machines", func() { clusterID = "cluster-" + string(uuid.NewUUID()) } - cluster = &clusterv1alpha1.Cluster{ + cluster = &MachineV1beta1.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: clusterID, Namespace: testNamespace.Name, }, - Spec: clusterv1alpha1.ClusterSpec{ - ClusterNetwork: clusterv1alpha1.ClusterNetworkingConfig{ - Services: clusterv1alpha1.NetworkRanges{ + Spec: MachineV1beta1.ClusterSpec{ + ClusterNetwork: MachineV1beta1.ClusterNetworkingConfig{ + Services: MachineV1beta1.NetworkRanges{ CIDRBlocks: []string{"10.0.0.1/24"}, }, - Pods: clusterv1alpha1.NetworkRanges{ + Pods: MachineV1beta1.NetworkRanges{ CIDRBlocks: []string{"10.0.0.1/24"}, }, ServiceDomain: "example.com", @@ -300,7 +300,7 @@ var _ = framework.SigKubeDescribe("Machines", func() { nonMasterNodes = append(nonMasterNodes, node) } - machines, err := clusterFramework.CAPIClient.ClusterV1alpha1().Machines(workerMachineSet.Namespace).List(metav1.ListOptions{ + machines, err := clusterFramework.CAPIClient.MachineV1beta1().Machines(workerMachineSet.Namespace).List(metav1.ListOptions{ LabelSelector: labels.SelectorFromSet(workerMachineSet.Spec.Selector.MatchLabels).String(), }) Expect(err).NotTo(HaveOccurred()) diff --git a/test/machines/utils.go b/test/machines/utils.go index c30b842b1d..78dfb006da 100644 --- a/test/machines/utils.go +++ b/test/machines/utils.go @@ -2,10 +2,10 @@ package machines import ( . "github.com/onsi/gomega" + MachineV1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework" @@ -25,8 +25,8 @@ func createSecretAndWait(f *framework.Framework, secret *apiv1.Secret) { Expect(err).NotTo(HaveOccurred()) } -func getMachineProviderStatus(f *framework.Framework, machine *clusterv1alpha1.Machine) *providerconfigv1.AWSMachineProviderStatus { - machine, err := f.CAPIClient.ClusterV1alpha1().Machines(machine.Namespace).Get(machine.Name, metav1.GetOptions{}) +func getMachineProviderStatus(f *framework.Framework, machine *MachineV1beta1.Machine) *providerconfigv1.AWSMachineProviderStatus { + machine, err := f.CAPIClient.MachineV1beta1().Machines(machine.Namespace).Get(machine.Name, metav1.GetOptions{}) Expect(err).NotTo(HaveOccurred()) codec, err := providerconfigv1.NewCodec() @@ -39,7 +39,7 @@ func getMachineProviderStatus(f *framework.Framework, machine *clusterv1alpha1.M return machineProviderStatus } -func getMachineCondition(f *framework.Framework, machine *clusterv1alpha1.Machine) providerconfigv1.AWSMachineProviderCondition { +func getMachineCondition(f *framework.Framework, machine *MachineV1beta1.Machine) providerconfigv1.AWSMachineProviderCondition { conditions := getMachineProviderStatus(f, machine).Conditions Expect(len(conditions)).To(Equal(1), "ambiguous conditions: %#v", conditions) return conditions[0] diff --git a/test/utils/manifests.go b/test/utils/manifests.go index 5bcd3c89b8..ea39b997d3 100644 --- a/test/utils/manifests.go +++ b/test/utils/manifests.go @@ -4,11 +4,11 @@ import ( "fmt" "os" + machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" providerconfigv1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // GenerateAwsCredentialsSecretFromEnv generates secret with AWS credentials @@ -25,7 +25,7 @@ func GenerateAwsCredentialsSecretFromEnv(secretName, namespace string) *apiv1.Se } } -func TestingMachineProviderSpec(awsCredentialsSecretName string, clusterID string) (clusterv1alpha1.ProviderSpec, error) { +func TestingMachineProviderSpec(awsCredentialsSecretName string, clusterID string) (machinev1beta1.ProviderSpec, error) { publicIP := true machinePc := &providerconfigv1.AWSMachineProviderConfig{ AMI: providerconfigv1.AWSResourceReference{ @@ -89,16 +89,16 @@ func TestingMachineProviderSpec(awsCredentialsSecretName string, clusterID strin codec, err := providerconfigv1.NewCodec() if err != nil { - return clusterv1alpha1.ProviderSpec{}, fmt.Errorf("failed creating codec: %v", err) + return machinev1beta1.ProviderSpec{}, fmt.Errorf("failed creating codec: %v", err) } providerSpec, err := codec.EncodeProviderSpec(machinePc) if err != nil { - return clusterv1alpha1.ProviderSpec{}, fmt.Errorf("codec.EncodeProviderSpec failed: %v", err) + return machinev1beta1.ProviderSpec{}, fmt.Errorf("codec.EncodeProviderSpec failed: %v", err) } return *providerSpec, nil } -func MasterMachineProviderSpec(awsCredentialsSecretName, masterUserDataSecretName, clusterID string) (clusterv1alpha1.ProviderSpec, error) { +func MasterMachineProviderSpec(awsCredentialsSecretName, masterUserDataSecretName, clusterID string) (machinev1beta1.ProviderSpec, error) { publicIP := true machinePc := &providerconfigv1.AWSMachineProviderConfig{ AMI: providerconfigv1.AWSResourceReference{ @@ -151,16 +151,16 @@ func MasterMachineProviderSpec(awsCredentialsSecretName, masterUserDataSecretNam codec, err := providerconfigv1.NewCodec() if err != nil { - return clusterv1alpha1.ProviderSpec{}, fmt.Errorf("failed creating codec: %v", err) + return machinev1beta1.ProviderSpec{}, fmt.Errorf("failed creating codec: %v", err) } providerSpec, err := codec.EncodeProviderSpec(machinePc) if err != nil { - return clusterv1alpha1.ProviderSpec{}, fmt.Errorf("codec.EncodeProviderSpec failed: %v", err) + return machinev1beta1.ProviderSpec{}, fmt.Errorf("codec.EncodeProviderSpec failed: %v", err) } return *providerSpec, nil } -func WorkerMachineSetProviderSpec(awsCredentialsSecretName, workerUserDataSecretName, clusterID string) (clusterv1alpha1.ProviderSpec, error) { +func WorkerMachineSetProviderSpec(awsCredentialsSecretName, workerUserDataSecretName, clusterID string) (machinev1beta1.ProviderSpec, error) { publicIP := true machinePc := &providerconfigv1.AWSMachineProviderConfig{ AMI: providerconfigv1.AWSResourceReference{ @@ -213,11 +213,11 @@ func WorkerMachineSetProviderSpec(awsCredentialsSecretName, workerUserDataSecret codec, err := providerconfigv1.NewCodec() if err != nil { - return clusterv1alpha1.ProviderSpec{}, fmt.Errorf("failed creating codec: %v", err) + return machinev1beta1.ProviderSpec{}, fmt.Errorf("failed creating codec: %v", err) } providerSpec, err := codec.EncodeProviderSpec(machinePc) if err != nil { - return clusterv1alpha1.ProviderSpec{}, fmt.Errorf("codec.EncodeProviderSpec failed: %v", err) + return machinev1beta1.ProviderSpec{}, fmt.Errorf("codec.EncodeProviderSpec failed: %v", err) } return *providerSpec, nil } 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 6b02fde547..5e048feb7a 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.ClusterV1alpha1().Clusters("default").List(metav1.ListOptions{}) + _, err := f.CAPIClient.MachineV1beta1().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 5c54fd5554..ce9fbbeaf9 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 @@ -7,13 +7,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + machine1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" ) -func (f *Framework) CreateClusterAndWait(cluster *clusterv1alpha1.Cluster) { +func (f *Framework) CreateClusterAndWait(cluster *machine1beta1.Cluster) { f.By(fmt.Sprintf("Creating %q cluster", cluster.Name)) err := wait.Poll(PollInterval, PoolTimeout, func() (bool, error) { - _, err := f.CAPIClient.ClusterV1alpha1().Clusters(cluster.Namespace).Create(cluster) + _, err := f.CAPIClient.MachineV1beta1().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 *clusterv1alpha1.Cluster) { f.ErrNotExpected(err) err = wait.Poll(PollInterval, PoolTimeout, func() (bool, error) { - _, err := f.CAPIClient.ClusterV1alpha1().Clusters(cluster.Namespace).Get(cluster.Name, metav1.GetOptions{}) + _, err := f.CAPIClient.MachineV1beta1().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/framework/framework.go b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/framework.go index 12476c8a9f..22d79f076f 100644 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/framework.go +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/framework.go @@ -18,7 +18,7 @@ import ( "k8s.io/client-go/rest" // apiregistrationclientset "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" + "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" diff --git a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/machines.go b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/machines.go index 3a24599e08..caccb0d679 100644 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/machines.go +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/e2e/framework/machines.go @@ -14,18 +14,18 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" ) -func (f *Framework) DeleteMachineAndWait(machine *clusterv1alpha1.Machine, client types.CloudProviderClient) { +func (f *Framework) DeleteMachineAndWait(machine *machinev1beta1.Machine, client types.CloudProviderClient) { f.By(fmt.Sprintf("Deleting %q machine", machine.Name)) - err := f.CAPIClient.ClusterV1alpha1().Machines(machine.Namespace).Delete(machine.Name, &metav1.DeleteOptions{}) + err := f.CAPIClient.MachineV1beta1().Machines(machine.Namespace).Delete(machine.Name, &metav1.DeleteOptions{}) f.IgnoreNotFoundErr(err) // Verify the testing machine has been destroyed f.By("Verify instance is terminated") err = wait.Poll(PollInterval, PoolTimeout, func() (bool, error) { - _, err := f.CAPIClient.ClusterV1alpha1().Machines(machine.Namespace).Get(machine.Name, metav1.GetOptions{}) + _, err := f.CAPIClient.MachineV1beta1().Machines(machine.Namespace).Get(machine.Name, metav1.GetOptions{}) if err == nil { glog.V(2).Info("Waiting for machine to be deleted") return false, nil @@ -55,11 +55,11 @@ func (f *Framework) DeleteMachineAndWait(machine *clusterv1alpha1.Machine, clien } } -func (f *Framework) waitForMachineToRun(machine *clusterv1alpha1.Machine, client types.CloudProviderClient) { +func (f *Framework) waitForMachineToRun(machine *machinev1beta1.Machine, client types.CloudProviderClient) { f.By(fmt.Sprintf("Waiting for %q machine", machine.Name)) // Verify machine has been deployed err := wait.Poll(PollInterval, TimeoutPoolMachineRunningInterval, func() (bool, error) { - if _, err := f.CAPIClient.ClusterV1alpha1().Machines(machine.Namespace).Get(machine.Name, metav1.GetOptions{}); err != nil { + if _, err := f.CAPIClient.MachineV1beta1().Machines(machine.Namespace).Get(machine.Name, metav1.GetOptions{}); err != nil { glog.V(2).Infof("Waiting for '%v/%v' machine to be created", machine.Namespace, machine.Name) return false, nil } @@ -88,7 +88,7 @@ func (f *Framework) waitForMachineToRun(machine *clusterv1alpha1.Machine, client f.ErrNotExpected(err) } -func (f *Framework) waitForMachineToTerminate(machine *clusterv1alpha1.Machine, client types.CloudProviderClient) error { +func (f *Framework) waitForMachineToTerminate(machine *machinev1beta1.Machine, client types.CloudProviderClient) error { f.By("Verify machine's underlying instance is not running") err := wait.Poll(PollInterval, PoolTimeout, func() (bool, error) { glog.V(2).Info("Waiting for instance to terminate") @@ -112,7 +112,7 @@ func (f *Framework) waitForMachineToTerminate(machine *clusterv1alpha1.Machine, f.By(fmt.Sprintf("Waiting for %q machine object to be deleted", machine.Name)) // Verify machine has been deployed err = wait.Poll(PollInterval, TimeoutPoolMachineRunningInterval, func() (bool, error) { - if _, err := f.CAPIClient.ClusterV1alpha1().Machines(machine.Namespace).Get(machine.Name, metav1.GetOptions{}); err != nil { + if _, err := f.CAPIClient.MachineV1beta1().Machines(machine.Namespace).Get(machine.Name, metav1.GetOptions{}); err != nil { glog.V(2).Infof("err: %v", err) return true, nil } @@ -125,10 +125,10 @@ func (f *Framework) waitForMachineToTerminate(machine *clusterv1alpha1.Machine, return nil } -func (f *Framework) CreateMachineAndWait(machine *clusterv1alpha1.Machine, client types.CloudProviderClient) { +func (f *Framework) CreateMachineAndWait(machine *machinev1beta1.Machine, client types.CloudProviderClient) { f.By(fmt.Sprintf("Creating %q machine", machine.Name)) err := wait.Poll(PollInterval, PoolTimeout, func() (bool, error) { - _, err := f.CAPIClient.ClusterV1alpha1().Machines(machine.Namespace).Create(machine) + _, err := f.CAPIClient.MachineV1beta1().Machines(machine.Namespace).Create(machine) if err != nil { glog.V(2).Infof("can't create machine: %v", err) return false, nil @@ -140,10 +140,10 @@ func (f *Framework) CreateMachineAndWait(machine *clusterv1alpha1.Machine, clien f.waitForMachineToRun(machine, client) } -func (f *Framework) CreateMachineSetAndWait(machineset *clusterv1alpha1.MachineSet, client types.CloudProviderClient) { +func (f *Framework) CreateMachineSetAndWait(machineset *machinev1beta1.MachineSet, client types.CloudProviderClient) { f.By(fmt.Sprintf("Creating %q machineset", machineset.Name)) err := wait.Poll(PollInterval, PoolTimeout, func() (bool, error) { - _, err := f.CAPIClient.ClusterV1alpha1().MachineSets(machineset.Namespace).Create(machineset) + _, err := f.CAPIClient.MachineV1beta1().MachineSets(machineset.Namespace).Create(machineset) if err != nil { glog.V(2).Infof("can't create machineset: %v", err) return false, nil @@ -154,7 +154,7 @@ func (f *Framework) CreateMachineSetAndWait(machineset *clusterv1alpha1.MachineS // Verify machineset has been deployed err = wait.Poll(PollInterval, TimeoutPoolMachineRunningInterval, func() (bool, error) { - if _, err := f.CAPIClient.ClusterV1alpha1().MachineSets(machineset.Namespace).Get(machineset.Name, metav1.GetOptions{}); err != nil { + if _, err := f.CAPIClient.MachineV1beta1().MachineSets(machineset.Namespace).Get(machineset.Name, metav1.GetOptions{}); err != nil { glog.V(2).Infof("Waiting for machineset to be created: %v", err) return false, nil } @@ -163,7 +163,7 @@ func (f *Framework) CreateMachineSetAndWait(machineset *clusterv1alpha1.MachineS f.ErrNotExpected(err) f.By("Verify machineset's underlying instances is running") - machines, err := f.CAPIClient.ClusterV1alpha1().Machines(machineset.Namespace).List(metav1.ListOptions{ + machines, err := f.CAPIClient.MachineV1beta1().Machines(machineset.Namespace).List(metav1.ListOptions{ LabelSelector: labels.SelectorFromSet(machineset.Spec.Selector.MatchLabels).String(), }) f.ErrNotExpected(err) @@ -173,9 +173,9 @@ func (f *Framework) CreateMachineSetAndWait(machineset *clusterv1alpha1.MachineS } } -func (f *Framework) DeleteMachineSetAndWait(machineset *clusterv1alpha1.MachineSet, client types.CloudProviderClient) error { +func (f *Framework) DeleteMachineSetAndWait(machineset *machinev1beta1.MachineSet, client types.CloudProviderClient) error { f.By(fmt.Sprintf("Get all %q machineset's machines", machineset.Name)) - machines, err := f.CAPIClient.ClusterV1alpha1().Machines(machineset.Namespace).List(metav1.ListOptions{ + machines, err := f.CAPIClient.MachineV1beta1().Machines(machineset.Namespace).List(metav1.ListOptions{ LabelSelector: labels.SelectorFromSet(machineset.Spec.Selector.MatchLabels).String(), }) if err != nil { @@ -183,7 +183,7 @@ func (f *Framework) DeleteMachineSetAndWait(machineset *clusterv1alpha1.MachineS } f.By(fmt.Sprintf("Deleting %q machineset", machineset.Name)) - err = f.CAPIClient.ClusterV1alpha1().MachineSets(machineset.Namespace).Delete(machineset.Name, &metav1.DeleteOptions{}) + err = f.CAPIClient.MachineV1beta1().MachineSets(machineset.Namespace).Delete(machineset.Name, &metav1.DeleteOptions{}) if err != nil { return err } @@ -195,7 +195,7 @@ func (f *Framework) DeleteMachineSetAndWait(machineset *clusterv1alpha1.MachineS } err = wait.Poll(PollInterval, PoolTimeout, func() (bool, error) { - _, err := f.CAPIClient.ClusterV1alpha1().MachineSets(machineset.Namespace).Get(machineset.Name, metav1.GetOptions{}) + _, err := f.CAPIClient.MachineV1beta1().MachineSets(machineset.Namespace).Get(machineset.Name, metav1.GetOptions{}) if err != nil { if strings.Contains(err.Error(), "not found") { return true, nil @@ -264,7 +264,7 @@ func ReadKubeconfigFromServer(sshConfig *SSHConfig) (string, error) { return b.String(), nil } -func (f *Framework) GetMasterMachineRestConfig(masterMachine *clusterv1alpha1.Machine, client types.CloudProviderClient) (*rest.Config, error) { +func (f *Framework) GetMasterMachineRestConfig(masterMachine *machinev1beta1.Machine, client types.CloudProviderClient) (*rest.Config, error) { var masterPublicDNSName string err := wait.Poll(PollInterval, TimeoutPoolMachineRunningInterval, func() (bool, error) { var err error @@ -312,13 +312,13 @@ func (f *Framework) GetMasterMachineRestConfig(masterMachine *clusterv1alpha1.Ma } type machineToDelete struct { - machine *clusterv1alpha1.Machine + machine *machinev1beta1.Machine framework *Framework client types.CloudProviderClient } type machinesetToDelete struct { - machineset *clusterv1alpha1.MachineSet + machineset *machinev1beta1.MachineSet framework *Framework client types.CloudProviderClient } @@ -335,11 +335,11 @@ func InitMachinesToDelete() *MachinesToDelete { } } -func (m *MachinesToDelete) AddMachine(machine *clusterv1alpha1.Machine, framework *Framework, client types.CloudProviderClient) { +func (m *MachinesToDelete) AddMachine(machine *machinev1beta1.Machine, framework *Framework, client types.CloudProviderClient) { m.machines = append([]machineToDelete{{machine: machine, framework: framework, client: client}}, m.machines...) } -func (m *MachinesToDelete) AddMachineSet(machineset *clusterv1alpha1.MachineSet, framework *Framework, client types.CloudProviderClient) { +func (m *MachinesToDelete) AddMachineSet(machineset *machinev1beta1.MachineSet, framework *Framework, client types.CloudProviderClient) { m.machinesets = append([]machinesetToDelete{{machineset: machineset, framework: framework, client: client}}, m.machinesets...) } 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 24297491be..d0ab481020 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 @@ -13,7 +13,7 @@ import ( "k8s.io/apimachinery/pkg/util/uuid" // apiregistrationv1beta1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + Machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" ) func ClusterCRDManifest() *v1beta1.CustomResourceDefinition { @@ -23,14 +23,14 @@ func ClusterCRDManifest() *v1beta1.CustomResourceDefinition { APIVersion: "apiextensions.k8s.io/v1beta1", }, ObjectMeta: metav1.ObjectMeta{ - Name: "clusters.cluster.k8s.io", + Name: "clusters.machine.openshift.io", Labels: map[string]string{ "controller-tools.k8s.io": "1.0", }, }, Spec: v1beta1.CustomResourceDefinitionSpec{ - Group: "cluster.k8s.io", - Version: "v1alpha1", + Group: "machine.openshift.io", + Version: "v1beta1", Names: v1beta1.CustomResourceDefinitionNames{ Plural: "clusters", Kind: "Cluster", @@ -164,14 +164,14 @@ func MachineCRDManifest() *v1beta1.CustomResourceDefinition { APIVersion: "apiextensions.k8s.io/v1beta1", }, ObjectMeta: metav1.ObjectMeta{ - Name: "machines.cluster.k8s.io", + Name: "machines.machine.openshift.io", Labels: map[string]string{ "controller-tools.k8s.io": "1.0", }, }, Spec: v1beta1.CustomResourceDefinitionSpec{ - Group: "cluster.k8s.io", - Version: "v1alpha1", + Group: "machine.openshift.io", + Version: "v1beta1", Names: v1beta1.CustomResourceDefinitionNames{ Plural: "machines", Kind: "Machine", @@ -304,14 +304,14 @@ func MachineSetCRDManifest() *v1beta1.CustomResourceDefinition { APIVersion: "apiextensions.k8s.io/v1beta1", }, ObjectMeta: metav1.ObjectMeta{ - Name: "machinesets.cluster.k8s.io", + Name: "machinesets.machine.openshift.io", Labels: map[string]string{ "controller-tools.k8s.io": "1.0", }, }, Spec: v1beta1.CustomResourceDefinitionSpec{ - Group: "cluster.k8s.io", - Version: "v1alpha1", + Group: "machine.openshift.io", + Version: "v1beta1", Names: v1beta1.CustomResourceDefinitionNames{ Plural: "machinesets", Kind: "MachineSet", @@ -454,14 +454,14 @@ func MachineDeploymentCRDManifest() *v1beta1.CustomResourceDefinition { APIVersion: "apiextensions.k8s.io/v1beta1", }, ObjectMeta: metav1.ObjectMeta{ - Name: "machinedeployments.cluster.k8s.io", + Name: "machinedeployments.machine.openshift.io", Labels: map[string]string{ "controller-tools.k8s.io": "1.0", }, }, Spec: v1beta1.CustomResourceDefinitionSpec{ - Group: "cluster.k8s.io", - Version: "v1alpha1", + Group: "machine.openshift.io", + Version: "v1beta1", Names: v1beta1.CustomResourceDefinitionNames{ Plural: "machinedeployments", Kind: "MachineDeployment", @@ -644,7 +644,7 @@ func ClusterRoleManifest() *rbacv1.ClusterRole { "delete", }, APIGroups: []string{ - "cluster.k8s.io", + "machine.openshift.io", }, Resources: []string{ "clusters", @@ -902,9 +902,9 @@ func ClusterAPIControllersDeployment(clusterAPINamespace, machineControllerImage return deployment } -func TestingMachine(clusterID string, namespace string, providerSpec clusterv1alpha1.ProviderSpec) *clusterv1alpha1.Machine { +func TestingMachine(clusterID string, namespace string, providerSpec Machinev1beta1.ProviderSpec) *Machinev1beta1.Machine { randomUUID := string(uuid.NewUUID()) - machine := &clusterv1alpha1.Machine{ + machine := &Machinev1beta1.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: clusterID + "-machine-" + randomUUID[:6], Namespace: namespace, @@ -913,14 +913,14 @@ func TestingMachine(clusterID string, namespace string, providerSpec clusterv1al "sigs.k8s.io/cluster-api-cluster": clusterID, }, }, - Spec: clusterv1alpha1.MachineSpec{ + Spec: Machinev1beta1.MachineSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "node-role.kubernetes.io/compute": "", }, }, ProviderSpec: providerSpec, - Versions: clusterv1alpha1.MachineVersionInfo{ + Versions: Machinev1beta1.MachineVersionInfo{ Kubelet: "1.10.1", ControlPlane: "1.10.1", }, @@ -930,9 +930,9 @@ func TestingMachine(clusterID string, namespace string, providerSpec clusterv1al return machine } -func MasterMachine(clusterID, namespace string, providerSpec clusterv1alpha1.ProviderSpec) *clusterv1alpha1.Machine { +func MasterMachine(clusterID, namespace string, providerSpec Machinev1beta1.ProviderSpec) *Machinev1beta1.Machine { randomUUID := string(uuid.NewUUID()) - machine := &clusterv1alpha1.Machine{ + machine := &Machinev1beta1.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: clusterID + "-master-machine-" + randomUUID[:6], Namespace: namespace, @@ -941,9 +941,9 @@ func MasterMachine(clusterID, namespace string, providerSpec clusterv1alpha1.Pro "sigs.k8s.io/cluster-api-cluster": clusterID, }, }, - Spec: clusterv1alpha1.MachineSpec{ + Spec: Machinev1beta1.MachineSpec{ ProviderSpec: providerSpec, - Versions: clusterv1alpha1.MachineVersionInfo{ + Versions: Machinev1beta1.MachineVersionInfo{ Kubelet: "1.10.1", ControlPlane: "1.10.1", }, @@ -1003,10 +1003,10 @@ func WorkerMachineUserDataSecret(secretName, namespace, masterIP string) (*apiv1 }, nil } -func WorkerMachineSet(clusterID, namespace string, providerSpec clusterv1alpha1.ProviderSpec) *clusterv1alpha1.MachineSet { +func WorkerMachineSet(clusterID, namespace string, providerSpec Machinev1beta1.ProviderSpec) *Machinev1beta1.MachineSet { var replicas int32 = 1 randomUUID := string(uuid.NewUUID()) - return &clusterv1alpha1.MachineSet{ + return &Machinev1beta1.MachineSet{ ObjectMeta: metav1.ObjectMeta{ Name: clusterID + "-worker-machineset-" + randomUUID[:6], Namespace: namespace, @@ -1015,7 +1015,7 @@ func WorkerMachineSet(clusterID, namespace string, providerSpec clusterv1alpha1. "sigs.k8s.io/cluster-api-cluster": clusterID, }, }, - Spec: clusterv1alpha1.MachineSetSpec{ + Spec: Machinev1beta1.MachineSetSpec{ Selector: metav1.LabelSelector{ MatchLabels: map[string]string{ "sigs.k8s.io/cluster-api-machineset": clusterID + "-worker-machineset-" + randomUUID[:6], @@ -1023,7 +1023,7 @@ func WorkerMachineSet(clusterID, namespace string, providerSpec clusterv1alpha1. }, }, Replicas: &replicas, - Template: clusterv1alpha1.MachineTemplateSpec{ + Template: Machinev1beta1.MachineTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ GenerateName: clusterID + "-worker-machine-" + randomUUID[:6] + "-", Labels: map[string]string{ @@ -1031,14 +1031,14 @@ func WorkerMachineSet(clusterID, namespace string, providerSpec clusterv1alpha1. "sigs.k8s.io/cluster-api-cluster": clusterID, }, }, - Spec: clusterv1alpha1.MachineSpec{ + Spec: Machinev1beta1.MachineSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ "node-role.kubernetes.io/compute": "", }, }, ProviderSpec: providerSpec, - Versions: clusterv1alpha1.MachineVersionInfo{ + Versions: Machinev1beta1.MachineVersionInfo{ Kubelet: "1.10.1", ControlPlane: "1.10.1", }, diff --git a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/types/types.go b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/types/types.go index b826b2f254..39458f2194 100644 --- a/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/types/types.go +++ b/vendor/github.com/openshift/cluster-api-actuator-pkg/pkg/types/types.go @@ -1,13 +1,13 @@ package types -import clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" +import machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" // CloudProviderClient interface to generalize queries over various cloud providers type CloudProviderClient interface { // Get running instances (of a given cloud provider) managed by the machine object - GetRunningInstances(machine *clusterv1alpha1.Machine) ([]interface{}, error) + GetRunningInstances(machine *machinev1beta1.Machine) ([]interface{}, error) // Get running instance public DNS name - GetPublicDNSName(machine *clusterv1alpha1.Machine) (string, error) + GetPublicDNSName(machine *machinev1beta1.Machine) (string, error) // Get private IP - GetPrivateIP(machine *clusterv1alpha1.Machine) (string, error) + GetPrivateIP(machine *machinev1beta1.Machine) (string, error) } diff --git a/vendor/sigs.k8s.io/cluster-api/.github/ISSUE_TEMPLATE/bug_report.md b/vendor/github.com/openshift/cluster-api/.github/ISSUE_TEMPLATE/bug_report.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/.github/ISSUE_TEMPLATE/bug_report.md rename to vendor/github.com/openshift/cluster-api/.github/ISSUE_TEMPLATE/bug_report.md diff --git a/vendor/sigs.k8s.io/cluster-api/.github/ISSUE_TEMPLATE/feature_request.md b/vendor/github.com/openshift/cluster-api/.github/ISSUE_TEMPLATE/feature_request.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/.github/ISSUE_TEMPLATE/feature_request.md rename to vendor/github.com/openshift/cluster-api/.github/ISSUE_TEMPLATE/feature_request.md diff --git a/vendor/sigs.k8s.io/cluster-api/.github/PULL_REQUEST_TEMPLATE.md b/vendor/github.com/openshift/cluster-api/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/.github/PULL_REQUEST_TEMPLATE.md rename to vendor/github.com/openshift/cluster-api/.github/PULL_REQUEST_TEMPLATE.md diff --git a/vendor/sigs.k8s.io/cluster-api/.gitignore b/vendor/github.com/openshift/cluster-api/.gitignore similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/.gitignore rename to vendor/github.com/openshift/cluster-api/.gitignore diff --git a/vendor/sigs.k8s.io/cluster-api/BUILD.bazel b/vendor/github.com/openshift/cluster-api/BUILD.bazel similarity index 67% rename from vendor/sigs.k8s.io/cluster-api/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/BUILD.bazel index 8f39d36c94..6b4ea4e7fd 100644 --- a/vendor/sigs.k8s.io/cluster-api/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/BUILD.bazel @@ -1,6 +1,6 @@ load("@bazel_gazelle//:def.bzl", "gazelle") -# gazelle:prefix sigs.k8s.io/cluster-api +# gazelle:prefix github.com/openshift/cluster-api gazelle( name = "gazelle", external = "vendored", diff --git a/vendor/sigs.k8s.io/cluster-api/CONTRIBUTING.md b/vendor/github.com/openshift/cluster-api/CONTRIBUTING.md similarity index 91% rename from vendor/sigs.k8s.io/cluster-api/CONTRIBUTING.md rename to vendor/github.com/openshift/cluster-api/CONTRIBUTING.md index a635b9d7ee..cc52280e07 100644 --- a/vendor/sigs.k8s.io/cluster-api/CONTRIBUTING.md +++ b/vendor/github.com/openshift/cluster-api/CONTRIBUTING.md @@ -17,7 +17,7 @@ If you're new to the project and want to help, but don't know where to start, we ## Contributing a Patch 1. If you haven't already done so, sign a Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. +1. Fork the desired repo, develop and test your code changes. 1. Submit a pull request. All changes must be code reviewed. Coding conventions and standards are explained in the official [developer docs](https://github.com/kubernetes/community/tree/master/contributors/devel). Expect reviewers to request that you avoid common [go style mistakes](https://github.com/golang/go/wiki/CodeReviewComments) in your PRs. @@ -41,7 +41,7 @@ The machine controller should be able to act on a subset of machines that form a ### Resources -* [Cluster Management API KEP](https://github.com/kubernetes/community/blob/master/keps/sig-cluster-lifecycle/0003-cluster-api.md) +* [Cluster Management API KEP](https://github.com/kubernetes/enhancements/blob/master/keps/sig-cluster-lifecycle/0003-cluster-api.md) * [Cluster type](https://github.com/kubernetes-sigs/cluster-api/blob/master/pkg/apis/cluster/v1alpha1/cluster_types.go#L40) * [Machine type](https://github.com/kubernetes-sigs/cluster-api/blob/master/pkg/apis/cluster/v1alpha1/machine_types.go#L42) @@ -54,7 +54,7 @@ To minimize code duplication and maximize flexibility, bootstrap clusters with a A new Machine can be created in a declarative way, specifying versions of various components such as the kubelet. It should also be able to specify provider-specific information such as OS image, instance type, disk configuration, etc., though this will not be portable. -When a cluster is first created with a cluster config file, there is no master node or api server. So the user will need to bootstrap a cluster. While the implementation details are specific to the provider, the following guidance should help you: +When a cluster is first created with a cluster config file, there is no control plane node or api server. So the user will need to bootstrap a cluster. While the implementation details are specific to the provider, the following guidance should help you: * Your tool should spin up the external apiserver and the machine controller. * POST the objects to the apiserver. @@ -63,23 +63,23 @@ When a cluster is first created with a cluster config file, there is no master n #### Configurable Machine Setup -While not mandatory, it is suggested for new providers to support configurable machine setups for creating new machines. +While not mandatory, it is suggested for new providers to support configurable machine setups for creating new machines. This is to allow flexibility in what startup scripts are used and what versions are supported instead of hardcoding startup scripts into the machine controller. You can find an example implementation for GCE [here](https://github.com/kubernetes-sigs/cluster-api-provider-gcp/blob/ee60efd89c4d0129a6d42b40d069c0b41d2c4987/cloud/google/machinesetup/config_types.go). ##### GCE Implementation For GCE, a [config map](https://github.com/kubernetes-sigs/cluster-api-provider-gcp/blob/c0ac09e86b6630bd65c277120883719e514cfdf5/clusterctl/examples/google/provider-components.yaml.template#L151) holds the list of valid machine setup configs, -and the yaml file is volume mounted into the machine controller using a ConfigMap named `machine-setup`. +and the yaml file is volume mounted into the machine controller using a ConfigMap named `machine-setup`. A [config type](https://github.com/kubernetes-sigs/cluster-api-provider-gcp/blob/ee60efd89c4d0129a6d42b40d069c0b41d2c4987/cloud/google/machinesetup/config_types.go#L70) defines a set of parameters that can be taken from the machine object being created, and maps those parameters to startup scripts and other relevant information. In GCE, the OS, machine roles, and version info are the parameters that map to a GCP image path and metadata (which contains the startup script). -When creating a new machine, there should be a check for whether the machine setup is supported. +When creating a new machine, there should be a check for whether the machine setup is supported. This is done by looking through the valid configs parsed out of the yaml for a config with matching parameters. If a match is found, then the machine can be created with the startup script found in the config. If no match is found, then the given machine configuration is not supported. -Getting the script onto the machine and running it on startup is a provider specific implementation detail. +Getting the script onto the machine and running it on startup is a provider specific implementation detail. More details can be found in the [design doc](https://docs.google.com/document/d/1OfykBDOXP_t6QEtiYBA-Ax7nSpqohFofyX-wOxrQrnw/edit?ts=5ae11208#heading=h.xgjl2srtytjt), but note that it is GCE specific. @@ -103,7 +103,7 @@ for machine in machines: The specific upgrade logic will be implement as part of the machine controller, and is specific to the provider. The user provided provider config will be in `machine.Spec.ProviderSpec`. -Discussion around in-place vs replace upgrades [is here](https://github.com/kubernetes/community/blob/master/keps/sig-cluster-lifecycle/0003-cluster-api.md#in-place-vs-replace). +Discussion around in-place vs replace upgrades [is here](https://github.com/kubernetes/enhancements/blob/master/keps/sig-cluster-lifecycle/0003-cluster-api.md#in-place-vs-replace). ## Support Channels diff --git a/vendor/sigs.k8s.io/cluster-api/Dockerfile b/vendor/github.com/openshift/cluster-api/Dockerfile similarity index 81% rename from vendor/sigs.k8s.io/cluster-api/Dockerfile rename to vendor/github.com/openshift/cluster-api/Dockerfile index 3555795986..f0d00be9f8 100644 --- a/vendor/sigs.k8s.io/cluster-api/Dockerfile +++ b/vendor/github.com/openshift/cluster-api/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # Build the manager binary -FROM golang:1.10.3 as builder +FROM golang:1.11.5 as builder # Copy in the go src WORKDIR $GOPATH/src/sigs.k8s.io/cluster-api @@ -22,11 +22,10 @@ COPY cmd/ cmd/ COPY vendor/ vendor/ # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager sigs.k8s.io/cluster-api/cmd/manager +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o manager sigs.k8s.io/cluster-api/cmd/manager # Copy the controller-manager into a thin image -# TODO: Build this on scratch -FROM debian:latest +FROM gcr.io/distroless/static:latest WORKDIR / COPY --from=builder /go/src/sigs.k8s.io/cluster-api/manager . ENTRYPOINT ["/manager"] diff --git a/vendor/sigs.k8s.io/cluster-api/Gopkg.lock b/vendor/github.com/openshift/cluster-api/Gopkg.lock similarity index 87% rename from vendor/sigs.k8s.io/cluster-api/Gopkg.lock rename to vendor/github.com/openshift/cluster-api/Gopkg.lock index 8df1de4f87..d4b85d1900 100644 --- a/vendor/sigs.k8s.io/cluster-api/Gopkg.lock +++ b/vendor/github.com/openshift/cluster-api/Gopkg.lock @@ -9,6 +9,14 @@ revision = "97efc2c9ffd9fe8ef47f7f3203dc60bbca547374" version = "v0.28.0" +[[projects]] + branch = "master" + digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d" + name = "github.com/beorn7/perks" + packages = ["quantile"] + pruneopts = "UT" + revision = "3a771d992973f24aa725d07868b467d1ddfceafb" + [[projects]] digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" name = "github.com/davecgh/go-spew" @@ -221,6 +229,14 @@ pruneopts = "UT" revision = "81af80346b1a01caae0cbc27fd3c1ba5b11e189f" +[[projects]] + digest = "1:ff5ebae34cfbf047d505ee150de27e60570e8c394b3b8fdbb720ff6ac71985fc" + name = "github.com/matttproud/golang_protobuf_extensions" + packages = ["pbutil"] + pruneopts = "UT" + revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" + version = "v1.0.1" + [[projects]] digest = "1:33422d238f147d247752996a26574ac48dcf472976eda7f5134015f06bf16563" name = "github.com/modern-go/concurrent" @@ -319,6 +335,59 @@ revision = "645ef00459ed84a119197bfb8d8205042c6df63d" version = "v0.8.0" +[[projects]] + digest = "1:93a746f1060a8acbcf69344862b2ceced80f854170e1caae089b2834c5fbf7f4" + name = "github.com/prometheus/client_golang" + packages = [ + "prometheus", + "prometheus/internal", + "prometheus/promhttp", + ] + pruneopts = "UT" + revision = "505eaef017263e299324067d40ca2c48f6a2cf50" + version = "v0.9.2" + +[[projects]] + branch = "master" + digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" + name = "github.com/prometheus/client_model" + packages = ["go"] + pruneopts = "UT" + revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f" + +[[projects]] + branch = "master" + digest = "1:db712fde5d12d6cdbdf14b777f0c230f4ff5ab0be8e35b239fc319953ed577a4" + name = "github.com/prometheus/common" + packages = [ + "expfmt", + "internal/bitbucket.org/ww/goautoneg", + "model", + ] + pruneopts = "UT" + revision = "4724e9255275ce38f7179b2478abeae4e28c904f" + +[[projects]] + branch = "master" + digest = "1:d39e7c7677b161c2dd4c635a2ac196460608c7d8ba5337cc8cae5825a2681f8f" + name = "github.com/prometheus/procfs" + packages = [ + ".", + "internal/util", + "nfs", + "xfs", + ] + pruneopts = "UT" + revision = "1dc9a6cbc91aacc3e8b2d63db4d2e957a5394ac4" + +[[projects]] + digest = "1:d917313f309bda80d27274d53985bc65651f81a5b66b820749ac7f8ef061fd04" + name = "github.com/sergi/go-diff" + packages = ["diffmatchpatch"] + pruneopts = "UT" + revision = "1744e2970ca51c86172c8190fadad617561ed6e7" + version = "v1.0.0" + [[projects]] digest = "1:6a4a11ba764a56d2758899ec6f3848d24698d48442ebce85ee7a3f63284526cd" name = "github.com/spf13/afero" @@ -536,7 +605,7 @@ version = "v2.2.1" [[projects]] - digest = "1:728c0c37966b7a6c8980fab69a3d690cc0996e206804a55052318858d00f1e17" + digest = "1:26a67eb988225c6a0600c1af0b35e795ac4d23a9c40a7aa178fa2adc0670f1f7" name = "k8s.io/api" packages = [ "admission/v1beta1", @@ -551,10 +620,12 @@ "authorization/v1beta1", "autoscaling/v1", "autoscaling/v2beta1", + "autoscaling/v2beta2", "batch/v1", "batch/v1beta1", "batch/v2alpha1", "certificates/v1beta1", + "coordination/v1beta1", "core/v1", "events/v1beta1", "extensions/v1beta1", @@ -571,11 +642,11 @@ "storage/v1beta1", ] pruneopts = "UT" - revision = "2d6f90ab1293a1fb871cf149423ebb72aa7423aa" - version = "kubernetes-1.11.2" + revision = "b503174bad5991eb66f18247f52e41c3258f6348" + version = "kubernetes-1.12.3" [[projects]] - digest = "1:145647b653ff6a6882bbc2c4701ebcbce7be643007231d545560e4ce612ad5cb" + digest = "1:d9e9a6062217111c1b7c548a47bd67b2b518c8da05d124dbca74e246565c76a6" name = "k8s.io/apiextensions-apiserver" packages = [ "pkg/apis/apiextensions", @@ -585,11 +656,11 @@ "pkg/client/clientset/clientset/typed/apiextensions/v1beta1", ] pruneopts = "UT" - revision = "408db4a50408e2149acbd657bceb2480c13cb0a4" - version = "kubernetes-1.11.2" + revision = "0cd23ebeb6882bd1cdc2cb15fc7b2d72e8a86a5b" + version = "kubernetes-1.12.3" [[projects]] - digest = "1:6a8fca786f4e263fac02cb6cfe8f0decfee526aede3969d301e18fcef167cd38" + digest = "1:37113933623d6702a851b11c9a7534adb99961c1bf3cc8bd3b354402fd7243fe" name = "k8s.io/apimachinery" packages = [ "pkg/api/equality", @@ -623,6 +694,7 @@ "pkg/util/intstr", "pkg/util/json", "pkg/util/mergepatch", + "pkg/util/naming", "pkg/util/net", "pkg/util/rand", "pkg/util/runtime", @@ -639,8 +711,8 @@ "third_party/forked/golang/reflect", ] pruneopts = "UT" - revision = "103fd098999dc9c0c88536f5c9ad2e5da39373ae" - version = "kubernetes-1.11.2" + revision = "eddba98df674a16931d2d4ba75edc3a389bf633a" + version = "kubernetes-1.12.3" [[projects]] branch = "master" @@ -651,7 +723,7 @@ revision = "cf5eff4f5e8f6019796cb18c69918b9f2f09e6db" [[projects]] - digest = "1:2094148c7308a9ddab4ad3c355c343a55d8b6c265417cebe42e74a594916dd9d" + digest = "1:b2820d12e324fc54ce0a4f330719c6858a5dfafbe053f2cb48ff299aed4538d1" name = "k8s.io/client-go" packages = [ "discovery", @@ -670,10 +742,12 @@ "kubernetes/typed/authorization/v1beta1", "kubernetes/typed/autoscaling/v1", "kubernetes/typed/autoscaling/v2beta1", + "kubernetes/typed/autoscaling/v2beta2", "kubernetes/typed/batch/v1", "kubernetes/typed/batch/v1beta1", "kubernetes/typed/batch/v2alpha1", "kubernetes/typed/certificates/v1beta1", + "kubernetes/typed/coordination/v1beta1", "kubernetes/typed/core/v1", "kubernetes/typed/events/v1beta1", "kubernetes/typed/extensions/v1beta1", @@ -723,8 +797,8 @@ "util/workqueue", ] pruneopts = "UT" - revision = "1f13a808da65775f22cbf47862c4e5898d8f4ca1" - version = "kubernetes-1.11.2" + revision = "d082d5923d3cc0bfbb066ee5fbdea3d0ca79acf8" + version = "kubernetes-1.12.3" [[projects]] branch = "master" @@ -785,7 +859,7 @@ revision = "e3762e86a74c878ffed47484592986685639c2cd" [[projects]] - digest = "1:264a5cbd8f1975842b856e8a590e2c54eaffb087c8bfa130d338eb07c7325a87" + digest = "1:734453bd0e3edfe11b06da2473ee42041f9f59c230d482fee90d7f877aed88b3" name = "sigs.k8s.io/controller-runtime" packages = [ "pkg/cache", @@ -800,9 +874,11 @@ "pkg/event", "pkg/handler", "pkg/internal/controller", + "pkg/internal/controller/metrics", "pkg/internal/recorder", "pkg/leaderelection", "pkg/manager", + "pkg/metrics", "pkg/patch", "pkg/predicate", "pkg/reconcile", @@ -813,29 +889,37 @@ "pkg/runtime/signals", "pkg/source", "pkg/source/internal", + "pkg/webhook", "pkg/webhook/admission", "pkg/webhook/admission/types", + "pkg/webhook/internal/cert", + "pkg/webhook/internal/cert/generator", + "pkg/webhook/internal/cert/writer", + "pkg/webhook/internal/cert/writer/atomic", "pkg/webhook/types", ] pruneopts = "UT" - revision = "5fd1e9e9fac5261e9ad9d47c375afc014fc31d21" - version = "v0.1.7" + revision = "c63ebda0bf4be5f0a8abd4003e4ea546032545ba" + version = "v0.1.8" [[projects]] - digest = "1:41e7c89bdceb653e2235a7b5627d23af65fa22fb4dad368bf49eb2857e23bac2" + digest = "1:946a62b07e59b9abd1f475a5b5c8d590255c1d40627f386d34fd073d3de9ecb8" name = "sigs.k8s.io/controller-tools" packages = [ "cmd/controller-gen", "pkg/crd/generator", "pkg/crd/util", - "pkg/generate/rbac", "pkg/internal/codegen", "pkg/internal/codegen/parse", + "pkg/internal/general", + "pkg/rbac", "pkg/util", + "pkg/webhook", + "pkg/webhook/internal", ] pruneopts = "UT" - revision = "38b2f3f497ed6b8ea5d2844ecf00c28ac4b5c2c4" - version = "v0.1.6" + revision = "950a0e88e4effb864253b3c7504b326cc83b9d11" + version = "v0.1.8" [[projects]] branch = "master" @@ -862,6 +946,8 @@ input-imports = [ "github.com/davecgh/go-spew/spew", "github.com/emicklei/go-restful", + "github.com/pkg/errors", + "github.com/sergi/go-diff/diffmatchpatch", "github.com/spf13/cobra", "github.com/spf13/pflag", "golang.org/x/net/context", diff --git a/vendor/sigs.k8s.io/cluster-api/Gopkg.toml b/vendor/github.com/openshift/cluster-api/Gopkg.toml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/Gopkg.toml rename to vendor/github.com/openshift/cluster-api/Gopkg.toml diff --git a/vendor/sigs.k8s.io/cluster-api/LICENSE b/vendor/github.com/openshift/cluster-api/LICENSE similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/LICENSE rename to vendor/github.com/openshift/cluster-api/LICENSE diff --git a/vendor/sigs.k8s.io/cluster-api/Makefile b/vendor/github.com/openshift/cluster-api/Makefile similarity index 67% rename from vendor/sigs.k8s.io/cluster-api/Makefile rename to vendor/github.com/openshift/cluster-api/Makefile index 7c9031d12a..ee65756510 100644 --- a/vendor/sigs.k8s.io/cluster-api/Makefile +++ b/vendor/github.com/openshift/cluster-api/Makefile @@ -17,7 +17,7 @@ .DEFAULT_GOAL:=help -# Default timeout for starting/stopping the Kubebuilder test controlplane +# Default timeout for starting/stopping the Kubebuilder test control plane export KUBEBUILDER_CONTROLPLANE_START_TIMEOUT ?=60s export KUBEBUILDER_CONTROLPLANE_STOP_TIMEOUT ?=60s @@ -33,17 +33,23 @@ help: ## Display this help gazelle: ## Run Bazel Gazelle (which bazel && ./hack/update-bazel.sh) || true +.PHONY: dep-ensure +dep-ensure: ## Runs dep-ensure and rebuilds Bazel gazelle files. + find vendor -name 'BUILD.bazel' -delete + (which dep && dep ensure -v) || true + $(MAKE) gazelle + .PHONY: test -test: verify generate fmt vet manifests ## Run tests +test: gazelle verify generate fmt vet manifests ## Run tests go test -v -tags=integration ./pkg/... ./cmd/... .PHONY: manager manager: generate fmt vet ## Build manager binary - go build -o bin/manager sigs.k8s.io/cluster-api/cmd/manager + go build -o bin/manager github.com/openshift/cluster-api/cmd/manager .PHONY: clusterctl clusterctl: generate fmt vet ## Build clusterctl binary - go build -o bin/clusterctl sigs.k8s.io/cluster-api/cmd/clusterctl + go build -o bin/clusterctl github.com/openshift/cluster-api/cmd/clusterctl .PHONY: run run: generate fmt vet ## Run against the configured Kubernetes cluster in ~/.kube/config @@ -57,10 +63,8 @@ deploy: manifests ## Deploy controller in the configured Kubernetes cluster in ~ .PHONY: manifests manifests: ## Generate manifests e.g. CRD, RBAC etc. go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go all - @# Kubebuilder CRD generation can't handle intstr.IntOrString properly: - @# https://github.com/kubernetes-sigs/kubebuilder/issues/442 - sed -i -e 's/maxSurge:/maxSurge: {}/g' -e '/maxSurge:/{n;d};' config/crds/cluster_v1alpha1_machinedeployment.yaml - sed -i -e 's/maxUnavailable:/maxUnavailable: {}/g' -e '/maxUnavailable:/{n;d};' config/crds/cluster_v1alpha1_machinedeployment.yaml + go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go crd --domain openshift.io + git checkout config/crds/cluster_v1alpha1_* .PHONY: fmt fmt: ## Run go fmt against code @@ -71,23 +75,23 @@ vet: ## Run go vet against code go vet ./pkg/... ./cmd/... .PHONY: generate -generate: clientset gazelle ## Generate code +generate: clientset dep-ensure ## Generate code go generate ./pkg/... ./cmd/... .PHONY: clientset clientset: ## Generate a typed clientset rm -rf pkg/client cd ./vendor/k8s.io/code-generator/cmd && go install ./client-gen ./lister-gen ./informer-gen - $$GOPATH/bin/client-gen --clientset-name clientset --input-base sigs.k8s.io/cluster-api/pkg/apis \ - --input cluster/v1alpha1 --output-package sigs.k8s.io/cluster-api/pkg/client/clientset_generated \ + $$GOPATH/bin/client-gen --clientset-name clientset --input-base github.com/openshift/cluster-api/pkg/apis \ + --input cluster/v1alpha1,machine/v1beta1 --output-package github.com/openshift/cluster-api/pkg/client/clientset_generated \ --go-header-file=./hack/boilerplate.go.txt - $$GOPATH/bin/lister-gen --input-dirs sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1 \ - --output-package sigs.k8s.io/cluster-api/pkg/client/listers_generated \ + $$GOPATH/bin/lister-gen --input-dirs github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1,github.com/openshift/cluster-api/pkg/apis/machine/v1beta1 \ + --output-package github.com/openshift/cluster-api/pkg/client/listers_generated \ --go-header-file=./hack/boilerplate.go.txt - $$GOPATH/bin/informer-gen --input-dirs sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1 \ - --versioned-clientset-package sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset \ - --listers-package sigs.k8s.io/cluster-api/pkg/client/listers_generated \ - --output-package sigs.k8s.io/cluster-api/pkg/client/informers_generated \ + $$GOPATH/bin/informer-gen --input-dirs github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1,github.com/openshift/cluster-api/pkg/apis/machine/v1beta1 \ + --versioned-clientset-package github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset \ + --listers-package github.com/openshift/cluster-api/pkg/client/listers_generated \ + --output-package github.com/openshift/cluster-api/pkg/client/informers_generated \ --go-header-file=./hack/boilerplate.go.txt .PHONY: docker-build diff --git a/vendor/github.com/openshift/cluster-api/OWNERS b/vendor/github.com/openshift/cluster-api/OWNERS new file mode 100644 index 0000000000..fae715a520 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/OWNERS @@ -0,0 +1,10 @@ +# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md + +approvers: + - enxebre + - frobware + - ingvagabund + - bison + - paulfantom + - spangenberg + - vikaschoudhary16 diff --git a/vendor/sigs.k8s.io/cluster-api/OWNERS_ALIASES b/vendor/github.com/openshift/cluster-api/OWNERS_ALIASES similarity index 83% rename from vendor/sigs.k8s.io/cluster-api/OWNERS_ALIASES rename to vendor/github.com/openshift/cluster-api/OWNERS_ALIASES index 8e41951cfa..d8f6e3cea8 100644 --- a/vendor/sigs.k8s.io/cluster-api/OWNERS_ALIASES +++ b/vendor/github.com/openshift/cluster-api/OWNERS_ALIASES @@ -12,9 +12,7 @@ aliases: - luxas - roberthbailey cluster-api-maintainers: - - jessicaochen - - karan - - kris-nova + - justinsb - krousey - - mkjelland - roberthbailey + - vincepri diff --git a/vendor/sigs.k8s.io/cluster-api/PROJECT b/vendor/github.com/openshift/cluster-api/PROJECT similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/PROJECT rename to vendor/github.com/openshift/cluster-api/PROJECT diff --git a/vendor/sigs.k8s.io/cluster-api/README.md b/vendor/github.com/openshift/cluster-api/README.md similarity index 83% rename from vendor/sigs.k8s.io/cluster-api/README.md rename to vendor/github.com/openshift/cluster-api/README.md index c2b54c22ac..91b12dcb68 100644 --- a/vendor/sigs.k8s.io/cluster-api/README.md +++ b/vendor/github.com/openshift/cluster-api/README.md @@ -24,7 +24,7 @@ Google Group for access to documents and calendars. * Previous meetings: \[ [notes][notes] | [recordings][recordings] \] * Provider implementer office hours - * Weekly on Mondays @ 09:30 PT and Tuesdays @ 12:00 PT on [Zoom][zoomMeeting] + * Weekly on Tuesdays @ 12:00 PT ([Zoom][providerZoomMeetingTues]) and Wednesdays @ 15:00 CET ([Zoom][providerZoomMeetingWed]) * Previous meetings: \[ [notes][implementerNotes] \] * Chat with us on [Slack](http://slack.k8s.io/): #cluster-api @@ -37,7 +37,7 @@ are also sponsored by SIG-cluster-lifecycle: * AWS, https://github.com/kubernetes-sigs/cluster-api-provider-aws * AWS/Openshift, https://github.com/openshift/cluster-operator - * Azure, https://github.com/platform9/azure-provider + * Azure, https://github.com/kubernetes-sigs/cluster-api-provider-azure * Baidu Cloud, https://github.com/baidu/cluster-api-provider-baiducloud * DigitalOcean, https://github.com/kubernetes-sigs/cluster-api-provider-digitalocean * GCE, https://github.com/kubernetes-sigs/cluster-api-provider-gcp @@ -58,8 +58,10 @@ Following are the implementations managed by third-parties adopting the standard * `kubectl` is required, see [here](http://kubernetes.io/docs/user-guide/prereqs/). * `clusterctl` is a SIG-cluster-lifecycle sponsored tool to manage Cluster API clusters. See [here](cmd/clusterctl) -[cluster-api-kep]: https://github.com/kubernetes/community/blob/master/keps/sig-cluster-lifecycle/0003-cluster-api.md -[notes]: https://docs.google.com/document/d/16ils69KImmE94RlmzjWDrkmFZysgB2J4lGnYMRN89WM/edit +[cluster-api-kep]: https://github.com/kubernetes/enhancements/blob/master/keps/sig-cluster-lifecycle/0003-cluster-api.md +[notes]: https://docs.google.com/document/d/1Ys-DOR5UsgbMEeciuG0HOgDQc8kZsaWIWJeKJ1-UfbY/edit [recordings]: https://www.youtube.com/playlist?list=PL69nYSiGNLP29D0nYgAGWt1ZFqS9Z7lw4 -[zoomMeeting]: https://zoom.us/j/166836624 +[zoomMeeting]: https://zoom.us/j/861487554 [implementerNotes]: https://docs.google.com/document/d/1IZ2-AZhe4r3CYiJuttyciS7bGZTTx4iMppcA8_Pr3xE/edit +[providerZoomMeetingTues]: https://zoom.us/j/140808484 +[providerZoomMeetingWed]: https://zoom.us/j/424743530 diff --git a/vendor/sigs.k8s.io/cluster-api/SECURITY_CONTACTS b/vendor/github.com/openshift/cluster-api/SECURITY_CONTACTS similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/SECURITY_CONTACTS rename to vendor/github.com/openshift/cluster-api/SECURITY_CONTACTS diff --git a/vendor/sigs.k8s.io/cluster-api/WORKSPACE b/vendor/github.com/openshift/cluster-api/WORKSPACE similarity index 85% rename from vendor/sigs.k8s.io/cluster-api/WORKSPACE rename to vendor/github.com/openshift/cluster-api/WORKSPACE index 27dbf6850c..25a8fa0083 100644 --- a/vendor/sigs.k8s.io/cluster-api/WORKSPACE +++ b/vendor/github.com/openshift/cluster-api/WORKSPACE @@ -2,8 +2,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", - url = "https://github.com/bazelbuild/rules_go/releases/download/0.16.5/rules_go-0.16.5.tar.gz", - sha256 = "7be7dc01f1e0afdba6c8eb2b43d2fa01c743be1b9273ab1eaf6c233df078d705", + url = "https://github.com/bazelbuild/rules_go/releases/download/0.16.6/rules_go-0.16.6.tar.gz", + sha256 = "ade51a315fa17347e5c31201fdc55aa5ffb913377aa315dceb56ee9725e620ee", ) http_archive( @@ -17,7 +17,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_too go_rules_dependencies() go_register_toolchains( - go_version = "1.11.4", + go_version = "1.11.5", ) load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") diff --git a/vendor/sigs.k8s.io/cluster-api/architecture.png b/vendor/github.com/openshift/cluster-api/architecture.png similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/architecture.png rename to vendor/github.com/openshift/cluster-api/architecture.png diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/BUILD.bazel similarity index 83% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/BUILD.bazel index 5344a11d3a..c9b97ec551 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/BUILD.bazel @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") go_library( name = "go_default_library", srcs = ["main.go"], - importpath = "sigs.k8s.io/cluster-api/cmd/clusterctl", + importpath = "github.com/openshift/cluster-api/cmd/clusterctl", visibility = ["//visibility:private"], deps = ["//cmd/clusterctl/cmd:go_default_library"], ) diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/CONTRIBUTING.md b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/CONTRIBUTING.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/CONTRIBUTING.md rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/CONTRIBUTING.md diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/README.md b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/README.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/README.md rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/README.md diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clientcmd/BUILD.bazel similarity index 87% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/clientcmd/BUILD.bazel index 45af598ffe..67d010e4ce 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clientcmd/BUILD.bazel @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["configutil.go"], - importpath = "sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd", + importpath = "github.com/openshift/cluster-api/cmd/clusterctl/clientcmd", visibility = ["//visibility:public"], deps = [ "//pkg/client/clientset_generated/clientset:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd/configutil.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clientcmd/configutil.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd/configutil.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/clientcmd/configutil.go index faef692ed8..ecaec43c52 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd/configutil.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clientcmd/configutil.go @@ -19,11 +19,11 @@ limitations under the License. package clientcmd import ( + "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" - "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" ) // This is a convenience method to prevent the need of importing both this version of clientcmd and the client-go version diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/BUILD.bazel similarity index 85% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/BUILD.bazel index 5686e5600a..748a7badd0 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/BUILD.bazel @@ -6,7 +6,7 @@ go_library( "clusterdeployer.go", "providercomponentsstorefactory.go", ], - importpath = "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer", + importpath = "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer", visibility = ["//visibility:public"], deps = [ "//cmd/clusterctl/clusterdeployer/bootstrap:go_default_library", @@ -15,6 +15,7 @@ go_library( "//cmd/clusterctl/providercomponents:go_default_library", "//pkg/apis/cluster/v1alpha1:go_default_library", "//pkg/util:go_default_library", + "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/client-go/kubernetes:go_default_library", "//vendor/k8s.io/klog:go_default_library", ], @@ -27,6 +28,7 @@ go_test( deps = [ "//cmd/clusterctl/clusterdeployer/clusterclient:go_default_library", "//pkg/apis/cluster/v1alpha1:go_default_library", + "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/kubernetes:go_default_library", diff --git a/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/BUILD.bazel new file mode 100644 index 0000000000..15b8e688e5 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "options.go", + "provisioner.go", + ], + importpath = "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap", + visibility = ["//visibility:public"], + deps = [ + "//cmd/clusterctl/clusterdeployer/bootstrap/existing:go_default_library", + "//cmd/clusterctl/clusterdeployer/bootstrap/kind:go_default_library", + "//cmd/clusterctl/clusterdeployer/bootstrap/minikube:go_default_library", + "//vendor/github.com/pkg/errors:go_default_library", + "//vendor/github.com/spf13/pflag:go_default_library", + ], +) diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing/BUILD.bazel similarity index 50% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing/BUILD.bazel index 1eaa6f4dba..dee8081ad8 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing/BUILD.bazel @@ -2,13 +2,14 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", - srcs = ["existingcluster.go"], - importpath = "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing", + srcs = ["cluster.go"], + importpath = "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing", visibility = ["//visibility:public"], + deps = ["//vendor/github.com/pkg/errors:go_default_library"], ) go_test( name = "go_default_test", - srcs = ["existingcluster_test.go"], + srcs = ["cluster_test.go"], embed = [":go_default_library"], ) diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing/existingcluster.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing/cluster.go similarity index 76% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing/existingcluster.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing/cluster.go index c5645cecd3..5fe3264134 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing/existingcluster.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing/cluster.go @@ -17,43 +17,44 @@ limitations under the License. package existing import ( - "fmt" "io/ioutil" "os" + + "github.com/pkg/errors" ) // Represents an existing cluster being used for bootstrapping, should not be able to // actually delete or create, but can point to actual kubeconfig file. -type ExistingCluster struct { +type Cluster struct { kubeconfigPath string kubeconfigFile string } -// NewExistingCluster creates a new existing k8s bootstrap cluster object +// New creates a new existing k8s bootstrap cluster object // We should clean up any lingering resources when clusterctl is complete. // TODO https://github.com/kubernetes-sigs/cluster-api/issues/448 -func NewExistingCluster(kubeconfigPath string) (*ExistingCluster, error) { +func New(kubeconfigPath string) (*Cluster, error) { if _, err := os.Stat(kubeconfigPath); os.IsNotExist(err) { - return nil, fmt.Errorf("file at %s does not exist", kubeconfigPath) + return nil, errors.Errorf("file at %s does not exist", kubeconfigPath) } - return &ExistingCluster{kubeconfigPath: kubeconfigPath}, nil + return &Cluster{kubeconfigPath: kubeconfigPath}, nil } // Create implements clusterdeployer.ClusterProvisioner interface -func (e *ExistingCluster) Create() error { +func (e *Cluster) Create() error { // noop return nil } // Delete implements clusterdeployer.ClusterProvisioner interface -func (e *ExistingCluster) Delete() error { +func (e *Cluster) Delete() error { // noop return nil } // GetKubeconfig implements clusterdeployer.ClusterProvisioner interface -func (e *ExistingCluster) GetKubeconfig() (string, error) { +func (e *Cluster) GetKubeconfig() (string, error) { if e.kubeconfigFile == "" { b, err := ioutil.ReadFile(e.kubeconfigPath) diff --git a/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/kind/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/kind/BUILD.bazel new file mode 100644 index 0000000000..fa2be53f4b --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/kind/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = ["kind.go"], + importpath = "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/kind", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/pkg/errors:go_default_library", + "//vendor/k8s.io/klog:go_default_library", + ], +) + +go_test( + name = "go_default_test", + srcs = ["kind_test.go"], + embed = [":go_default_library"], + deps = ["//vendor/github.com/pkg/errors:go_default_library"], +) diff --git a/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/kind/kind.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/kind/kind.go new file mode 100644 index 0000000000..b256762d0d --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/kind/kind.go @@ -0,0 +1,113 @@ +/* +Copyright 2019 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 kind + +import ( + "fmt" + "io/ioutil" + "os/exec" + "strings" + + "github.com/pkg/errors" + "k8s.io/klog" +) + +const ( + kubeconfigEnvVar = "KUBECONFIG" + kindClusterName = "clusterapi" +) + +type Kind struct { + options []string + // execFunc implemented as function variable for testing hooks + execFunc func(args ...string) (string, error) +} + +func New() *Kind { + return WithOptions([]string{}) +} + +func WithOptions(options []string) *Kind { + return &Kind{ + execFunc: execFunc, + options: append(options, fmt.Sprintf("name=%s", kindClusterName)), + } +} + +var execFunc = func(args ...string) (string, error) { + const executable = "kind" + klog.V(3).Infof("Running: %v %v", executable, args) + cmd := exec.Command(executable, args...) + cmdOut, err := cmd.CombinedOutput() + klog.V(2).Infof("Ran: %v %v Output: %v", executable, args, string(cmdOut)) + if err != nil { + err = errors.Wrapf(err, "error running command '%v %v'", executable, strings.Join(args, " ")) + } + return string(cmdOut), err +} + +func (k *Kind) Create() error { + args := []string{"create", "cluster"} + for _, opt := range k.options { + args = append(args, fmt.Sprintf("--%v", opt)) + } + + _, err := k.exec(args...) + return err +} + +func (k *Kind) Delete() error { + args := []string{"delete", "cluster"} + for _, opt := range k.options { + args = append(args, fmt.Sprintf("--%v", opt)) + } + + _, err := k.exec(args...) + return err +} + +func (k *Kind) GetKubeconfig() (string, error) { + path, err := k.getKubeConfigPath() + if err != nil { + return "", err + } + + b, err := ioutil.ReadFile(path) + if err != nil { + return "", err + } + + return string(b), nil +} + +func (k *Kind) getKubeConfigPath() (string, error) { + args := []string{"get", "kubeconfig-path"} + for _, opt := range k.options { + args = append(args, fmt.Sprintf("--%v", opt)) + } + + out, err := k.exec(args...) + if err != nil { + return "", err + } + + return strings.TrimSpace(out), nil +} + +func (k *Kind) exec(args ...string) (string, error) { + return k.execFunc(args...) +} diff --git a/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/BUILD.bazel new file mode 100644 index 0000000000..4303d4a52d --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = ["minikube.go"], + importpath = "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/pkg/errors:go_default_library", + "//vendor/k8s.io/klog:go_default_library", + ], +) + +go_test( + name = "go_default_test", + srcs = ["minikube_test.go"], + embed = [":go_default_library"], + deps = ["//vendor/github.com/pkg/errors:go_default_library"], +) diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go similarity index 95% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go index 2c5a73f528..fceb4df31f 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube.go @@ -23,6 +23,7 @@ import ( "os/exec" "strings" + "github.com/pkg/errors" "k8s.io/klog" ) @@ -61,7 +62,7 @@ var minikubeExec = func(env []string, args ...string) (string, error) { cmdOut, err := cmd.CombinedOutput() klog.V(2).Infof("Ran: %v %v Output: %v", executable, args, string(cmdOut)) if err != nil { - err = fmt.Errorf("error running command '%v %v': %v", executable, strings.Join(args, " "), err) + err = errors.Wrapf(err, "error running command '%v %v'", executable, strings.Join(args, " ")) } return string(cmdOut), err } diff --git a/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/options.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/options.go new file mode 100644 index 0000000000..c1444411db --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/options.go @@ -0,0 +1,33 @@ +/* +Copyright 2019 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 bootstrap + +import "github.com/spf13/pflag" + +type Options struct { + Type string + Cleanup bool + ExtraFlags []string + KubeConfig string +} + +func (o *Options) AddFlags(fs *pflag.FlagSet) { + fs.StringVarP(&o.Type, "bootstrap-type", "", "none", "The cluster bootstrapper to use.") + fs.BoolVarP(&o.Cleanup, "bootstrap-cluster-cleanup", "", true, "Whether to cleanup the bootstrap cluster after bootstrap.") + fs.StringVarP(&o.KubeConfig, "bootstrap-cluster-kubeconfig", "e", "", "Sets the bootstrap cluster to be an existing Kubernetes cluster.") + fs.StringSliceVarP(&o.ExtraFlags, "bootstrap-flags", "", []string{}, "Command line flags to be passed to the chosen bootstrapper") +} diff --git a/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/provisioner.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/provisioner.go new file mode 100644 index 0000000000..183e550b88 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/provisioner.go @@ -0,0 +1,46 @@ +/* +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 bootstrap + +import ( + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/kind" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube" + "github.com/pkg/errors" +) + +// Can provision a kubernetes cluster +type ClusterProvisioner interface { + Create() error + Delete() error + GetKubeconfig() (string, error) +} + +func Get(o Options) (ClusterProvisioner, error) { + switch o.Type { + case "kind": + return kind.WithOptions(o.ExtraFlags), nil + case "minikube": + return minikube.WithOptions(o.ExtraFlags), nil + default: + if o.KubeConfig != "" { + return existing.New(o.KubeConfig) + } + + return nil, errors.New("no bootstrap provisioner specified, you can specify `--bootstrap-cluster-kubeconfig` to use an existing Kubernetes cluster or `--bootstrap-type` to use a built-in ephemeral cluster.") + } +} diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/BUILD.bazel similarity index 86% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/BUILD.bazel index 6a60489cc9..e58d7c3545 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/BUILD.bazel @@ -6,13 +6,14 @@ go_library( "clientfactory.go", "clusterclient.go", ], - importpath = "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient", + importpath = "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient", visibility = ["//visibility:public"], deps = [ "//cmd/clusterctl/clientcmd:go_default_library", "//pkg/apis/cluster/v1alpha1:go_default_library", "//pkg/client/clientset_generated/clientset:go_default_library", "//pkg/util:go_default_library", + "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clientfactory.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clientfactory.go similarity index 95% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clientfactory.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clientfactory.go index 2cda63d101..b1e4e16d08 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clientfactory.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clientfactory.go @@ -17,8 +17,8 @@ limitations under the License. package clusterclient import ( + "github.com/openshift/cluster-api/cmd/clusterctl/clientcmd" "k8s.io/client-go/kubernetes" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd" ) // Factory can create cluster clients diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go similarity index 89% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go index bac8268257..b270a90518 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go @@ -17,7 +17,6 @@ limitations under the License. package clusterclient import ( - "fmt" "io/ioutil" "os" "os/exec" @@ -25,15 +24,15 @@ import ( "sync" "time" + "github.com/openshift/cluster-api/cmd/clusterctl/clientcmd" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" + "github.com/openshift/cluster-api/pkg/util" + "github.com/pkg/errors" apiv1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" tcmd "k8s.io/client-go/tools/clientcmd" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - "sigs.k8s.io/cluster-api/pkg/util" - "k8s.io/klog" ) @@ -110,7 +109,7 @@ func (c *client) removeKubeconfigFile() error { func (c *client) EnsureNamespace(namespaceName string) error { clientset, err := clientcmd.NewCoreClientSetForDefaultSearchPath(c.kubeconfigFile, clientcmd.NewConfigOverrides()) if err != nil { - return fmt.Errorf("error creating core clientset: %v", err) + return errors.Wrap(err, "error creating core clientset") } namespace := apiv1.Namespace{ @@ -131,7 +130,7 @@ func (c *client) DeleteNamespace(namespaceName string) error { } clientset, err := clientcmd.NewCoreClientSetForDefaultSearchPath(c.kubeconfigFile, clientcmd.NewConfigOverrides()) if err != nil { - return fmt.Errorf("error creating core clientset: %v", err) + return errors.Wrap(err, "error creating core clientset") } err = clientset.CoreV1().Namespaces().Delete(namespaceName, &metav1.DeleteOptions{}) @@ -198,7 +197,7 @@ func (c *client) GetClusterObjectsInNamespace(namespace string) ([]*clusterv1.Cl clusters := []*clusterv1.Cluster{} clusterlist, err := c.clientSet.ClusterV1alpha1().Clusters(namespace).List(metav1.ListOptions{}) if err != nil { - return nil, fmt.Errorf("error listing cluster objects in namespace %q: %v", namespace, err) + return nil, errors.Wrapf(err, "error listing cluster objects in namespace %q", namespace) } for i := 0; i < len(clusterlist.Items); i++ { @@ -210,7 +209,7 @@ func (c *client) GetClusterObjectsInNamespace(namespace string) ([]*clusterv1.Cl func (c *client) GetMachineDeploymentObjectsInNamespace(namespace string) ([]*clusterv1.MachineDeployment, error) { machineDeploymentList, err := c.clientSet.ClusterV1alpha1().MachineDeployments(namespace).List(metav1.ListOptions{}) if err != nil { - return nil, fmt.Errorf("error listing machine deployment objects in namespace %q: %v", namespace, err) + return nil, errors.Wrapf(err, "error listing machine deployment objects in namespace %q", namespace) } var machineDeployments []*clusterv1.MachineDeployment for i := 0; i < len(machineDeploymentList.Items); i++ { @@ -228,7 +227,7 @@ func (c *client) GetMachineDeploymentObjects() ([]*clusterv1.MachineDeployment, func (c *client) GetMachineSetObjectsInNamespace(namespace string) ([]*clusterv1.MachineSet, error) { machineSetList, err := c.clientSet.ClusterV1alpha1().MachineSets(namespace).List(metav1.ListOptions{}) if err != nil { - return nil, fmt.Errorf("error listing machine set objects in namespace %q: %v", namespace, err) + return nil, errors.Wrapf(err, "error listing machine set objects in namespace %q", namespace) } var machineSets []*clusterv1.MachineSet for i := 0; i < len(machineSetList.Items); i++ { @@ -247,7 +246,7 @@ func (c *client) GetMachineObjectsInNamespace(namespace string) ([]*clusterv1.Ma machines := []*clusterv1.Machine{} machineslist, err := c.clientSet.ClusterV1alpha1().Machines(namespace).List(metav1.ListOptions{}) if err != nil { - return nil, fmt.Errorf("error listing machine objects in namespace %q: %v", namespace, err) + return nil, errors.Wrapf(err, "error listing machine objects in namespace %q", namespace) } for i := 0; i < len(machineslist.Items); i++ { @@ -270,7 +269,7 @@ func (c *client) CreateClusterObject(cluster *clusterv1.Cluster) error { _, err := c.clientSet.ClusterV1alpha1().Clusters(namespace).Create(cluster) if err != nil { - return fmt.Errorf("error creating cluster in namespace %v: %v", namespace, err) + return errors.Wrapf(err, "error creating cluster in namespace %v", namespace) } return err } @@ -280,7 +279,7 @@ func (c *client) CreateMachineDeploymentObjects(deployments []*clusterv1.Machine // TODO: Run in parallel https://github.com/kubernetes-sigs/cluster-api/issues/258 _, err := c.clientSet.ClusterV1alpha1().MachineDeployments(namespace).Create(deploy) if err != nil { - return fmt.Errorf("error creating a machine deployment object in namespace %q: %v", namespace, err) + return errors.Wrapf(err, "error creating a machine deployment object in namespace %q", namespace) } } return nil @@ -291,7 +290,7 @@ func (c *client) CreateMachineSetObjects(machineSets []*clusterv1.MachineSet, na // TODO: Run in parallel https://github.com/kubernetes-sigs/cluster-api/issues/258 _, err := c.clientSet.ClusterV1alpha1().MachineSets(namespace).Create(ms) if err != nil { - return fmt.Errorf("error creating a machine set object in namespace %q: %v", namespace, err) + return errors.Wrapf(err, "error creating a machine set object in namespace %q", namespace) } } return nil @@ -313,7 +312,7 @@ func (c *client) CreateMachineObjects(machines []*clusterv1.Machine, namespace s createdMachine, err := c.clientSet.ClusterV1alpha1().Machines(namespace).Create(machine) if err != nil { errOnce.Do(func() { - gerr = fmt.Errorf("error creating a machine object in namespace %v: %v", namespace, err) + gerr = errors.Wrapf(err, "error creating a machine object in namespace %v", namespace) }) return } @@ -336,11 +335,11 @@ func (c *client) DeleteClusterObjects() error { func (c *client) DeleteClusterObjectsInNamespace(namespace string) error { err := c.clientSet.ClusterV1alpha1().Clusters(namespace).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) if err != nil { - return fmt.Errorf("error deleting cluster objects in namespace %q: %v", namespace, err) + return errors.Wrapf(err, "error deleting cluster objects in namespace %q", namespace) } err = c.waitForClusterDelete(namespace) if err != nil { - return fmt.Errorf("error waiting for cluster(s) deletion to complete in namespace %q: %v", namespace, err) + return errors.Wrapf(err, "error waiting for cluster(s) deletion to complete in namespace %q", namespace) } return nil } @@ -354,11 +353,11 @@ func (c *client) DeleteMachineDeploymentObjects() error { func (c *client) DeleteMachineDeploymentObjectsInNamespace(namespace string) error { err := c.clientSet.ClusterV1alpha1().MachineDeployments(namespace).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) if err != nil { - return fmt.Errorf("error deleting machine deployment objects in namespace %q: %v", namespace, err) + return errors.Wrapf(err, "error deleting machine deployment objects in namespace %q", namespace) } err = c.waitForMachineDeploymentsDelete(namespace) if err != nil { - return fmt.Errorf("error waiting for machine deployment(s) deletion to complete in namespace %q: %v", namespace, err) + return errors.Wrapf(err, "error waiting for machine deployment(s) deletion to complete in namespace %q", namespace) } return nil } @@ -372,11 +371,11 @@ func (c *client) DeleteMachineSetObjects() error { func (c *client) DeleteMachineSetObjectsInNamespace(namespace string) error { err := c.clientSet.ClusterV1alpha1().MachineSets(namespace).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) if err != nil { - return fmt.Errorf("error deleting machine set objects in namespace %q: %v", namespace, err) + return errors.Wrapf(err, "error deleting machine set objects in namespace %q", namespace) } err = c.waitForMachineSetsDelete(namespace) if err != nil { - return fmt.Errorf("error waiting for machine set(s) deletion to complete in namespace %q: %v", namespace, err) + return errors.Wrapf(err, "error waiting for machine set(s) deletion to complete in namespace %q", namespace) } return nil } @@ -390,11 +389,11 @@ func (c *client) DeleteMachineObjects() error { func (c *client) DeleteMachineObjectsInNamespace(namespace string) error { err := c.clientSet.ClusterV1alpha1().Machines(namespace).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) if err != nil { - return fmt.Errorf("error deleting machine objects in namespace %q: %v", namespace, err) + return errors.Wrapf(err, "error deleting machine objects in namespace %q", namespace) } err = c.waitForMachinesDelete(namespace) if err != nil { - return fmt.Errorf("error waiting for machine(s) deletion to complete in namespace %q: %v", namespace, err) + return errors.Wrapf(err, "error waiting for machine(s) deletion to complete in namespace %q", namespace) } return nil } @@ -407,14 +406,14 @@ func newDeleteOptions() *metav1.DeleteOptions { } // TODO: Test this function -func (c *client) UpdateClusterObjectEndpoint(masterIP, clusterName, namespace string) error { +func (c *client) UpdateClusterObjectEndpoint(controlPlaneIP, clusterName, namespace string) error { cluster, err := c.GetClusterObject(clusterName, namespace) if err != nil { return err } cluster.Status.APIEndpoints = append(cluster.Status.APIEndpoints, clusterv1.APIEndpoint{ - Host: masterIP, + Host: controlPlaneIP, Port: apiServerPort, }) _, err = c.clientSet.ClusterV1alpha1().Clusters(namespace).UpdateStatus(cluster) @@ -494,7 +493,7 @@ func (c *client) kubectlManifestCmd(commandName, manifest string) error { cmd.Stdin = strings.NewReader(manifest) out, err := cmd.CombinedOutput() if err != nil { - return fmt.Errorf("couldn't kubectl apply: %v, output: %s", err, string(out)) + return errors.Wrapf(err, "couldn't kubectl apply, output: %s", string(out)) } return nil } @@ -578,7 +577,7 @@ func waitForMachineReady(cs clientset.Interface, machine *clusterv1.Machine) err } // TODO: update once machine controllers have a way to indicate a machine has been provisoned. https://github.com/kubernetes-sigs/cluster-api/issues/253 - // Seeing a node cannot be purely relied upon because the provisioned master will not be registering with + // Seeing a node cannot be purely relied upon because the provisioned control plane will not be registering with // the stack that provisions it. ready := m.Status.NodeRef != nil || len(m.Annotations) > 0 return ready, nil diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterdeployer.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterdeployer.go similarity index 68% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterdeployer.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterdeployer.go index b1c444f839..332215dc7a 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterdeployer.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterdeployer.go @@ -17,19 +17,19 @@ limitations under the License. package clusterdeployer import ( - "fmt" "io/ioutil" "os" "strings" "time" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" + "github.com/openshift/cluster-api/cmd/clusterctl/phases" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + "github.com/openshift/cluster-api/pkg/util" + "github.com/pkg/errors" "k8s.io/client-go/kubernetes" "k8s.io/klog" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" - "sigs.k8s.io/cluster-api/cmd/clusterctl/phases" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/util" ) // Deprecated interface for Provider specific logic. Please do not extend or add. This interface should be removed @@ -38,7 +38,7 @@ type ProviderDeployer interface { // TODO: This requirement can be removed once after: https://github.com/kubernetes-sigs/cluster-api/issues/158 GetIP(cluster *clusterv1.Cluster, machine *clusterv1.Machine) (string, error) // TODO: This requirement can be removed after: https://github.com/kubernetes-sigs/cluster-api/issues/160 - GetKubeConfig(cluster *clusterv1.Cluster, master *clusterv1.Machine) (string, error) + GetKubeConfig(cluster *clusterv1.Cluster, controlPlaneMachine *clusterv1.Machine) (string, error) } type ProviderComponentsStore interface { @@ -80,81 +80,81 @@ const ( // Create the cluster from the provided cluster definition and machine list. func (d *ClusterDeployer) Create(cluster *clusterv1.Cluster, machines []*clusterv1.Machine, provider ProviderDeployer, kubeconfigOutput string, providerComponentsStoreFactory ProviderComponentsStoreFactory) error { - master, nodes, err := extractMasterMachine(machines) + controlPlaneMachine, nodes, err := extractControlPlaneMachine(machines) if err != nil { - return fmt.Errorf("unable to separate master machines from node machines: %v", err) + return errors.Wrap(err, "unable to separate control plane machines from node machines") } bootstrapClient, cleanupBootstrapCluster, err := phases.CreateBootstrapCluster(d.bootstrapProvisioner, d.cleanupBootstrapCluster, d.clientFactory) defer cleanupBootstrapCluster() if err != nil { - return fmt.Errorf("could not create bootstrap cluster: %v", err) + return errors.Wrap(err, "could not create bootstrap cluster") } defer closeClient(bootstrapClient, "bootstrap") klog.Info("Applying Cluster API stack to bootstrap cluster") if err := phases.ApplyClusterAPIComponents(bootstrapClient, d.providerComponents); err != nil { - return fmt.Errorf("unable to apply cluster api stack to bootstrap cluster: %v", err) + return errors.Wrap(err, "unable to apply cluster api stack to bootstrap cluster") } klog.Info("Provisioning target cluster via bootstrap cluster") if err := phases.ApplyCluster(bootstrapClient, cluster); err != nil { - return fmt.Errorf("unable to create cluster %q in bootstrap cluster: %v", cluster.Name, err) + return errors.Wrapf(err, "unable to create cluster %q in bootstrap cluster", cluster.Name) } if cluster.Namespace == "" { cluster.Namespace = bootstrapClient.GetContextNamespace() } - klog.Infof("Creating master %v in namespace %q", master.Name, cluster.Namespace) - if err := phases.ApplyMachines(bootstrapClient, cluster.Namespace, []*clusterv1.Machine{master}); err != nil { - return fmt.Errorf("unable to create master machine: %v", err) + klog.Infof("Creating control plane %v in namespace %q", controlPlaneMachine.Name, cluster.Namespace) + if err := phases.ApplyMachines(bootstrapClient, cluster.Namespace, []*clusterv1.Machine{controlPlaneMachine}); err != nil { + return errors.Wrap(err, "unable to create control plane machine") } - klog.Infof("Updating bootstrap cluster object for cluster %v in namespace %q with master (%s) endpoint", cluster.Name, cluster.Namespace, master.Name) + klog.Infof("Updating bootstrap cluster object for cluster %v in namespace %q with control plane endpoint running on %s", cluster.Name, cluster.Namespace, controlPlaneMachine.Name) if err := d.updateClusterEndpoint(bootstrapClient, provider, cluster.Name, cluster.Namespace); err != nil { - return fmt.Errorf("unable to update bootstrap cluster endpoint: %v", err) + return errors.Wrap(err, "unable to update bootstrap cluster endpoint") } klog.Info("Creating target cluster") targetClient, err := d.createTargetClusterClient(bootstrapClient, provider, kubeconfigOutput, cluster.Name, cluster.Namespace) if err != nil { - return fmt.Errorf("unable to create target cluster: %v", err) + return errors.Wrap(err, "unable to create target cluster") } defer closeClient(targetClient, "target") if d.addonComponents != "" { if err := phases.ApplyAddons(targetClient, d.addonComponents); err != nil { - return fmt.Errorf("unable to apply addons to target cluster: %v", err) + return errors.Wrap(err, "unable to apply addons to target cluster") } } klog.Info("Applying Cluster API stack to target cluster") if err := d.applyClusterAPIComponentsWithPivoting(targetClient, bootstrapClient, cluster.Namespace); err != nil { - return fmt.Errorf("unable to apply cluster api stack to target cluster: %v", err) + return errors.Wrap(err, "unable to apply cluster api stack to target cluster") } klog.Info("Saving provider components to the target cluster") err = d.saveProviderComponentsToCluster(providerComponentsStoreFactory, kubeconfigOutput) if err != nil { - return fmt.Errorf("unable to save provider components to target cluster: %v", err) + return errors.Wrap(err, "unable to save provider components to target cluster") } err = targetClient.EnsureNamespace(cluster.Namespace) if err != nil { - return fmt.Errorf("unable to ensure namespace %q in targetCluster: %v", cluster.Namespace, err) + return errors.Wrapf(err, "unable to ensure namespace %q in targetCluster", cluster.Namespace) } // For some reason, endpoint doesn't get updated in bootstrap cluster sometimes. So we // update the target cluster endpoint as well to be sure. - klog.Infof("Updating target cluster object with master (%s) endpoint", master.Name) + klog.Infof("Updating target cluster object with control plane endpoint running on %s", controlPlaneMachine.Name) if err := d.updateClusterEndpoint(targetClient, provider, cluster.Name, cluster.Namespace); err != nil { - return fmt.Errorf("unable to update target cluster endpoint: %v", err) + return errors.Wrap(err, "unable to update target cluster endpoint") } klog.Info("Creating node machines in target cluster.") if err := phases.ApplyMachines(targetClient, cluster.Namespace, nodes); err != nil { - return fmt.Errorf("unable to create node machines: %v", err) + return errors.Wrap(err, "unable to create node machines") } klog.Infof("Done provisioning cluster. You can now access your cluster with kubectl --kubeconfig %v", kubeconfigOutput) @@ -167,13 +167,13 @@ func (d *ClusterDeployer) Delete(targetClient clusterclient.Client, namespace st bootstrapClient, cleanupBootstrapCluster, err := phases.CreateBootstrapCluster(d.bootstrapProvisioner, d.cleanupBootstrapCluster, d.clientFactory) defer cleanupBootstrapCluster() if err != nil { - return fmt.Errorf("could not create bootstrap cluster: %v", err) + return errors.Wrap(err, "could not create bootstrap cluster") } defer closeClient(bootstrapClient, "bootstrap") klog.Info("Applying Cluster API stack to bootstrap cluster") if err := phases.ApplyClusterAPIComponents(bootstrapClient, d.providerComponents); err != nil { - return fmt.Errorf("unable to apply cluster api stack to bootstrap cluster: %v", err) + return errors.Wrap(err, "unable to apply cluster api stack to bootstrap cluster") } klog.Info("Deleting Cluster API Provider Components from target cluster") @@ -184,12 +184,12 @@ func (d *ClusterDeployer) Delete(targetClient clusterclient.Client, namespace st klog.Info("Copying objects from target cluster to bootstrap cluster") if err = pivotNamespace(targetClient, bootstrapClient, namespace); err != nil { - return fmt.Errorf("unable to copy objects from target to bootstrap cluster: %v", err) + return errors.Wrap(err, "unable to copy objects from target to bootstrap cluster") } klog.Info("Deleting objects from bootstrap cluster") if err = deleteObjectsInNamespace(bootstrapClient, namespace); err != nil { - return fmt.Errorf("unable to finish deleting objects in bootstrap cluster, resources may have been leaked: %v", err) + return errors.Wrap(err, "unable to finish deleting objects in bootstrap cluster, resources may have been leaked") } klog.Info("Deletion of cluster complete") @@ -198,15 +198,15 @@ func (d *ClusterDeployer) Delete(targetClient clusterclient.Client, namespace st } func (d *ClusterDeployer) createTargetClusterClient(bootstrapClient clusterclient.Client, provider ProviderDeployer, kubeconfigOutput string, clusterName, namespace string) (clusterclient.Client, error) { - cluster, master, _, err := getClusterAPIObject(bootstrapClient, clusterName, namespace) + cluster, controlPlane, _, err := getClusterAPIObject(bootstrapClient, clusterName, namespace) if err != nil { return nil, err } klog.V(1).Info("Getting target cluster kubeconfig.") - targetKubeconfig, err := waitForKubeconfigReady(provider, cluster, master) + targetKubeconfig, err := waitForKubeconfigReady(provider, cluster, controlPlane) if err != nil { - return nil, fmt.Errorf("unable to get target cluster kubeconfig: %v", err) + return nil, errors.Wrap(err, "unable to get target cluster kubeconfig") } if err = d.writeKubeconfig(targetKubeconfig, kubeconfigOutput); err != nil { @@ -215,7 +215,7 @@ func (d *ClusterDeployer) createTargetClusterClient(bootstrapClient clusterclien targetClient, err := d.clientFactory.NewClientFromKubeconfig(targetKubeconfig) if err != nil { - return nil, fmt.Errorf("unable to create target cluster client: %v", err) + return nil, errors.Wrap(err, "unable to create target cluster client") } return targetClient, nil @@ -225,17 +225,17 @@ func (d *ClusterDeployer) updateClusterEndpoint(client clusterclient.Client, pro // Update cluster endpoint. Needed till this logic moves into cluster controller. // TODO: https://github.com/kubernetes-sigs/cluster-api/issues/158 // Fetch fresh objects. - cluster, master, _, err := getClusterAPIObject(client, clusterName, namespace) + cluster, controlPlane, _, err := getClusterAPIObject(client, clusterName, namespace) if err != nil { return err } - masterIP, err := provider.GetIP(cluster, master) + clusterEndpoint, err := provider.GetIP(cluster, controlPlane) if err != nil { - return fmt.Errorf("unable to get master IP: %v", err) + return errors.Wrap(err, "unable to get cluster endpoint") } - err = client.UpdateClusterObjectEndpoint(masterIP, clusterName, namespace) + err = client.UpdateClusterObjectEndpoint(clusterEndpoint, clusterName, namespace) if err != nil { - return fmt.Errorf("unable to update cluster endpoint: %v", err) + return errors.Wrap(err, "unable to update cluster endpoint") } return nil } @@ -243,15 +243,15 @@ func (d *ClusterDeployer) updateClusterEndpoint(client clusterclient.Client, pro func (d *ClusterDeployer) saveProviderComponentsToCluster(factory ProviderComponentsStoreFactory, kubeconfigPath string) error { clientset, err := d.clientFactory.NewCoreClientsetFromKubeconfigFile(kubeconfigPath) if err != nil { - return fmt.Errorf("error creating core clientset: %v", err) + return errors.Wrap(err, "error creating core clientset") } pcStore, err := factory.NewFromCoreClientset(clientset) if err != nil { - return fmt.Errorf("unable to create provider components store: %v", err) + return errors.Wrap(err, "unable to create provider components store") } err = pcStore.Save(d.providerComponents) if err != nil { - return fmt.Errorf("error saving provider components: %v", err) + return errors.Wrap(err, "error saving provider components") } return nil } @@ -259,13 +259,13 @@ func (d *ClusterDeployer) saveProviderComponentsToCluster(factory ProviderCompon func (d *ClusterDeployer) applyClusterAPIComponentsWithPivoting(client, source clusterclient.Client, namespace string) error { klog.Info("Applying Cluster API Provider Components") if err := client.Apply(d.providerComponents); err != nil { - return fmt.Errorf("unable to apply cluster api controllers: %v", err) + return errors.Wrap(err, "unable to apply cluster api controllers") } klog.Info("Pivoting Cluster API objects from bootstrap to target cluster.") err := pivotNamespace(source, client, namespace) if err != nil { - return fmt.Errorf("unable to pivot cluster API objects: %v", err) + return errors.Wrap(err, "unable to pivot cluster API objects") } return nil @@ -298,11 +298,11 @@ func waitForKubeconfigReady(provider ProviderDeployer, cluster *clusterv1.Cluste func pivotNamespace(from, to clusterclient.Client, namespace string) error { if err := from.WaitForClusterV1alpha1Ready(); err != nil { - return fmt.Errorf("cluster v1alpha1 resource not ready on source cluster") + return errors.New("cluster v1alpha1 resource not ready on source cluster") } if err := to.WaitForClusterV1alpha1Ready(); err != nil { - return fmt.Errorf("cluster v1alpha1 resource not ready on target cluster") + return errors.New("cluster v1alpha1 resource not ready on target cluster") } clusters, err := from.GetClusterObjectsInNamespace(namespace) @@ -314,7 +314,7 @@ func pivotNamespace(from, to clusterclient.Client, namespace string) error { // New objects cannot have a specified resource version. Clear it out. cluster.SetResourceVersion("") if err = to.CreateClusterObject(cluster); err != nil { - return fmt.Errorf("error moving Cluster '%v': %v", cluster.GetName(), err) + return errors.Wrapf(err, "error moving Cluster %q", cluster.GetName()) } klog.Infof("Moved Cluster '%s'", cluster.GetName()) } @@ -327,7 +327,7 @@ func pivotNamespace(from, to clusterclient.Client, namespace string) error { // New objects cannot have a specified resource version. Clear it out. deployment.SetResourceVersion("") if err = to.CreateMachineDeploymentObjects([]*clusterv1.MachineDeployment{deployment}, namespace); err != nil { - return fmt.Errorf("error moving MachineDeployment '%v': %v", deployment.GetName(), err) + return errors.Wrapf(err, "error moving MachineDeployment %q", deployment.GetName()) } klog.Infof("Moved MachineDeployment %v", deployment.GetName()) } @@ -340,7 +340,7 @@ func pivotNamespace(from, to clusterclient.Client, namespace string) error { // New objects cannot have a specified resource version. Clear it out. machineSet.SetResourceVersion("") if err := to.CreateMachineSetObjects([]*clusterv1.MachineSet{machineSet}, namespace); err != nil { - return fmt.Errorf("error moving MachineSet '%v': %v", machineSet.GetName(), err) + return errors.Wrapf(err, "error moving MachineSet %q", machineSet.GetName()) } klog.Infof("Moved MachineSet %v", machineSet.GetName()) } @@ -354,7 +354,7 @@ func pivotNamespace(from, to clusterclient.Client, namespace string) error { // New objects cannot have a specified resource version. Clear it out. machine.SetResourceVersion("") if err = to.CreateMachineObjects([]*clusterv1.Machine{machine}, namespace); err != nil { - return fmt.Errorf("error moving Machine '%v': %v", machine.GetName(), err) + return errors.Wrapf(err, "error moving Machine %q", machine.GetName()) } klog.Infof("Moved Machine '%s'", machine.GetName()) } @@ -362,34 +362,34 @@ func pivotNamespace(from, to clusterclient.Client, namespace string) error { } func deleteObjectsInNamespace(client clusterclient.Client, namespace string) error { - var errors []string + var errorList []string klog.Infof("Deleting machine deployments in namespace %q", namespace) if err := client.DeleteMachineDeploymentObjectsInNamespace(namespace); err != nil { - err = fmt.Errorf("error deleting machine deployments: %v", err) - errors = append(errors, err.Error()) + err = errors.Wrap(err, "error deleting machine deployments") + errorList = append(errorList, err.Error()) } klog.Infof("Deleting machine sets in namespace %q", namespace) if err := client.DeleteMachineSetObjectsInNamespace(namespace); err != nil { - err = fmt.Errorf("error deleting machine sets: %v", err) - errors = append(errors, err.Error()) + err = errors.Wrap(err, "error deleting machine sets") + errorList = append(errorList, err.Error()) } klog.Infof("Deleting machines in namespace %q", namespace) if err := client.DeleteMachineObjectsInNamespace(namespace); err != nil { - err = fmt.Errorf("error deleting machines: %v", err) - errors = append(errors, err.Error()) + err = errors.Wrap(err, "error deleting machines") + errorList = append(errorList, err.Error()) } klog.Infof("Deleting clusters in namespace %q", namespace) if err := client.DeleteClusterObjectsInNamespace(namespace); err != nil { - err = fmt.Errorf("error deleting clusters: %v", err) - errors = append(errors, err.Error()) + err = errors.Wrap(err, "error deleting clusters") + errorList = append(errorList, err.Error()) } klog.Infof("Deleting namespace %q", namespace) if err := client.DeleteNamespace(namespace); err != nil { - err = fmt.Errorf("error deleting namespace: %v", err) - errors = append(errors, err.Error()) + err = errors.Wrap(err, "error deleting namespace") + errorList = append(errorList, err.Error()) } - if len(errors) > 0 { - return fmt.Errorf("error(s) encountered deleting objects from bootstrap cluster: [%v]", strings.Join(errors, ", ")) + if len(errorList) > 0 { + return errors.Errorf("error(s) encountered deleting objects from bootstrap cluster: [%v]", strings.Join(errorList, ", ")) } return nil } @@ -397,37 +397,37 @@ func deleteObjectsInNamespace(client clusterclient.Client, namespace string) err func getClusterAPIObject(client clusterclient.Client, clusterName, namespace string) (*clusterv1.Cluster, *clusterv1.Machine, []*clusterv1.Machine, error) { machines, err := client.GetMachineObjectsInNamespace(namespace) if err != nil { - return nil, nil, nil, fmt.Errorf("unable to fetch machines: %v", err) + return nil, nil, nil, errors.Wrap(err, "unable to fetch machines") } cluster, err := client.GetClusterObject(clusterName, namespace) if err != nil { - return nil, nil, nil, fmt.Errorf("unable to fetch cluster %v in namespace %v: %v", clusterName, namespace, err) + return nil, nil, nil, errors.Wrapf(err, "unable to fetch cluster %v in namespace %v", clusterName, namespace) } - master, nodes, err := extractMasterMachine(machines) + controlPlaneMachine, nodes, err := extractControlPlaneMachine(machines) if err != nil { - return nil, nil, nil, fmt.Errorf("unable to fetch master machine in cluster %v in namespace %v: %v", clusterName, namespace, err) + return nil, nil, nil, errors.Wrapf(err, "unable to fetch control plane machine in cluster %v in namespace %v", clusterName, namespace) } - return cluster, master, nodes, nil + return cluster, controlPlaneMachine, nodes, nil } -// extractMasterMachine separates the master (singular) from the incoming machines. -// This is currently done by looking at which machine specifies the control plane version -// (which implies that it is a master). This should be cleaned up in the future. -func extractMasterMachine(machines []*clusterv1.Machine) (*clusterv1.Machine, []*clusterv1.Machine, error) { +// extractControlPlaneMachine separates the machines running the control plane (singular) from the incoming machines. +// This is currently done by looking at which machine specifies the control plane version. +// TODO: Cleanup. +func extractControlPlaneMachine(machines []*clusterv1.Machine) (*clusterv1.Machine, []*clusterv1.Machine, error) { nodes := []*clusterv1.Machine{} - masters := []*clusterv1.Machine{} + controlPlaneMachines := []*clusterv1.Machine{} for _, machine := range machines { - if util.IsMaster(machine) { - masters = append(masters, machine) + if util.IsControlPlaneMachine(machine) { + controlPlaneMachines = append(controlPlaneMachines, machine) } else { nodes = append(nodes, machine) } } - if len(masters) != 1 { - return nil, nil, fmt.Errorf("expected one master, got: %v", len(masters)) + if len(controlPlaneMachines) != 1 { + return nil, nil, errors.Errorf("expected one control plane machine, got: %v", len(controlPlaneMachines)) } - return masters[0], nodes, nil + return controlPlaneMachines[0], nodes, nil } func closeClient(client clusterclient.Client, name string) { diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/providercomponentsstorefactory.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/providercomponentsstorefactory.go similarity index 92% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/providercomponentsstorefactory.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/providercomponentsstorefactory.go index ca3bccb97e..bd07586fa3 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/providercomponentsstorefactory.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/providercomponentsstorefactory.go @@ -17,8 +17,8 @@ limitations under the License. package clusterdeployer import ( + "github.com/openshift/cluster-api/cmd/clusterctl/providercomponents" "k8s.io/client-go/kubernetes" - "sigs.k8s.io/cluster-api/cmd/clusterctl/providercomponents" ) type factory struct { diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/BUILD.bazel similarity index 89% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/BUILD.bazel index 946d098a90..4bae503b9d 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/BUILD.bazel @@ -19,14 +19,12 @@ go_library( "validate.go", "validate_cluster.go", ], - importpath = "sigs.k8s.io/cluster-api/cmd/clusterctl/cmd", + importpath = "github.com/openshift/cluster-api/cmd/clusterctl/cmd", visibility = ["//visibility:public"], deps = [ "//cmd/clusterctl/clientcmd:go_default_library", "//cmd/clusterctl/clusterdeployer:go_default_library", "//cmd/clusterctl/clusterdeployer/bootstrap:go_default_library", - "//cmd/clusterctl/clusterdeployer/bootstrap/existing:go_default_library", - "//cmd/clusterctl/clusterdeployer/bootstrap/minikube:go_default_library", "//cmd/clusterctl/clusterdeployer/clusterclient:go_default_library", "//cmd/clusterctl/phases:go_default_library", "//cmd/clusterctl/providercomponents:go_default_library", @@ -34,6 +32,7 @@ go_library( "//pkg/apis:go_default_library", "//pkg/apis/cluster/common:go_default_library", "//pkg/util:go_default_library", + "//vendor/github.com/pkg/errors:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha.go diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_addons.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_addons.go similarity index 94% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_addons.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_addons.go index d4f7f1ed24..1bae521d56 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_addons.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_addons.go @@ -20,10 +20,10 @@ import ( "fmt" "io/ioutil" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" + "github.com/openshift/cluster-api/cmd/clusterctl/phases" "github.com/spf13/cobra" "k8s.io/klog" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" - "sigs.k8s.io/cluster-api/cmd/clusterctl/phases" ) type AlphaPhaseApplyAddonsOptions struct { diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_cluster.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_cluster.go similarity index 86% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_cluster.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_cluster.go index 4197ffc8e5..1189b2a0ec 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_cluster.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_cluster.go @@ -17,14 +17,14 @@ limitations under the License. package cmd import ( - "fmt" "io/ioutil" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" + "github.com/openshift/cluster-api/cmd/clusterctl/phases" + "github.com/openshift/cluster-api/pkg/util" + "github.com/pkg/errors" "github.com/spf13/cobra" "k8s.io/klog" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" - "sigs.k8s.io/cluster-api/cmd/clusterctl/phases" - "sigs.k8s.io/cluster-api/pkg/util" ) type AlphaPhaseApplyClusterOptions struct { @@ -67,11 +67,11 @@ func RunAlphaPhaseApplyCluster(paco *AlphaPhaseApplyClusterOptions) error { clientFactory := clusterclient.NewFactory() client, err := clientFactory.NewClientFromKubeconfig(string(kubeconfig)) if err != nil { - return fmt.Errorf("unable to create cluster client: %v", err) + return errors.Wrap(err, "unable to create cluster client") } if err := phases.ApplyCluster(client, cluster); err != nil { - return fmt.Errorf("unable to apply cluster: %v", err) + return errors.Wrap(err, "unable to apply cluster") } return nil diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_cluster_api_components.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_cluster_api_components.go similarity index 87% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_cluster_api_components.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_cluster_api_components.go index 9bd767afd4..d8f107ac57 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_cluster_api_components.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_cluster_api_components.go @@ -17,13 +17,13 @@ limitations under the License. package cmd import ( - "fmt" "io/ioutil" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" + "github.com/openshift/cluster-api/cmd/clusterctl/phases" + "github.com/pkg/errors" "github.com/spf13/cobra" "k8s.io/klog" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" - "sigs.k8s.io/cluster-api/cmd/clusterctl/phases" ) type AlphaPhaseApplyClusterAPIComponentsOptions struct { @@ -60,13 +60,13 @@ func RunAlphaPhaseApplyClusterAPIComponents(pacaso *AlphaPhaseApplyClusterAPICom pc, err := ioutil.ReadFile(pacaso.ProviderComponents) if err != nil { - return fmt.Errorf("error loading provider components file '%v': %v", pacaso.ProviderComponents, err) + return errors.Wrapf(err, "error loading provider components file %q", pacaso.ProviderComponents) } clientFactory := clusterclient.NewFactory() client, err := clientFactory.NewClientFromKubeconfig(string(kubeconfig)) if err != nil { - return fmt.Errorf("unable to create cluster client: %v", err) + return errors.Wrap(err, "unable to create cluster client") } return phases.ApplyClusterAPIComponents(client, string(pc)) diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_machines.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_machines.go similarity index 87% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_machines.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_machines.go index 4fd9d5d5c2..b597047021 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_machines.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_apply_machines.go @@ -17,14 +17,14 @@ limitations under the License. package cmd import ( - "fmt" "io/ioutil" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" + "github.com/openshift/cluster-api/cmd/clusterctl/phases" + "github.com/openshift/cluster-api/pkg/util" + "github.com/pkg/errors" "github.com/spf13/cobra" "k8s.io/klog" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" - "sigs.k8s.io/cluster-api/cmd/clusterctl/phases" - "sigs.k8s.io/cluster-api/pkg/util" ) type AlphaPhaseApplyMachinesOptions struct { @@ -68,11 +68,11 @@ func RunAlphaPhaseApplyMachines(pamo *AlphaPhaseApplyMachinesOptions) error { clientFactory := clusterclient.NewFactory() client, err := clientFactory.NewClientFromKubeconfig(string(kubeconfig)) if err != nil { - return fmt.Errorf("unable to create cluster client: %v", err) + return errors.Wrap(err, "unable to create cluster client") } if err := phases.ApplyMachines(client, pamo.Namespace, machines); err != nil { - return fmt.Errorf("unable to apply machines: %v", err) + return errors.Wrap(err, "unable to apply machines") } return nil diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_create_bootstrap_cluster.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_create_bootstrap_cluster.go similarity index 64% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_create_bootstrap_cluster.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_create_bootstrap_cluster.go index cd6346cde1..a48ee2dde4 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phase_create_bootstrap_cluster.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phase_create_bootstrap_cluster.go @@ -17,18 +17,17 @@ limitations under the License. package cmd import ( - "fmt" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" + "github.com/openshift/cluster-api/cmd/clusterctl/phases" + "github.com/pkg/errors" "github.com/spf13/cobra" "k8s.io/klog" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" - "sigs.k8s.io/cluster-api/cmd/clusterctl/phases" ) type AlphaPhaseCreateBootstrapClusterOptions struct { - MiniKube []string - VmDriver string + Bootstrap bootstrap.Options KubeconfigOutput string } @@ -46,15 +45,14 @@ var alphaPhaseCreateBootstrapClusterCmd = &cobra.Command{ } func RunAlphaPhaseCreateBootstrapCluster(pcbco *AlphaPhaseCreateBootstrapClusterOptions) error { - if pcbco.VmDriver != "" { - pcbco.MiniKube = append(pcbco.MiniKube, fmt.Sprintf("vm-driver=%s", pcbco.VmDriver)) + bootstrapProvider, err := bootstrap.Get(pcbco.Bootstrap) + if err != nil { + return err } - bootstrapProvider := minikube.WithOptionsAndKubeConfigPath(pcbco.MiniKube, pcbco.KubeconfigOutput) - - _, _, err := phases.CreateBootstrapCluster(bootstrapProvider, false, clusterclient.NewFactory()) + _, _, err = phases.CreateBootstrapCluster(bootstrapProvider, false, clusterclient.NewFactory()) if err != nil { - return fmt.Errorf("failed to create bootstrap cluster: %v", err) + return errors.Wrap(err, "failed to create bootstrap cluster") } klog.Infof("Created bootstrap cluster, path to kubeconfig: %q", pcbco.KubeconfigOutput) @@ -63,9 +61,7 @@ func RunAlphaPhaseCreateBootstrapCluster(pcbco *AlphaPhaseCreateBootstrapCluster func init() { // Optional flags - alphaPhaseCreateBootstrapClusterCmd.Flags().StringSliceVarP(&pcbco.MiniKube, "minikube", "", []string{}, "Minikube options") - alphaPhaseCreateBootstrapClusterCmd.Flags().StringVarP(&pcbco.VmDriver, "vm-driver", "", "", "Which vm driver to use for minikube") alphaPhaseCreateBootstrapClusterCmd.Flags().StringVarP(&pcbco.KubeconfigOutput, "kubeconfig-out", "", "minikube.kubeconfig", "Where to output the kubeconfig for the bootstrap cluster") - + pcbco.Bootstrap.AddFlags(alphaPhasesCmd.Flags()) alphaPhasesCmd.AddCommand(alphaPhaseCreateBootstrapClusterCmd) } diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phases.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phases.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/alpha_phases.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/alpha_phases.go diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/create.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/create.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/create.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/create.go diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/create_cluster.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/create_cluster.go similarity index 57% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/create_cluster.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/create_cluster.go index cecaa4a679..4cc86adb87 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/create_cluster.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/create_cluster.go @@ -17,31 +17,26 @@ limitations under the License. package cmd import ( - "fmt" "io/ioutil" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" + clustercommon "github.com/openshift/cluster-api/pkg/apis/cluster/common" + "github.com/openshift/cluster-api/pkg/util" + "github.com/pkg/errors" "github.com/spf13/cobra" "k8s.io/klog" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" - clustercommon "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" - "sigs.k8s.io/cluster-api/pkg/util" ) type CreateOptions struct { - Cluster string - Machine string - ProviderComponents string - AddonComponents string - CleanupBootstrapCluster bool - MiniKube []string - VmDriver string - Provider string - KubeconfigOutput string - ExistingClusterKubeconfigPath string + Cluster string + Machine string + ProviderComponents string + AddonComponents string + Provider string + KubeconfigOutput string + BootstrapFlags bootstrap.Options } var co = &CreateOptions{} @@ -76,19 +71,9 @@ func RunCreate(co *CreateOptions) error { return err } - var bootstrapProvider bootstrap.ClusterProvisioner - if co.ExistingClusterKubeconfigPath != "" { - bootstrapProvider, err = existing.NewExistingCluster(co.ExistingClusterKubeconfigPath) - if err != nil { - return err - } - } else { - if co.VmDriver != "" { - co.MiniKube = append(co.MiniKube, fmt.Sprintf("vm-driver=%s", co.VmDriver)) - } - - bootstrapProvider = minikube.WithOptions(co.MiniKube) - + bootstrapProvider, err := bootstrap.Get(co.BootstrapFlags) + if err != nil { + return err } pd, err := getProvider(co.Provider) @@ -97,41 +82,44 @@ func RunCreate(co *CreateOptions) error { } pc, err := ioutil.ReadFile(co.ProviderComponents) if err != nil { - return fmt.Errorf("error loading provider components file '%v': %v", co.ProviderComponents, err) + return errors.Wrapf(err, "error loading provider components file %q", co.ProviderComponents) } var ac []byte if co.AddonComponents != "" { ac, err = ioutil.ReadFile(co.AddonComponents) if err != nil { - return fmt.Errorf("error loading addons file '%v': %v", co.AddonComponents, err) + return errors.Wrapf(err, "error loading addons file %q", co.AddonComponents) } } pcsFactory := clusterdeployer.NewProviderComponentsStoreFactory() + d := clusterdeployer.New( bootstrapProvider, clusterclient.NewFactory(), string(pc), string(ac), - co.CleanupBootstrapCluster) + co.BootstrapFlags.Cleanup) + return d.Create(c, m, pd, co.KubeconfigOutput, pcsFactory) } func init() { // Required flags - createClusterCmd.Flags().StringVarP(&co.Cluster, "cluster", "c", "", "A yaml file containing cluster object definition") - createClusterCmd.Flags().StringVarP(&co.Machine, "machines", "m", "", "A yaml file containing machine object definition(s)") - createClusterCmd.Flags().StringVarP(&co.ProviderComponents, "provider-components", "p", "", "A yaml file containing cluster api provider controllers and supporting objects") + createClusterCmd.Flags().StringVarP(&co.Cluster, "cluster", "c", "", "A yaml file containing cluster object definition. Required.") + createClusterCmd.MarkFlagRequired("cluster") + createClusterCmd.Flags().StringVarP(&co.Machine, "machines", "m", "", "A yaml file containing machine object definition(s). Required.") + createClusterCmd.MarkFlagRequired("machines") + createClusterCmd.Flags().StringVarP(&co.ProviderComponents, "provider-components", "p", "", "A yaml file containing cluster api provider controllers and supporting objects. Required.") + createClusterCmd.MarkFlagRequired("provider-components") // TODO: Remove as soon as code allows https://github.com/kubernetes-sigs/cluster-api/issues/157 - createClusterCmd.Flags().StringVarP(&co.Provider, "provider", "", "", "Which provider deployment logic to use (google/vsphere/azure)") + createClusterCmd.Flags().StringVarP(&co.Provider, "provider", "", "", "Which provider deployment logic to use (google/vsphere/azure). Required.") + createClusterCmd.MarkFlagRequired("provider") // Optional flags createClusterCmd.Flags().StringVarP(&co.AddonComponents, "addon-components", "a", "", "A yaml file containing cluster addons to apply to the internal cluster") - createClusterCmd.Flags().BoolVarP(&co.CleanupBootstrapCluster, "cleanup-bootstrap-cluster", "", true, "Whether to cleanup the bootstrap cluster after bootstrap") - createClusterCmd.Flags().StringSliceVarP(&co.MiniKube, "minikube", "", []string{}, "Minikube options") - createClusterCmd.Flags().StringVarP(&co.VmDriver, "vm-driver", "", "", "Which vm driver to use for minikube") createClusterCmd.Flags().StringVarP(&co.KubeconfigOutput, "kubeconfig-out", "", "kubeconfig", "Where to output the kubeconfig for the provisioned cluster") - createClusterCmd.Flags().StringVarP(&co.ExistingClusterKubeconfigPath, "existing-bootstrap-cluster-kubeconfig", "e", "", "Path to an existing cluster's kubeconfig for bootstrapping (intead of using minikube)") + co.BootstrapFlags.AddFlags(createClusterCmd.Flags()) createCmd.AddCommand(createClusterCmd) } @@ -142,7 +130,7 @@ func getProvider(name string) (clusterdeployer.ProviderDeployer, error) { } provider, ok := provisioner.(clusterdeployer.ProviderDeployer) if !ok { - return nil, fmt.Errorf("provider for %s does not implement ProviderDeployer interface", name) + return nil, errors.Errorf("provider for %s does not implement ProviderDeployer interface", name) } return provider, nil } diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/delete.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/delete.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/delete.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/delete.go diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/delete_cluster.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/delete_cluster.go similarity index 59% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/delete_cluster.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/delete_cluster.go index 2435713c69..d96bc2777b 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/delete_cluster.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/delete_cluster.go @@ -17,31 +17,24 @@ limitations under the License. package cmd import ( - "fmt" - - "k8s.io/api/core/v1" - tcmd "k8s.io/client-go/tools/clientcmd" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/existing" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" - "sigs.k8s.io/cluster-api/cmd/clusterctl/providercomponents" - + "github.com/openshift/cluster-api/cmd/clusterctl/clientcmd" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" + "github.com/openshift/cluster-api/cmd/clusterctl/providercomponents" + "github.com/pkg/errors" "github.com/spf13/cobra" + v1 "k8s.io/api/core/v1" + tcmd "k8s.io/client-go/tools/clientcmd" "k8s.io/klog" ) type DeleteOptions struct { - KubeconfigPath string - ProviderComponents string - ClusterNamespace string - CleanupBootstrapCluster bool - MiniKube []string - VmDriver string - ExistingClusterKubeconfigPath string - KubeconfigOverrides tcmd.ConfigOverrides + KubeconfigPath string + ProviderComponents string + ClusterNamespace string + KubeconfigOverrides tcmd.ConfigOverrides + BootstrapFlags bootstrap.Options } var do = &DeleteOptions{} @@ -70,12 +63,11 @@ func init() { // Optional flags deleteClusterCmd.Flags().StringVarP(&do.ClusterNamespace, "cluster-namespace", "", v1.NamespaceDefault, "Namespace where the cluster to be deleted resides") - deleteClusterCmd.Flags().BoolVarP(&do.CleanupBootstrapCluster, "cleanup-bootstrap-cluster", "", true, "Whether to cleanup the bootstrap cluster after bootstrap") - deleteClusterCmd.Flags().StringSliceVarP(&do.MiniKube, "minikube", "", []string{}, "Minikube options") - deleteClusterCmd.Flags().StringVarP(&do.VmDriver, "vm-driver", "", "", "Which vm driver to use for minikube") - deleteClusterCmd.Flags().StringVarP(&do.ExistingClusterKubeconfigPath, "existing-bootstrap-cluster-kubeconfig", "e", "", "Path to an existing cluster's kubeconfig for bootstrapping (intead of using minikube)") + // BindContextFlags will bind the flags cluster, namespace, and user tcmd.BindContextFlags(&do.KubeconfigOverrides.Context, deleteClusterCmd.Flags(), tcmd.RecommendedContextOverrideFlags("")) + + do.BootstrapFlags.AddFlags(deleteClusterCmd.Flags()) deleteCmd.AddCommand(deleteClusterCmd) } @@ -86,22 +78,13 @@ func RunDelete() error { } clusterClient, err := clusterclient.NewFromDefaultSearchPath(do.KubeconfigPath, do.KubeconfigOverrides) if err != nil { - return fmt.Errorf("error when creating cluster client: %v", err) + return errors.Wrap(err, "error when creating cluster client") } defer clusterClient.Close() - var bootstrapProvider bootstrap.ClusterProvisioner - if do.ExistingClusterKubeconfigPath != "" { - bootstrapProvider, err = existing.NewExistingCluster(do.ExistingClusterKubeconfigPath) - if err != nil { - return err - } - } else { - if do.VmDriver != "" { - do.MiniKube = append(do.MiniKube, fmt.Sprintf("vm-driver=%s", do.VmDriver)) - } - - bootstrapProvider = minikube.WithOptions(do.MiniKube) + bootstrapProvider, err := bootstrap.Get(do.BootstrapFlags) + if err != nil { + return err } deployer := clusterdeployer.New( @@ -109,14 +92,15 @@ func RunDelete() error { clusterclient.NewFactory(), providerComponents, "", - do.CleanupBootstrapCluster) + do.BootstrapFlags.Cleanup) + return deployer.Delete(clusterClient, do.ClusterNamespace) } func loadProviderComponents() (string, error) { coreClients, err := clientcmd.NewCoreClientSetForDefaultSearchPath(do.KubeconfigPath, do.KubeconfigOverrides) if err != nil { - return "", fmt.Errorf("error creating core clients: %v", err) + return "", errors.Wrap(err, "error creating core clients") } pcStore := providercomponents.Store{ ExplicitPath: do.ProviderComponents, @@ -124,7 +108,7 @@ func loadProviderComponents() (string, error) { } providerComponents, err := pcStore.Load() if err != nil { - return "", fmt.Errorf("error when loading provider components: %v", err) + return "", errors.Wrap(err, "error when loading provider components") } return providerComponents, nil } diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/logutil.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/logutil.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/logutil.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/logutil.go diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/root.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/root.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/root.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/root.go diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/validate.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/validate.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/validate.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/validate.go diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/validate_cluster.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/validate_cluster.go similarity index 86% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/validate_cluster.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/validate_cluster.go index 06839f72e6..570769e154 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/cmd/validate_cluster.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/cmd/validate_cluster.go @@ -19,15 +19,15 @@ package cmd import ( "fmt" "os" - "sigs.k8s.io/cluster-api/pkg/apis" - "sigs.k8s.io/controller-runtime/pkg/manager" + "github.com/openshift/cluster-api/cmd/clusterctl/validation" + "github.com/openshift/cluster-api/pkg/apis" + "github.com/pkg/errors" "github.com/spf13/cobra" - tcmd "k8s.io/client-go/tools/clientcmd" - "sigs.k8s.io/cluster-api/cmd/clusterctl/validation" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/config" + "sigs.k8s.io/controller-runtime/pkg/manager" ) type ValidateClusterOptions struct { @@ -58,20 +58,20 @@ func init() { func RunValidateCluster() error { cfg, err := config.GetConfig() if err != nil { - return fmt.Errorf("failed to create client configuration: %v", err) + return errors.Wrap(err, "failed to create client configuration") } mgr, err := manager.New(cfg, manager.Options{}) if err != nil { - return fmt.Errorf("failed to create manager: %v", err) + return errors.Wrap(err, "failed to create manager") } // Setup Scheme for all resources if err := apis.AddToScheme(mgr.GetScheme()); err != nil { - return fmt.Errorf("failed to add APIs to manager: %v", err) + return errors.Wrap(err, "failed to add APIs to manager") } c, err := client.New(mgr.GetConfig(), client.Options{Scheme: mgr.GetScheme(), Mapper: mgr.GetRESTMapper()}) if err != nil { - return fmt.Errorf("failed to create client: %v", err) + return errors.Wrap(err, "failed to create client") } if err = validation.ValidateClusterAPIObjects(os.Stdout, c, vco.KubeconfigOverrides.Context.Cluster, vco.KubeconfigOverrides.Context.Namespace); err != nil { return err diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/main.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/main.go similarity index 91% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/main.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/main.go index fccad5e92b..f875d46ffb 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/main.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/main.go @@ -16,7 +16,7 @@ limitations under the License. package main -import "sigs.k8s.io/cluster-api/cmd/clusterctl/cmd" +import "github.com/openshift/cluster-api/cmd/clusterctl/cmd" func main() { cmd.Execute() diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/BUILD.bazel similarity index 81% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/BUILD.bazel index accc177fc5..35d0e612f6 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/BUILD.bazel @@ -9,12 +9,13 @@ go_library( "applymachines.go", "createbootstrapcluster.go", ], - importpath = "sigs.k8s.io/cluster-api/cmd/clusterctl/phases", + importpath = "github.com/openshift/cluster-api/cmd/clusterctl/phases", visibility = ["//visibility:public"], deps = [ "//cmd/clusterctl/clusterdeployer/bootstrap:go_default_library", "//cmd/clusterctl/clusterdeployer/clusterclient:go_default_library", "//pkg/apis/cluster/v1alpha1:go_default_library", + "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/klog:go_default_library", ], ) diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/applyaddons.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/applyaddons.go similarity index 90% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/applyaddons.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/applyaddons.go index dec8422d29..5141f4966b 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/applyaddons.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/applyaddons.go @@ -17,8 +17,8 @@ limitations under the License. package phases import ( + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" "k8s.io/klog" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" ) func ApplyAddons(client clusterclient.Client, addons string) error { diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/applycluster.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/applycluster.go similarity index 80% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/applycluster.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/applycluster.go index 7c46a03ced..5a5dfd9a2f 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/applycluster.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/applycluster.go @@ -17,11 +17,10 @@ limitations under the License. package phases import ( - "fmt" - + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + "github.com/pkg/errors" "k8s.io/klog" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) func ApplyCluster(client clusterclient.Client, cluster *clusterv1.Cluster) error { @@ -31,7 +30,7 @@ func ApplyCluster(client clusterclient.Client, cluster *clusterv1.Cluster) error err := client.EnsureNamespace(cluster.Namespace) if err != nil { - return fmt.Errorf("unable to ensure namespace %q: %v", cluster.Namespace, err) + return errors.Wrapf(err, "unable to ensure namespace %q", cluster.Namespace) } klog.Infof("Creating cluster object %v in namespace %q", cluster.Name, cluster.Namespace) diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/applyclusterapicomponents.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/applyclusterapicomponents.go similarity index 83% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/applyclusterapicomponents.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/applyclusterapicomponents.go index e5e0e01bec..2e44dbbe1e 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/applyclusterapicomponents.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/applyclusterapicomponents.go @@ -17,16 +17,15 @@ limitations under the License. package phases import ( - "fmt" - + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" + "github.com/pkg/errors" "k8s.io/klog" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" ) func ApplyClusterAPIComponents(client clusterclient.Client, providerComponents string) error { klog.Info("Applying Cluster API Provider Components") if err := client.Apply(providerComponents); err != nil { - return fmt.Errorf("unable to apply cluster api controllers: %v", err) + return errors.Wrap(err, "unable to apply cluster api controllers") } return client.WaitForClusterV1alpha1Ready() diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/applymachines.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/applymachines.go similarity index 80% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/applymachines.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/applymachines.go index 232c8db784..de96972b26 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/applymachines.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/applymachines.go @@ -17,11 +17,10 @@ limitations under the License. package phases import ( - "fmt" - + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + "github.com/pkg/errors" "k8s.io/klog" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) func ApplyMachines(client clusterclient.Client, namespace string, machines []*clusterv1.Machine) error { @@ -31,7 +30,7 @@ func ApplyMachines(client clusterclient.Client, namespace string, machines []*cl err := client.EnsureNamespace(namespace) if err != nil { - return fmt.Errorf("unable to ensure namespace %q: %v", namespace, err) + return errors.Wrapf(err, "unable to ensure namespace %q", namespace) } klog.Infof("Creating machines in namespace %q", namespace) diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go similarity index 74% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go index 4a3fefa63c..766da316cc 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/phases/createbootstrapcluster.go @@ -17,11 +17,10 @@ limitations under the License. package phases import ( - "fmt" - + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap" + "github.com/openshift/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" + "github.com/pkg/errors" "k8s.io/klog" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap" - "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" ) func CreateBootstrapCluster(provisioner bootstrap.ClusterProvisioner, cleanupBootstrapCluster bool, clientFactory clusterclient.Factory) (clusterclient.Client, func(), error) { @@ -29,7 +28,7 @@ func CreateBootstrapCluster(provisioner bootstrap.ClusterProvisioner, cleanupBoo cleanupFn := func() {} if err := provisioner.Create(); err != nil { - return nil, cleanupFn, fmt.Errorf("could not create bootstrap control plane: %v", err) + return nil, cleanupFn, errors.Wrap(err, "could not create bootstrap control plane") } if cleanupBootstrapCluster { @@ -41,11 +40,11 @@ func CreateBootstrapCluster(provisioner bootstrap.ClusterProvisioner, cleanupBoo bootstrapKubeconfig, err := provisioner.GetKubeconfig() if err != nil { - return nil, cleanupFn, fmt.Errorf("unable to get bootstrap cluster kubeconfig: %v", err) + return nil, cleanupFn, errors.Wrap(err, "unable to get bootstrap cluster kubeconfig") } bootstrapClient, err := clientFactory.NewClientFromKubeconfig(bootstrapKubeconfig) if err != nil { - return nil, cleanupFn, fmt.Errorf("unable to create bootstrap client: %v", err) + return nil, cleanupFn, errors.Wrap(err, "unable to create bootstrap client") } return bootstrapClient, cleanupFn, nil diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/providercomponents/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/providercomponents/BUILD.bazel similarity index 84% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/providercomponents/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/providercomponents/BUILD.bazel index 6583bd1c48..5da8a70c4d 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/providercomponents/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/providercomponents/BUILD.bazel @@ -3,9 +3,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["providercomponents.go"], - importpath = "sigs.k8s.io/cluster-api/cmd/clusterctl/providercomponents", + importpath = "github.com/openshift/cluster-api/cmd/clusterctl/providercomponents", visibility = ["//visibility:public"], deps = [ + "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", @@ -20,6 +21,7 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/apis/cluster/v1alpha1:go_default_library", + "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/providercomponents/providercomponents.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/providercomponents/providercomponents.go similarity index 78% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/providercomponents/providercomponents.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/providercomponents/providercomponents.go index 75e5044e30..0b28bf6e26 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/providercomponents/providercomponents.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/providercomponents/providercomponents.go @@ -17,13 +17,14 @@ limitations under the License. package providercomponents import ( - "fmt" "io/ioutil" + + "github.com/pkg/errors" core "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" + apierrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" - "k8s.io/client-go/kubernetes/typed/core/v1" + v1 "k8s.io/client-go/kubernetes/typed/core/v1" ) const ( @@ -66,21 +67,21 @@ func (pc *Store) Load() (string, error) { func (pc *Store) loadFromFile() (string, error) { bytes, err := ioutil.ReadFile(pc.ExplicitPath) if err != nil { - return "", fmt.Errorf("error when loading provider components from '%v': %v", pc.ExplicitPath, err) + return "", errors.Wrapf(err, "error when loading provider components from %q", pc.ExplicitPath) } return string(bytes), nil } func (pc *Store) saveToConfigMap(providerComponents string) error { configMap, err := pc.ConfigMap.Get(configMapName, meta.GetOptions{}) - if errors.IsNotFound(err) { + if apierrors.IsNotFound(err) { configMap = &core.ConfigMap{ ObjectMeta: meta.ObjectMeta{ Name: configMapName, }, } } else if err != nil { - return fmt.Errorf("unable to get configmap '%v': %v", configMapName, err) + return errors.Wrapf(err, "unable to get configmap %q", configMapName) } if configMap.Data == nil { configMap.Data = make(map[string]string) @@ -89,12 +90,12 @@ func (pc *Store) saveToConfigMap(providerComponents string) error { if err == nil { _, err = pc.ConfigMap.Update(configMap) if err != nil { - return fmt.Errorf("error updating config map '%v': %v", configMapName, err) + return errors.Wrapf(err, "error updating config map %q", configMapName) } } else { _, err = pc.ConfigMap.Create(configMap) if err != nil { - return fmt.Errorf("error creating config map '%v': %v", configMapName, err) + return errors.Wrapf(err, "error creating config map %q", configMapName) } } return nil @@ -102,15 +103,15 @@ func (pc *Store) saveToConfigMap(providerComponents string) error { func (pc *Store) loadFromConfigMap() (string, error) { if pc.ConfigMap == nil { - return "", fmt.Errorf("unable to load config map: need a valid ConfigMapInterface") + return "", errors.New("unable to load config map: need a valid ConfigMapInterface") } configMap, err := pc.ConfigMap.Get(configMapName, meta.GetOptions{}) if err != nil { - return "", fmt.Errorf("error getting configmap named '%v': %v", configMapName, err) + return "", errors.Wrapf(err, "error getting configmap named %q", configMapName) } providerComponents, ok := configMap.Data[configMapProviderComponentsKey] if !ok { - return "", fmt.Errorf("configmap '%v' does not contain the provider components key '%v'", configMapName, configMapProviderComponentsKey) + return "", errors.Errorf("configmap %q does not contain the provider components key %q", configMapName, configMapProviderComponentsKey) } return providerComponents, nil } diff --git a/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden new file mode 100644 index 0000000000..c52acce044 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden @@ -0,0 +1,30 @@ +Error: unknown flag: --invalid-flag +Usage: + clusterctl create cluster [flags] + +Flags: + -a, --addon-components string A yaml file containing cluster addons to apply to the internal cluster + --bootstrap-cluster-cleanup Whether to cleanup the bootstrap cluster after bootstrap. (default true) + -e, --bootstrap-cluster-kubeconfig string Sets the bootstrap cluster to be an existing Kubernetes cluster. + --bootstrap-flags strings Command line flags to be passed to the chosen bootstrapper + --bootstrap-type string The cluster bootstrapper to use. (default "none") + -c, --cluster string A yaml file containing cluster object definition. Required. + -h, --help help for cluster + --kubeconfig-out string Where to output the kubeconfig for the provisioned cluster (default "kubeconfig") + -m, --machines string A yaml file containing machine object definition(s). Required. + --provider string Which provider deployment logic to use (google/vsphere/azure). Required. + -p, --provider-components string A yaml file containing cluster api provider controllers and supporting objects. Required. + +Global Flags: + --alsologtostderr log to standard error as well as files + --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files (default true) + --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging + +unknown flag: --invalid-flag diff --git a/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden new file mode 100644 index 0000000000..a9ec3422ba --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden @@ -0,0 +1,30 @@ +Error: required flag(s) "cluster", "machines", "provider", "provider-components" not set +Usage: + clusterctl create cluster [flags] + +Flags: + -a, --addon-components string A yaml file containing cluster addons to apply to the internal cluster + --bootstrap-cluster-cleanup Whether to cleanup the bootstrap cluster after bootstrap. (default true) + -e, --bootstrap-cluster-kubeconfig string Sets the bootstrap cluster to be an existing Kubernetes cluster. + --bootstrap-flags strings Command line flags to be passed to the chosen bootstrapper + --bootstrap-type string The cluster bootstrapper to use. (default "none") + -c, --cluster string A yaml file containing cluster object definition. Required. + -h, --help help for cluster + --kubeconfig-out string Where to output the kubeconfig for the provisioned cluster (default "kubeconfig") + -m, --machines string A yaml file containing machine object definition(s). Required. + --provider string Which provider deployment logic to use (google/vsphere/azure). Required. + -p, --provider-components string A yaml file containing cluster api provider controllers and supporting objects. Required. + +Global Flags: + --alsologtostderr log to standard error as well as files + --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files (default true) + --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging + +required flag(s) "cluster", "machines", "provider", "provider-components" not set diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args-invalid-flag.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/create-no-args-invalid-flag.golden similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args-invalid-flag.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/create-no-args-invalid-flag.golden diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/create-no-args.golden similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-no-args.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/create-no-args.golden diff --git a/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden new file mode 100644 index 0000000000..7b648f6abd --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden @@ -0,0 +1,29 @@ +Error: unknown flag: --invalid-flag +Usage: + clusterctl delete cluster [flags] + +Flags: + --bootstrap-cluster-cleanup Whether to cleanup the bootstrap cluster after bootstrap. (default true) + -e, --bootstrap-cluster-kubeconfig string Sets the bootstrap cluster to be an existing Kubernetes cluster. + --bootstrap-flags strings Command line flags to be passed to the chosen bootstrapper + --bootstrap-type string The cluster bootstrapper to use. (default "none") + --cluster string The name of the kubeconfig cluster to use + --cluster-namespace string Namespace where the cluster to be deleted resides (default "default") + -h, --help help for cluster + -n, --namespace string If present, the namespace scope for this CLI request + -p, --provider-components string A yaml file containing cluster api provider controllers and supporting objects, if empty the value is loaded from the cluster's configuration store. + --user string The name of the kubeconfig user to use + +Global Flags: + --alsologtostderr log to standard error as well as files + --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. + --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files (default true) + --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging + +unknown flag: --invalid-flag diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden similarity index 50% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden index e672c5647c..17f3f30bb4 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args.golden @@ -5,16 +5,16 @@ Usage: clusterctl delete cluster [flags] Flags: - --cleanup-bootstrap-cluster Whether to cleanup the bootstrap cluster after bootstrap (default true) - --cluster string The name of the kubeconfig cluster to use - --cluster-namespace string Namespace where the cluster to be deleted resides (default "default") - -e, --existing-bootstrap-cluster-kubeconfig string Path to an existing cluster's kubeconfig for bootstrapping (intead of using minikube) - -h, --help help for cluster - --minikube strings Minikube options - -n, --namespace string If present, the namespace scope for this CLI request - -p, --provider-components string A yaml file containing cluster api provider controllers and supporting objects, if empty the value is loaded from the cluster's configuration store. - --user string The name of the kubeconfig user to use - --vm-driver string Which vm driver to use for minikube + --bootstrap-cluster-cleanup Whether to cleanup the bootstrap cluster after bootstrap. (default true) + -e, --bootstrap-cluster-kubeconfig string Sets the bootstrap cluster to be an existing Kubernetes cluster. + --bootstrap-flags strings Command line flags to be passed to the chosen bootstrapper + --bootstrap-type string The cluster bootstrapper to use. (default "none") + --cluster string The name of the kubeconfig cluster to use + --cluster-namespace string Namespace where the cluster to be deleted resides (default "default") + -h, --help help for cluster + -n, --namespace string If present, the namespace scope for this CLI request + -p, --provider-components string A yaml file containing cluster api provider controllers and supporting objects, if empty the value is loaded from the cluster's configuration store. + --user string The name of the kubeconfig user to use Global Flags: --alsologtostderr log to standard error as well as files diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args-invalid-flag.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/delete-no-args-invalid-flag.golden similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args-invalid-flag.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/delete-no-args-invalid-flag.golden diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/delete-no-args.golden similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-no-args.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/delete-no-args.golden diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args-invalid-flag.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/no-args-invalid-flag.golden similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args-invalid-flag.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/no-args-invalid-flag.golden diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/no-args.golden similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/no-args.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/no-args.golden diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-cluster-no-args-invalid-flag.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/validate-cluster-no-args-invalid-flag.golden similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-cluster-no-args-invalid-flag.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/validate-cluster-no-args-invalid-flag.golden diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args-invalid-flag.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/validate-no-args-invalid-flag.golden similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args-invalid-flag.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/validate-no-args-invalid-flag.golden diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/validate-no-args.golden similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/validate-no-args.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/testdata/validate-no-args.golden diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/BUILD.bazel similarity index 92% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/BUILD.bazel index d5c9fb500c..37fdb4f3d8 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/BUILD.bazel @@ -3,13 +3,13 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["validate_cluster_api_objects.go"], - importpath = "sigs.k8s.io/cluster-api/cmd/clusterctl/validation", + importpath = "github.com/openshift/cluster-api/cmd/clusterctl/validation", visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/common:go_default_library", "//pkg/apis/cluster/v1alpha1:go_default_library", "//pkg/controller/noderefutil:go_default_library", - "//vendor/golang.org/x/net/context:go_default_library", + "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/client:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-cluster-object.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-cluster-object.golden similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-cluster-object.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-cluster-object.golden diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-machine-objects-with-errors.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-machine-objects-with-errors.golden similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-machine-objects-with-errors.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-machine-objects-with-errors.golden diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-machine-objects-with-noderef-errors.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-machine-objects-with-noderef-errors.golden similarity index 68% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-machine-objects-with-noderef-errors.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-machine-objects-with-noderef-errors.golden index b1c314b6d7..730fe227bd 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-machine-objects-with-noderef-errors.golden +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/testdata/fail-to-validate-machine-objects-with-noderef-errors.golden @@ -1,6 +1,6 @@ Validating Cluster API objects in namespace "validate-machine-objects-node-ref-errors" Checking cluster object "test-cluster"... PASS Checking machine object "test-machine1"... FAIL - The corresponding node "test-node-not-ready" is not ready. + the corresponding node "test-node-not-ready" is not ready Checking machine object "test-machine2"... FAIL - The corresponding node "test-node-not-exist" is not found: nodes "test-node-not-exist" not found + the corresponding node "test-node-not-exist" is not found: nodes "test-node-not-exist" not found diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/testdata/validate-cluster-api-object-output-pass.golden b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/testdata/validate-cluster-api-object-output-pass.golden similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/testdata/validate-cluster-api-object-output-pass.golden rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/testdata/validate-cluster-api-object-output-pass.golden diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/validate_cluster_api_objects.go b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/validate_cluster_api_objects.go similarity index 78% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/validate_cluster_api_objects.go rename to vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/validate_cluster_api_objects.go index 3ccf41fc77..a93c759537 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/validation/validate_cluster_api_objects.go +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/validation/validate_cluster_api_objects.go @@ -17,17 +17,17 @@ limitations under the License. package validation import ( + "context" "fmt" "io" - "golang.org/x/net/context" - + "github.com/openshift/cluster-api/pkg/apis/cluster/common" + "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + "github.com/openshift/cluster-api/pkg/controller/noderefutil" + "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/controller/noderefutil" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -44,7 +44,7 @@ func ValidateClusterAPIObjects(w io.Writer, c client.Client, clusterName string, machines := &clusterv1alpha1.MachineList{} if err := c.List(context.TODO(), client.InNamespace(namespace), machines); err != nil { - return fmt.Errorf("failed to get the machines from the apiserver in namespace %q: %v", namespace, err) + return errors.Wrapf(err, "failed to get the machines from the apiserver in namespace %q", namespace) } return validateMachineObjects(w, machines, c) @@ -59,13 +59,13 @@ func getClusterObject(c client.Client, clusterName string, namespace string) (*v clusters := &clusterv1alpha1.ClusterList{} if err := c.List(context.TODO(), &client.ListOptions{Namespace: namespace}, clusters); err != nil { - return nil, fmt.Errorf("failed to get the clusters from the apiserver in namespace %q: %v", namespace, err) + return nil, errors.Wrapf(err, "failed to get the clusters from the apiserver in namespace %q", namespace) } if numOfClusters := len(clusters.Items); numOfClusters == 0 { - return nil, fmt.Errorf("fail: No cluster exists in namespace %q.", namespace) + return nil, errors.Errorf("fail: No cluster exists in namespace %q", namespace) } else if numOfClusters > 1 { - return nil, fmt.Errorf("fail: There is more than one cluster in namespace %q. Please specify --cluster-name.", namespace) + return nil, errors.Errorf("fail: There is more than one cluster in namespace %q. Please specify --cluster-name", namespace) } return &clusters.Items[0], nil } @@ -75,7 +75,7 @@ func validateClusterObject(w io.Writer, cluster *v1alpha1.Cluster) error { if cluster.Status.ErrorReason != "" || cluster.Status.ErrorMessage != "" { fmt.Fprintf(w, "FAIL\n") fmt.Fprintf(w, "\t[%v]: %s\n", cluster.Status.ErrorReason, cluster.Status.ErrorMessage) - return fmt.Errorf("Cluster %q failed the validation.", cluster.Name) + return errors.Errorf("cluster %q failed the validation", cluster.Name) } fmt.Fprintf(w, "PASS\n") return nil @@ -89,7 +89,7 @@ func validateMachineObjects(w io.Writer, machines *v1alpha1.MachineList, client } } if !pass { - return fmt.Errorf("Machine objects failed the validation.") + return errors.Errorf("machine objects failed the validation") } return nil } @@ -126,10 +126,10 @@ func validateMachineObject(w io.Writer, machine v1alpha1.Machine, client client. func validateReferredNode(nodeName string, client client.Client) error { node := &corev1.Node{} if err := client.Get(context.TODO(), types.NamespacedName{Name: nodeName}, node); err != nil { - return fmt.Errorf("The corresponding node %q is not found: %v", nodeName, err) + return errors.Wrapf(err, "the corresponding node %q is not found", nodeName) } if !noderefutil.IsNodeReady(node) { - return fmt.Errorf("The corresponding node %q is not ready.", nodeName) + return errors.Errorf("the corresponding node %q is not ready", nodeName) } return nil } diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/manager/BUILD.bazel b/vendor/github.com/openshift/cluster-api/cmd/manager/BUILD.bazel similarity index 86% rename from vendor/sigs.k8s.io/cluster-api/cmd/manager/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/cmd/manager/BUILD.bazel index dbc53953f8..f8784022b4 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/manager/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/cmd/manager/BUILD.bazel @@ -3,12 +3,13 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") go_library( name = "go_default_library", srcs = ["main.go"], - importpath = "sigs.k8s.io/cluster-api/cmd/manager", + importpath = "github.com/openshift/cluster-api/cmd/manager", visibility = ["//visibility:private"], deps = [ "//pkg/apis:go_default_library", "//pkg/controller:go_default_library", "//vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp:go_default_library", + "//vendor/k8s.io/klog:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/client/config:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/manager:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/runtime/signals:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go b/vendor/github.com/openshift/cluster-api/cmd/manager/main.go similarity index 94% rename from vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go rename to vendor/github.com/openshift/cluster-api/cmd/manager/main.go index 6082803af6..9faed58fe9 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/manager/main.go +++ b/vendor/github.com/openshift/cluster-api/cmd/manager/main.go @@ -17,14 +17,13 @@ limitations under the License. package main import ( - "log" - "flag" + "log" + "github.com/openshift/cluster-api/pkg/apis" + "github.com/openshift/cluster-api/pkg/controller" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "k8s.io/klog" - "sigs.k8s.io/cluster-api/pkg/apis" - "sigs.k8s.io/cluster-api/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/runtime/signals" diff --git a/vendor/sigs.k8s.io/cluster-api/code-of-conduct.md b/vendor/github.com/openshift/cluster-api/code-of-conduct.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/code-of-conduct.md rename to vendor/github.com/openshift/cluster-api/code-of-conduct.md diff --git a/vendor/sigs.k8s.io/cluster-api/config/BUILD.bazel b/vendor/github.com/openshift/cluster-api/config/BUILD.bazel similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/config/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/config/BUILD.bazel diff --git a/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_cluster.yaml b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_cluster.yaml new file mode 100644 index 0000000000..28df239479 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_cluster.yaml @@ -0,0 +1,134 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: clusters.cluster.k8s.io +spec: + group: cluster.k8s.io + names: + kind: Cluster + plural: clusters + scope: Namespaced + subresources: + status: {} + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + clusterNetwork: + description: Cluster network configuration + properties: + pods: + description: The network ranges from which Pod networks are allocated. + properties: + cidrBlocks: + items: + type: string + type: array + required: + - cidrBlocks + type: object + serviceDomain: + description: Domain name for services. + type: string + services: + description: The network ranges from which service VIPs are allocated. + properties: + cidrBlocks: + items: + type: string + type: array + required: + - cidrBlocks + type: object + required: + - services + - pods + - serviceDomain + type: object + providerSpec: + description: 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. + properties: + value: + description: Value is an inlined, serialized representation of the + resource configuration. It is recommended that providers maintain + their own versioned API types that should be serialized/deserialized + from this field, akin to component config. + type: object + valueFrom: + description: Source for the provider configuration. Cannot be used + if value is not empty. + properties: + machineClass: + description: The machine class from which the provider config + should be sourced. + properties: + provider: + description: Provider is the name of the cloud-provider + which MachineClass is intended for. + type: string + type: object + type: object + type: object + required: + - clusterNetwork + type: object + status: + properties: + apiEndpoints: + description: APIEndpoint represents the endpoint to communicate with + the IP. + items: + properties: + host: + description: The hostname on which the API server is serving. + type: string + port: + description: The port on which the API server is serving. + format: int64 + type: integer + required: + - host + - port + type: object + type: array + errorMessage: + description: If set, indicates that there is a problem reconciling the + state, and will be set to a descriptive error message. + type: string + errorReason: + description: If set, indicates that there is a problem reconciling the + state, and will be set to a token value suitable for programmatic + interpretation. + type: string + providerStatus: + description: Provider-specific status. It is recommended that providers + maintain their own versioned API types that should be serialized/deserialized + from this field. + type: object + type: object + version: v1alpha1 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machine.yaml b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machine.yaml new file mode 100644 index 0000000000..f24e69f338 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machine.yaml @@ -0,0 +1,218 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: machines.cluster.k8s.io +spec: + group: cluster.k8s.io + names: + kind: Machine + plural: machines + scope: Namespaced + subresources: + status: {} + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + configSource: + description: ConfigSource is used to populate in the associated Node + for dynamic kubelet config. This field already exists in Node, so + any updates to it in the Machine spec will be automatically copied + to the linked NodeRef from the status. The rest of dynamic kubelet + config support should then work as-is. + type: object + metadata: + description: ObjectMeta will autopopulate the Node created. Use this + to indicate what labels, annotations, name prefix, etc., should be + used when creating the Node. + type: object + providerSpec: + description: ProviderSpec details Provider-specific configuration to + use during node creation. + properties: + value: + description: Value is an inlined, serialized representation of the + resource configuration. It is recommended that providers maintain + their own versioned API types that should be serialized/deserialized + from this field, akin to component config. + type: object + valueFrom: + description: Source for the provider configuration. Cannot be used + if value is not empty. + properties: + machineClass: + description: The machine class from which the provider config + should be sourced. + properties: + provider: + description: Provider is the name of the cloud-provider + which MachineClass is intended for. + type: string + type: object + type: object + type: object + taints: + description: Taints is the full, authoritative list of taints to apply + to the corresponding Node. This list will overwrite any modifications + made to the Node on an ongoing basis. + items: + type: object + type: array + versions: + description: Versions of key software to use. This field is optional + at cluster creation time, and omitting the field indicates that the + cluster installation tool should select defaults for the user. These + defaults may differ based on the cluster installer, but the tool should + populate the values it uses when persisting Machine objects. A Machine + spec missing this field at runtime is invalid. + properties: + controlPlane: + description: ControlPlane is the semantic version of the Kubernetes + control plane to run. This should only be populated when the machine + is a control plane. + type: string + kubelet: + description: Kubelet is the semantic version of kubelet to run + type: string + required: + - kubelet + type: object + required: + - providerSpec + type: object + status: + properties: + addresses: + description: Addresses is a list of addresses assigned to the machine. + Queried from cloud provider, if available. + items: + type: object + type: array + conditions: + description: 'Conditions lists the conditions synced from the node conditions + of the corresponding node-object. Machine-controller is responsible + for keeping conditions up-to-date. MachineSet controller will be taking + these conditions as a signal to decide if machine is healthy or needs + to be replaced. Refer: https://kubernetes.io/docs/concepts/architecture/nodes/#condition' + items: + type: object + type: array + errorMessage: + description: ErrorMessage will be set in the event that there is a terminal + problem reconciling the Machine and will contain a more verbose string + suitable for logging and human consumption. This field should not + be set for transitive errors that a controller faces that are expected + to be fixed automatically over time (like service outages), but instead + indicate that something is fundamentally wrong with the Machine's + spec or the configuration of the controller, and that manual intervention + is required. Examples of terminal errors would be invalid combinations + of settings in the spec, values that are unsupported by the controller, + or the responsible controller itself being critically misconfigured. Any + transient errors that occur during the reconciliation of Machines + can be added as events to the Machine object and/or logged in the + controller's output. + type: string + errorReason: + description: ErrorReason will be set in the event that there is a terminal + problem reconciling the Machine and will contain a succinct value + suitable for machine interpretation. This field should not be set + for transitive errors that a controller faces that are expected to + be fixed automatically over time (like service outages), but instead + indicate that something is fundamentally wrong with the Machine's + spec or the configuration of the controller, and that manual intervention + is required. Examples of terminal errors would be invalid combinations + of settings in the spec, values that are unsupported by the controller, + or the responsible controller itself being critically misconfigured. Any + transient errors that occur during the reconciliation of Machines + can be added as events to the Machine object and/or logged in the + controller's output. + type: string + lastOperation: + description: LastOperation describes the last-operation performed by + the machine-controller. This API should be useful as a history in + terms of the latest operation performed on the specific machine. It + should also convey the state of the latest-operation for example if + it is still on-going, failed or completed successfully. + properties: + description: + description: Description is the human-readable description of the + last operation. + type: string + lastUpdated: + description: LastUpdated is the timestamp at which LastOperation + API was last-updated. + format: date-time + type: string + state: + description: State is the current status of the last performed operation. + E.g. Processing, Failed, Successful etc + type: string + type: + description: Type is the type of operation which was last performed. + E.g. Create, Delete, Update etc + type: string + type: object + lastUpdated: + description: LastUpdated identifies when this status was last observed. + format: date-time + type: string + nodeRef: + description: NodeRef will point to the corresponding Node if it exists. + type: object + phase: + description: Phase represents the current phase of machine actuation. + E.g. Pending, Running, Terminating, Failed etc. + type: string + providerStatus: + description: ProviderStatus details a Provider-specific status. It is + recommended that providers maintain their own versioned API types + that should be serialized/deserialized from this field. + type: object + versions: + description: 'Versions specifies the current versions of software on + the corresponding Node (if it exists). This is provided for a few + reasons: 1) It is more convenient than checking the NodeRef, traversing + it to the Node, and finding the appropriate field in Node.Status.NodeInfo (which + uses different field names and formatting). 2) It removes some of + the dependency on the structure of the Node, so that if the structure + of Node.Status.NodeInfo changes, only machine controllers need + to be updated, rather than every client of the Machines API. 3) + There is no other simple way to check the control plane version. + A client would have to connect directly to the apiserver running + on the target node in order to find out its version.' + properties: + controlPlane: + description: ControlPlane is the semantic version of the Kubernetes + control plane to run. This should only be populated when the machine + is a control plane. + type: string + kubelet: + description: Kubelet is the semantic version of kubelet to run + type: string + required: + - kubelet + type: object + type: object + version: v1alpha1 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machineclass.yaml b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machineclass.yaml new file mode 100644 index 0000000000..149b5ab36a --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machineclass.yaml @@ -0,0 +1,40 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: machineclasses.cluster.k8s.io +spec: + group: cluster.k8s.io + names: + kind: MachineClass + plural: machineclasses + scope: Namespaced + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + providerSpec: + description: Provider-specific configuration to use during node creation. + type: object + required: + - providerSpec + version: v1alpha1 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml new file mode 100644 index 0000000000..40bbc3036c --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml @@ -0,0 +1,241 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: machinedeployments.cluster.k8s.io +spec: + group: cluster.k8s.io + names: + kind: MachineDeployment + plural: machinedeployments + scope: Namespaced + subresources: + scale: + labelSelectorPath: .status.labelSelector + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + minReadySeconds: + description: Minimum number of seconds for which a newly created machine + should be ready. Defaults to 0 (machine will be considered available + as soon as it is ready) + format: int32 + type: integer + paused: + description: Indicates that the deployment is paused. + type: boolean + progressDeadlineSeconds: + description: The maximum time in seconds for a deployment to make progress + before it is considered to be failed. The deployment controller will + continue to process failed deployments and a condition with a ProgressDeadlineExceeded + reason will be surfaced in the deployment status. Note that progress + will not be estimated during the time a deployment is paused. Defaults + to 600s. + format: int32 + type: integer + replicas: + description: Number of desired machines. Defaults to 1. This is a pointer + to distinguish between explicit zero and not specified. + format: int32 + type: integer + revisionHistoryLimit: + description: The number of old MachineSets to retain to allow rollback. + This is a pointer to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + selector: + description: Label selector for machines. Existing MachineSets whose + machines are selected by this will be the ones affected by this deployment. + It must match the machine template's labels. + type: object + strategy: + description: The deployment strategy to use to replace existing machines + with new ones. + properties: + rollingUpdate: + description: Rolling update config params. Present only if MachineDeploymentStrategyType + = RollingUpdate. + properties: + maxSurge: + description: 'The maximum number of machines that can be scheduled + above the desired number of machines. Value can be an absolute + number (ex: 5) or a percentage of desired machines (ex: 10%). + This can not be 0 if MaxUnavailable is 0. Absolute number + is calculated from percentage by rounding up. Defaults to + 1. Example: when this is set to 30%, the new MachineSet can + be scaled up immediately when the rolling update starts, such + that the total number of old and new machines do not exceed + 130% of desired machines. Once old machines have been killed, + new MachineSet can be scaled up further, ensuring that total + number of machines running at any time during the update is + at most 130% of desired machines.' + oneOf: + - type: string + - type: integer + maxUnavailable: + description: 'The maximum number of machines that can be unavailable + during the update. Value can be an absolute number (ex: 5) + or a percentage of desired machines (ex: 10%). Absolute number + is calculated from percentage by rounding down. This can not + be 0 if MaxSurge is 0. Defaults to 0. Example: when this is + set to 30%, the old MachineSet can be scaled down to 70% of + desired machines immediately when the rolling update starts. + Once new machines are ready, old MachineSet can be scaled + down further, followed by scaling up the new MachineSet, ensuring + that the total number of machines available at all times during + the update is at least 70% of desired machines.' + oneOf: + - type: string + - type: integer + type: object + type: + description: Type of deployment. Currently the only supported strategy + is "RollingUpdate". Default is RollingUpdate. + type: string + type: object + template: + description: Template describes the machines that will be created. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' + type: object + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + properties: + configSource: + description: ConfigSource is used to populate in the associated + Node for dynamic kubelet config. This field already exists + in Node, so any updates to it in the Machine spec will be + automatically copied to the linked NodeRef from the status. + The rest of dynamic kubelet config support should then work + as-is. + type: object + metadata: + description: ObjectMeta will autopopulate the Node created. + Use this to indicate what labels, annotations, name prefix, + etc., should be used when creating the Node. + type: object + providerSpec: + description: ProviderSpec details Provider-specific configuration + to use during node creation. + properties: + value: + description: Value is an inlined, serialized representation + of the resource configuration. It is recommended that + providers maintain their own versioned API types that + should be serialized/deserialized from this field, akin + to component config. + type: object + valueFrom: + description: Source for the provider configuration. Cannot + be used if value is not empty. + properties: + machineClass: + description: The machine class from which the provider + config should be sourced. + properties: + provider: + description: Provider is the name of the cloud-provider + which MachineClass is intended for. + type: string + type: object + type: object + type: object + taints: + description: Taints is the full, authoritative list of taints + to apply to the corresponding Node. This list will overwrite + any modifications made to the Node on an ongoing basis. + items: + type: object + type: array + versions: + description: Versions of key software to use. This field is + optional at cluster creation time, and omitting the field + indicates that the cluster installation tool should select + defaults for the user. These defaults may differ based on + the cluster installer, but the tool should populate the values + it uses when persisting Machine objects. A Machine spec missing + this field at runtime is invalid. + properties: + controlPlane: + description: ControlPlane is the semantic version of the + Kubernetes control plane to run. This should only be populated + when the machine is a control plane. + type: string + kubelet: + description: Kubelet is the semantic version of kubelet + to run + type: string + required: + - kubelet + type: object + required: + - providerSpec + type: object + type: object + required: + - selector + - template + type: object + status: + properties: + availableReplicas: + description: Total number of available machines (ready for at least + minReadySeconds) targeted by this deployment. + format: int32 + type: integer + observedGeneration: + description: The generation observed by the deployment controller. + format: int64 + type: integer + readyReplicas: + description: Total number of ready machines targeted by this deployment. + format: int32 + type: integer + replicas: + description: Total number of non-terminated machines targeted by this + deployment (their labels match the selector). + format: int32 + type: integer + unavailableReplicas: + description: Total number of unavailable machines targeted by this deployment. + This is the total number of machines that are still required for the + deployment to have 100% available capacity. They may either be machines + that are running but not yet available or machines that still have + not been created. + format: int32 + type: integer + updatedReplicas: + description: Total number of non-terminated machines targeted by this + deployment that have the desired template spec. + format: int32 + type: integer + type: object + version: v1alpha1 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml new file mode 100644 index 0000000000..4df91b3de8 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml @@ -0,0 +1,194 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: machinesets.cluster.k8s.io +spec: + group: cluster.k8s.io + names: + kind: MachineSet + plural: machinesets + scope: Namespaced + subresources: + scale: + labelSelectorPath: .status.labelSelector + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + minReadySeconds: + description: MinReadySeconds is the minimum number of seconds for which + a newly created machine should be ready. Defaults to 0 (machine will + be considered available as soon as it is ready) + format: int32 + type: integer + replicas: + description: Replicas is the number of desired replicas. This is a pointer + to distinguish between explicit zero and unspecified. Defaults to + 1. + format: int32 + type: integer + selector: + description: 'Selector is a label query over machines that should match + the replica count. Label keys and values that must match in order + to be controlled by this MachineSet. It must match the machine template''s + labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors' + type: object + template: + description: Template is the object that describes the machine that + will be created if insufficient replicas are detected. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' + type: object + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + properties: + configSource: + description: ConfigSource is used to populate in the associated + Node for dynamic kubelet config. This field already exists + in Node, so any updates to it in the Machine spec will be + automatically copied to the linked NodeRef from the status. + The rest of dynamic kubelet config support should then work + as-is. + type: object + metadata: + description: ObjectMeta will autopopulate the Node created. + Use this to indicate what labels, annotations, name prefix, + etc., should be used when creating the Node. + type: object + providerSpec: + description: ProviderSpec details Provider-specific configuration + to use during node creation. + properties: + value: + description: Value is an inlined, serialized representation + of the resource configuration. It is recommended that + providers maintain their own versioned API types that + should be serialized/deserialized from this field, akin + to component config. + type: object + valueFrom: + description: Source for the provider configuration. Cannot + be used if value is not empty. + properties: + machineClass: + description: The machine class from which the provider + config should be sourced. + properties: + provider: + description: Provider is the name of the cloud-provider + which MachineClass is intended for. + type: string + type: object + type: object + type: object + taints: + description: Taints is the full, authoritative list of taints + to apply to the corresponding Node. This list will overwrite + any modifications made to the Node on an ongoing basis. + items: + type: object + type: array + versions: + description: Versions of key software to use. This field is + optional at cluster creation time, and omitting the field + indicates that the cluster installation tool should select + defaults for the user. These defaults may differ based on + the cluster installer, but the tool should populate the values + it uses when persisting Machine objects. A Machine spec missing + this field at runtime is invalid. + properties: + controlPlane: + description: ControlPlane is the semantic version of the + Kubernetes control plane to run. This should only be populated + when the machine is a control plane. + type: string + kubelet: + description: Kubelet is the semantic version of kubelet + to run + type: string + required: + - kubelet + type: object + required: + - providerSpec + type: object + type: object + required: + - selector + type: object + status: + properties: + availableReplicas: + description: The number of available replicas (ready for at least minReadySeconds) + for this MachineSet. + format: int32 + type: integer + errorMessage: + type: string + errorReason: + description: In the event that there is a terminal problem reconciling + the replicas, both ErrorReason and ErrorMessage will be set. ErrorReason + will be populated with a succinct value suitable for machine interpretation, + while ErrorMessage will contain a more verbose string suitable for + logging and human consumption. These fields should not be set for + transitive errors that a controller faces that are expected to be + fixed automatically over time (like service outages), but instead + indicate that something is fundamentally wrong with the MachineTemplate's + spec or the configuration of the machine controller, and that manual + intervention is required. Examples of terminal errors would be invalid + combinations of settings in the spec, values that are unsupported + by the machine controller, or the responsible machine controller itself + being critically misconfigured. Any transient errors that occur during + the reconciliation of Machines can be added as events to the MachineSet + object and/or logged in the controller's output. + type: string + fullyLabeledReplicas: + description: The number of replicas that have labels matching the labels + of the machine template of the MachineSet. + format: int32 + type: integer + observedGeneration: + description: ObservedGeneration reflects the generation of the most + recently observed MachineSet. + format: int64 + type: integer + readyReplicas: + description: The number of ready replicas for this MachineSet. A machine + is considered ready when the node has been created and is "Ready". + format: int32 + type: integer + replicas: + description: Replicas is the most recently observed number of replicas. + format: int32 + type: integer + required: + - replicas + type: object + version: v1alpha1 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_cluster.yaml b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_cluster.yaml new file mode 100644 index 0000000000..253ebd0d3c --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_cluster.yaml @@ -0,0 +1,134 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: clusters.machine.openshift.io +spec: + group: machine.openshift.io + names: + kind: Cluster + plural: clusters + scope: Namespaced + subresources: + status: {} + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + clusterNetwork: + description: Cluster network configuration + properties: + pods: + description: The network ranges from which Pod networks are allocated. + properties: + cidrBlocks: + items: + type: string + type: array + required: + - cidrBlocks + type: object + serviceDomain: + description: Domain name for services. + type: string + services: + description: The network ranges from which service VIPs are allocated. + properties: + cidrBlocks: + items: + type: string + type: array + required: + - cidrBlocks + type: object + required: + - services + - pods + - serviceDomain + type: object + providerSpec: + description: 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. + properties: + value: + description: Value is an inlined, serialized representation of the + resource configuration. It is recommended that providers maintain + their own versioned API types that should be serialized/deserialized + from this field, akin to component config. + type: object + valueFrom: + description: Source for the provider configuration. Cannot be used + if value is not empty. + properties: + machineClass: + description: The machine class from which the provider config + should be sourced. + properties: + provider: + description: Provider is the name of the cloud-provider + which MachineClass is intended for. + type: string + type: object + type: object + type: object + required: + - clusterNetwork + type: object + status: + properties: + apiEndpoints: + description: APIEndpoint represents the endpoint to communicate with + the IP. + items: + properties: + host: + description: The hostname on which the API server is serving. + type: string + port: + description: The port on which the API server is serving. + format: int64 + type: integer + required: + - host + - port + type: object + type: array + errorMessage: + description: If set, indicates that there is a problem reconciling the + state, and will be set to a descriptive error message. + type: string + errorReason: + description: If set, indicates that there is a problem reconciling the + state, and will be set to a token value suitable for programmatic + interpretation. + type: string + providerStatus: + description: Provider-specific status. It is recommended that providers + maintain their own versioned API types that should be serialized/deserialized + from this field. + type: object + type: object + version: v1beta1 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machine.yaml b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machine.yaml new file mode 100644 index 0000000000..b3282f6d01 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machine.yaml @@ -0,0 +1,218 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: machines.machine.openshift.io +spec: + group: machine.openshift.io + names: + kind: Machine + plural: machines + scope: Namespaced + subresources: + status: {} + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + configSource: + description: ConfigSource is used to populate in the associated Node + for dynamic kubelet config. This field already exists in Node, so + any updates to it in the Machine spec will be automatically copied + to the linked NodeRef from the status. The rest of dynamic kubelet + config support should then work as-is. + type: object + metadata: + description: ObjectMeta will autopopulate the Node created. Use this + to indicate what labels, annotations, name prefix, etc., should be + used when creating the Node. + type: object + providerSpec: + description: ProviderSpec details Provider-specific configuration to + use during node creation. + properties: + value: + description: Value is an inlined, serialized representation of the + resource configuration. It is recommended that providers maintain + their own versioned API types that should be serialized/deserialized + from this field, akin to component config. + type: object + valueFrom: + description: Source for the provider configuration. Cannot be used + if value is not empty. + properties: + machineClass: + description: The machine class from which the provider config + should be sourced. + properties: + provider: + description: Provider is the name of the cloud-provider + which MachineClass is intended for. + type: string + type: object + type: object + type: object + taints: + description: Taints is the full, authoritative list of taints to apply + to the corresponding Node. This list will overwrite any modifications + made to the Node on an ongoing basis. + items: + type: object + type: array + versions: + description: Versions of key software to use. This field is optional + at cluster creation time, and omitting the field indicates that the + cluster installation tool should select defaults for the user. These + defaults may differ based on the cluster installer, but the tool should + populate the values it uses when persisting Machine objects. A Machine + spec missing this field at runtime is invalid. + properties: + controlPlane: + description: ControlPlane is the semantic version of the Kubernetes + control plane to run. This should only be populated when the machine + is a control plane. + type: string + kubelet: + description: Kubelet is the semantic version of kubelet to run + type: string + required: + - kubelet + type: object + required: + - providerSpec + type: object + status: + properties: + addresses: + description: Addresses is a list of addresses assigned to the machine. + Queried from cloud provider, if available. + items: + type: object + type: array + conditions: + description: 'Conditions lists the conditions synced from the node conditions + of the corresponding node-object. Machine-controller is responsible + for keeping conditions up-to-date. MachineSet controller will be taking + these conditions as a signal to decide if machine is healthy or needs + to be replaced. Refer: https://kubernetes.io/docs/concepts/architecture/nodes/#condition' + items: + type: object + type: array + errorMessage: + description: ErrorMessage will be set in the event that there is a terminal + problem reconciling the Machine and will contain a more verbose string + suitable for logging and human consumption. This field should not + be set for transitive errors that a controller faces that are expected + to be fixed automatically over time (like service outages), but instead + indicate that something is fundamentally wrong with the Machine's + spec or the configuration of the controller, and that manual intervention + is required. Examples of terminal errors would be invalid combinations + of settings in the spec, values that are unsupported by the controller, + or the responsible controller itself being critically misconfigured. Any + transient errors that occur during the reconciliation of Machines + can be added as events to the Machine object and/or logged in the + controller's output. + type: string + errorReason: + description: ErrorReason will be set in the event that there is a terminal + problem reconciling the Machine and will contain a succinct value + suitable for machine interpretation. This field should not be set + for transitive errors that a controller faces that are expected to + be fixed automatically over time (like service outages), but instead + indicate that something is fundamentally wrong with the Machine's + spec or the configuration of the controller, and that manual intervention + is required. Examples of terminal errors would be invalid combinations + of settings in the spec, values that are unsupported by the controller, + or the responsible controller itself being critically misconfigured. Any + transient errors that occur during the reconciliation of Machines + can be added as events to the Machine object and/or logged in the + controller's output. + type: string + lastOperation: + description: LastOperation describes the last-operation performed by + the machine-controller. This API should be useful as a history in + terms of the latest operation performed on the specific machine. It + should also convey the state of the latest-operation for example if + it is still on-going, failed or completed successfully. + properties: + description: + description: Description is the human-readable description of the + last operation. + type: string + lastUpdated: + description: LastUpdated is the timestamp at which LastOperation + API was last-updated. + format: date-time + type: string + state: + description: State is the current status of the last performed operation. + E.g. Processing, Failed, Successful etc + type: string + type: + description: Type is the type of operation which was last performed. + E.g. Create, Delete, Update etc + type: string + type: object + lastUpdated: + description: LastUpdated identifies when this status was last observed. + format: date-time + type: string + nodeRef: + description: NodeRef will point to the corresponding Node if it exists. + type: object + phase: + description: Phase represents the current phase of machine actuation. + E.g. Pending, Running, Terminating, Failed etc. + type: string + providerStatus: + description: ProviderStatus details a Provider-specific status. It is + recommended that providers maintain their own versioned API types + that should be serialized/deserialized from this field. + type: object + versions: + description: 'Versions specifies the current versions of software on + the corresponding Node (if it exists). This is provided for a few + reasons: 1) It is more convenient than checking the NodeRef, traversing + it to the Node, and finding the appropriate field in Node.Status.NodeInfo (which + uses different field names and formatting). 2) It removes some of + the dependency on the structure of the Node, so that if the structure + of Node.Status.NodeInfo changes, only machine controllers need + to be updated, rather than every client of the Machines API. 3) + There is no other simple way to check the control plane version. + A client would have to connect directly to the apiserver running + on the target node in order to find out its version.' + properties: + controlPlane: + description: ControlPlane is the semantic version of the Kubernetes + control plane to run. This should only be populated when the machine + is a control plane. + type: string + kubelet: + description: Kubelet is the semantic version of kubelet to run + type: string + required: + - kubelet + type: object + type: object + version: v1beta1 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineclass.yaml b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineclass.yaml new file mode 100644 index 0000000000..e7fd7972b8 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineclass.yaml @@ -0,0 +1,40 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: machineclasses.machine.openshift.io +spec: + group: machine.openshift.io + names: + kind: MachineClass + plural: machineclasses + scope: Namespaced + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + providerSpec: + description: Provider-specific configuration to use during node creation. + type: object + required: + - providerSpec + version: v1beta1 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machinedeployment.yaml b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machinedeployment.yaml new file mode 100644 index 0000000000..27832fc286 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machinedeployment.yaml @@ -0,0 +1,241 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: machinedeployments.machine.openshift.io +spec: + group: machine.openshift.io + names: + kind: MachineDeployment + plural: machinedeployments + scope: Namespaced + subresources: + scale: + labelSelectorPath: .status.labelSelector + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + minReadySeconds: + description: Minimum number of seconds for which a newly created machine + should be ready. Defaults to 0 (machine will be considered available + as soon as it is ready) + format: int32 + type: integer + paused: + description: Indicates that the deployment is paused. + type: boolean + progressDeadlineSeconds: + description: The maximum time in seconds for a deployment to make progress + before it is considered to be failed. The deployment controller will + continue to process failed deployments and a condition with a ProgressDeadlineExceeded + reason will be surfaced in the deployment status. Note that progress + will not be estimated during the time a deployment is paused. Defaults + to 600s. + format: int32 + type: integer + replicas: + description: Number of desired machines. Defaults to 1. This is a pointer + to distinguish between explicit zero and not specified. + format: int32 + type: integer + revisionHistoryLimit: + description: The number of old MachineSets to retain to allow rollback. + This is a pointer to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + selector: + description: Label selector for machines. Existing MachineSets whose + machines are selected by this will be the ones affected by this deployment. + It must match the machine template's labels. + type: object + strategy: + description: The deployment strategy to use to replace existing machines + with new ones. + properties: + rollingUpdate: + description: Rolling update config params. Present only if MachineDeploymentStrategyType + = RollingUpdate. + properties: + maxSurge: + description: 'The maximum number of machines that can be scheduled + above the desired number of machines. Value can be an absolute + number (ex: 5) or a percentage of desired machines (ex: 10%). + This can not be 0 if MaxUnavailable is 0. Absolute number + is calculated from percentage by rounding up. Defaults to + 1. Example: when this is set to 30%, the new MachineSet can + be scaled up immediately when the rolling update starts, such + that the total number of old and new machines do not exceed + 130% of desired machines. Once old machines have been killed, + new MachineSet can be scaled up further, ensuring that total + number of machines running at any time during the update is + at most 130% of desired machines.' + oneOf: + - type: string + - type: integer + maxUnavailable: + description: 'The maximum number of machines that can be unavailable + during the update. Value can be an absolute number (ex: 5) + or a percentage of desired machines (ex: 10%). Absolute number + is calculated from percentage by rounding down. This can not + be 0 if MaxSurge is 0. Defaults to 0. Example: when this is + set to 30%, the old MachineSet can be scaled down to 70% of + desired machines immediately when the rolling update starts. + Once new machines are ready, old MachineSet can be scaled + down further, followed by scaling up the new MachineSet, ensuring + that the total number of machines available at all times during + the update is at least 70% of desired machines.' + oneOf: + - type: string + - type: integer + type: object + type: + description: Type of deployment. Currently the only supported strategy + is "RollingUpdate". Default is RollingUpdate. + type: string + type: object + template: + description: Template describes the machines that will be created. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' + type: object + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + properties: + configSource: + description: ConfigSource is used to populate in the associated + Node for dynamic kubelet config. This field already exists + in Node, so any updates to it in the Machine spec will be + automatically copied to the linked NodeRef from the status. + The rest of dynamic kubelet config support should then work + as-is. + type: object + metadata: + description: ObjectMeta will autopopulate the Node created. + Use this to indicate what labels, annotations, name prefix, + etc., should be used when creating the Node. + type: object + providerSpec: + description: ProviderSpec details Provider-specific configuration + to use during node creation. + properties: + value: + description: Value is an inlined, serialized representation + of the resource configuration. It is recommended that + providers maintain their own versioned API types that + should be serialized/deserialized from this field, akin + to component config. + type: object + valueFrom: + description: Source for the provider configuration. Cannot + be used if value is not empty. + properties: + machineClass: + description: The machine class from which the provider + config should be sourced. + properties: + provider: + description: Provider is the name of the cloud-provider + which MachineClass is intended for. + type: string + type: object + type: object + type: object + taints: + description: Taints is the full, authoritative list of taints + to apply to the corresponding Node. This list will overwrite + any modifications made to the Node on an ongoing basis. + items: + type: object + type: array + versions: + description: Versions of key software to use. This field is + optional at cluster creation time, and omitting the field + indicates that the cluster installation tool should select + defaults for the user. These defaults may differ based on + the cluster installer, but the tool should populate the values + it uses when persisting Machine objects. A Machine spec missing + this field at runtime is invalid. + properties: + controlPlane: + description: ControlPlane is the semantic version of the + Kubernetes control plane to run. This should only be populated + when the machine is a control plane. + type: string + kubelet: + description: Kubelet is the semantic version of kubelet + to run + type: string + required: + - kubelet + type: object + required: + - providerSpec + type: object + type: object + required: + - selector + - template + type: object + status: + properties: + availableReplicas: + description: Total number of available machines (ready for at least + minReadySeconds) targeted by this deployment. + format: int32 + type: integer + observedGeneration: + description: The generation observed by the deployment controller. + format: int64 + type: integer + readyReplicas: + description: Total number of ready machines targeted by this deployment. + format: int32 + type: integer + replicas: + description: Total number of non-terminated machines targeted by this + deployment (their labels match the selector). + format: int32 + type: integer + unavailableReplicas: + description: Total number of unavailable machines targeted by this deployment. + This is the total number of machines that are still required for the + deployment to have 100% available capacity. They may either be machines + that are running but not yet available or machines that still have + not been created. + format: int32 + type: integer + updatedReplicas: + description: Total number of non-terminated machines targeted by this + deployment that have the desired template spec. + format: int32 + type: integer + type: object + version: v1beta1 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineset.yaml b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineset.yaml new file mode 100644 index 0000000000..f7a1d9586d --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineset.yaml @@ -0,0 +1,194 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: machinesets.machine.openshift.io +spec: + group: machine.openshift.io + names: + kind: MachineSet + plural: machinesets + scope: Namespaced + subresources: + scale: + labelSelectorPath: .status.labelSelector + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + minReadySeconds: + description: MinReadySeconds is the minimum number of seconds for which + a newly created machine should be ready. Defaults to 0 (machine will + be considered available as soon as it is ready) + format: int32 + type: integer + replicas: + description: Replicas is the number of desired replicas. This is a pointer + to distinguish between explicit zero and unspecified. Defaults to + 1. + format: int32 + type: integer + selector: + description: 'Selector is a label query over machines that should match + the replica count. Label keys and values that must match in order + to be controlled by this MachineSet. It must match the machine template''s + labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors' + type: object + template: + description: Template is the object that describes the machine that + will be created if insufficient replicas are detected. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' + type: object + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + properties: + configSource: + description: ConfigSource is used to populate in the associated + Node for dynamic kubelet config. This field already exists + in Node, so any updates to it in the Machine spec will be + automatically copied to the linked NodeRef from the status. + The rest of dynamic kubelet config support should then work + as-is. + type: object + metadata: + description: ObjectMeta will autopopulate the Node created. + Use this to indicate what labels, annotations, name prefix, + etc., should be used when creating the Node. + type: object + providerSpec: + description: ProviderSpec details Provider-specific configuration + to use during node creation. + properties: + value: + description: Value is an inlined, serialized representation + of the resource configuration. It is recommended that + providers maintain their own versioned API types that + should be serialized/deserialized from this field, akin + to component config. + type: object + valueFrom: + description: Source for the provider configuration. Cannot + be used if value is not empty. + properties: + machineClass: + description: The machine class from which the provider + config should be sourced. + properties: + provider: + description: Provider is the name of the cloud-provider + which MachineClass is intended for. + type: string + type: object + type: object + type: object + taints: + description: Taints is the full, authoritative list of taints + to apply to the corresponding Node. This list will overwrite + any modifications made to the Node on an ongoing basis. + items: + type: object + type: array + versions: + description: Versions of key software to use. This field is + optional at cluster creation time, and omitting the field + indicates that the cluster installation tool should select + defaults for the user. These defaults may differ based on + the cluster installer, but the tool should populate the values + it uses when persisting Machine objects. A Machine spec missing + this field at runtime is invalid. + properties: + controlPlane: + description: ControlPlane is the semantic version of the + Kubernetes control plane to run. This should only be populated + when the machine is a control plane. + type: string + kubelet: + description: Kubelet is the semantic version of kubelet + to run + type: string + required: + - kubelet + type: object + required: + - providerSpec + type: object + type: object + required: + - selector + type: object + status: + properties: + availableReplicas: + description: The number of available replicas (ready for at least minReadySeconds) + for this MachineSet. + format: int32 + type: integer + errorMessage: + type: string + errorReason: + description: In the event that there is a terminal problem reconciling + the replicas, both ErrorReason and ErrorMessage will be set. ErrorReason + will be populated with a succinct value suitable for machine interpretation, + while ErrorMessage will contain a more verbose string suitable for + logging and human consumption. These fields should not be set for + transitive errors that a controller faces that are expected to be + fixed automatically over time (like service outages), but instead + indicate that something is fundamentally wrong with the MachineTemplate's + spec or the configuration of the machine controller, and that manual + intervention is required. Examples of terminal errors would be invalid + combinations of settings in the spec, values that are unsupported + by the machine controller, or the responsible machine controller itself + being critically misconfigured. Any transient errors that occur during + the reconciliation of Machines can be added as events to the MachineSet + object and/or logged in the controller's output. + type: string + fullyLabeledReplicas: + description: The number of replicas that have labels matching the labels + of the machine template of the MachineSet. + format: int32 + type: integer + observedGeneration: + description: ObservedGeneration reflects the generation of the most + recently observed MachineSet. + format: int64 + type: integer + readyReplicas: + description: The number of ready replicas for this MachineSet. A machine + is considered ready when the node has been created and is "Ready". + format: int32 + type: integer + replicas: + description: Replicas is the most recently observed number of replicas. + format: int32 + type: integer + required: + - replicas + type: object + version: v1beta1 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/vendor/sigs.k8s.io/cluster-api/config/default/kustomization.yaml b/vendor/github.com/openshift/cluster-api/config/default/kustomization.yaml similarity index 78% rename from vendor/sigs.k8s.io/cluster-api/config/default/kustomization.yaml rename to vendor/github.com/openshift/cluster-api/config/default/kustomization.yaml index 2e1e38c32e..f4236b3cee 100644 --- a/vendor/sigs.k8s.io/cluster-api/config/default/kustomization.yaml +++ b/vendor/github.com/openshift/cluster-api/config/default/kustomization.yaml @@ -18,11 +18,11 @@ namePrefix: cluster-api- # YAML string, with resources separated by document # markers ("---"). resources: -- ../crds/cluster_v1alpha1_cluster.yaml -- ../crds/cluster_v1alpha1_machine.yaml -- ../crds/cluster_v1alpha1_machineclass.yaml -- ../crds/cluster_v1alpha1_machinedeployment.yaml -- ../crds/cluster_v1alpha1_machineset.yaml +- ../crds/machine_v1beta1_cluster.yaml +- ../crds/machine_v1beta1_machine.yaml +- ../crds/machine_v1beta1_machineclass.yaml +- ../crds/machine_v1beta1_machinedeployment.yaml +- ../crds/machine_v1beta1_machineset.yaml - ../rbac/rbac_role.yaml - ../rbac/rbac_role_binding.yaml - ../manager/manager.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/config/default/manager_image_patch.yaml b/vendor/github.com/openshift/cluster-api/config/default/manager_image_patch.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/config/default/manager_image_patch.yaml rename to vendor/github.com/openshift/cluster-api/config/default/manager_image_patch.yaml diff --git a/vendor/github.com/openshift/cluster-api/config/default/manager_image_patch.yaml-e b/vendor/github.com/openshift/cluster-api/config/default/manager_image_patch.yaml-e new file mode 100644 index 0000000000..3996ddede7 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/config/default/manager_image_patch.yaml-e @@ -0,0 +1,11 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: controller-manager + namespace: system +spec: + template: + spec: + containers: + - image: gcr.io/k8s-cluster-api/cluster-api-controller:latest + name: manager diff --git a/vendor/sigs.k8s.io/cluster-api/config/manager/manager.yaml b/vendor/github.com/openshift/cluster-api/config/manager/manager.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/config/manager/manager.yaml rename to vendor/github.com/openshift/cluster-api/config/manager/manager.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role.yaml b/vendor/github.com/openshift/cluster-api/config/rbac/rbac_role.yaml similarity index 86% rename from vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role.yaml rename to vendor/github.com/openshift/cluster-api/config/rbac/rbac_role.yaml index 96d3796643..716ae1690c 100644 --- a/vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role.yaml +++ b/vendor/github.com/openshift/cluster-api/config/rbac/rbac_role.yaml @@ -5,7 +5,7 @@ metadata: name: manager-role rules: - apiGroups: - - cluster.k8s.io + - machine.openshift.io resources: - clusters verbs: @@ -17,7 +17,7 @@ rules: - patch - delete - apiGroups: - - cluster.k8s.io + - machine.openshift.io resources: - machines verbs: @@ -29,7 +29,7 @@ rules: - patch - delete - apiGroups: - - cluster.k8s.io + - machine.openshift.io resources: - machinedeployments verbs: @@ -41,7 +41,7 @@ rules: - patch - delete - apiGroups: - - cluster.k8s.io + - machine.openshift.io resources: - machinesets verbs: @@ -53,7 +53,7 @@ rules: - patch - delete - apiGroups: - - cluster.k8s.io + - machine.openshift.io resources: - machines verbs: @@ -77,7 +77,7 @@ rules: - patch - delete - apiGroups: - - cluster.k8s.io + - machine.openshift.io resources: - machines verbs: diff --git a/vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role_binding.yaml b/vendor/github.com/openshift/cluster-api/config/rbac/rbac_role_binding.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/config/rbac/rbac_role_binding.yaml rename to vendor/github.com/openshift/cluster-api/config/rbac/rbac_role_binding.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/config/samples/cluster_v1alpha1_cluster.yaml b/vendor/github.com/openshift/cluster-api/config/samples/cluster_v1alpha1_cluster.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/config/samples/cluster_v1alpha1_cluster.yaml rename to vendor/github.com/openshift/cluster-api/config/samples/cluster_v1alpha1_cluster.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/config/samples/cluster_v1alpha1_machine.yaml b/vendor/github.com/openshift/cluster-api/config/samples/cluster_v1alpha1_machine.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/config/samples/cluster_v1alpha1_machine.yaml rename to vendor/github.com/openshift/cluster-api/config/samples/cluster_v1alpha1_machine.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/config/samples/cluster_v1alpha1_machinedeployment.yaml b/vendor/github.com/openshift/cluster-api/config/samples/cluster_v1alpha1_machinedeployment.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/config/samples/cluster_v1alpha1_machinedeployment.yaml rename to vendor/github.com/openshift/cluster-api/config/samples/cluster_v1alpha1_machinedeployment.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/config/samples/cluster_v1alpha1_machineset.yaml b/vendor/github.com/openshift/cluster-api/config/samples/cluster_v1alpha1_machineset.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/config/samples/cluster_v1alpha1_machineset.yaml rename to vendor/github.com/openshift/cluster-api/config/samples/cluster_v1alpha1_machineset.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/Dockerfile b/vendor/github.com/openshift/cluster-api/docs/book/Dockerfile similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/Dockerfile rename to vendor/github.com/openshift/cluster-api/docs/book/Dockerfile diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/GLOSSARY.md b/vendor/github.com/openshift/cluster-api/docs/book/GLOSSARY.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/GLOSSARY.md rename to vendor/github.com/openshift/cluster-api/docs/book/GLOSSARY.md diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/README.md b/vendor/github.com/openshift/cluster-api/docs/book/README.md similarity index 83% rename from vendor/sigs.k8s.io/cluster-api/docs/book/README.md rename to vendor/github.com/openshift/cluster-api/docs/book/README.md index 8df0a0e62a..3e09655e3a 100644 --- a/vendor/sigs.k8s.io/cluster-api/docs/book/README.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/README.md @@ -29,8 +29,8 @@ Including the ability to: - Develop new Cluster and Machine controllers. - Develop automation on top of MachineSets and MachineDeployments as well as other Cluster API resources. For example, - - Cloud agnostic Upgrade and Repair tools. - - Cluster Autoscalars. + - Cloud agnostic upgrade and repair tools. + - Cluster autoscalers. - Etc. ## Who else will this book be for in the future? @@ -51,20 +51,20 @@ through Kubernetes native abstractions. Including the ability to: -- Create reproducable Kubernetes clusters. +- Create reproducible Kubernetes clusters. - Create hybrid cloud environments which optimize for cost, performance, and reliability. ## Resources -GitBook: [book.cluster-api.sigs.k8s.io](http://book.cluster-api.sigs.k8s.io) -GitHub Repo: [kubernetes-sigs/cluster-api](https://github.com/kubernetes-sigs/cluster-api) -Slack channel: [#cluster-api](http://slack.k8s.io/#cluster-api) -Google Group: [kubernetes-sig-cluster-lifecycle@googlegroups.com](https://groups.google.com/forum/#!forum/kubernetes-sig-cluster-lifecycle) +- GitBook: [kubernetes-sigs.github.io/cluster-api](https://kubernetes-sigs.github.io/cluster-api) +- GitHub Repo: [kubernetes-sigs/cluster-api](https://github.com/kubernetes-sigs/cluster-api) +- Slack channel: [#cluster-api](http://slack.k8s.io/#cluster-api) +- Google Group: [kubernetes-sig-cluster-lifecycle@googlegroups.com](https://groups.google.com/forum/#!forum/kubernetes-sig-cluster-lifecycle) ## Navigating this book -This section describes how to use the navigation elements of this book +This section describes how to use the navigation elements of this book. ##### Code Navigation diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/RELEASE b/vendor/github.com/openshift/cluster-api/docs/book/RELEASE similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/RELEASE rename to vendor/github.com/openshift/cluster-api/docs/book/RELEASE diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/SUMMARY.md b/vendor/github.com/openshift/cluster-api/docs/book/SUMMARY.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/SUMMARY.md rename to vendor/github.com/openshift/cluster-api/docs/book/SUMMARY.md diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/appendices/keps/0003-cluster-api.md b/vendor/github.com/openshift/cluster-api/docs/book/appendices/keps/0003-cluster-api.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/appendices/keps/0003-cluster-api.md rename to vendor/github.com/openshift/cluster-api/docs/book/appendices/keps/0003-cluster-api.md diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/book.json b/vendor/github.com/openshift/cluster-api/docs/book/book.json similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/book.json rename to vendor/github.com/openshift/cluster-api/docs/book/book.json diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/common_code/architecture.md b/vendor/github.com/openshift/cluster-api/docs/book/common_code/architecture.md similarity index 94% rename from vendor/sigs.k8s.io/cluster-api/docs/book/common_code/architecture.md rename to vendor/github.com/openshift/cluster-api/docs/book/common_code/architecture.md index fd2104e53b..83070feca5 100644 --- a/vendor/sigs.k8s.io/cluster-api/docs/book/common_code/architecture.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/architecture.md @@ -4,8 +4,8 @@ It may be useful to read at least the following chapters of the Kubebuilder book in order to better understand this section. -- [What is a Resource](https://github.com/kubernetes-sigs/kubebuilder.git/docs/book/basics/what_is_a_resource.md) -- [What is a Controller](https://github.com/kubernetes-sigs/kubebuilder.git/docs/book/basics/what_is_a_controller.md) +- [What is a Resource](https://github.com/kubernetes-sigs/kubebuilder/blob/master/docs/book/basics/what_is_a_resource.md) +- [What is a Controller](https://github.com/kubernetes-sigs/kubebuilder/blob/master/docs/book/basics/what_is_a_controller.md) {% endpanel %} {% panel style="warning", title="Architecture Diagram" %} diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/common_code/architecture.png b/vendor/github.com/openshift/cluster-api/docs/book/common_code/architecture.png similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/common_code/architecture.png rename to vendor/github.com/openshift/cluster-api/docs/book/common_code/architecture.png diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/common_code/cluster_controller.md b/vendor/github.com/openshift/cluster-api/docs/book/common_code/cluster_controller.md similarity index 93% rename from vendor/sigs.k8s.io/cluster-api/docs/book/common_code/cluster_controller.md rename to vendor/github.com/openshift/cluster-api/docs/book/common_code/cluster_controller.md index 4df76df262..e24bfd82e9 100644 --- a/vendor/sigs.k8s.io/cluster-api/docs/book/common_code/cluster_controller.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/cluster_controller.md @@ -16,11 +16,11 @@ defaults or by Controllers such as autoscalers. controllers. `Status` is not the source of truth for any information, but instead aggregates and publishes observed state. -`TypeMeta` contains metadata about the API itself - such as Group, Version, +`TypeMeta` contains metadata about the API itself - such as Group, Version, Kind. `ObjectMeta` contains metadata about the specific object instance, for example, -it's name, namespace, labels, and annotations, etc. `ObjectMeta` contains data +it's name, namespace, labels, and annotations, etc. `ObjectMeta` contains data common to most objects. {% sample lang="go" %} @@ -46,21 +46,21 @@ them to evolve independently of it. {% method %} ## ClusterStatus -Like `ProviderSpec`, `ProviderStatus` is recommended to be a serialized API +Like `ProviderSpec`, `ProviderStatus` is recommended to be a serialized API object in a format owned by that provider. Some providers use the `APIEndpoint` field to determine when one or more -masters have been provisioned. This may be necessary before worker nodes +control plane machines have been provisioned. This may be necessary before worker nodes can be provisioned. For example, `cluster-api-provider-gcp` does [this]( https://github.com/kubernetes-sigs/cluster-api-provider-gcp/blob/f3145d8810a5c7fc434ddb5577699b4deb1b5fa6/pkg/cloud/google/metadata.go#L43): ```go if len(cluster.Status.APIEndpoints) == 0 { - return nil, fmt.Errorf("master endpoint not found in apiEndpoints for cluster %v", cluster) + return nil, fmt.Errorf("control plane endpoint not found in apiEndpoints for cluster %v", cluster) } ``` -**TODO**: Provide examples of how `ErrorReason` and `ErrorMessage` are +**TODO**: Provide examples of how `ErrorReason` and `ErrorMessage` are used in practice. {% sample lang="go" %} @@ -72,10 +72,10 @@ used in practice. All methods should be idempotent. -`Reconcile()` will be called whenever there is a change to the `Cluster` +`Reconcile()` will be called whenever there is a change to the `Cluster` `Spec`, or after every resync period. -If a `Cluster` resource is deleted, the controller will call the actuator's +If a `Cluster` resource is deleted, the controller will call the actuator's `Delete()` method until it succeeds, or the [finalizer]( https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#finalizers) is removed (see below). diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/common_code/machine_controller.md b/vendor/github.com/openshift/cluster-api/docs/book/common_code/machine_controller.md similarity index 93% rename from vendor/sigs.k8s.io/cluster-api/docs/book/common_code/machine_controller.md rename to vendor/github.com/openshift/cluster-api/docs/book/common_code/machine_controller.md index 521b985494..7d6e8e2d8b 100644 --- a/vendor/sigs.k8s.io/cluster-api/docs/book/common_code/machine_controller.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/machine_controller.md @@ -1,12 +1,12 @@ # Machine Controller -A `Machine` is the declarative spec for a `Node`, as represented in Kubernetes -core. If a new Machine object is created, a provider-specific controller will +A `Machine` is the declarative spec for a `Node`, as represented in Kubernetes +core. If a new Machine object is created, a provider-specific controller will handle provisioning and installing a new host to register as a new `Node` matching the Machine spec. If the `Machine`s spec is updated, a provider- -specific controller is responsible for updating the Node in-place or replacing -the host with a new one matching the updated spec. If a `Machine` object is +specific controller is responsible for updating the Node in-place or replacing +the host with a new one matching the updated spec. If a `Machine` object is deleted, the corresponding `Node` should have its external resources released by the provider-specific controller, and should be deleted as well. @@ -20,14 +20,14 @@ of the `Spec` is defined by users, unspecified parts may be filled in with defaults or by Controllers such as autoscalers. `Status` contains only observed cluster state and is only written by -controllers. `Status` is not the source of truth for any information, but +controllers. `Status` is not the source of truth for any information, but instead aggregates and publishes observed state. -`TypeMeta` contains metadata about the API itself - such as Group, Version, -Kind. +`TypeMeta` contains metadata about the API itself - such as Group, Version, +Kind. `ObjectMeta` contains metadata about the specific object instance, for -example, it's name, namespace, labels, and annotations, etc. `ObjectMeta` +example, it's name, namespace, labels, and annotations, etc. `ObjectMeta` contains data common to most objects. {% sample lang="go" %} @@ -37,11 +37,11 @@ contains data common to most objects. {% method %} ## MachineSpec -The `ProviderSpec` is recommended to be a serialized API object in a format +The `ProviderSpec` is recommended to be a serialized API object in a format owned by that provider. This will allow the configuration to be strongly typed, versioned, and have as much nested depth as appropriate. These provider-specific API definitions are meant to live outside of the Machine API, which will allow -them to evolve independently of it. Attributes like instance type, which +them to evolve independently of it. Attributes like instance type, which network to use, and the OS image all belong in the `ProviderSpec`. Some providers and tooling depend on an annotation to be set on the `Machine` @@ -49,8 +49,8 @@ to determine if provisioning has completed. For example, the `clusterctl` command does this [here](https://github.com/kubernetes-sigs/cluster-api/blob/a30de81123009a5f91ade870008c1a35f7ce4b35/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go#L555): ```go // TODO: update once machine controllers have a way to indicate a machine has been provisoned. https://github.com/kubernetes-sigs/cluster-api/issues/253 - // Seeing a node cannot be purely relied upon because the provisioned master will not be registering with - // the stack that provisions it. + // Seeing a node cannot be purely relied upon because the machine running the control plane + // will not be registering with the stack that provisions it. ready := m.Status.NodeRef != nil || len(m.Annotations) > 0 return ready, nil ``` @@ -62,16 +62,16 @@ command does this [here](https://github.com/kubernetes-sigs/cluster-api/blob/a30 {% method %} ## MachineStatus -Like `ProviderSpec`, `ProviderStatus` is recommended to be a serialized API +Like `ProviderSpec`, `ProviderStatus` is recommended to be a serialized API object in a format owned by that provider. -Note that `NodeRef` may not be set. This can happen if the `Machine` and +Note that `NodeRef` may not be set. This can happen if the `Machine` and corresponding `Node` are not within the same cluster. Two reasons this might be the case are: -- During bootstraping the master `Machine` will initially not be in the same +- During bootstrapping, the control plane `Machine` will initially not be in the same cluster which is being created. -- Some providers distinguish between _manager_ and _managed_ clusters. For +- Some providers distinguish between _manager_ and _managed_ clusters. For these providers a `Machine` and it's corresponding `Node` may never be within the same cluster. **TODO**: There are open issues to address this. @@ -125,7 +125,7 @@ method. {% panel style="warning", title="Machines depend on Clusters" %} The Machine actuator methods expect both a `Cluster` and a `Machine` to be passed in. While there is not a strong link between `Cluster`s and `Machine`s, -the machine controller will determine which cluster to pass by looking for a +the machine controller will determine which cluster to pass by looking for a `Cluster` in the same namespace as the `Machine` There are two consequences of this: @@ -138,7 +138,7 @@ There are two consequences of this: --- -[^1] One reason a `Machine` may not be deleted is if it corresponds to the +[^1] One reason a `Machine` may not be deleted is if it corresponds to the node running the Machine controller. [machine_types_source]: https://github.com/kubernetes-sigs/cluster-api/blob/master/pkg/apis/cluster/v1alpha1/machine_types.go diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/common_code/machinedeployment_controller.md b/vendor/github.com/openshift/cluster-api/docs/book/common_code/machinedeployment_controller.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/common_code/machinedeployment_controller.md rename to vendor/github.com/openshift/cluster-api/docs/book/common_code/machinedeployment_controller.md diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/common_code/machineset_controller.md b/vendor/github.com/openshift/cluster-api/docs/book/common_code/machineset_controller.md similarity index 90% rename from vendor/sigs.k8s.io/cluster-api/docs/book/common_code/machineset_controller.md rename to vendor/github.com/openshift/cluster-api/docs/book/common_code/machineset_controller.md index 656e37d99a..c4ca6014df 100644 --- a/vendor/sigs.k8s.io/cluster-api/docs/book/common_code/machineset_controller.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/machineset_controller.md @@ -23,7 +23,7 @@ which implement their intent by modifying provider-specific `Cluster` and ## MachineSetTemplateSpec {% sample lang="go" %} -[import:'MachineSetSpec'](../../../pkg/apis/cluster/v1alpha1/machineset_types.go) +[import:'MachineSetTemplateSpec'](../../../pkg/apis/cluster/v1alpha1/machineset_types.go) {% endmethod %} {% method %} diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/common_code/repository_layout.md b/vendor/github.com/openshift/cluster-api/docs/book/common_code/repository_layout.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/common_code/repository_layout.md rename to vendor/github.com/openshift/cluster-api/docs/book/common_code/repository_layout.md diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/getting_started/existing_providers.md b/vendor/github.com/openshift/cluster-api/docs/book/getting_started/existing_providers.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/getting_started/existing_providers.md rename to vendor/github.com/openshift/cluster-api/docs/book/getting_started/existing_providers.md diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/package-lock.json b/vendor/github.com/openshift/cluster-api/docs/book/package-lock.json similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/package-lock.json rename to vendor/github.com/openshift/cluster-api/docs/book/package-lock.json diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/building_running_and_testing.md b/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/building_running_and_testing.md similarity index 95% rename from vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/building_running_and_testing.md rename to vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/building_running_and_testing.md index e6ea35399a..6ccb13b914 100644 --- a/vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/building_running_and_testing.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/building_running_and_testing.md @@ -52,7 +52,7 @@ make deploy **TODO**: Should deploy a sample `Cluster` and `Machine` resource to verify controllers are reconciling properly. This is troublesome however since before -the actuator stubs are filled in, all we will see is messages to the effect of +the actuator stubs are filled in, all we will see are messages to the effect of "TODO: Not yet implemented"..." ```bash diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/create_actuators.md b/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/create_actuators.md similarity index 93% rename from vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/create_actuators.md rename to vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/create_actuators.md index 54b1b75357..9e88e32c37 100644 --- a/vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/create_actuators.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/create_actuators.md @@ -103,7 +103,7 @@ const ( ) // Actuator is responsible for performing machine reconciliation -type Actuator struct { +type Actuator struct { machinesGetter client.MachinesGetter } @@ -137,7 +137,7 @@ func (a *Actuator) Update(ctx context.Context, cluster *clusterv1.Cluster, machi return fmt.Errorf("TODO: Not yet implemented") } -// Exists test for the existance of a machine and is invoked by the Machine Controller +// Exists tests for the existence of a machine and is invoked by the Machine Controller func (a *Actuator) Exists(ctx context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) (bool, error) { log.Printf("Checking if machine %v for cluster %v exists.", machine.Name, cluster.Name) return false, fmt.Errorf("TODO: Not yet implemented") @@ -153,9 +153,9 @@ func (a *Actuator) GetIP(cluster *clusterv1.Cluster, machine *clusterv1.Machine) return "", fmt.Errorf("TODO: Not yet implemented") } -// GetKubeConfig gets a kubeconfig from the master. -func (a *Actuator) GetKubeConfig(cluster *clusterv1.Cluster, master *clusterv1.Machine) (string, error) { - log.Printf("Getting IP of machine %v for cluster %v.", master.Name, cluster.Name) +// GetKubeConfig gets a kubeconfig from the running control plane. +func (a *Actuator) GetKubeConfig(cluster *clusterv1.Cluster, controlPlaneMachine *clusterv1.Machine) (string, error) { + log.Printf("Getting IP of machine %v for cluster %v.", controlPlaneMachine.Name, cluster.Name) return "", fmt.Errorf("TODO: Not yet implemented") } ``` diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/generate_crds.md b/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/generate_crds.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/generate_crds.md rename to vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/generate_crds.md diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/naming.md b/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/naming.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/naming.md rename to vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/naming.md diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/overview.md b/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/overview.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/overview.md rename to vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/overview.md diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/register_controllers.md b/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/register_controllers.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/register_controllers.md rename to vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/register_controllers.md diff --git a/vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/register_schemes.md b/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/register_schemes.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/book/provider_implementations/register_schemes.md rename to vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/register_schemes.md diff --git a/vendor/sigs.k8s.io/cluster-api/docs/examples/cluster/cluster.yaml b/vendor/github.com/openshift/cluster-api/docs/examples/cluster/cluster.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/examples/cluster/cluster.yaml rename to vendor/github.com/openshift/cluster-api/docs/examples/cluster/cluster.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/docs/examples/machine/machine.yaml b/vendor/github.com/openshift/cluster-api/docs/examples/machine/machine.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/examples/machine/machine.yaml rename to vendor/github.com/openshift/cluster-api/docs/examples/machine/machine.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/docs/examples/machinedeployment/machinedeployment.yaml b/vendor/github.com/openshift/cluster-api/docs/examples/machinedeployment/machinedeployment.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/examples/machinedeployment/machinedeployment.yaml rename to vendor/github.com/openshift/cluster-api/docs/examples/machinedeployment/machinedeployment.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/docs/examples/machineset/machineset.yaml b/vendor/github.com/openshift/cluster-api/docs/examples/machineset/machineset.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/examples/machineset/machineset.yaml rename to vendor/github.com/openshift/cluster-api/docs/examples/machineset/machineset.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/docs/proposals/machine-api-proposal.md b/vendor/github.com/openshift/cluster-api/docs/proposals/machine-api-proposal.md similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/docs/proposals/machine-api-proposal.md rename to vendor/github.com/openshift/cluster-api/docs/proposals/machine-api-proposal.md diff --git a/vendor/sigs.k8s.io/cluster-api/hack/boilerplate.go.txt b/vendor/github.com/openshift/cluster-api/hack/boilerplate.go.txt similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/hack/boilerplate.go.txt rename to vendor/github.com/openshift/cluster-api/hack/boilerplate.go.txt diff --git a/vendor/sigs.k8s.io/cluster-api/hack/boilerplate/boilerplate.Dockerfile.txt b/vendor/github.com/openshift/cluster-api/hack/boilerplate/boilerplate.Dockerfile.txt similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/hack/boilerplate/boilerplate.Dockerfile.txt rename to vendor/github.com/openshift/cluster-api/hack/boilerplate/boilerplate.Dockerfile.txt diff --git a/vendor/sigs.k8s.io/cluster-api/hack/boilerplate/boilerplate.Makefile.txt b/vendor/github.com/openshift/cluster-api/hack/boilerplate/boilerplate.Makefile.txt similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/hack/boilerplate/boilerplate.Makefile.txt rename to vendor/github.com/openshift/cluster-api/hack/boilerplate/boilerplate.Makefile.txt diff --git a/vendor/sigs.k8s.io/cluster-api/hack/boilerplate/boilerplate.bzl.txt b/vendor/github.com/openshift/cluster-api/hack/boilerplate/boilerplate.bzl.txt similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/hack/boilerplate/boilerplate.bzl.txt rename to vendor/github.com/openshift/cluster-api/hack/boilerplate/boilerplate.bzl.txt diff --git a/vendor/sigs.k8s.io/cluster-api/hack/boilerplate/boilerplate.go.txt b/vendor/github.com/openshift/cluster-api/hack/boilerplate/boilerplate.go.txt similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/hack/boilerplate/boilerplate.go.txt rename to vendor/github.com/openshift/cluster-api/hack/boilerplate/boilerplate.go.txt diff --git a/vendor/sigs.k8s.io/cluster-api/hack/boilerplate/boilerplate.py.txt b/vendor/github.com/openshift/cluster-api/hack/boilerplate/boilerplate.py.txt similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/hack/boilerplate/boilerplate.py.txt rename to vendor/github.com/openshift/cluster-api/hack/boilerplate/boilerplate.py.txt diff --git a/vendor/sigs.k8s.io/cluster-api/hack/boilerplate/boilerplate.sh.txt b/vendor/github.com/openshift/cluster-api/hack/boilerplate/boilerplate.sh.txt similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/hack/boilerplate/boilerplate.sh.txt rename to vendor/github.com/openshift/cluster-api/hack/boilerplate/boilerplate.sh.txt diff --git a/vendor/sigs.k8s.io/cluster-api/hack/update-bazel.sh b/vendor/github.com/openshift/cluster-api/hack/update-bazel.sh similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/hack/update-bazel.sh rename to vendor/github.com/openshift/cluster-api/hack/update-bazel.sh diff --git a/vendor/sigs.k8s.io/cluster-api/hack/verify-bazel.sh b/vendor/github.com/openshift/cluster-api/hack/verify-bazel.sh similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/hack/verify-bazel.sh rename to vendor/github.com/openshift/cluster-api/hack/verify-bazel.sh diff --git a/vendor/sigs.k8s.io/cluster-api/hack/verify_boilerplate.py b/vendor/github.com/openshift/cluster-api/hack/verify_boilerplate.py similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/hack/verify_boilerplate.py rename to vendor/github.com/openshift/cluster-api/hack/verify_boilerplate.py index 6ac800a888..22490fa89c 100755 --- a/vendor/sigs.k8s.io/cluster-api/hack/verify_boilerplate.py +++ b/vendor/github.com/openshift/cluster-api/hack/verify_boilerplate.py @@ -157,7 +157,7 @@ def get_regexs(): # Search for "YEAR" which exists in the boilerplate, but shouldn't in the real thing regexs["year"] = re.compile('YEAR') # dates can be 2014, 2015, 2016, 2017 or 2018, company holder names can be anything - regexs["date"] = re.compile('(2014|2015|2016|2017|2018)') + regexs["date"] = re.compile('(2014|2015|2016|2017|2018|2019)') # strip // +build \n\n build constraints regexs["go_build_constraints"] = re.compile(r"^(// \+build.*\n)+\n", re.MULTILINE) # strip #!.* from shell/python scripts diff --git a/vendor/sigs.k8s.io/cluster-api/hack/verify_clientset.sh b/vendor/github.com/openshift/cluster-api/hack/verify_clientset.sh similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/hack/verify_clientset.sh rename to vendor/github.com/openshift/cluster-api/hack/verify_clientset.sh diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/apis/BUILD.bazel similarity index 69% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/apis/BUILD.bazel index 5fb1263e99..05e6c8defc 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/BUILD.bazel @@ -4,12 +4,14 @@ go_library( name = "go_default_library", srcs = [ "addtoscheme_cluster_v1alpha1.go", + "addtoscheme_machine_v1beta1.go", "apis.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/apis", + importpath = "github.com/openshift/cluster-api/pkg/apis", visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/machine/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", ], ) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/addtoscheme_cluster_v1alpha1.go b/vendor/github.com/openshift/cluster-api/pkg/apis/addtoscheme_cluster_v1alpha1.go similarity index 92% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/addtoscheme_cluster_v1alpha1.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/addtoscheme_cluster_v1alpha1.go index 5c1ec47ea6..bc92fbcafb 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/addtoscheme_cluster_v1alpha1.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/addtoscheme_cluster_v1alpha1.go @@ -17,7 +17,7 @@ limitations under the License. package apis import ( - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" ) func init() { diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/fake/doc.go b/vendor/github.com/openshift/cluster-api/pkg/apis/addtoscheme_machine_v1beta1.go similarity index 62% rename from vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/fake/doc.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/addtoscheme_machine_v1beta1.go index 9b99e71670..45f12f0626 100644 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/fake/doc.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/addtoscheme_machine_v1beta1.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +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. @@ -14,7 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen. DO NOT EDIT. +package apis -// This package has the automatically generated fake clientset. -package fake +import ( + "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" +) + +func init() { + // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back + AddToSchemes = append(AddToSchemes, v1beta1.SchemeBuilder.AddToScheme) +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/apis.go b/vendor/github.com/openshift/cluster-api/pkg/apis/apis.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/apis.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/apis.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/BUILD.bazel similarity index 70% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/BUILD.bazel index f8a8882a79..f58dcf0c0a 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/BUILD.bazel @@ -3,6 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["group.go"], - importpath = "sigs.k8s.io/cluster-api/pkg/apis/cluster", + importpath = "github.com/openshift/cluster-api/pkg/apis/cluster", visibility = ["//visibility:public"], ) diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/BUILD.bazel new file mode 100644 index 0000000000..ac9e600f3f --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "consts.go", + "plugins.go", + ], + importpath = "github.com/openshift/cluster-api/pkg/apis/cluster/common", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/pkg/errors:go_default_library", + "//vendor/k8s.io/klog:go_default_library", + ], +) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/consts.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/consts.go similarity index 91% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/consts.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/consts.go index 81fed067fe..287480250d 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/consts.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/consts.go @@ -58,6 +58,15 @@ const ( // // Example: cannot resolve EC2 IP address. DeleteMachineError MachineStatusError = "DeleteError" + + // This error indicates that the machine did not join the cluster + // as a new node within the expected timeframe after instance + // creation at the provider succeeded + // + // Example use case: A controller that deletes Machines which do + // not result in a Node joining the cluster within a given timeout + // and that are managed by a MachineSet + JoinClusterTimeoutMachineError = "JoinClusterTimeoutError" ) type ClusterStatusError string diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/plugins.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/plugins.go similarity index 93% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/plugins.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/plugins.go index 276cbe9be5..8c2083d88c 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/plugins.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/common/plugins.go @@ -17,9 +17,9 @@ limitations under the License. package common import ( - "fmt" "sync" + "github.com/pkg/errors" "k8s.io/klog" ) @@ -45,7 +45,7 @@ func ClusterProvisioner(name string) (interface{}, error) { defer providersMutex.Unlock() provisioner, found := providers[name] if !found { - return nil, fmt.Errorf("unable to find provisioner for %s", name) + return nil, errors.Errorf("unable to find provisioner for %s", name) } return provisioner, nil } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/group.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/group.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/group.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/group.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/BUILD.bazel similarity index 96% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/BUILD.bazel index 074fbc10c0..1e5c0f9832 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/BUILD.bazel @@ -14,7 +14,7 @@ go_library( "register.go", "zz_generated.deepcopy.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1", + importpath = "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1", visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/common:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go index c0cd29a46b..dae8b49ceb 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go @@ -20,8 +20,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "github.com/openshift/cluster-api/pkg/apis/cluster/common" "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" ) const ClusterFinalizer = "cluster.cluster.k8s.io" diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/common_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/common_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/common_types.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/common_types.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/defaults.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/defaults.go similarity index 97% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/defaults.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/defaults.go index f9aeb4b438..a64e64ab37 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/defaults.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/defaults.go @@ -17,9 +17,9 @@ limitations under the License. package v1alpha1 import ( + "github.com/openshift/cluster-api/pkg/apis/cluster/common" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" ) // PopulateDefaultsMachineDeployment fills in default field values diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/doc.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/doc.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/doc.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/doc.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go similarity index 74% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go index 5a10bba39f..6c6cc4a3c2 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go @@ -21,7 +21,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" + "github.com/openshift/cluster-api/pkg/apis/cluster/common" ) // Finalizer is set on PrepareForCreate callback @@ -47,19 +47,19 @@ type Machine struct { /// [MachineSpec] // MachineSpec defines the desired state of Machine type MachineSpec struct { - // This ObjectMeta will autopopulate the Node created. Use this to + // ObjectMeta will autopopulate the Node created. Use this to // indicate what labels, annotations, name prefix, etc., should be used // when creating the Node. // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // The full, authoritative list of taints to apply to the corresponding + // Taints is the full, authoritative list of taints to apply to the corresponding // Node. This list will overwrite any modifications made to the Node on // an ongoing basis. // +optional Taints []corev1.Taint `json:"taints,omitempty"` - // Provider-specific configuration to use during node creation. + // ProviderSpec details Provider-specific configuration to use during node creation. // +optional ProviderSpec ProviderSpec `json:"providerSpec"` @@ -72,7 +72,7 @@ type MachineSpec struct { // +optional Versions MachineVersionInfo `json:"versions,omitempty"` - // To populate in the associated Node for dynamic kubelet config. This + // ConfigSource is used to populate in the associated Node for dynamic kubelet config. This // field already exists in Node, so any updates to it in the Machine // spec will be automatically copied to the linked NodeRef from the // status. The rest of dynamic kubelet config support should then work @@ -86,15 +86,15 @@ type MachineSpec struct { /// [MachineStatus] // MachineStatus defines the observed state of Machine type MachineStatus struct { - // If the corresponding Node exists, this will point to its object. + // NodeRef will point to the corresponding Node if it exists. // +optional NodeRef *corev1.ObjectReference `json:"nodeRef,omitempty"` - // When was this status last observed + // LastUpdated identifies when this status was last observed. // +optional LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` - // The current versions of software on the corresponding Node (if it + // Versions specifies the current versions of software on the corresponding Node (if it // exists). This is provided for a few reasons: // // 1) It is more convenient than checking the NodeRef, traversing it to @@ -104,20 +104,18 @@ type MachineStatus struct { // so that if the structure of Node.Status.NodeInfo changes, only // machine controllers need to be updated, rather than every client // of the Machines API. - // 3) There is no other simple way to check the ControlPlane + // 3) There is no other simple way to check the control plane // version. A client would have to connect directly to the apiserver // running on the target node in order to find out its version. // +optional Versions *MachineVersionInfo `json:"versions,omitempty"` - // In the event that there is a terminal problem reconciling the - // Machine, both ErrorReason and ErrorMessage will be set. ErrorReason - // will be populated with a succinct value suitable for machine - // interpretation, while ErrorMessage will contain a more verbose - // string suitable for logging and human consumption. + // ErrorReason will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a succinct value suitable + // for machine interpretation. // - // These fields should not be set for transitive errors that a - // controller faces that are expected to be fixed automatically over + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over // time (like service outages), but instead indicate that something is // fundamentally wrong with the Machine's spec or the configuration of // the controller, and that manual intervention is required. Examples @@ -130,10 +128,27 @@ type MachineStatus struct { // controller's output. // +optional ErrorReason *common.MachineStatusError `json:"errorReason,omitempty"` + + // ErrorMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. // +optional ErrorMessage *string `json:"errorMessage,omitempty"` - // Provider-specific status. + // ProviderStatus details a Provider-specific status. // It is recommended that providers maintain their // own versioned API types that should be // serialized/deserialized from this field. @@ -144,7 +159,7 @@ type MachineStatus struct { // +optional Addresses []corev1.NodeAddress `json:"addresses,omitempty"` - // List of conditions synced from the node conditions of the corresponding node-object. + // Conditions lists the conditions synced from the node conditions of the corresponding node-object. // Machine-controller is responsible for keeping conditions up-to-date. // MachineSet controller will be taking these conditions as a signal to decide if // machine is healthy or needs to be replaced. @@ -170,7 +185,7 @@ type LastOperation struct { // Description is the human-readable description of the last operation. Description *string `json:"description,omitempty"` - // LastUpdateTime is the timestamp at which LastOperation API was last-updated. + // LastUpdated is the timestamp at which LastOperation API was last-updated. LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` // State is the current status of the last performed operation. @@ -186,12 +201,12 @@ type LastOperation struct { /// [MachineVersionInfo] type MachineVersionInfo struct { - // Semantic version of kubelet to run + // Kubelet is the semantic version of kubelet to run Kubelet string `json:"kubelet"` - // Semantic version of the Kubernetes control plane to + // ControlPlane is the semantic version of the Kubernetes control plane to // run. This should only be populated when the machine is a - // master. + // control plane. // +optional ControlPlane string `json:"controlPlane,omitempty"` } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machineclass_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineclass_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machineclass_types.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineclass_types.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go similarity index 99% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go index 690d095ad0..be0cc25ff6 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go @@ -20,7 +20,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" + "github.com/openshift/cluster-api/pkg/apis/cluster/common" ) /// [MachineDeploymentSpec] diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go similarity index 99% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go index 40c04286a3..95644395ac 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go @@ -22,9 +22,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" + "github.com/openshift/cluster-api/pkg/apis/cluster/common" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" ) // +genclient diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/register.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/register.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/register.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/register.go diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/testutil/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/testutil/BUILD.bazel new file mode 100644 index 0000000000..d128bab6cc --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/testutil/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["testutil.go"], + importpath = "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/testutil", + visibility = ["//visibility:public"], + deps = ["//pkg/apis/cluster/v1alpha1:go_default_library"], +) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/testutil/testutil.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/testutil/testutil.go similarity index 93% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/testutil/testutil.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/testutil/testutil.go index 2af50c96d8..9bfeaed981 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/testutil/testutil.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/testutil/testutil.go @@ -16,7 +16,7 @@ limitations under the License. package testutil -import "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" +import "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" // GetVanillaCluster return a bare minimum functional cluster resource object func GetVanillaCluster() v1alpha1.Cluster { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go similarity index 99% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go index 9b0a035208..fd8e1f63a9 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go @@ -21,10 +21,10 @@ limitations under the License. package v1alpha1 import ( + common "github.com/openshift/cluster-api/pkg/apis/cluster/common" v1 "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" intstr "k8s.io/apimachinery/pkg/util/intstr" - common "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/BUILD.bazel similarity index 55% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/apis/machine/BUILD.bazel index b5f66c2d09..c47e656b76 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/BUILD.bazel @@ -2,7 +2,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", - srcs = ["provisioner.go"], - importpath = "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap", + srcs = ["group.go"], + importpath = "github.com/openshift/cluster-api/pkg/apis/machine", visibility = ["//visibility:public"], ) diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/BUILD.bazel new file mode 100644 index 0000000000..311c852d40 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "consts.go", + "plugins.go", + ], + importpath = "github.com/openshift/cluster-api/pkg/apis/machine/common", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/pkg/errors:go_default_library", + "//vendor/k8s.io/klog:go_default_library", + ], +) diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/consts.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/consts.go new file mode 100644 index 0000000000..287480250d --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/consts.go @@ -0,0 +1,114 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package common + +// Constants aren't automatically generated for unversioned packages. +// Instead share the same constant for all versioned packages +type MachineStatusError string + +const ( + // Represents that the combination of configuration in the MachineSpec + // is not supported by this cluster. This is not a transient error, but + // indicates a state that must be fixed before progress can be made. + // + // Example: the ProviderSpec specifies an instance type that doesn't exist, + InvalidConfigurationMachineError MachineStatusError = "InvalidConfiguration" + + // This indicates that the MachineSpec has been updated in a way that + // is not supported for reconciliation on this cluster. The spec may be + // completely valid from a configuration standpoint, but the controller + // does not support changing the real world state to match the new + // spec. + // + // Example: the responsible controller is not capable of changing the + // container runtime from docker to rkt. + UnsupportedChangeMachineError MachineStatusError = "UnsupportedChange" + + // This generally refers to exceeding one's quota in a cloud provider, + // or running out of physical machines in an on-premise environment. + InsufficientResourcesMachineError MachineStatusError = "InsufficientResources" + + // There was an error while trying to create a Node to match this + // Machine. This may indicate a transient problem that will be fixed + // automatically with time, such as a service outage, or a terminal + // error during creation that doesn't match a more specific + // MachineStatusError value. + // + // Example: timeout trying to connect to GCE. + CreateMachineError MachineStatusError = "CreateError" + + // An error was encountered while trying to delete the Node that this + // Machine represents. This could be a transient or terminal error, but + // will only be observable if the provider's Machine controller has + // added a finalizer to the object to more gracefully handle deletions. + // + // Example: cannot resolve EC2 IP address. + DeleteMachineError MachineStatusError = "DeleteError" + + // This error indicates that the machine did not join the cluster + // as a new node within the expected timeframe after instance + // creation at the provider succeeded + // + // Example use case: A controller that deletes Machines which do + // not result in a Node joining the cluster within a given timeout + // and that are managed by a MachineSet + JoinClusterTimeoutMachineError = "JoinClusterTimeoutError" +) + +type ClusterStatusError string + +const ( + // InvalidConfigurationClusterError indicates that the cluster + // configuration is invalid. + InvalidConfigurationClusterError ClusterStatusError = "InvalidConfiguration" + + // UnsupportedChangeClusterError indicates that the cluster + // spec has been updated in an unsupported way. That cannot be + // reconciled. + UnsupportedChangeClusterError ClusterStatusError = "UnsupportedChange" + + // CreateClusterError indicates that an error was encountered + // when trying to create the cluster. + CreateClusterError ClusterStatusError = "CreateError" + + // UpdateClusterError indicates that an error was encountered + // when trying to update the cluster. + UpdateClusterError ClusterStatusError = "UpdateError" + + // DeleteClusterError indicates that an error was encountered + // when trying to delete the cluster. + DeleteClusterError ClusterStatusError = "DeleteError" +) + +type MachineSetStatusError string + +const ( + // Represents that the combination of configuration in the MachineTemplateSpec + // is not supported by this cluster. This is not a transient error, but + // indicates a state that must be fixed before progress can be made. + // + // Example: the ProviderSpec specifies an instance type that doesn't exist. + InvalidConfigurationMachineSetError MachineSetStatusError = "InvalidConfiguration" +) + +type MachineDeploymentStrategyType string + +const ( + // Replace the old MachineSet by new one using rolling update + // i.e. gradually scale down the old MachineSet and scale up the new one. + RollingUpdateMachineDeploymentStrategyType MachineDeploymentStrategyType = "RollingUpdate" +) diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/plugins.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/plugins.go new file mode 100644 index 0000000000..8c2083d88c --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/plugins.go @@ -0,0 +1,51 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package common + +import ( + "sync" + + "github.com/pkg/errors" + "k8s.io/klog" +) + +var ( + providersMutex sync.Mutex + providers = make(map[string]interface{}) +) + +// RegisterClusterProvisioner registers a ClusterProvisioner by name. This +// is expected to happen during app startup. +func RegisterClusterProvisioner(name string, provisioner interface{}) { + providersMutex.Lock() + defer providersMutex.Unlock() + if _, found := providers[name]; found { + klog.Fatalf("Cluster provisioner %q was registered twice", name) + } + klog.V(1).Infof("Registered cluster provisioner %q", name) + providers[name] = provisioner +} + +func ClusterProvisioner(name string) (interface{}, error) { + providersMutex.Lock() + defer providersMutex.Unlock() + provisioner, found := providers[name] + if !found { + return nil, errors.Errorf("unable to find provisioner for %s", name) + } + return provisioner, nil +} diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/provisioner.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/group.go similarity index 78% rename from vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/provisioner.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/machine/group.go index 03865ebd78..6c4be57b0c 100644 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/provisioner.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/group.go @@ -14,11 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bootstrap - -// Can provision a kubernetes cluster -type ClusterProvisioner interface { - Create() error - Delete() error - GetKubeconfig() (string, error) -} +// Package machine contains machine API versions +package machine 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 new file mode 100644 index 0000000000..3fc6c32d0d --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/BUILD.bazel @@ -0,0 +1,52 @@ +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", + "machine_types.go", + "machineclass_types.go", + "machinedeployment_types.go", + "machineset_types.go", + "register.go", + "zz_generated.deepcopy.go", + ], + importpath = "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1", + visibility = ["//visibility:public"], + deps = [ + "//pkg/apis/machine/common:go_default_library", + "//vendor/k8s.io/api/core/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", + "//vendor/sigs.k8s.io/controller-runtime/pkg/runtime/scheme:go_default_library", + ], +) + +go_test( + name = "go_default_test", + srcs = [ + "cluster_types_test.go", + "machine_types_test.go", + "machinedeployment_types_test.go", + "machineset_types_test.go", + "v1alpha1_suite_test.go", + ], + embed = [":go_default_library"], + deps = [ + "//vendor/golang.org/x/net/context:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", + "//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library", + "//vendor/k8s.io/client-go/rest:go_default_library", + "//vendor/sigs.k8s.io/controller-runtime/pkg/client:go_default_library", + "//vendor/sigs.k8s.io/controller-runtime/pkg/envtest:go_default_library", + ], +) 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 new file mode 100644 index 0000000000..134a63abb6 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/cluster_types.go @@ -0,0 +1,165 @@ +/* +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/common_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/common_types.go new file mode 100644 index 0000000000..7884754101 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/common_types.go @@ -0,0 +1,58 @@ +/* +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 ( + corev1 "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// ProviderSpec defines the configuration to use during node creation. +type ProviderSpec struct { + + // No more than one of the following may be specified. + + // Value is an inlined, serialized representation of the resource + // configuration. It is recommended that providers maintain their own + // versioned API types that should be serialized/deserialized from this + // field, akin to component config. + // +optional + Value *runtime.RawExtension `json:"value,omitempty"` + + // Source for the provider configuration. Cannot be used if value is + // not empty. + // +optional + ValueFrom *ProviderSpecSource `json:"valueFrom,omitempty"` +} + +// ProviderSpecSource represents a source for the provider-specific +// resource configuration. +type ProviderSpecSource struct { + // The machine class from which the provider config should be sourced. + // +optional + MachineClass *MachineClassRef `json:"machineClass,omitempty"` +} + +// MachineClassRef is a reference to the MachineClass object. Controllers should find the right MachineClass using this reference. +type MachineClassRef struct { + // +optional + *corev1.ObjectReference `json:",inline"` + + // Provider is the name of the cloud-provider which MachineClass is intended for. + // +optional + Provider string `json:"provider,omitempty"` +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/defaults.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/defaults.go new file mode 100644 index 0000000000..354cfa3f6e --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/defaults.go @@ -0,0 +1,74 @@ +/* +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 ( + "github.com/openshift/cluster-api/pkg/apis/machine/common" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" +) + +// PopulateDefaultsMachineDeployment fills in default field values +// Currently it is called after reading objects, but it could be called in an admission webhook also +func PopulateDefaultsMachineDeployment(d *MachineDeployment) { + if d.Spec.Replicas == nil { + d.Spec.Replicas = new(int32) + *d.Spec.Replicas = 1 + } + + if d.Spec.MinReadySeconds == nil { + d.Spec.MinReadySeconds = new(int32) + *d.Spec.MinReadySeconds = 0 + } + + if d.Spec.RevisionHistoryLimit == nil { + d.Spec.RevisionHistoryLimit = new(int32) + *d.Spec.RevisionHistoryLimit = 1 + } + + if d.Spec.ProgressDeadlineSeconds == nil { + d.Spec.ProgressDeadlineSeconds = new(int32) + *d.Spec.ProgressDeadlineSeconds = 600 + } + + if d.Spec.Strategy == nil { + d.Spec.Strategy = &MachineDeploymentStrategy{} + } + + if d.Spec.Strategy.Type == "" { + d.Spec.Strategy.Type = common.RollingUpdateMachineDeploymentStrategyType + } + + // Default RollingUpdate strategy only if strategy type is RollingUpdate. + if d.Spec.Strategy.Type == common.RollingUpdateMachineDeploymentStrategyType { + if d.Spec.Strategy.RollingUpdate == nil { + d.Spec.Strategy.RollingUpdate = &MachineRollingUpdateDeployment{} + } + if d.Spec.Strategy.RollingUpdate.MaxSurge == nil { + ios1 := intstr.FromInt(1) + d.Spec.Strategy.RollingUpdate.MaxSurge = &ios1 + } + if d.Spec.Strategy.RollingUpdate.MaxUnavailable == nil { + ios0 := intstr.FromInt(0) + d.Spec.Strategy.RollingUpdate.MaxUnavailable = &ios0 + } + } + + if len(d.Namespace) == 0 { + d.Namespace = metav1.NamespaceDefault + } +} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/doc.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/doc.go similarity index 65% rename from vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/doc.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/doc.go index e6614c0da6..ca985dc5b9 100644 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/doc.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors. +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. @@ -14,7 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:deepcopy-gen=package +// Package v1beta1 contains API Schema definitions for the machine v1beta1 API group +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=sigs.k8s.io/cluster-api/pkg/apis/machine // +k8s:defaulter-gen=TypeMeta -// +groupName=example.crd.code-generator.k8s.io -package v1 +// +groupName=machine.openshift.io +package v1beta1 diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machine_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machine_types.go new file mode 100644 index 0000000000..657d7aeeaa --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machine_types.go @@ -0,0 +1,227 @@ +/* +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 ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + + "github.com/openshift/cluster-api/pkg/apis/machine/common" +) + +// Finalizer is set on PrepareForCreate callback +const MachineFinalizer = "machine.machine.openshift.io" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +/// [Machine] +// Machine is the Schema for the machines API +// +k8s:openapi-gen=true +// +kubebuilder:subresource:status +type Machine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec MachineSpec `json:"spec,omitempty"` + Status MachineStatus `json:"status,omitempty"` +} + +/// [Machine] + +/// [MachineSpec] +// MachineSpec defines the desired state of Machine +type MachineSpec struct { + // ObjectMeta will autopopulate the Node created. Use this to + // indicate what labels, annotations, name prefix, etc., should be used + // when creating the Node. + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Taints is the full, authoritative list of taints to apply to the corresponding + // Node. This list will overwrite any modifications made to the Node on + // an ongoing basis. + // +optional + Taints []corev1.Taint `json:"taints,omitempty"` + + // ProviderSpec details Provider-specific configuration to use during node creation. + // +optional + ProviderSpec ProviderSpec `json:"providerSpec"` + + // Versions of key software to use. This field is optional at cluster + // creation time, and omitting the field indicates that the cluster + // installation tool should select defaults for the user. These + // defaults may differ based on the cluster installer, but the tool + // should populate the values it uses when persisting Machine objects. + // A Machine spec missing this field at runtime is invalid. + // +optional + Versions MachineVersionInfo `json:"versions,omitempty"` + + // ConfigSource is used to populate in the associated Node for dynamic kubelet config. This + // field already exists in Node, so any updates to it in the Machine + // spec will be automatically copied to the linked NodeRef from the + // status. The rest of dynamic kubelet config support should then work + // as-is. + // +optional + ConfigSource *corev1.NodeConfigSource `json:"configSource,omitempty"` +} + +/// [MachineSpec] + +/// [MachineStatus] +// MachineStatus defines the observed state of Machine +type MachineStatus struct { + // NodeRef will point to the corresponding Node if it exists. + // +optional + NodeRef *corev1.ObjectReference `json:"nodeRef,omitempty"` + + // LastUpdated identifies when this status was last observed. + // +optional + LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` + + // Versions specifies the current versions of software on the corresponding Node (if it + // exists). This is provided for a few reasons: + // + // 1) It is more convenient than checking the NodeRef, traversing it to + // the Node, and finding the appropriate field in Node.Status.NodeInfo + // (which uses different field names and formatting). + // 2) It removes some of the dependency on the structure of the Node, + // so that if the structure of Node.Status.NodeInfo changes, only + // machine controllers need to be updated, rather than every client + // of the Machines API. + // 3) There is no other simple way to check the control plane + // version. A client would have to connect directly to the apiserver + // running on the target node in order to find out its version. + // +optional + Versions *MachineVersionInfo `json:"versions,omitempty"` + + // ErrorReason will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a succinct value suitable + // for machine interpretation. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + ErrorReason *common.MachineStatusError `json:"errorReason,omitempty"` + + // ErrorMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + ErrorMessage *string `json:"errorMessage,omitempty"` + + // ProviderStatus details a Provider-specific status. + // It is recommended that providers maintain their + // own versioned API types that should be + // serialized/deserialized from this field. + // +optional + ProviderStatus *runtime.RawExtension `json:"providerStatus,omitempty"` + + // Addresses is a list of addresses assigned to the machine. Queried from cloud provider, if available. + // +optional + Addresses []corev1.NodeAddress `json:"addresses,omitempty"` + + // Conditions lists the conditions synced from the node conditions of the corresponding node-object. + // Machine-controller is responsible for keeping conditions up-to-date. + // MachineSet controller will be taking these conditions as a signal to decide if + // machine is healthy or needs to be replaced. + // Refer: https://kubernetes.io/docs/concepts/architecture/nodes/#condition + // +optional + Conditions []corev1.NodeCondition `json:"conditions,omitempty"` + + // LastOperation describes the last-operation performed by the machine-controller. + // This API should be useful as a history in terms of the latest operation performed on the + // specific machine. It should also convey the state of the latest-operation for example if + // it is still on-going, failed or completed successfully. + // +optional + LastOperation *LastOperation `json:"lastOperation,omitempty"` + + // Phase represents the current phase of machine actuation. + // E.g. Pending, Running, Terminating, Failed etc. + // +optional + Phase *string `json:"phase,omitempty"` +} + +// LastOperation represents the detail of the last performed operation on the MachineObject. +type LastOperation struct { + // Description is the human-readable description of the last operation. + Description *string `json:"description,omitempty"` + + // LastUpdated is the timestamp at which LastOperation API was last-updated. + LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` + + // State is the current status of the last performed operation. + // E.g. Processing, Failed, Successful etc + State *string `json:"state,omitempty"` + + // Type is the type of operation which was last performed. + // E.g. Create, Delete, Update etc + Type *string `json:"type,omitempty"` +} + +/// [MachineStatus] + +/// [MachineVersionInfo] +type MachineVersionInfo struct { + // Kubelet is the semantic version of kubelet to run + Kubelet string `json:"kubelet"` + + // ControlPlane is the semantic version of the Kubernetes control plane to + // run. This should only be populated when the machine is a + // control plane. + // +optional + ControlPlane string `json:"controlPlane,omitempty"` +} + +/// [MachineVersionInfo] + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MachineList contains a list of Machine +type MachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Machine `json:"items"` +} + +func init() { + SchemeBuilder.Register(&Machine{}, &MachineList{}) +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineclass_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineclass_types.go new file mode 100644 index 0000000000..85a1ea37d0 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineclass_types.go @@ -0,0 +1,78 @@ +/* +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" +) + +// +genclient +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +/// [MachineClass] +// MachineClass can be used to templatize and re-use provider configuration +// across multiple Machines / MachineSets / MachineDeployments. +// +k8s:openapi-gen=true +// +resource:path=machineclasses +type MachineClass struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // The total capacity available on this machine type (cpu/memory/disk). + // + // WARNING: It is up to the creator of the MachineClass to ensure that + // this field is consistent with the underlying machine that will + // be provisioned when this class is used, to inform higher level + // automation (e.g. the cluster autoscaler). + // TODO(hardikdr) Add allocatable field once requirements are clear from autoscaler-clusterapi // integration topic. + // Capacity corev1.ResourceList `json:"capacity"` + + // How much capacity is actually allocatable on this machine. + // Must be equal to or less than the capacity, and when less + // indicates the resources reserved for system overhead. + // + // WARNING: It is up to the creator of the MachineClass to ensure that + // this field is consistent with the underlying machine that will + // be provisioned when this class is used, to inform higher level + // automation (e.g. the cluster autoscaler). + // TODO(hardikdr) Add allocatable field once requirements are clear from autoscaler-clusterapi // integration topic. + // Allocatable corev1.ResourceList `json:"allocatable"` + + // Provider-specific configuration to use during node creation. + ProviderSpec runtime.RawExtension `json:"providerSpec"` + + // TODO: should this use an api.ObjectReference to a 'MachineTemplate' instead? + // A link to the MachineTemplate that will be used to create provider + // specific configuration for Machines of this class. + // MachineTemplate corev1.ObjectReference `json:machineTemplate` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MachineClassList contains a list of MachineClasses +type MachineClassList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MachineClass `json:"items"` +} + +func init() { + SchemeBuilder.Register(&MachineClass{}, &MachineClassList{}) +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machinedeployment_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machinedeployment_types.go new file mode 100644 index 0000000000..8e892ecc07 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machinedeployment_types.go @@ -0,0 +1,194 @@ +/* +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/util/intstr" + + "github.com/openshift/cluster-api/pkg/apis/machine/common" +) + +/// [MachineDeploymentSpec] +// MachineDeploymentSpec defines the desired state of MachineDeployment +type MachineDeploymentSpec struct { + // Number of desired machines. Defaults to 1. + // This is a pointer to distinguish between explicit zero and not specified. + Replicas *int32 `json:"replicas,omitempty"` + + // Label selector for machines. Existing MachineSets whose machines are + // selected by this will be the ones affected by this deployment. + // It must match the machine template's labels. + Selector metav1.LabelSelector `json:"selector"` + + // Template describes the machines that will be created. + Template MachineTemplateSpec `json:"template"` + + // The deployment strategy to use to replace existing machines with + // new ones. + // +optional + Strategy *MachineDeploymentStrategy `json:"strategy,omitempty"` + + // Minimum number of seconds for which a newly created machine should + // be ready. + // Defaults to 0 (machine will be considered available as soon as it + // is ready) + // +optional + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + + // The number of old MachineSets to retain to allow rollback. + // This is a pointer to distinguish between explicit zero and not specified. + // Defaults to 1. + // +optional + RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` + + // Indicates that the deployment is paused. + // +optional + Paused bool `json:"paused,omitempty"` + + // The maximum time in seconds for a deployment to make progress before it + // is considered to be failed. The deployment controller will continue to + // process failed deployments and a condition with a ProgressDeadlineExceeded + // reason will be surfaced in the deployment status. Note that progress will + // not be estimated during the time a deployment is paused. Defaults to 600s. + ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` +} + +/// [MachineDeploymentSpec] + +/// [MachineDeploymentStrategy] +// MachineDeploymentStrategy describes how to replace existing machines +// with new ones. +type MachineDeploymentStrategy struct { + // Type of deployment. Currently the only supported strategy is + // "RollingUpdate". + // Default is RollingUpdate. + // +optional + Type common.MachineDeploymentStrategyType `json:"type,omitempty"` + + // Rolling update config params. Present only if + // MachineDeploymentStrategyType = RollingUpdate. + // +optional + RollingUpdate *MachineRollingUpdateDeployment `json:"rollingUpdate,omitempty"` +} + +/// [MachineDeploymentStrategy] + +/// [MachineRollingUpdateDeployment] +// Spec to control the desired behavior of rolling update. +type MachineRollingUpdateDeployment struct { + // The maximum number of machines that can be unavailable during the update. + // Value can be an absolute number (ex: 5) or a percentage of desired + // machines (ex: 10%). + // Absolute number is calculated from percentage by rounding down. + // This can not be 0 if MaxSurge is 0. + // Defaults to 0. + // Example: when this is set to 30%, the old MachineSet can be scaled + // down to 70% of desired machines immediately when the rolling update + // starts. Once new machines are ready, old MachineSet can be scaled + // down further, followed by scaling up the new MachineSet, ensuring + // that the total number of machines available at all times + // during the update is at least 70% of desired machines. + // +optional + MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"` + + // The maximum number of machines that can be scheduled above the + // desired number of machines. + // Value can be an absolute number (ex: 5) or a percentage of + // desired machines (ex: 10%). + // This can not be 0 if MaxUnavailable is 0. + // Absolute number is calculated from percentage by rounding up. + // Defaults to 1. + // Example: when this is set to 30%, the new MachineSet can be scaled + // up immediately when the rolling update starts, such that the total + // number of old and new machines do not exceed 130% of desired + // machines. Once old machines have been killed, new MachineSet can + // be scaled up further, ensuring that total number of machines running + // at any time during the update is at most 130% of desired machines. + // +optional + MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"` +} + +/// [MachineRollingUpdateDeployment] + +/// [MachineDeploymentStatus] +// MachineDeploymentStatus defines the observed state of MachineDeployment +type MachineDeploymentStatus struct { + // The generation observed by the deployment controller. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"` + + // Total number of non-terminated machines targeted by this deployment + // (their labels match the selector). + // +optional + Replicas int32 `json:"replicas,omitempty" protobuf:"varint,2,opt,name=replicas"` + + // Total number of non-terminated machines targeted by this deployment + // that have the desired template spec. + // +optional + UpdatedReplicas int32 `json:"updatedReplicas,omitempty" protobuf:"varint,3,opt,name=updatedReplicas"` + + // Total number of ready machines targeted by this deployment. + // +optional + ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,7,opt,name=readyReplicas"` + + // Total number of available machines (ready for at least minReadySeconds) + // targeted by this deployment. + // +optional + AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,4,opt,name=availableReplicas"` + + // Total number of unavailable machines targeted by this deployment. + // This is the total number of machines that are still required for + // the deployment to have 100% available capacity. They may either + // be machines that are running but not yet available or machines + // that still have not been created. + // +optional + UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"` +} + +/// [MachineDeploymentStatus] + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +/// [MachineDeployment] +// MachineDeployment is the Schema for the machinedeployments API +// +k8s:openapi-gen=true +// +kubebuilder:subresource:status +// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector +type MachineDeployment struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec MachineDeploymentSpec `json:"spec,omitempty"` + Status MachineDeploymentStatus `json:"status,omitempty"` +} + +/// [MachineDeployment] + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MachineDeploymentList contains a list of MachineDeployment +type MachineDeploymentList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MachineDeployment `json:"items"` +} + +func init() { + SchemeBuilder.Register(&MachineDeployment{}, &MachineDeploymentList{}) +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineset_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineset_types.go new file mode 100644 index 0000000000..ee810bc94d --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineset_types.go @@ -0,0 +1,187 @@ +/* +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 ( + "log" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" + + "github.com/openshift/cluster-api/pkg/apis/machine/common" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +/// [MachineSet] +// MachineSet ensures that a specified number of machines replicas are running at any given time. +// +k8s:openapi-gen=true +// +kubebuilder:subresource:status +// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector +type MachineSet struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec MachineSetSpec `json:"spec,omitempty"` + Status MachineSetStatus `json:"status,omitempty"` +} + +/// [MachineSet] + +/// [MachineSetSpec] +// MachineSetSpec defines the desired state of MachineSet +type MachineSetSpec struct { + // Replicas is the number of desired replicas. + // This is a pointer to distinguish between explicit zero and unspecified. + // Defaults to 1. + // +optional + Replicas *int32 `json:"replicas,omitempty"` + + // MinReadySeconds is the minimum number of seconds for which a newly created machine should be ready. + // Defaults to 0 (machine will be considered available as soon as it is ready) + // +optional + MinReadySeconds int32 `json:"minReadySeconds,omitempty"` + + // Selector is a label query over machines that should match the replica count. + // Label keys and values that must match in order to be controlled by this MachineSet. + // It must match the machine template's labels. + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + Selector metav1.LabelSelector `json:"selector"` + + // Template is the object that describes the machine that will be created if + // insufficient replicas are detected. + // +optional + Template MachineTemplateSpec `json:"template,omitempty"` +} + +/// [MachineSetSpec] // doxygen marker + +/// [MachineTemplateSpec] // doxygen marker +// MachineTemplateSpec describes the data needed to create a Machine from a template +type MachineTemplateSpec struct { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Specification of the desired behavior of the machine. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status + // +optional + Spec MachineSpec `json:"spec,omitempty"` +} + +/// [MachineTemplateSpec] + +/// [MachineSetStatus] +// MachineSetStatus defines the observed state of MachineSet +type MachineSetStatus struct { + // Replicas is the most recently observed number of replicas. + Replicas int32 `json:"replicas"` + + // The number of replicas that have labels matching the labels of the machine template of the MachineSet. + // +optional + FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"` + + // The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready". + // +optional + ReadyReplicas int32 `json:"readyReplicas,omitempty"` + + // The number of available replicas (ready for at least minReadySeconds) for this MachineSet. + // +optional + AvailableReplicas int32 `json:"availableReplicas,omitempty"` + + // ObservedGeneration reflects the generation of the most recently observed MachineSet. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // In the event that there is a terminal problem reconciling the + // replicas, both ErrorReason and ErrorMessage will be set. ErrorReason + // will be populated with a succinct value suitable for machine + // interpretation, while ErrorMessage will contain a more verbose + // string suitable for logging and human consumption. + // + // These fields should not be set for transitive errors that a + // controller faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the MachineTemplate's spec or the configuration of + // the machine controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the machine controller, or the + // responsible machine controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the MachineSet object and/or logged in the + // controller's output. + // +optional + ErrorReason *common.MachineSetStatusError `json:"errorReason,omitempty"` + // +optional + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +/// [MachineSetStatus] + +func (machineSet *MachineSet) Validate() field.ErrorList { + errors := field.ErrorList{} + + // validate spec.selector and spec.template.labels + fldPath := field.NewPath("spec") + errors = append(errors, metav1validation.ValidateLabelSelector(&machineSet.Spec.Selector, fldPath.Child("selector"))...) + if len(machineSet.Spec.Selector.MatchLabels)+len(machineSet.Spec.Selector.MatchExpressions) == 0 { + errors = append(errors, field.Invalid(fldPath.Child("selector"), machineSet.Spec.Selector, "empty selector is not valid for MachineSet.")) + } + selector, err := metav1.LabelSelectorAsSelector(&machineSet.Spec.Selector) + if err != nil { + errors = append(errors, field.Invalid(fldPath.Child("selector"), machineSet.Spec.Selector, "invalid label selector.")) + } else { + labels := labels.Set(machineSet.Spec.Template.Labels) + if !selector.Matches(labels) { + errors = append(errors, field.Invalid(fldPath.Child("template", "metadata", "labels"), machineSet.Spec.Template.Labels, "`selector` does not match template `labels`")) + } + } + + return errors +} + +// DefaultingFunction sets default MachineSet field values +func (obj *MachineSet) Default() { + log.Printf("Defaulting fields for MachineSet %s\n", obj.Name) + + if obj.Spec.Replicas == nil { + obj.Spec.Replicas = new(int32) + *obj.Spec.Replicas = 1 + } + + if len(obj.Namespace) == 0 { + obj.Namespace = metav1.NamespaceDefault + } +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MachineSetList contains a list of MachineSet +type MachineSetList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MachineSet `json:"items"` +} + +func init() { + SchemeBuilder.Register(&MachineSet{}, &MachineSetList{}) +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/register.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/register.go new file mode 100644 index 0000000000..5062825dc8 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/register.go @@ -0,0 +1,48 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// NOTE: Boilerplate only. Ignore this file. + +// Package v1beta1 contains API Schema definitions for the machine v1beta1 API group +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=sigs.k8s.io/cluster-api/pkg/apis/machine +// +k8s:defaulter-gen=TypeMeta +// +groupName=machine.openshift.io +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/runtime/scheme" +) + +var ( + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: "machine.openshift.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} + + // Required by pkg/client/... + // TODO(pwittrock): Remove this after removing pkg/client/... + AddToScheme = SchemeBuilder.AddToScheme +) + +// Required by pkg/client/listers/... +// TODO(pwittrock): Remove this after removing pkg/client/... +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/testutil/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/testutil/BUILD.bazel similarity index 72% rename from vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/testutil/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/testutil/BUILD.bazel index bcee50bdc5..438085562c 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/testutil/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/testutil/BUILD.bazel @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["testutil.go"], - importpath = "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/testutil", + importpath = "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/testutil", visibility = ["//visibility:public"], deps = ["//pkg/apis/cluster/v1alpha1:go_default_library"], ) diff --git a/vendor/k8s.io/code-generator/cmd/register-gen/args/args.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/testutil/testutil.go similarity index 51% rename from vendor/k8s.io/code-generator/cmd/register-gen/args/args.go rename to vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/testutil/testutil.go index 2e3ab084e2..9bfeaed981 100644 --- a/vendor/k8s.io/code-generator/cmd/register-gen/args/args.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/testutil/testutil.go @@ -14,26 +14,23 @@ See the License for the specific language governing permissions and limitations under the License. */ -package args - -import ( - "fmt" - - "k8s.io/gengo/args" -) - -// NewDefaults returns default arguments for the generator. -func NewDefaults() *args.GeneratorArgs { - genericArgs := args.Default().WithoutDefaultFlagParsing() - genericArgs.OutputFileBaseName = "zz_generated.register" - return genericArgs -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - if len(genericArgs.OutputFileBaseName) == 0 { - return fmt.Errorf("output file base name cannot be empty") +package testutil + +import "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + +// GetVanillaCluster return a bare minimum functional cluster resource object +func GetVanillaCluster() v1alpha1.Cluster { + return v1alpha1.Cluster{ + Spec: v1alpha1.ClusterSpec{ + ClusterNetwork: v1alpha1.ClusterNetworkingConfig{ + Services: v1alpha1.NetworkRanges{ + CIDRBlocks: []string{"10.96.0.0/12"}, + }, + Pods: v1alpha1.NetworkRanges{ + CIDRBlocks: []string{"192.168.0.0/16"}, + }, + ServiceDomain: "cluster.local", + }, + }, } - - return nil } 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 new file mode 100644 index 0000000000..ab6e3a5879 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,821 @@ +// +build !ignore_autogenerated + +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + common "github.com/openshift/cluster-api/pkg/apis/machine/common" + v1 "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. +func (in *APIEndpoint) DeepCopy() *APIEndpoint { + if in == nil { + return nil + } + out := new(APIEndpoint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Cluster) DeepCopyInto(out *Cluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. +func (in *Cluster) DeepCopy() *Cluster { + if in == nil { + return nil + } + out := new(Cluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Cluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterList) DeepCopyInto(out *ClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Cluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. +func (in *ClusterList) DeepCopy() *ClusterList { + if in == nil { + return nil + } + out := new(ClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterNetworkingConfig) DeepCopyInto(out *ClusterNetworkingConfig) { + *out = *in + in.Services.DeepCopyInto(&out.Services) + in.Pods.DeepCopyInto(&out.Pods) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterNetworkingConfig. +func (in *ClusterNetworkingConfig) DeepCopy() *ClusterNetworkingConfig { + if in == nil { + return nil + } + out := new(ClusterNetworkingConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { + *out = *in + in.ClusterNetwork.DeepCopyInto(&out.ClusterNetwork) + in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. +func (in *ClusterSpec) DeepCopy() *ClusterSpec { + if in == nil { + return nil + } + out := new(ClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { + *out = *in + if in.APIEndpoints != nil { + in, out := &in.APIEndpoints, &out.APIEndpoints + *out = make([]APIEndpoint, len(*in)) + copy(*out, *in) + } + if in.ProviderStatus != nil { + in, out := &in.ProviderStatus, &out.ProviderStatus + *out = new(runtime.RawExtension) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. +func (in *ClusterStatus) DeepCopy() *ClusterStatus { + if in == nil { + return nil + } + out := new(ClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LastOperation) DeepCopyInto(out *LastOperation) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.LastUpdated != nil { + in, out := &in.LastUpdated, &out.LastUpdated + *out = (*in).DeepCopy() + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LastOperation. +func (in *LastOperation) DeepCopy() *LastOperation { + if in == nil { + return nil + } + out := new(LastOperation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Machine) DeepCopyInto(out *Machine) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine. +func (in *Machine) DeepCopy() *Machine { + if in == nil { + return nil + } + out := new(Machine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Machine) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineClass) DeepCopyInto(out *MachineClass) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineClass. +func (in *MachineClass) DeepCopy() *MachineClass { + if in == nil { + return nil + } + out := new(MachineClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineClass) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineClassList) DeepCopyInto(out *MachineClassList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MachineClass, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineClassList. +func (in *MachineClassList) DeepCopy() *MachineClassList { + if in == nil { + return nil + } + out := new(MachineClassList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineClassList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineClassRef) DeepCopyInto(out *MachineClassRef) { + *out = *in + if in.ObjectReference != nil { + in, out := &in.ObjectReference, &out.ObjectReference + *out = new(v1.ObjectReference) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineClassRef. +func (in *MachineClassRef) DeepCopy() *MachineClassRef { + if in == nil { + return nil + } + out := new(MachineClassRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeployment) DeepCopyInto(out *MachineDeployment) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeployment. +func (in *MachineDeployment) DeepCopy() *MachineDeployment { + if in == nil { + return nil + } + out := new(MachineDeployment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineDeployment) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentList) DeepCopyInto(out *MachineDeploymentList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MachineDeployment, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentList. +func (in *MachineDeploymentList) DeepCopy() *MachineDeploymentList { + if in == nil { + return nil + } + out := new(MachineDeploymentList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineDeploymentList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentSpec) DeepCopyInto(out *MachineDeploymentSpec) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + in.Selector.DeepCopyInto(&out.Selector) + in.Template.DeepCopyInto(&out.Template) + if in.Strategy != nil { + in, out := &in.Strategy, &out.Strategy + *out = new(MachineDeploymentStrategy) + (*in).DeepCopyInto(*out) + } + if in.MinReadySeconds != nil { + in, out := &in.MinReadySeconds, &out.MinReadySeconds + *out = new(int32) + **out = **in + } + if in.RevisionHistoryLimit != nil { + in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit + *out = new(int32) + **out = **in + } + if in.ProgressDeadlineSeconds != nil { + in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentSpec. +func (in *MachineDeploymentSpec) DeepCopy() *MachineDeploymentSpec { + if in == nil { + return nil + } + out := new(MachineDeploymentSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentStatus) DeepCopyInto(out *MachineDeploymentStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStatus. +func (in *MachineDeploymentStatus) DeepCopy() *MachineDeploymentStatus { + if in == nil { + return nil + } + out := new(MachineDeploymentStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentStrategy) DeepCopyInto(out *MachineDeploymentStrategy) { + *out = *in + if in.RollingUpdate != nil { + in, out := &in.RollingUpdate, &out.RollingUpdate + *out = new(MachineRollingUpdateDeployment) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStrategy. +func (in *MachineDeploymentStrategy) DeepCopy() *MachineDeploymentStrategy { + if in == nil { + return nil + } + out := new(MachineDeploymentStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineList) DeepCopyInto(out *MachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Machine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineList. +func (in *MachineList) DeepCopy() *MachineList { + if in == nil { + return nil + } + out := new(MachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineRollingUpdateDeployment) DeepCopyInto(out *MachineRollingUpdateDeployment) { + *out = *in + if in.MaxUnavailable != nil { + in, out := &in.MaxUnavailable, &out.MaxUnavailable + *out = new(intstr.IntOrString) + **out = **in + } + if in.MaxSurge != nil { + in, out := &in.MaxSurge, &out.MaxSurge + *out = new(intstr.IntOrString) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineRollingUpdateDeployment. +func (in *MachineRollingUpdateDeployment) DeepCopy() *MachineRollingUpdateDeployment { + if in == nil { + return nil + } + out := new(MachineRollingUpdateDeployment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineSet) DeepCopyInto(out *MachineSet) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSet. +func (in *MachineSet) DeepCopy() *MachineSet { + if in == nil { + return nil + } + out := new(MachineSet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineSet) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineSetList) DeepCopyInto(out *MachineSetList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MachineSet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetList. +func (in *MachineSetList) DeepCopy() *MachineSetList { + if in == nil { + return nil + } + out := new(MachineSetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineSetList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineSetSpec) DeepCopyInto(out *MachineSetSpec) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + in.Selector.DeepCopyInto(&out.Selector) + in.Template.DeepCopyInto(&out.Template) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetSpec. +func (in *MachineSetSpec) DeepCopy() *MachineSetSpec { + if in == nil { + return nil + } + out := new(MachineSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineSetStatus) DeepCopyInto(out *MachineSetStatus) { + *out = *in + if in.ErrorReason != nil { + in, out := &in.ErrorReason, &out.ErrorReason + *out = new(common.MachineSetStatusError) + **out = **in + } + if in.ErrorMessage != nil { + in, out := &in.ErrorMessage, &out.ErrorMessage + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetStatus. +func (in *MachineSetStatus) DeepCopy() *MachineSetStatus { + if in == nil { + return nil + } + out := new(MachineSetStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineSpec) DeepCopyInto(out *MachineSpec) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Taints != nil { + in, out := &in.Taints, &out.Taints + *out = make([]v1.Taint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) + out.Versions = in.Versions + if in.ConfigSource != nil { + in, out := &in.ConfigSource, &out.ConfigSource + *out = new(v1.NodeConfigSource) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpec. +func (in *MachineSpec) DeepCopy() *MachineSpec { + if in == nil { + return nil + } + out := new(MachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { + *out = *in + if in.NodeRef != nil { + in, out := &in.NodeRef, &out.NodeRef + *out = new(v1.ObjectReference) + **out = **in + } + if in.LastUpdated != nil { + in, out := &in.LastUpdated, &out.LastUpdated + *out = (*in).DeepCopy() + } + if in.Versions != nil { + in, out := &in.Versions, &out.Versions + *out = new(MachineVersionInfo) + **out = **in + } + if in.ErrorReason != nil { + in, out := &in.ErrorReason, &out.ErrorReason + *out = new(common.MachineStatusError) + **out = **in + } + if in.ErrorMessage != nil { + in, out := &in.ErrorMessage, &out.ErrorMessage + *out = new(string) + **out = **in + } + if in.ProviderStatus != nil { + in, out := &in.ProviderStatus, &out.ProviderStatus + *out = new(runtime.RawExtension) + (*in).DeepCopyInto(*out) + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]v1.NodeAddress, len(*in)) + copy(*out, *in) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.NodeCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LastOperation != nil { + in, out := &in.LastOperation, &out.LastOperation + *out = new(LastOperation) + (*in).DeepCopyInto(*out) + } + if in.Phase != nil { + in, out := &in.Phase, &out.Phase + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatus. +func (in *MachineStatus) DeepCopy() *MachineStatus { + if in == nil { + return nil + } + out := new(MachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineTemplateSpec) DeepCopyInto(out *MachineTemplateSpec) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineTemplateSpec. +func (in *MachineTemplateSpec) DeepCopy() *MachineTemplateSpec { + if in == nil { + return nil + } + out := new(MachineTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineVersionInfo) DeepCopyInto(out *MachineVersionInfo) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineVersionInfo. +func (in *MachineVersionInfo) DeepCopy() *MachineVersionInfo { + if in == nil { + return nil + } + out := new(MachineVersionInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkRanges) DeepCopyInto(out *NetworkRanges) { + *out = *in + if in.CIDRBlocks != nil { + in, out := &in.CIDRBlocks, &out.CIDRBlocks + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkRanges. +func (in *NetworkRanges) DeepCopy() *NetworkRanges { + if in == nil { + return nil + } + out := new(NetworkRanges) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProviderSpec) DeepCopyInto(out *ProviderSpec) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(runtime.RawExtension) + (*in).DeepCopyInto(*out) + } + if in.ValueFrom != nil { + in, out := &in.ValueFrom, &out.ValueFrom + *out = new(ProviderSpecSource) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderSpec. +func (in *ProviderSpec) DeepCopy() *ProviderSpec { + if in == nil { + return nil + } + out := new(ProviderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProviderSpecSource) DeepCopyInto(out *ProviderSpecSource) { + *out = *in + if in.MachineClass != nil { + in, out := &in.MachineClass, &out.MachineClass + *out = new(MachineClassRef) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderSpecSource. +func (in *ProviderSpecSource) DeepCopy() *ProviderSpecSource { + if in == nil { + return nil + } + out := new(ProviderSpecSource) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/cert/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/cert/BUILD.bazel similarity index 61% rename from vendor/sigs.k8s.io/cluster-api/pkg/cert/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/cert/BUILD.bazel index 160388a913..6355114c18 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/cert/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/cert/BUILD.bazel @@ -3,9 +3,12 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["cert_authority.go"], - importpath = "sigs.k8s.io/cluster-api/pkg/cert", + importpath = "github.com/openshift/cluster-api/pkg/cert", visibility = ["//visibility:public"], - deps = ["//vendor/k8s.io/klog:go_default_library"], + deps = [ + "//vendor/github.com/pkg/errors:go_default_library", + "//vendor/k8s.io/klog:go_default_library", + ], ) go_test( diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/cert/cert_authority.go b/vendor/github.com/openshift/cluster-api/pkg/cert/cert_authority.go similarity index 85% rename from vendor/sigs.k8s.io/cluster-api/pkg/cert/cert_authority.go rename to vendor/github.com/openshift/cluster-api/pkg/cert/cert_authority.go index 591602d9d6..96e5438662 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/cert/cert_authority.go +++ b/vendor/github.com/openshift/cluster-api/pkg/cert/cert_authority.go @@ -17,11 +17,11 @@ limitations under the License. package cert import ( - "fmt" "io/ioutil" "os" "path/filepath" + "github.com/pkg/errors" "k8s.io/klog" ) @@ -45,11 +45,11 @@ func Load(caPath string) (*CertificateAuthority, error) { } certMaterial, err := ioutil.ReadFile(certPath) if err != nil { - return nil, fmt.Errorf("unable to read cert %v: %v", certPath, err) + return nil, errors.Wrapf(err, "unable to read cert %v", certPath) } keyMaterial, err := ioutil.ReadFile(keyPath) if err != nil { - return nil, fmt.Errorf("unable to read key %v: %v", keyPath, err) + return nil, errors.Wrapf(err, "unable to read key %v", keyPath) } ca := CertificateAuthority{ Certificate: certMaterial, @@ -77,14 +77,14 @@ func certPathToCertAndKeyPaths(caPath string) (string, string, error) { certPath = caPath[0:len(caPath)-len(ext)] + ".crt" keyPath = caPath default: - return "", "", fmt.Errorf("unable to use certificate authority, not directory, .crt, or .key file: %v", caPath) + return "", "", errors.Errorf("unable to use certificate authority, not directory, .crt, or .key file: %v", caPath) } } if _, err := os.Stat(certPath); err != nil { - return "", "", fmt.Errorf("unable to use certificate file: %v (%v)", certPath, err) + return "", "", errors.Wrapf(err, "unable to use certificate file: %v", certPath) } if _, err := os.Stat(keyPath); err != nil { - return "", "", fmt.Errorf("unable to use key file: %v (%v)", keyPath, err) + return "", "", errors.Wrapf(err, "unable to use key file: %v", keyPath) } return certPath, keyPath, err } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/BUILD.bazel similarity index 73% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/BUILD.bazel index 9665ba8d3d..10e4314959 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/BUILD.bazel @@ -6,10 +6,11 @@ go_library( "clientset.go", "doc.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset", + importpath = "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset", visibility = ["//visibility:public"], deps = [ "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", + "//pkg/client/clientset_generated/clientset/typed/machine/v1beta1:go_default_library", "//vendor/k8s.io/client-go/discovery:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/util/flowcontrol:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/clientset.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/clientset.go similarity index 74% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/clientset.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/clientset.go index 1d5483d3f6..1ea1557458 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/clientset.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/clientset.go @@ -19,10 +19,11 @@ limitations under the License. package clientset import ( + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" + machinev1beta1 "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" ) type Interface interface { @@ -30,6 +31,9 @@ type Interface interface { ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface // Deprecated: please explicitly pick a version if possible. Cluster() clusterv1alpha1.ClusterV1alpha1Interface + MachineV1beta1() machinev1beta1.MachineV1beta1Interface + // Deprecated: please explicitly pick a version if possible. + Machine() machinev1beta1.MachineV1beta1Interface } // Clientset contains the clients for groups. Each group has exactly one @@ -37,6 +41,7 @@ type Interface interface { type Clientset struct { *discovery.DiscoveryClient clusterV1alpha1 *clusterv1alpha1.ClusterV1alpha1Client + machineV1beta1 *machinev1beta1.MachineV1beta1Client } // ClusterV1alpha1 retrieves the ClusterV1alpha1Client @@ -50,6 +55,17 @@ func (c *Clientset) Cluster() clusterv1alpha1.ClusterV1alpha1Interface { return c.clusterV1alpha1 } +// MachineV1beta1 retrieves the MachineV1beta1Client +func (c *Clientset) MachineV1beta1() machinev1beta1.MachineV1beta1Interface { + return c.machineV1beta1 +} + +// Deprecated: Machine retrieves the default version of MachineClient. +// Please explicitly pick a version. +func (c *Clientset) Machine() machinev1beta1.MachineV1beta1Interface { + return c.machineV1beta1 +} + // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { @@ -70,6 +86,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } + cs.machineV1beta1, err = machinev1beta1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) if err != nil { @@ -83,6 +103,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset cs.clusterV1alpha1 = clusterv1alpha1.NewForConfigOrDie(c) + cs.machineV1beta1 = machinev1beta1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -92,6 +113,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { func New(c rest.Interface) *Clientset { var cs Clientset cs.clusterV1alpha1 = clusterv1alpha1.New(c) + cs.machineV1beta1 = machinev1beta1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/doc.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/doc.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/doc.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/doc.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake/BUILD.bazel similarity index 77% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake/BUILD.bazel index e3d124b8b1..f28dda486b 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake/BUILD.bazel @@ -7,13 +7,16 @@ go_library( "doc.go", "register.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake", + importpath = "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake", visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/machine/v1beta1:go_default_library", "//pkg/client/clientset_generated/clientset:go_default_library", "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake:go_default_library", + "//pkg/client/clientset_generated/clientset/typed/machine/v1beta1:go_default_library", + "//pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake/clientset_generated.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake/clientset_generated.go similarity index 73% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake/clientset_generated.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake/clientset_generated.go index 5d9e34e78e..dce09350de 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake/clientset_generated.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake/clientset_generated.go @@ -19,14 +19,16 @@ limitations under the License. package fake import ( + clientset "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" + fakeclusterv1alpha1 "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake" + machinev1beta1 "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1" + fakemachinev1beta1 "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" fakediscovery "k8s.io/client-go/discovery/fake" "k8s.io/client-go/testing" - clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" - fakeclusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. @@ -80,3 +82,13 @@ func (c *Clientset) ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface { func (c *Clientset) Cluster() clusterv1alpha1.ClusterV1alpha1Interface { return &fakeclusterv1alpha1.FakeClusterV1alpha1{Fake: &c.Fake} } + +// MachineV1beta1 retrieves the MachineV1beta1Client +func (c *Clientset) MachineV1beta1() machinev1beta1.MachineV1beta1Interface { + return &fakemachinev1beta1.FakeMachineV1beta1{Fake: &c.Fake} +} + +// Machine retrieves the MachineV1beta1Client +func (c *Clientset) Machine() machinev1beta1.MachineV1beta1Interface { + return &fakemachinev1beta1.FakeMachineV1beta1{Fake: &c.Fake} +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake/doc.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake/doc.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake/doc.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake/doc.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake/register.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake/register.go similarity index 91% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake/register.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake/register.go index 47efc4e89a..c10e170c32 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake/register.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/fake/register.go @@ -19,12 +19,13 @@ limitations under the License. package fake import ( + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) var scheme = runtime.NewScheme() @@ -32,6 +33,7 @@ var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ clusterv1alpha1.AddToScheme, + machinev1beta1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme/BUILD.bazel similarity index 80% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme/BUILD.bazel index 967e9635f2..44d1770004 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme/BUILD.bazel @@ -6,10 +6,11 @@ go_library( "doc.go", "register.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme", + importpath = "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme", visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/machine/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme/doc.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme/doc.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme/doc.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme/doc.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme/register.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme/register.go similarity index 91% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme/register.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme/register.go index ecb609f771..afb084a63f 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme/register.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme/register.go @@ -19,12 +19,13 @@ limitations under the License. package scheme import ( + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) var Scheme = runtime.NewScheme() @@ -32,6 +33,7 @@ var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ clusterv1alpha1.AddToScheme, + machinev1beta1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/BUILD.bazel similarity index 88% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/BUILD.bazel index d7034eae03..157ef970ed 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/BUILD.bazel @@ -12,7 +12,7 @@ go_library( "machinedeployment.go", "machineset.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1", + importpath = "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1", visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/v1alpha1:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster.go similarity index 97% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster.go index 531c48ba6c..00b10e505e 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster.go @@ -19,12 +19,12 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + 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" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) // ClustersGetter has a method to return a ClusterInterface. diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go similarity index 95% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go index 85c29d2fb7..f9081c3503 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme" serializer "k8s.io/apimachinery/pkg/runtime/serializer" rest "k8s.io/client-go/rest" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) type ClusterV1alpha1Interface interface { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/doc.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/doc.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/doc.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/doc.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/BUILD.bazel similarity index 89% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/BUILD.bazel index 76a6933b28..4da0d037ea 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/BUILD.bazel @@ -11,7 +11,7 @@ go_library( "fake_machinedeployment.go", "fake_machineset.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake", + importpath = "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake", visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/v1alpha1:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/doc.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/doc.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/doc.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/doc.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster.go index 2bdae205a3..4554fd127a 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster.go @@ -19,13 +19,13 @@ limitations under the License. package fake import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" 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" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // FakeClusters implements ClusterInterface diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster_client.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster_client.go similarity index 93% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster_client.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster_client.go index 9e08c5d5b4..aca19fdcbd 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster_client.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster_client.go @@ -19,9 +19,9 @@ limitations under the License. package fake import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" ) type FakeClusterV1alpha1 struct { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machine.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machine.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machine.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machine.go index cdd274aa14..70036f36c0 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machine.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machine.go @@ -19,13 +19,13 @@ limitations under the License. package fake import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" 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" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // FakeMachines implements MachineInterface diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineclass.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineclass.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineclass.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineclass.go index ee36cd5242..995955a7df 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineclass.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineclass.go @@ -19,13 +19,13 @@ limitations under the License. package fake import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" 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" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // FakeMachineClasses implements MachineClassInterface diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machinedeployment.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machinedeployment.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machinedeployment.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machinedeployment.go index 26fa794d79..092c03c3bd 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machinedeployment.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machinedeployment.go @@ -19,13 +19,13 @@ limitations under the License. package fake import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" 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" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // FakeMachineDeployments implements MachineDeploymentInterface diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineset.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineset.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineset.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineset.go index c333daa682..fbd9447fe9 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineset.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineset.go @@ -19,13 +19,13 @@ limitations under the License. package fake import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" 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" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // FakeMachineSets implements MachineSetInterface diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/generated_expansion.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/generated_expansion.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/generated_expansion.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/generated_expansion.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machine.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machine.go similarity index 97% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machine.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machine.go index 2d5b5c4cb8..4a3ada009a 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machine.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machine.go @@ -19,12 +19,12 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + 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" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) // MachinesGetter has a method to return a MachineInterface. diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go similarity index 96% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go index 9d685d94fd..2d01222e8a 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go @@ -19,12 +19,12 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + 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" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) // MachineClassesGetter has a method to return a MachineClassInterface. diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machinedeployment.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machinedeployment.go similarity index 97% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machinedeployment.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machinedeployment.go index 41a499054f..9582b5bc69 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machinedeployment.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machinedeployment.go @@ -19,12 +19,12 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + 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" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) // MachineDeploymentsGetter has a method to return a MachineDeploymentInterface. diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineset.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineset.go similarity index 97% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineset.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineset.go index 25886851db..42dee11775 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineset.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineset.go @@ -19,12 +19,12 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + 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" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) // MachineSetsGetter has a method to return a MachineSetInterface. 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 new file mode 100644 index 0000000000..be7c3feb1d --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/BUILD.bazel @@ -0,0 +1,26 @@ +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", + "machine_client.go", + "machineclass.go", + "machinedeployment.go", + "machineset.go", + ], + importpath = "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1", + visibility = ["//visibility:public"], + deps = [ + "//pkg/apis/machine/v1beta1:go_default_library", + "//pkg/client/clientset_generated/clientset/scheme:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", + "//vendor/k8s.io/client-go/rest:go_default_library", + ], +) 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 new file mode 100644 index 0000000000..b996ae44ad --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/cluster.go @@ -0,0 +1,174 @@ +/* +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 ( + 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) { + result = &v1beta1.ClusterList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusters. +func (c *clusters) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("clusters"). + VersionedParams(&opts, scheme.ParameterCodec). + 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 { + return c.client.Delete(). + Namespace(c.ns). + Resource("clusters"). + VersionedParams(&listOptions, scheme.ParameterCodec). + 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/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/doc.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/doc.go similarity index 92% rename from vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/doc.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/doc.go index 3af5d054f1..11ae7049d1 100644 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/doc.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +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. @@ -17,4 +17,4 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1 +package v1beta1 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 new file mode 100644 index 0000000000..6fcca0ee85 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "fake_cluster.go", + "fake_machine.go", + "fake_machine_client.go", + "fake_machineclass.go", + "fake_machinedeployment.go", + "fake_machineset.go", + ], + importpath = "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake", + visibility = ["//visibility:public"], + deps = [ + "//pkg/apis/machine/v1beta1:go_default_library", + "//pkg/client/clientset_generated/clientset/typed/machine/v1beta1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", + "//vendor/k8s.io/client-go/rest:go_default_library", + "//vendor/k8s.io/client-go/testing:go_default_library", + ], +) diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/doc.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/doc.go similarity index 94% rename from vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/doc.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/doc.go index 16f4439906..87a1873edc 100644 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/doc.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +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. 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 new file mode 100644 index 0000000000..6e6087777e --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_cluster.go @@ -0,0 +1,140 @@ +/* +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, 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.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machine.go new file mode 100644 index 0000000000..8f68699629 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machine.go @@ -0,0 +1,140 @@ +/* +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" +) + +// FakeMachines implements MachineInterface +type FakeMachines struct { + Fake *FakeMachineV1beta1 + ns string +} + +var machinesResource = schema.GroupVersionResource{Group: "machine.openshift.io", Version: "v1beta1", Resource: "machines"} + +var machinesKind = schema.GroupVersionKind{Group: "machine.openshift.io", Version: "v1beta1", Kind: "Machine"} + +// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any. +func (c *FakeMachines) Get(name string, options v1.GetOptions) (result *v1beta1.Machine, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(machinesResource, c.ns, name), &v1beta1.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Machine), err +} + +// List takes label and field selectors, and returns the list of Machines that match those selectors. +func (c *FakeMachines) List(opts v1.ListOptions) (result *v1beta1.MachineList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(machinesResource, machinesKind, c.ns, opts), &v1beta1.MachineList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.MachineList{ListMeta: obj.(*v1beta1.MachineList).ListMeta} + for _, item := range obj.(*v1beta1.MachineList).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 machines. +func (c *FakeMachines) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(machinesResource, c.ns, opts)) + +} + +// Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any. +func (c *FakeMachines) Create(machine *v1beta1.Machine) (result *v1beta1.Machine, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(machinesResource, c.ns, machine), &v1beta1.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Machine), err +} + +// Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any. +func (c *FakeMachines) Update(machine *v1beta1.Machine) (result *v1beta1.Machine, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(machinesResource, c.ns, machine), &v1beta1.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Machine), 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 *FakeMachines) UpdateStatus(machine *v1beta1.Machine) (*v1beta1.Machine, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(machinesResource, "status", c.ns, machine), &v1beta1.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Machine), err +} + +// Delete takes name of the machine and deletes it. Returns an error if one occurs. +func (c *FakeMachines) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(machinesResource, c.ns, name), &v1beta1.Machine{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMachines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(machinesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1beta1.MachineList{}) + return err +} + +// Patch applies the patch and returns the patched machine. +func (c *FakeMachines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Machine, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(machinesResource, c.ns, name, data, subresources...), &v1beta1.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Machine), 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 new file mode 100644 index 0000000000..c94b1ce47e --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machine_client.go @@ -0,0 +1,56 @@ +/* +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/client/clientset_generated/clientset/typed/machine/v1beta1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +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} +} + +func (c *FakeMachineV1beta1) MachineClasses(namespace string) v1beta1.MachineClassInterface { + return &FakeMachineClasses{c, namespace} +} + +func (c *FakeMachineV1beta1) MachineDeployments(namespace string) v1beta1.MachineDeploymentInterface { + return &FakeMachineDeployments{c, namespace} +} + +func (c *FakeMachineV1beta1) MachineSets(namespace string) v1beta1.MachineSetInterface { + return &FakeMachineSets{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeMachineV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machineclass.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machineclass.go new file mode 100644 index 0000000000..018e6d24c9 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machineclass.go @@ -0,0 +1,128 @@ +/* +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" +) + +// FakeMachineClasses implements MachineClassInterface +type FakeMachineClasses struct { + Fake *FakeMachineV1beta1 + ns string +} + +var machineclassesResource = schema.GroupVersionResource{Group: "machine.openshift.io", Version: "v1beta1", Resource: "machineclasses"} + +var machineclassesKind = schema.GroupVersionKind{Group: "machine.openshift.io", Version: "v1beta1", Kind: "MachineClass"} + +// Get takes name of the machineClass, and returns the corresponding machineClass object, and an error if there is any. +func (c *FakeMachineClasses) Get(name string, options v1.GetOptions) (result *v1beta1.MachineClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(machineclassesResource, c.ns, name), &v1beta1.MachineClass{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineClass), err +} + +// List takes label and field selectors, and returns the list of MachineClasses that match those selectors. +func (c *FakeMachineClasses) List(opts v1.ListOptions) (result *v1beta1.MachineClassList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(machineclassesResource, machineclassesKind, c.ns, opts), &v1beta1.MachineClassList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.MachineClassList{ListMeta: obj.(*v1beta1.MachineClassList).ListMeta} + for _, item := range obj.(*v1beta1.MachineClassList).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 machineClasses. +func (c *FakeMachineClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(machineclassesResource, c.ns, opts)) + +} + +// Create takes the representation of a machineClass and creates it. Returns the server's representation of the machineClass, and an error, if there is any. +func (c *FakeMachineClasses) Create(machineClass *v1beta1.MachineClass) (result *v1beta1.MachineClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(machineclassesResource, c.ns, machineClass), &v1beta1.MachineClass{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineClass), err +} + +// Update takes the representation of a machineClass and updates it. Returns the server's representation of the machineClass, and an error, if there is any. +func (c *FakeMachineClasses) Update(machineClass *v1beta1.MachineClass) (result *v1beta1.MachineClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(machineclassesResource, c.ns, machineClass), &v1beta1.MachineClass{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineClass), err +} + +// Delete takes name of the machineClass and deletes it. Returns an error if one occurs. +func (c *FakeMachineClasses) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(machineclassesResource, c.ns, name), &v1beta1.MachineClass{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMachineClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(machineclassesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1beta1.MachineClassList{}) + return err +} + +// Patch applies the patch and returns the patched machineClass. +func (c *FakeMachineClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(machineclassesResource, c.ns, name, data, subresources...), &v1beta1.MachineClass{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineClass), err +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machinedeployment.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machinedeployment.go new file mode 100644 index 0000000000..0cd408f6d9 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machinedeployment.go @@ -0,0 +1,140 @@ +/* +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" +) + +// FakeMachineDeployments implements MachineDeploymentInterface +type FakeMachineDeployments struct { + Fake *FakeMachineV1beta1 + ns string +} + +var machinedeploymentsResource = schema.GroupVersionResource{Group: "machine.openshift.io", Version: "v1beta1", Resource: "machinedeployments"} + +var machinedeploymentsKind = schema.GroupVersionKind{Group: "machine.openshift.io", Version: "v1beta1", Kind: "MachineDeployment"} + +// Get takes name of the machineDeployment, and returns the corresponding machineDeployment object, and an error if there is any. +func (c *FakeMachineDeployments) Get(name string, options v1.GetOptions) (result *v1beta1.MachineDeployment, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(machinedeploymentsResource, c.ns, name), &v1beta1.MachineDeployment{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineDeployment), err +} + +// List takes label and field selectors, and returns the list of MachineDeployments that match those selectors. +func (c *FakeMachineDeployments) List(opts v1.ListOptions) (result *v1beta1.MachineDeploymentList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(machinedeploymentsResource, machinedeploymentsKind, c.ns, opts), &v1beta1.MachineDeploymentList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.MachineDeploymentList{ListMeta: obj.(*v1beta1.MachineDeploymentList).ListMeta} + for _, item := range obj.(*v1beta1.MachineDeploymentList).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 machineDeployments. +func (c *FakeMachineDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(machinedeploymentsResource, c.ns, opts)) + +} + +// Create takes the representation of a machineDeployment and creates it. Returns the server's representation of the machineDeployment, and an error, if there is any. +func (c *FakeMachineDeployments) Create(machineDeployment *v1beta1.MachineDeployment) (result *v1beta1.MachineDeployment, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(machinedeploymentsResource, c.ns, machineDeployment), &v1beta1.MachineDeployment{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineDeployment), err +} + +// Update takes the representation of a machineDeployment and updates it. Returns the server's representation of the machineDeployment, and an error, if there is any. +func (c *FakeMachineDeployments) Update(machineDeployment *v1beta1.MachineDeployment) (result *v1beta1.MachineDeployment, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(machinedeploymentsResource, c.ns, machineDeployment), &v1beta1.MachineDeployment{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineDeployment), 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 *FakeMachineDeployments) UpdateStatus(machineDeployment *v1beta1.MachineDeployment) (*v1beta1.MachineDeployment, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(machinedeploymentsResource, "status", c.ns, machineDeployment), &v1beta1.MachineDeployment{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineDeployment), err +} + +// Delete takes name of the machineDeployment and deletes it. Returns an error if one occurs. +func (c *FakeMachineDeployments) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(machinedeploymentsResource, c.ns, name), &v1beta1.MachineDeployment{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMachineDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(machinedeploymentsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1beta1.MachineDeploymentList{}) + return err +} + +// Patch applies the patch and returns the patched machineDeployment. +func (c *FakeMachineDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineDeployment, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(machinedeploymentsResource, c.ns, name, data, subresources...), &v1beta1.MachineDeployment{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineDeployment), err +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machineset.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machineset.go new file mode 100644 index 0000000000..2bcf0b3800 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/fake/fake_machineset.go @@ -0,0 +1,140 @@ +/* +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" +) + +// FakeMachineSets implements MachineSetInterface +type FakeMachineSets struct { + Fake *FakeMachineV1beta1 + ns string +} + +var machinesetsResource = schema.GroupVersionResource{Group: "machine.openshift.io", Version: "v1beta1", Resource: "machinesets"} + +var machinesetsKind = schema.GroupVersionKind{Group: "machine.openshift.io", Version: "v1beta1", Kind: "MachineSet"} + +// Get takes name of the machineSet, and returns the corresponding machineSet object, and an error if there is any. +func (c *FakeMachineSets) Get(name string, options v1.GetOptions) (result *v1beta1.MachineSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(machinesetsResource, c.ns, name), &v1beta1.MachineSet{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineSet), err +} + +// List takes label and field selectors, and returns the list of MachineSets that match those selectors. +func (c *FakeMachineSets) List(opts v1.ListOptions) (result *v1beta1.MachineSetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(machinesetsResource, machinesetsKind, c.ns, opts), &v1beta1.MachineSetList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.MachineSetList{ListMeta: obj.(*v1beta1.MachineSetList).ListMeta} + for _, item := range obj.(*v1beta1.MachineSetList).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 machineSets. +func (c *FakeMachineSets) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(machinesetsResource, c.ns, opts)) + +} + +// Create takes the representation of a machineSet and creates it. Returns the server's representation of the machineSet, and an error, if there is any. +func (c *FakeMachineSets) Create(machineSet *v1beta1.MachineSet) (result *v1beta1.MachineSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(machinesetsResource, c.ns, machineSet), &v1beta1.MachineSet{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineSet), err +} + +// Update takes the representation of a machineSet and updates it. Returns the server's representation of the machineSet, and an error, if there is any. +func (c *FakeMachineSets) Update(machineSet *v1beta1.MachineSet) (result *v1beta1.MachineSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(machinesetsResource, c.ns, machineSet), &v1beta1.MachineSet{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineSet), 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 *FakeMachineSets) UpdateStatus(machineSet *v1beta1.MachineSet) (*v1beta1.MachineSet, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(machinesetsResource, "status", c.ns, machineSet), &v1beta1.MachineSet{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineSet), err +} + +// Delete takes name of the machineSet and deletes it. Returns an error if one occurs. +func (c *FakeMachineSets) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(machinesetsResource, c.ns, name), &v1beta1.MachineSet{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMachineSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(machinesetsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1beta1.MachineSetList{}) + return err +} + +// Patch applies the patch and returns the patched machineSet. +func (c *FakeMachineSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(machinesetsResource, c.ns, name, data, subresources...), &v1beta1.MachineSet{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MachineSet), err +} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/generated_expansion.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/generated_expansion.go similarity index 70% rename from vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/generated_expansion.go rename to vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/generated_expansion.go index 3059734a9e..e4cc014464 100644 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/generated_expansion.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +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. @@ -16,8 +16,14 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1 +package v1beta1 -type ClusterTestTypeExpansion interface{} +type ClusterExpansion interface{} -type TestTypeExpansion interface{} +type MachineExpansion interface{} + +type MachineClassExpansion interface{} + +type MachineDeploymentExpansion interface{} + +type MachineSetExpansion interface{} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machine.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machine.go new file mode 100644 index 0000000000..c3f02e9542 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machine.go @@ -0,0 +1,174 @@ +/* +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 ( + 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" +) + +// MachinesGetter has a method to return a MachineInterface. +// A group's client should implement this interface. +type MachinesGetter interface { + Machines(namespace string) MachineInterface +} + +// MachineInterface has methods to work with Machine resources. +type MachineInterface interface { + Create(*v1beta1.Machine) (*v1beta1.Machine, error) + Update(*v1beta1.Machine) (*v1beta1.Machine, error) + UpdateStatus(*v1beta1.Machine) (*v1beta1.Machine, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1beta1.Machine, error) + List(opts v1.ListOptions) (*v1beta1.MachineList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Machine, err error) + MachineExpansion +} + +// machines implements MachineInterface +type machines struct { + client rest.Interface + ns string +} + +// newMachines returns a Machines +func newMachines(c *MachineV1beta1Client, namespace string) *machines { + return &machines{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any. +func (c *machines) Get(name string, options v1.GetOptions) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machines"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Machines that match those selectors. +func (c *machines) List(opts v1.ListOptions) (result *v1beta1.MachineList, err error) { + result = &v1beta1.MachineList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machines. +func (c *machines) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any. +func (c *machines) Create(machine *v1beta1.Machine) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machines"). + Body(machine). + Do(). + Into(result) + return +} + +// Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any. +func (c *machines) Update(machine *v1beta1.Machine) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machines"). + Name(machine.Name). + Body(machine). + 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 *machines) UpdateStatus(machine *v1beta1.Machine) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machines"). + Name(machine.Name). + SubResource("status"). + Body(machine). + Do(). + Into(result) + return +} + +// Delete takes name of the machine and deletes it. Returns an error if one occurs. +func (c *machines) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machines"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched machine. +func (c *machines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machines"). + 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/machine_client.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machine_client.go new file mode 100644 index 0000000000..93e8491575 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machine_client.go @@ -0,0 +1,110 @@ +/* +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 ( + v1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + rest "k8s.io/client-go/rest" +) + +type MachineV1beta1Interface interface { + RESTClient() rest.Interface + ClustersGetter + MachinesGetter + MachineClassesGetter + MachineDeploymentsGetter + MachineSetsGetter +} + +// MachineV1beta1Client is used to interact with features provided by the machine.openshift.io group. +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) +} + +func (c *MachineV1beta1Client) MachineClasses(namespace string) MachineClassInterface { + return newMachineClasses(c, namespace) +} + +func (c *MachineV1beta1Client) MachineDeployments(namespace string) MachineDeploymentInterface { + return newMachineDeployments(c, namespace) +} + +func (c *MachineV1beta1Client) MachineSets(namespace string) MachineSetInterface { + return newMachineSets(c, namespace) +} + +// NewForConfig creates a new MachineV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*MachineV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &MachineV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new MachineV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *MachineV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new MachineV1beta1Client for the given RESTClient. +func New(c rest.Interface) *MachineV1beta1Client { + return &MachineV1beta1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1beta1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *MachineV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machineclass.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machineclass.go new file mode 100644 index 0000000000..7bee80f3c0 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machineclass.go @@ -0,0 +1,157 @@ +/* +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 ( + 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" +) + +// MachineClassesGetter has a method to return a MachineClassInterface. +// A group's client should implement this interface. +type MachineClassesGetter interface { + MachineClasses(namespace string) MachineClassInterface +} + +// MachineClassInterface has methods to work with MachineClass resources. +type MachineClassInterface interface { + Create(*v1beta1.MachineClass) (*v1beta1.MachineClass, error) + Update(*v1beta1.MachineClass) (*v1beta1.MachineClass, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1beta1.MachineClass, error) + List(opts v1.ListOptions) (*v1beta1.MachineClassList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineClass, err error) + MachineClassExpansion +} + +// machineClasses implements MachineClassInterface +type machineClasses struct { + client rest.Interface + ns string +} + +// newMachineClasses returns a MachineClasses +func newMachineClasses(c *MachineV1beta1Client, namespace string) *machineClasses { + return &machineClasses{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machineClass, and returns the corresponding machineClass object, and an error if there is any. +func (c *machineClasses) Get(name string, options v1.GetOptions) (result *v1beta1.MachineClass, err error) { + result = &v1beta1.MachineClass{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machineclasses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MachineClasses that match those selectors. +func (c *machineClasses) List(opts v1.ListOptions) (result *v1beta1.MachineClassList, err error) { + result = &v1beta1.MachineClassList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machineclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machineClasses. +func (c *machineClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machineclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a machineClass and creates it. Returns the server's representation of the machineClass, and an error, if there is any. +func (c *machineClasses) Create(machineClass *v1beta1.MachineClass) (result *v1beta1.MachineClass, err error) { + result = &v1beta1.MachineClass{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machineclasses"). + Body(machineClass). + Do(). + Into(result) + return +} + +// Update takes the representation of a machineClass and updates it. Returns the server's representation of the machineClass, and an error, if there is any. +func (c *machineClasses) Update(machineClass *v1beta1.MachineClass) (result *v1beta1.MachineClass, err error) { + result = &v1beta1.MachineClass{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machineclasses"). + Name(machineClass.Name). + Body(machineClass). + Do(). + Into(result) + return +} + +// Delete takes name of the machineClass and deletes it. Returns an error if one occurs. +func (c *machineClasses) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machineclasses"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machineClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machineclasses"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched machineClass. +func (c *machineClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineClass, err error) { + result = &v1beta1.MachineClass{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machineclasses"). + 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/machinedeployment.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machinedeployment.go new file mode 100644 index 0000000000..0d5550c18b --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machinedeployment.go @@ -0,0 +1,174 @@ +/* +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 ( + 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" +) + +// MachineDeploymentsGetter has a method to return a MachineDeploymentInterface. +// A group's client should implement this interface. +type MachineDeploymentsGetter interface { + MachineDeployments(namespace string) MachineDeploymentInterface +} + +// MachineDeploymentInterface has methods to work with MachineDeployment resources. +type MachineDeploymentInterface interface { + Create(*v1beta1.MachineDeployment) (*v1beta1.MachineDeployment, error) + Update(*v1beta1.MachineDeployment) (*v1beta1.MachineDeployment, error) + UpdateStatus(*v1beta1.MachineDeployment) (*v1beta1.MachineDeployment, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1beta1.MachineDeployment, error) + List(opts v1.ListOptions) (*v1beta1.MachineDeploymentList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineDeployment, err error) + MachineDeploymentExpansion +} + +// machineDeployments implements MachineDeploymentInterface +type machineDeployments struct { + client rest.Interface + ns string +} + +// newMachineDeployments returns a MachineDeployments +func newMachineDeployments(c *MachineV1beta1Client, namespace string) *machineDeployments { + return &machineDeployments{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machineDeployment, and returns the corresponding machineDeployment object, and an error if there is any. +func (c *machineDeployments) Get(name string, options v1.GetOptions) (result *v1beta1.MachineDeployment, err error) { + result = &v1beta1.MachineDeployment{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machinedeployments"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MachineDeployments that match those selectors. +func (c *machineDeployments) List(opts v1.ListOptions) (result *v1beta1.MachineDeploymentList, err error) { + result = &v1beta1.MachineDeploymentList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machinedeployments"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machineDeployments. +func (c *machineDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machinedeployments"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a machineDeployment and creates it. Returns the server's representation of the machineDeployment, and an error, if there is any. +func (c *machineDeployments) Create(machineDeployment *v1beta1.MachineDeployment) (result *v1beta1.MachineDeployment, err error) { + result = &v1beta1.MachineDeployment{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machinedeployments"). + Body(machineDeployment). + Do(). + Into(result) + return +} + +// Update takes the representation of a machineDeployment and updates it. Returns the server's representation of the machineDeployment, and an error, if there is any. +func (c *machineDeployments) Update(machineDeployment *v1beta1.MachineDeployment) (result *v1beta1.MachineDeployment, err error) { + result = &v1beta1.MachineDeployment{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machinedeployments"). + Name(machineDeployment.Name). + Body(machineDeployment). + 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 *machineDeployments) UpdateStatus(machineDeployment *v1beta1.MachineDeployment) (result *v1beta1.MachineDeployment, err error) { + result = &v1beta1.MachineDeployment{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machinedeployments"). + Name(machineDeployment.Name). + SubResource("status"). + Body(machineDeployment). + Do(). + Into(result) + return +} + +// Delete takes name of the machineDeployment and deletes it. Returns an error if one occurs. +func (c *machineDeployments) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machinedeployments"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machineDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machinedeployments"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched machineDeployment. +func (c *machineDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineDeployment, err error) { + result = &v1beta1.MachineDeployment{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machinedeployments"). + 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/machineset.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machineset.go new file mode 100644 index 0000000000..73d377629f --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/machineset.go @@ -0,0 +1,174 @@ +/* +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 ( + 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" +) + +// MachineSetsGetter has a method to return a MachineSetInterface. +// A group's client should implement this interface. +type MachineSetsGetter interface { + MachineSets(namespace string) MachineSetInterface +} + +// MachineSetInterface has methods to work with MachineSet resources. +type MachineSetInterface interface { + Create(*v1beta1.MachineSet) (*v1beta1.MachineSet, error) + Update(*v1beta1.MachineSet) (*v1beta1.MachineSet, error) + UpdateStatus(*v1beta1.MachineSet) (*v1beta1.MachineSet, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1beta1.MachineSet, error) + List(opts v1.ListOptions) (*v1beta1.MachineSetList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineSet, err error) + MachineSetExpansion +} + +// machineSets implements MachineSetInterface +type machineSets struct { + client rest.Interface + ns string +} + +// newMachineSets returns a MachineSets +func newMachineSets(c *MachineV1beta1Client, namespace string) *machineSets { + return &machineSets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machineSet, and returns the corresponding machineSet object, and an error if there is any. +func (c *machineSets) Get(name string, options v1.GetOptions) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machinesets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MachineSets that match those selectors. +func (c *machineSets) List(opts v1.ListOptions) (result *v1beta1.MachineSetList, err error) { + result = &v1beta1.MachineSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machinesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machineSets. +func (c *machineSets) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machinesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a machineSet and creates it. Returns the server's representation of the machineSet, and an error, if there is any. +func (c *machineSets) Create(machineSet *v1beta1.MachineSet) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machinesets"). + Body(machineSet). + Do(). + Into(result) + return +} + +// Update takes the representation of a machineSet and updates it. Returns the server's representation of the machineSet, and an error, if there is any. +func (c *machineSets) Update(machineSet *v1beta1.MachineSet) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machinesets"). + Name(machineSet.Name). + Body(machineSet). + 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 *machineSets) UpdateStatus(machineSet *v1beta1.MachineSet) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machinesets"). + Name(machineSet.Name). + SubResource("status"). + Body(machineSet). + Do(). + Into(result) + return +} + +// Delete takes name of the machineSet and deletes it. Returns an error if one occurs. +func (c *machineSets) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machinesets"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machineSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machinesets"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched machineSet. +func (c *machineSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machinesets"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/BUILD.bazel similarity index 77% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/BUILD.bazel index 039490a151..60a55cb9f6 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/BUILD.bazel @@ -6,13 +6,15 @@ go_library( "factory.go", "generic.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions", + importpath = "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions", visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/machine/v1beta1:go_default_library", "//pkg/client/clientset_generated/clientset:go_default_library", "//pkg/client/informers_generated/externalversions/cluster:go_default_library", "//pkg/client/informers_generated/externalversions/internalinterfaces:go_default_library", + "//pkg/client/informers_generated/externalversions/machine:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/BUILD.bazel similarity index 78% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/BUILD.bazel index b8cbc69a99..1d77735c75 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/BUILD.bazel @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["interface.go"], - importpath = "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster", + importpath = "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster", visibility = ["//visibility:public"], deps = [ "//pkg/client/informers_generated/externalversions/cluster/v1alpha1:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/interface.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/interface.go similarity index 86% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/interface.go rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/interface.go index 945aef05d6..f133f8ea32 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/interface.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/interface.go @@ -19,8 +19,8 @@ limitations under the License. package cluster import ( - v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1" - internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" + v1alpha1 "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1" + internalinterfaces "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" ) // Interface provides access to each of this group's versions. diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/BUILD.bazel similarity index 88% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/BUILD.bazel index ffabb236fe..60d106d832 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/BUILD.bazel @@ -10,7 +10,7 @@ go_library( "machinedeployment.go", "machineset.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1", + importpath = "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1", visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/v1alpha1:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go similarity index 89% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go index e5c750411c..4a5e1ec53b 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go @@ -21,14 +21,14 @@ package v1alpha1 import ( time "time" + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + clientset "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" + internalinterfaces "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" + v1alpha1 "github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" 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" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" ) // ClusterInformer provides access to a shared informer and lister for diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go similarity index 95% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go index 40562f0dfb..68b08874b6 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" + internalinterfaces "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go similarity index 89% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go index c0be887be8..06063ebe21 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go @@ -21,14 +21,14 @@ package v1alpha1 import ( time "time" + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + clientset "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" + internalinterfaces "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" + v1alpha1 "github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" 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" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" ) // MachineInformer provides access to a shared informer and lister for diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go similarity index 89% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go index d224d5516f..6db4475b06 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go @@ -21,14 +21,14 @@ package v1alpha1 import ( time "time" + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + clientset "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" + internalinterfaces "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" + v1alpha1 "github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" 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" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" ) // MachineClassInformer provides access to a shared informer and lister for diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go similarity index 90% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go index 5c574e7cde..0b5f7c4113 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go @@ -21,14 +21,14 @@ package v1alpha1 import ( time "time" + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + clientset "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" + internalinterfaces "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" + v1alpha1 "github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" 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" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" ) // MachineDeploymentInformer provides access to a shared informer and lister for diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go similarity index 89% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go index b24fc14a5f..a3179d4fbf 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go @@ -21,14 +21,14 @@ package v1alpha1 import ( time "time" + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + clientset "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" + internalinterfaces "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" + v1alpha1 "github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" 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" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" ) // MachineSetInformer provides access to a shared informer and lister for diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/factory.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/factory.go similarity index 91% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/factory.go rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/factory.go index 29dfc9a45c..2383e1a543 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/factory.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/factory.go @@ -23,13 +23,14 @@ import ( sync "sync" time "time" + clientset "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" + cluster "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/cluster" + internalinterfaces "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" + machine "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" - clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - cluster "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster" - internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" ) // SharedInformerOption defines the functional option type for SharedInformerFactory. @@ -173,8 +174,13 @@ type SharedInformerFactory interface { WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool Cluster() cluster.Interface + Machine() machine.Interface } func (f *sharedInformerFactory) Cluster() cluster.Interface { return cluster.New(f, f.namespace, f.tweakListOptions) } + +func (f *sharedInformerFactory) Machine() machine.Interface { + return machine.New(f, f.namespace, f.tweakListOptions) +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/generic.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/generic.go similarity index 70% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/generic.go rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/generic.go index a51e0ed76b..b26301d595 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/generic.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/generic.go @@ -21,9 +21,10 @@ package externalversions import ( "fmt" + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + v1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other @@ -64,6 +65,18 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v1alpha1.SchemeGroupVersion.WithResource("machinesets"): 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"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Machine().V1beta1().MachineClasses().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("machinedeployments"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Machine().V1beta1().MachineDeployments().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("machinesets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Machine().V1beta1().MachineSets().Informer()}, nil + } return nil, fmt.Errorf("no informer found for %v", resource) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/BUILD.bazel similarity index 80% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/BUILD.bazel index d6a8332c99..86d3c2e403 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/BUILD.bazel @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["factory_interfaces.go"], - importpath = "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces", + importpath = "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces", visibility = ["//visibility:public"], deps = [ "//pkg/client/clientset_generated/clientset:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/factory_interfaces.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/factory_interfaces.go similarity index 93% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/factory_interfaces.go rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/factory_interfaces.go index 272ebb1980..919e36ac49 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/factory_interfaces.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/factory_interfaces.go @@ -21,10 +21,10 @@ package internalinterfaces import ( time "time" + clientset "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" - clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" ) type NewInformerFunc func(clientset.Interface, time.Duration) cache.SharedIndexInformer diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/BUILD.bazel new file mode 100644 index 0000000000..ea25500806 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["interface.go"], + importpath = "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine", + visibility = ["//visibility:public"], + deps = [ + "//pkg/client/informers_generated/externalversions/internalinterfaces:go_default_library", + "//pkg/client/informers_generated/externalversions/machine/v1beta1:go_default_library", + ], +) diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/interface.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/interface.go similarity index 67% rename from vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/interface.go rename to vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/interface.go index a874fdc5d8..ef2ffff994 100644 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/interface.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/interface.go @@ -1,5 +1,5 @@ /* -Copyright The Kubernetes Authors. +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. @@ -16,17 +16,17 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package example +package machine import ( - v1 "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/v1" - internalinterfaces "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" + v1beta1 "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1" ) // Interface provides access to each of this group's versions. type Interface interface { - // V1 provides access to shared informers for resources in V1. - V1() v1.Interface + // V1beta1 provides access to shared informers for resources in V1beta1. + V1beta1() v1beta1.Interface } type group struct { @@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// V1 returns a new v1.Interface. -func (g *group) V1() v1.Interface { - return v1.New(g.factory, g.namespace, g.tweakListOptions) +// V1beta1 returns a new v1beta1.Interface. +func (g *group) V1beta1() v1beta1.Interface { + return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } 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 new file mode 100644 index 0000000000..65f99f6c14 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/BUILD.bazel @@ -0,0 +1,25 @@ +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", + "machinedeployment.go", + "machineset.go", + ], + importpath = "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1", + visibility = ["//visibility:public"], + deps = [ + "//pkg/apis/machine/v1beta1:go_default_library", + "//pkg/client/clientset_generated/clientset:go_default_library", + "//pkg/client/informers_generated/externalversions/internalinterfaces:go_default_library", + "//pkg/client/listers_generated/machine/v1beta1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", + "//vendor/k8s.io/client-go/tools/cache:go_default_library", + ], +) 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 new file mode 100644 index 0000000000..292c42f02c --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/cluster.go @@ -0,0 +1,89 @@ +/* +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 new file mode 100644 index 0000000000..870a0b17b6 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/interface.go @@ -0,0 +1,73 @@ +/* +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 ( + internalinterfaces "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" +) + +// 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. + MachineClasses() MachineClassInformer + // MachineDeployments returns a MachineDeploymentInformer. + MachineDeployments() MachineDeploymentInformer + // MachineSets returns a MachineSetInformer. + MachineSets() MachineSetInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + 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} +} + +// MachineClasses returns a MachineClassInformer. +func (v *version) MachineClasses() MachineClassInformer { + return &machineClassInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// MachineDeployments returns a MachineDeploymentInformer. +func (v *version) MachineDeployments() MachineDeploymentInformer { + return &machineDeploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// MachineSets returns a MachineSetInformer. +func (v *version) MachineSets() MachineSetInformer { + return &machineSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/machine.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/machine.go new file mode 100644 index 0000000000..21a0714e24 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/machine.go @@ -0,0 +1,89 @@ +/* +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" +) + +// MachineInformer provides access to a shared informer and lister for +// Machines. +type MachineInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.MachineLister +} + +type machineInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMachineInformer constructs a new informer for Machine 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 NewMachineInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMachineInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMachineInformer constructs a new informer for Machine 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 NewFilteredMachineInformer(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().Machines(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().Machines(namespace).Watch(options) + }, + }, + &machinev1beta1.Machine{}, + resyncPeriod, + indexers, + ) +} + +func (f *machineInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMachineInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *machineInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&machinev1beta1.Machine{}, f.defaultInformer) +} + +func (f *machineInformer) Lister() v1beta1.MachineLister { + return v1beta1.NewMachineLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/machineclass.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/machineclass.go new file mode 100644 index 0000000000..dba4270077 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/machineclass.go @@ -0,0 +1,89 @@ +/* +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" +) + +// MachineClassInformer provides access to a shared informer and lister for +// MachineClasses. +type MachineClassInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.MachineClassLister +} + +type machineClassInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMachineClassInformer constructs a new informer for MachineClass 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 NewMachineClassInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMachineClassInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMachineClassInformer constructs a new informer for MachineClass 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 NewFilteredMachineClassInformer(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().MachineClasses(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().MachineClasses(namespace).Watch(options) + }, + }, + &machinev1beta1.MachineClass{}, + resyncPeriod, + indexers, + ) +} + +func (f *machineClassInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMachineClassInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *machineClassInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&machinev1beta1.MachineClass{}, f.defaultInformer) +} + +func (f *machineClassInformer) Lister() v1beta1.MachineClassLister { + return v1beta1.NewMachineClassLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/machinedeployment.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/machinedeployment.go new file mode 100644 index 0000000000..e1c226bdb3 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/machinedeployment.go @@ -0,0 +1,89 @@ +/* +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" +) + +// MachineDeploymentInformer provides access to a shared informer and lister for +// MachineDeployments. +type MachineDeploymentInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.MachineDeploymentLister +} + +type machineDeploymentInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMachineDeploymentInformer constructs a new informer for MachineDeployment 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 NewMachineDeploymentInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMachineDeploymentInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMachineDeploymentInformer constructs a new informer for MachineDeployment 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 NewFilteredMachineDeploymentInformer(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().MachineDeployments(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().MachineDeployments(namespace).Watch(options) + }, + }, + &machinev1beta1.MachineDeployment{}, + resyncPeriod, + indexers, + ) +} + +func (f *machineDeploymentInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMachineDeploymentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *machineDeploymentInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&machinev1beta1.MachineDeployment{}, f.defaultInformer) +} + +func (f *machineDeploymentInformer) Lister() v1beta1.MachineDeploymentLister { + return v1beta1.NewMachineDeploymentLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/machineset.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/machineset.go new file mode 100644 index 0000000000..fe576d6327 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1/machineset.go @@ -0,0 +1,89 @@ +/* +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" +) + +// MachineSetInformer provides access to a shared informer and lister for +// MachineSets. +type MachineSetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.MachineSetLister +} + +type machineSetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMachineSetInformer constructs a new informer for MachineSet 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 NewMachineSetInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMachineSetInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMachineSetInformer constructs a new informer for MachineSet 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 NewFilteredMachineSetInformer(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().MachineSets(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().MachineSets(namespace).Watch(options) + }, + }, + &machinev1beta1.MachineSet{}, + resyncPeriod, + indexers, + ) +} + +func (f *machineSetInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMachineSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *machineSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&machinev1beta1.MachineSet{}, f.defaultInformer) +} + +func (f *machineSetInformer) Lister() v1beta1.MachineSetLister { + return v1beta1.NewMachineSetLister(f.Informer().GetIndexer()) +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/BUILD.bazel similarity index 86% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/BUILD.bazel index 40ed528680..50e7b656d7 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/BUILD.bazel @@ -10,7 +10,7 @@ go_library( "machinedeployment.go", "machineset.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1", + importpath = "github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1", visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/v1alpha1:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/cluster.go b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/cluster.go similarity index 97% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/cluster.go rename to vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/cluster.go index e7d199083b..79f5a06f82 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/cluster.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/cluster.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // ClusterLister helps list Clusters. diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/expansion_generated.go b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/expansion_generated.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/expansion_generated.go rename to vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/expansion_generated.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machine.go b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machine.go similarity index 97% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machine.go rename to vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machine.go index 408a2a9837..7d1335329b 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machine.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machine.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // MachineLister helps list Machines. diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineclass.go b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineclass.go similarity index 97% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineclass.go rename to vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineclass.go index 61dde88f21..df2c0ed6ca 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineclass.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineclass.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // MachineClassLister helps list MachineClasses. diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go rename to vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go index 265e4358e7..96b47bbf56 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // MachineDeploymentLister helps list MachineDeployments. diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineset.go b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineset.go similarity index 97% rename from vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineset.go rename to vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineset.go index da73376fa2..50066366c4 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineset.go +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineset.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) // MachineSetLister helps list MachineSets. 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 new file mode 100644 index 0000000000..dd58545475 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/BUILD.bazel @@ -0,0 +1,21 @@ +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", + "machinedeployment.go", + "machineset.go", + ], + importpath = "github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1", + visibility = ["//visibility:public"], + deps = [ + "//pkg/apis/machine/v1beta1:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", + "//vendor/k8s.io/client-go/tools/cache:go_default_library", + ], +) 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 new file mode 100644 index 0000000000..1a509ddaff --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/cluster.go @@ -0,0 +1,94 @@ +/* +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 new file mode 100644 index 0000000000..8333c80081 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/expansion_generated.go @@ -0,0 +1,59 @@ +/* +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 + +// 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{} + +// MachineNamespaceListerExpansion allows custom methods to be added to +// MachineNamespaceLister. +type MachineNamespaceListerExpansion interface{} + +// MachineClassListerExpansion allows custom methods to be added to +// MachineClassLister. +type MachineClassListerExpansion interface{} + +// MachineClassNamespaceListerExpansion allows custom methods to be added to +// MachineClassNamespaceLister. +type MachineClassNamespaceListerExpansion interface{} + +// MachineDeploymentListerExpansion allows custom methods to be added to +// MachineDeploymentLister. +type MachineDeploymentListerExpansion interface{} + +// MachineDeploymentNamespaceListerExpansion allows custom methods to be added to +// MachineDeploymentNamespaceLister. +type MachineDeploymentNamespaceListerExpansion interface{} + +// MachineSetListerExpansion allows custom methods to be added to +// MachineSetLister. +type MachineSetListerExpansion interface{} + +// MachineSetNamespaceListerExpansion allows custom methods to be added to +// MachineSetNamespaceLister. +type MachineSetNamespaceListerExpansion interface{} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/machine.go b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/machine.go new file mode 100644 index 0000000000..8208d3386a --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/machine.go @@ -0,0 +1,94 @@ +/* +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" +) + +// MachineLister helps list Machines. +type MachineLister interface { + // List lists all Machines in the indexer. + List(selector labels.Selector) (ret []*v1beta1.Machine, err error) + // Machines returns an object that can list and get Machines. + Machines(namespace string) MachineNamespaceLister + MachineListerExpansion +} + +// machineLister implements the MachineLister interface. +type machineLister struct { + indexer cache.Indexer +} + +// NewMachineLister returns a new MachineLister. +func NewMachineLister(indexer cache.Indexer) MachineLister { + return &machineLister{indexer: indexer} +} + +// List lists all Machines in the indexer. +func (s *machineLister) List(selector labels.Selector) (ret []*v1beta1.Machine, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Machine)) + }) + return ret, err +} + +// Machines returns an object that can list and get Machines. +func (s *machineLister) Machines(namespace string) MachineNamespaceLister { + return machineNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MachineNamespaceLister helps list and get Machines. +type MachineNamespaceLister interface { + // List lists all Machines in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1beta1.Machine, err error) + // Get retrieves the Machine from the indexer for a given namespace and name. + Get(name string) (*v1beta1.Machine, error) + MachineNamespaceListerExpansion +} + +// machineNamespaceLister implements the MachineNamespaceLister +// interface. +type machineNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Machines in the indexer for a given namespace. +func (s machineNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Machine, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Machine)) + }) + return ret, err +} + +// Get retrieves the Machine from the indexer for a given namespace and name. +func (s machineNamespaceLister) Get(name string) (*v1beta1.Machine, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("machine"), name) + } + return obj.(*v1beta1.Machine), nil +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/machineclass.go b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/machineclass.go new file mode 100644 index 0000000000..7e78a7ec86 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/machineclass.go @@ -0,0 +1,94 @@ +/* +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" +) + +// MachineClassLister helps list MachineClasses. +type MachineClassLister interface { + // List lists all MachineClasses in the indexer. + List(selector labels.Selector) (ret []*v1beta1.MachineClass, err error) + // MachineClasses returns an object that can list and get MachineClasses. + MachineClasses(namespace string) MachineClassNamespaceLister + MachineClassListerExpansion +} + +// machineClassLister implements the MachineClassLister interface. +type machineClassLister struct { + indexer cache.Indexer +} + +// NewMachineClassLister returns a new MachineClassLister. +func NewMachineClassLister(indexer cache.Indexer) MachineClassLister { + return &machineClassLister{indexer: indexer} +} + +// List lists all MachineClasses in the indexer. +func (s *machineClassLister) List(selector labels.Selector) (ret []*v1beta1.MachineClass, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineClass)) + }) + return ret, err +} + +// MachineClasses returns an object that can list and get MachineClasses. +func (s *machineClassLister) MachineClasses(namespace string) MachineClassNamespaceLister { + return machineClassNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MachineClassNamespaceLister helps list and get MachineClasses. +type MachineClassNamespaceLister interface { + // List lists all MachineClasses in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1beta1.MachineClass, err error) + // Get retrieves the MachineClass from the indexer for a given namespace and name. + Get(name string) (*v1beta1.MachineClass, error) + MachineClassNamespaceListerExpansion +} + +// machineClassNamespaceLister implements the MachineClassNamespaceLister +// interface. +type machineClassNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all MachineClasses in the indexer for a given namespace. +func (s machineClassNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.MachineClass, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineClass)) + }) + return ret, err +} + +// Get retrieves the MachineClass from the indexer for a given namespace and name. +func (s machineClassNamespaceLister) Get(name string) (*v1beta1.MachineClass, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("machineclass"), name) + } + return obj.(*v1beta1.MachineClass), nil +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/machinedeployment.go b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/machinedeployment.go new file mode 100644 index 0000000000..359522d563 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/machinedeployment.go @@ -0,0 +1,94 @@ +/* +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" +) + +// MachineDeploymentLister helps list MachineDeployments. +type MachineDeploymentLister interface { + // List lists all MachineDeployments in the indexer. + List(selector labels.Selector) (ret []*v1beta1.MachineDeployment, err error) + // MachineDeployments returns an object that can list and get MachineDeployments. + MachineDeployments(namespace string) MachineDeploymentNamespaceLister + MachineDeploymentListerExpansion +} + +// machineDeploymentLister implements the MachineDeploymentLister interface. +type machineDeploymentLister struct { + indexer cache.Indexer +} + +// NewMachineDeploymentLister returns a new MachineDeploymentLister. +func NewMachineDeploymentLister(indexer cache.Indexer) MachineDeploymentLister { + return &machineDeploymentLister{indexer: indexer} +} + +// List lists all MachineDeployments in the indexer. +func (s *machineDeploymentLister) List(selector labels.Selector) (ret []*v1beta1.MachineDeployment, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineDeployment)) + }) + return ret, err +} + +// MachineDeployments returns an object that can list and get MachineDeployments. +func (s *machineDeploymentLister) MachineDeployments(namespace string) MachineDeploymentNamespaceLister { + return machineDeploymentNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MachineDeploymentNamespaceLister helps list and get MachineDeployments. +type MachineDeploymentNamespaceLister interface { + // List lists all MachineDeployments in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1beta1.MachineDeployment, err error) + // Get retrieves the MachineDeployment from the indexer for a given namespace and name. + Get(name string) (*v1beta1.MachineDeployment, error) + MachineDeploymentNamespaceListerExpansion +} + +// machineDeploymentNamespaceLister implements the MachineDeploymentNamespaceLister +// interface. +type machineDeploymentNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all MachineDeployments in the indexer for a given namespace. +func (s machineDeploymentNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.MachineDeployment, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineDeployment)) + }) + return ret, err +} + +// Get retrieves the MachineDeployment from the indexer for a given namespace and name. +func (s machineDeploymentNamespaceLister) Get(name string) (*v1beta1.MachineDeployment, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("machinedeployment"), name) + } + return obj.(*v1beta1.MachineDeployment), nil +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/machineset.go b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/machineset.go new file mode 100644 index 0000000000..0c5d85c94a --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1/machineset.go @@ -0,0 +1,94 @@ +/* +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" +) + +// MachineSetLister helps list MachineSets. +type MachineSetLister interface { + // List lists all MachineSets in the indexer. + List(selector labels.Selector) (ret []*v1beta1.MachineSet, err error) + // MachineSets returns an object that can list and get MachineSets. + MachineSets(namespace string) MachineSetNamespaceLister + MachineSetListerExpansion +} + +// machineSetLister implements the MachineSetLister interface. +type machineSetLister struct { + indexer cache.Indexer +} + +// NewMachineSetLister returns a new MachineSetLister. +func NewMachineSetLister(indexer cache.Indexer) MachineSetLister { + return &machineSetLister{indexer: indexer} +} + +// List lists all MachineSets in the indexer. +func (s *machineSetLister) List(selector labels.Selector) (ret []*v1beta1.MachineSet, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineSet)) + }) + return ret, err +} + +// MachineSets returns an object that can list and get MachineSets. +func (s *machineSetLister) MachineSets(namespace string) MachineSetNamespaceLister { + return machineSetNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MachineSetNamespaceLister helps list and get MachineSets. +type MachineSetNamespaceLister interface { + // List lists all MachineSets in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1beta1.MachineSet, err error) + // Get retrieves the MachineSet from the indexer for a given namespace and name. + Get(name string) (*v1beta1.MachineSet, error) + MachineSetNamespaceListerExpansion +} + +// machineSetNamespaceLister implements the MachineSetNamespaceLister +// interface. +type machineSetNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all MachineSets in the indexer for a given namespace. +func (s machineSetNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.MachineSet, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineSet)) + }) + return ret, err +} + +// Get retrieves the MachineSet from the indexer for a given namespace and name. +func (s machineSetNamespaceLister) Get(name string) (*v1beta1.MachineSet, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("machineset"), name) + } + return obj.(*v1beta1.MachineSet), nil +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/cmd-runner/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/cmdrunner/BUILD.bazel similarity index 81% rename from vendor/sigs.k8s.io/cluster-api/pkg/cmd-runner/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/cmdrunner/BUILD.bazel index 40cf8d60b3..121fed16c8 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/cmd-runner/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/cmdrunner/BUILD.bazel @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["cmd_runner.go"], - importpath = "sigs.k8s.io/cluster-api/pkg/cmd-runner", + importpath = "github.com/openshift/cluster-api/pkg/cmdrunner", visibility = ["//visibility:public"], ) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/cmd-runner/cmd_runner.go b/vendor/github.com/openshift/cluster-api/pkg/cmdrunner/cmd_runner.go similarity index 77% rename from vendor/sigs.k8s.io/cluster-api/pkg/cmd-runner/cmd_runner.go rename to vendor/github.com/openshift/cluster-api/pkg/cmdrunner/cmd_runner.go index e0311e98dc..b095b7c64a 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/cmd-runner/cmd_runner.go +++ b/vendor/github.com/openshift/cluster-api/pkg/cmdrunner/cmd_runner.go @@ -14,24 +14,24 @@ See the License for the specific language governing permissions and limitations under the License. */ -package cmd_runner +package cmdrunner import ( "os/exec" ) -type CmdRunner interface { +type Runner interface { CombinedOutput(cmd string, args ...string) (output string, err error) } -type realCmdRunner struct { +type realRunner struct { } -func New() *realCmdRunner { - return &realCmdRunner{} +func New() *realRunner { + return &realRunner{} } -func (runner *realCmdRunner) CombinedOutput(cmd string, args ...string) (string, error) { +func (runner *realRunner) CombinedOutput(cmd string, args ...string) (string, error) { output, err := exec.Command(cmd, args...).CombinedOutput() return string(output), err } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/BUILD.bazel similarity index 89% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/controller/BUILD.bazel index 8f075625a7..7b27be2c69 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/BUILD.bazel @@ -8,7 +8,7 @@ go_library( "add_node.go", "controller.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/controller", + importpath = "github.com/openshift/cluster-api/pkg/controller", visibility = ["//visibility:public"], deps = [ "//pkg/controller/machinedeployment:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/add_machinedeployment.go b/vendor/github.com/openshift/cluster-api/pkg/controller/add_machinedeployment.go similarity index 91% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/add_machinedeployment.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/add_machinedeployment.go index abe62f9900..9fd46a6712 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/add_machinedeployment.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/add_machinedeployment.go @@ -17,7 +17,7 @@ limitations under the License. package controller import ( - "sigs.k8s.io/cluster-api/pkg/controller/machinedeployment" + "github.com/openshift/cluster-api/pkg/controller/machinedeployment" ) func init() { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/add_machineset.go b/vendor/github.com/openshift/cluster-api/pkg/controller/add_machineset.go similarity index 92% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/add_machineset.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/add_machineset.go index bbdb3d36f2..b0279c1183 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/add_machineset.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/add_machineset.go @@ -17,7 +17,7 @@ limitations under the License. package controller import ( - "sigs.k8s.io/cluster-api/pkg/controller/machineset" + "github.com/openshift/cluster-api/pkg/controller/machineset" ) func init() { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/add_node.go b/vendor/github.com/openshift/cluster-api/pkg/controller/add_node.go similarity index 93% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/add_node.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/add_node.go index f6783fb534..34c00cf72e 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/add_node.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/add_node.go @@ -17,7 +17,7 @@ limitations under the License. package controller import ( - "sigs.k8s.io/cluster-api/pkg/controller/node" + "github.com/openshift/cluster-api/pkg/controller/node" ) func init() { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/cluster/BUILD.bazel similarity index 96% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/controller/cluster/BUILD.bazel index 61c5fa9a23..000be8c496 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/cluster/BUILD.bazel @@ -7,7 +7,7 @@ go_library( "controller.go", "testactuator.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/controller/cluster", + importpath = "github.com/openshift/cluster-api/pkg/controller/cluster", visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/v1alpha1:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster/actuator.go b/vendor/github.com/openshift/cluster-api/pkg/controller/cluster/actuator.go similarity index 92% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster/actuator.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/cluster/actuator.go index d41a6cbb4b..6266aa5de2 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster/actuator.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/cluster/actuator.go @@ -17,7 +17,7 @@ limitations under the License. package cluster import ( - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" ) /// [Actuator] diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/cluster/controller.go similarity index 92% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster/controller.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/cluster/controller.go index c9b6118f90..5bf21616aa 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/cluster/controller.go @@ -19,13 +19,13 @@ package cluster import ( "context" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + controllerError "github.com/openshift/cluster-api/pkg/controller/error" + "github.com/openshift/cluster-api/pkg/util" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/klog" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - controllerError "sigs.k8s.io/cluster-api/pkg/controller/error" - "sigs.k8s.io/cluster-api/pkg/util" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" @@ -71,7 +71,7 @@ type ReconcileCluster struct { actuator Actuator } -// +kubebuilder:rbac:groups=cluster.k8s.io,resources=clusters,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=machine.openshift.io,resources=clusters,verbs=get;list;watch;create;update;patch;delete func (r *ReconcileCluster) Reconcile(request reconcile.Request) (reconcile.Result, error) { cluster := &clusterv1alpha1.Cluster{} err := r.Get(context.Background(), request.NamespacedName, cluster) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster/testactuator.go b/vendor/github.com/openshift/cluster-api/pkg/controller/cluster/testactuator.go similarity index 95% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster/testactuator.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/cluster/testactuator.go index 5de8a13b98..716521d516 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster/testactuator.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/cluster/testactuator.go @@ -19,7 +19,7 @@ package cluster import ( "sync" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" ) type TestActuator struct { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/config/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/config/BUILD.bazel similarity index 84% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/config/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/controller/config/BUILD.bazel index 67471d9dcc..86411f3745 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/config/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/config/BUILD.bazel @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["configuration.go"], - importpath = "sigs.k8s.io/cluster-api/pkg/controller/config", + importpath = "github.com/openshift/cluster-api/pkg/controller/config", visibility = ["//visibility:public"], deps = [ "//vendor/github.com/spf13/pflag:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/config/configuration.go b/vendor/github.com/openshift/cluster-api/pkg/controller/config/configuration.go similarity index 96% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/config/configuration.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/config/configuration.go index dc4bef508e..6e409320ff 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/config/configuration.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/config/configuration.go @@ -40,7 +40,7 @@ type LeaderElectionConfiguration struct { // by another candidate. This is only applicable if leader election is // enabled. LeaseDuration metav1.Duration - // RenewDeadline is the interval between attempts by the acting master to + // RenewDeadline is the interval between attempts by the acting control plane to // renew a leadership slot before it stops leading. This must be less // than or equal to the lease duration. This is only applicable if leader // election is enabled. @@ -85,7 +85,7 @@ func GetLeaderElectionConfig() *LeaderElectionConfiguration { } func (c *Configuration) AddFlags(fs *pflag.FlagSet) { - fs.StringVar(&c.Kubeconfig, "kubeconfig", c.Kubeconfig, "Path to kubeconfig file with authorization and master location information.") + fs.StringVar(&c.Kubeconfig, "kubeconfig", c.Kubeconfig, "Path to kubeconfig file with authorization and control plane location information.") fs.IntVar(&c.WorkerCount, "workers", c.WorkerCount, "The number of workers for controller.") AddLeaderElectionFlags(c.leaderElectionConfig, fs) @@ -103,7 +103,7 @@ func AddLeaderElectionFlags(l *LeaderElectionConfiguration, fs *pflag.FlagSet) { "before it is replaced by another candidate. This is only applicable if leader "+ "election is enabled.") fs.DurationVar(&l.RenewDeadline.Duration, "leader-elect-renew-deadline", l.RenewDeadline.Duration, ""+ - "The interval between attempts by the acting master to renew a leadership slot "+ + "The interval between attempts by the acting control plane to renew a leadership slot "+ "before it stops leading. This must be less than or equal to the lease duration. "+ "This is only applicable if leader election is enabled.") fs.DurationVar(&l.RetryPeriod.Duration, "leader-elect-retry-period", l.RetryPeriod.Duration, ""+ diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/controller.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/controller.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/controller.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/error/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/error/BUILD.bazel similarity index 70% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/error/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/controller/error/BUILD.bazel index db3ab41550..b125943e60 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/error/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/error/BUILD.bazel @@ -3,6 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["requeue_error.go"], - importpath = "sigs.k8s.io/cluster-api/pkg/controller/error", + importpath = "github.com/openshift/cluster-api/pkg/controller/error", visibility = ["//visibility:public"], ) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/error/requeue_error.go b/vendor/github.com/openshift/cluster-api/pkg/controller/error/requeue_error.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/error/requeue_error.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/error/requeue_error.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/BUILD.bazel similarity index 84% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/controller/machine/BUILD.bazel index b63ecbdd57..b9297268fa 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/BUILD.bazel @@ -7,14 +7,15 @@ go_library( "controller.go", "testactuator.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/controller/machine", + 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", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/client:go_default_library", @@ -29,19 +30,21 @@ go_library( go_test( name = "go_default_test", srcs = [ + "controller_test.go", "machine_controller_suite_test.go", "machine_controller_test.go", ], embed = [":go_default_library"], deps = [ "//pkg/apis:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/machine/v1beta1:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/client:go_default_library", + "//vendor/sigs.k8s.io/controller-runtime/pkg/client/fake:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/envtest:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/manager:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/actuator.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/actuator.go similarity index 76% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/actuator.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/machine/actuator.go index fb07683b39..6ddd372e64 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/actuator.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/actuator.go @@ -19,7 +19,7 @@ package machine import ( "context" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + machinev1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" ) /// [Actuator] @@ -27,13 +27,13 @@ import ( // methods should be idempotent unless otherwise specified. type Actuator interface { // Create the machine. - Create(context.Context, *clusterv1.Cluster, *clusterv1.Machine) error + Create(context.Context, *machinev1.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, *clusterv1.Cluster, *clusterv1.Machine) error + Delete(context.Context, *machinev1.Cluster, *machinev1.Machine) error // Update the machine to the provided definition. - Update(context.Context, *clusterv1.Cluster, *clusterv1.Machine) error + Update(context.Context, *machinev1.Cluster, *machinev1.Machine) error // Checks if the machine currently exists. - Exists(context.Context, *clusterv1.Cluster, *clusterv1.Machine) (bool, error) + Exists(context.Context, *machinev1.Cluster, *machinev1.Machine) (bool, error) } /// [Actuator] diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go similarity index 79% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/controller.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go index 19f258632c..c9d3b9c38c 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go @@ -21,13 +21,14 @@ import ( "errors" "os" + 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" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/klog" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - controllerError "sigs.k8s.io/cluster-api/pkg/controller/error" - "sigs.k8s.io/cluster-api/pkg/util" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" @@ -69,7 +70,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error { } // Watch for changes to Machine - err = c.Watch(&source.Kind{Type: &clusterv1.Machine{}}, &handler.EnqueueRequestForObject{}) + err = c.Watch(&source.Kind{Type: &machinev1.Machine{}}, &handler.EnqueueRequestForObject{}) if err != nil { return err } @@ -92,12 +93,12 @@ type ReconcileMachine struct { // Reconcile reads that state of the cluster for a Machine object and makes changes based on the state read // and what is in the Machine.Spec -// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machines,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=machine.openshift.io,resources=machines,verbs=get;list;watch;create;update;patch;delete func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Result, error) { // TODO(mvladev): Can context be passed from Kubebuilder? ctx := context.TODO() // Fetch the Machine instance - m := &clusterv1.Machine{} + m := &machinev1.Machine{} if err := r.Client.Get(ctx, request.NamespacedName, m); err != nil { if apierrors.IsNotFound(err) { // Object not found, return. Created objects are automatically garbage collected. @@ -112,11 +113,18 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul name := m.Name klog.Infof("Running reconcile Machine for %s\n", name) + // Cluster might be nil as some providers might not require a cluster object + // for machine management. + cluster, err := r.getCluster(ctx, m) + if err != nil { + // Just log the error here. + klog.V(4).Infof("Cluster not found, machine actuation might fail: %v", err) + } // If object hasn't been deleted and doesn't have a finalizer, add one // Add a finalizer to newly created objects. if m.ObjectMeta.DeletionTimestamp.IsZero() && - !util.Contains(m.ObjectMeta.Finalizers, clusterv1.MachineFinalizer) { - m.Finalizers = append(m.Finalizers, clusterv1.MachineFinalizer) + !util.Contains(m.ObjectMeta.Finalizers, machinev1.MachineFinalizer) { + m.Finalizers = append(m.Finalizers, machinev1.MachineFinalizer) if err := r.Client.Update(ctx, m); err != nil { klog.Infof("failed to add finalizer to machine object %v due to error %v.", name, err) return reconcile.Result{}, err @@ -128,7 +136,7 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul if !m.ObjectMeta.DeletionTimestamp.IsZero() { // no-op if finalizer has been removed. - if !util.Contains(m.ObjectMeta.Finalizers, clusterv1.MachineFinalizer) { + if !util.Contains(m.ObjectMeta.Finalizers, machinev1.MachineFinalizer) { klog.Infof("reconciling machine object %v causes a no-op as there is no finalizer.", name) return reconcile.Result{}, nil } @@ -137,7 +145,7 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul return reconcile.Result{}, nil } klog.Infof("reconciling machine object %v triggers delete.", name) - if err := r.delete(ctx, m); err != nil { + if err := r.actuator.Delete(ctx, cluster, m); err != nil { klog.Errorf("Error deleting machine object %v; %v", name, err) if requeueErr, ok := err.(*controllerError.RequeueAfterError); ok { klog.Infof("Actuator returned requeue-after error: %v", requeueErr) @@ -148,7 +156,7 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul // Remove finalizer on successful deletion. klog.Infof("machine object %v deletion successful, removing finalizer.", name) - m.ObjectMeta.Finalizers = util.Filter(m.ObjectMeta.Finalizers, clusterv1.MachineFinalizer) + m.ObjectMeta.Finalizers = util.Filter(m.ObjectMeta.Finalizers, machinev1.MachineFinalizer) if err := r.Client.Update(context.Background(), m); err != nil { klog.Errorf("Error removing finalizer from machine object %v; %v", name, err) return reconcile.Result{}, err @@ -156,11 +164,6 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul return reconcile.Result{}, nil } - cluster, err := r.getCluster(ctx, m) - if err != nil { - return reconcile.Result{}, err - } - exist, err := r.actuator.Exists(ctx, cluster, m) if err != nil { klog.Errorf("Error checking existence of machine instance for machine object %v; %v", name, err) @@ -168,7 +171,7 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul } if exist { klog.Infof("Reconciling machine object %v triggers idempotent update.", name) - if err := r.update(ctx, m); err != nil { + if err := r.actuator.Update(ctx, cluster, m); err != nil { if requeueErr, ok := err.(*controllerError.RequeueAfterError); ok { klog.Infof("Actuator returned requeue-after error: %v", requeueErr) return reconcile.Result{Requeue: true, RequeueAfter: requeueErr.RequeueAfter}, nil @@ -179,7 +182,7 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul } // Machine resource created. Machine does not yet exist. klog.Infof("Reconciling machine object %v triggers idempotent create.", m.ObjectMeta.Name) - if err := r.create(ctx, m); err != nil { + if err := r.actuator.Create(ctx, cluster, m); err != nil { klog.Warningf("unable to create machine %v: %v", name, err) if requeueErr, ok := err.(*controllerError.RequeueAfterError); ok { klog.Infof("Actuator returned requeue-after error: %v", requeueErr) @@ -190,38 +193,20 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul return reconcile.Result{}, nil } -func (r *ReconcileMachine) create(ctx context.Context, machine *clusterv1.Machine) error { - cluster, err := r.getCluster(ctx, machine) - if err != nil { - return err - } - - return r.actuator.Create(ctx, cluster, machine) -} - -func (r *ReconcileMachine) update(ctx context.Context, new_machine *clusterv1.Machine) error { - cluster, err := r.getCluster(ctx, new_machine) - if err != nil { - return err - } - - // TODO: Assume single master for now. - // TODO: Assume we never change the role for the machines. (Master->Node, Node->Master, etc) - return r.actuator.Update(ctx, cluster, new_machine) -} - -func (r *ReconcileMachine) delete(ctx context.Context, machine *clusterv1.Machine) error { - cluster, err := r.getCluster(ctx, machine) - if err != nil { - return err - } - - return r.actuator.Delete(ctx, cluster, machine) -} - -func (r *ReconcileMachine) getCluster(ctx context.Context, machine *clusterv1.Machine) (*clusterv1.Cluster, error) { - clusterList := clusterv1.ClusterList{} - if err := r.Client.List(ctx, client.InNamespace(machine.Namespace), &clusterList); err != nil { +func (r *ReconcileMachine) getCluster(ctx context.Context, machine *machinev1.Machine) (*machinev1.Cluster, error) { + clusterList := machinev1.ClusterList{} + listOptions := &client.ListOptions{ + Namespace: machine.Namespace, + // This is set so the fake client can be used for unit test. See: + // https://github.com/kubernetes-sigs/controller-runtime/issues/168 + Raw: &metav1.ListOptions{ + TypeMeta: metav1.TypeMeta{ + APIVersion: machinev1.SchemeGroupVersion.String(), + Kind: "Cluster", + }, + }, + } + if err := r.Client.List(ctx, listOptions, &clusterList); err != nil { return nil, err } @@ -235,7 +220,7 @@ func (r *ReconcileMachine) getCluster(ctx context.Context, machine *clusterv1.Ma } } -func (r *ReconcileMachine) isDeleteAllowed(machine *clusterv1.Machine) bool { +func (r *ReconcileMachine) isDeleteAllowed(machine *machinev1.Machine) bool { if r.nodeName == "" || machine.Status.NodeRef == nil { return true } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/testactuator.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/testactuator.go similarity index 77% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/testactuator.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/machine/testactuator.go index 8b58ab0970..8198698842 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machine/testactuator.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/testactuator.go @@ -20,9 +20,11 @@ import ( "context" "sync" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" ) +var _ Actuator = &TestActuator{} + type TestActuator struct { unblock chan string BlockOnCreate bool @@ -37,7 +39,7 @@ type TestActuator struct { Lock sync.Mutex } -func (a *TestActuator) Create(context.Context, *v1alpha1.Cluster, *v1alpha1.Machine) error { +func (a *TestActuator) Create(context.Context, *v1beta1.Cluster, *v1beta1.Machine) error { defer func() { if a.BlockOnCreate { <-a.unblock @@ -50,7 +52,7 @@ func (a *TestActuator) Create(context.Context, *v1alpha1.Cluster, *v1alpha1.Mach return nil } -func (a *TestActuator) Delete(context.Context, *v1alpha1.Cluster, *v1alpha1.Machine) error { +func (a *TestActuator) Delete(context.Context, *v1beta1.Cluster, *v1beta1.Machine) error { defer func() { if a.BlockOnDelete { <-a.unblock @@ -63,7 +65,7 @@ func (a *TestActuator) Delete(context.Context, *v1alpha1.Cluster, *v1alpha1.Mach return nil } -func (a *TestActuator) Update(ctx context.Context, c *v1alpha1.Cluster, machine *v1alpha1.Machine) error { +func (a *TestActuator) Update(ctx context.Context, c *v1beta1.Cluster, machine *v1beta1.Machine) error { defer func() { if a.BlockOnUpdate { <-a.unblock @@ -75,7 +77,7 @@ func (a *TestActuator) Update(ctx context.Context, c *v1alpha1.Cluster, machine return nil } -func (a *TestActuator) Exists(context.Context, *v1alpha1.Cluster, *v1alpha1.Machine) (bool, error) { +func (a *TestActuator) Exists(context.Context, *v1beta1.Cluster, *v1beta1.Machine) (bool, error) { defer func() { if a.BlockOnExists { <-a.unblock diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/BUILD.bazel similarity index 79% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/BUILD.bazel index 65ae4d7f89..fa3522eba0 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/BUILD.bazel @@ -7,12 +7,13 @@ go_library( "rolling.go", "sync.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/controller/machinedeployment", + importpath = "github.com/openshift/cluster-api/pkg/controller/machinedeployment", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/common:go_default_library", - "//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", + "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", @@ -35,22 +36,26 @@ go_library( go_test( name = "go_default_test", srcs = [ + "controller_test.go", "machinedeployment_controller_suite_test.go", "machinedeployment_controller_test.go", ], embed = [":go_default_library"], deps = [ "//pkg/apis:go_default_library", - "//pkg/apis/cluster/common:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/machine/common:go_default_library", + "//pkg/apis/machine/v1beta1:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library", "//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/client:go_default_library", + "//vendor/sigs.k8s.io/controller-runtime/pkg/client/fake:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/envtest:go_default_library", + "//vendor/sigs.k8s.io/controller-runtime/pkg/handler:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/manager:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile:go_default_library", ], diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go similarity index 84% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/controller.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go index 6abb0a48ab..a963c57104 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go @@ -18,17 +18,17 @@ package machinedeployment import ( "context" - "fmt" "reflect" - "k8s.io/apimachinery/pkg/api/errors" + "github.com/openshift/cluster-api/pkg/apis/machine/common" + "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + "github.com/pkg/errors" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/klog" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" @@ -38,7 +38,7 @@ import ( ) // controllerKind contains the schema.GroupVersionKind for this controller type. -var controllerKind = v1alpha1.SchemeGroupVersion.WithKind("MachineDeployment") +var controllerKind = v1beta1.SchemeGroupVersion.WithKind("MachineDeployment") // ReconcileMachineDeployment reconciles a MachineDeployment object type ReconcileMachineDeployment struct { @@ -66,21 +66,21 @@ func add(mgr manager.Manager, r reconcile.Reconciler, mapFn handler.ToRequestsFu } // Watch for changes to MachineDeployment - err = c.Watch(&source.Kind{Type: &v1alpha1.MachineDeployment{}}, &handler.EnqueueRequestForObject{}) + err = c.Watch(&source.Kind{Type: &v1beta1.MachineDeployment{}}, &handler.EnqueueRequestForObject{}) if err != nil { return err } // Watch for changes to MachineSet and reconcile the owner MachineDeployment - err = c.Watch(&source.Kind{Type: &v1alpha1.MachineSet{}}, - &handler.EnqueueRequestForOwner{OwnerType: &v1alpha1.MachineDeployment{}, IsController: true}) + err = c.Watch(&source.Kind{Type: &v1beta1.MachineSet{}}, + &handler.EnqueueRequestForOwner{OwnerType: &v1beta1.MachineDeployment{}, IsController: true}) if err != nil { return err } // Map MachineSet changes to MachineDeployment err = c.Watch( - &source.Kind{Type: &v1alpha1.MachineSet{}}, + &source.Kind{Type: &v1beta1.MachineSet{}}, &handler.EnqueueRequestsFromMapFunc{ToRequests: mapFn}) if err != nil { return err @@ -91,17 +91,17 @@ func add(mgr manager.Manager, r reconcile.Reconciler, mapFn handler.ToRequestsFu var _ reconcile.Reconciler = &ReconcileMachineDeployment{} -func (r *ReconcileMachineDeployment) getMachineSetsForDeployment(d *v1alpha1.MachineDeployment) ([]*v1alpha1.MachineSet, error) { +func (r *ReconcileMachineDeployment) getMachineSetsForDeployment(d *v1beta1.MachineDeployment) ([]*v1beta1.MachineSet, error) { // List all MachineSets to find those we own but that no longer match our // selector. - machineSets := &v1alpha1.MachineSetList{} + machineSets := &v1beta1.MachineSetList{} listOptions := &client.ListOptions{ Namespace: d.Namespace, // This is set so the fake client can be used for unit test. See: // https://github.com/kubernetes-sigs/controller-runtime/issues/168 Raw: &metav1.ListOptions{ TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), + APIVersion: v1beta1.SchemeGroupVersion.String(), Kind: "MachineSet", }, }, @@ -112,7 +112,7 @@ func (r *ReconcileMachineDeployment) getMachineSetsForDeployment(d *v1alpha1.Mac // TODO: flush out machine set adoption. - var filteredMS []*v1alpha1.MachineSet + var filteredMS []*v1beta1.MachineSet for idx, _ := range machineSets.Items { ms := &machineSets.Items[idx] if metav1.GetControllerOf(ms) == nil || (metav1.GetControllerOf(ms) != nil && !metav1.IsControlledBy(ms, d)) { @@ -140,13 +140,13 @@ func (r *ReconcileMachineDeployment) getMachineSetsForDeployment(d *v1alpha1.Mac // Reconcile reads that state of the cluster for a MachineDeployment object and makes changes based on the state read // and what is in the MachineDeployment.Spec -// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machinedeployments,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=machine.openshift.io,resources=machinedeployments,verbs=get;list;watch;create;update;patch;delete func (r *ReconcileMachineDeployment) Reconcile(request reconcile.Request) (reconcile.Result, error) { // Fetch the MachineDeployment instance - d := &v1alpha1.MachineDeployment{} + d := &v1beta1.MachineDeployment{} err := r.Get(context.TODO(), request.NamespacedName, d) if err != nil { - if errors.IsNotFound(err) { + if apierrors.IsNotFound(err) { // Object not found, return. Created objects are automatically garbage collected. // For additional cleanup logic use finalizers. return reconcile.Result{}, nil @@ -155,7 +155,7 @@ func (r *ReconcileMachineDeployment) Reconcile(request reconcile.Request) (recon return reconcile.Result{}, err } - v1alpha1.PopulateDefaultsMachineDeployment(d) + v1beta1.PopulateDefaultsMachineDeployment(d) everything := metav1.LabelSelector{} if reflect.DeepEqual(d.Spec.Selector, &everything) { @@ -192,25 +192,25 @@ func (r *ReconcileMachineDeployment) Reconcile(request reconcile.Request) (recon return reconcile.Result{}, r.rolloutRolling(d, msList, machineMap) } - return reconcile.Result{}, fmt.Errorf("unexpected deployment strategy type: %s", d.Spec.Strategy.Type) + return reconcile.Result{}, errors.Errorf("unexpected deployment strategy type: %s", d.Spec.Strategy.Type) } // getMachineDeploymentsForMachineSet returns a list of Deployments that potentially // match a MachineSet. -func (r *ReconcileMachineDeployment) getMachineDeploymentsForMachineSet(ms *v1alpha1.MachineSet) []*v1alpha1.MachineDeployment { +func (r *ReconcileMachineDeployment) getMachineDeploymentsForMachineSet(ms *v1beta1.MachineSet) []*v1beta1.MachineDeployment { if len(ms.Labels) == 0 { klog.Warningf("no machine deployments found for MachineSet %v because it has no labels", ms.Name) return nil } - dList := &v1alpha1.MachineDeploymentList{} + dList := &v1beta1.MachineDeploymentList{} listOptions := &client.ListOptions{ Namespace: ms.Namespace, // This is set so the fake client can be used for unit test. See: // https://github.com/kubernetes-sigs/controller-runtime/issues/168 Raw: &metav1.ListOptions{ TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), + APIVersion: v1beta1.SchemeGroupVersion.String(), Kind: "MachineDeployment", }, }, @@ -220,7 +220,7 @@ func (r *ReconcileMachineDeployment) getMachineDeploymentsForMachineSet(ms *v1al return nil } - var deployments []*v1alpha1.MachineDeployment + var deployments []*v1beta1.MachineDeployment for idx, d := range dList.Items { selector, err := metav1.LabelSelectorAsSelector(&d.Spec.Selector) if err != nil { @@ -240,7 +240,7 @@ func (r *ReconcileMachineDeployment) getMachineDeploymentsForMachineSet(ms *v1al // // It returns a map from MachineSet UID to a list of Machines controlled by that MS, // according to the Machine's ControllerRef. -func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1alpha1.MachineDeployment, msList []*v1alpha1.MachineSet) (map[types.UID]*v1alpha1.MachineList, error) { +func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1beta1.MachineDeployment, msList []*v1beta1.MachineSet) (map[types.UID]*v1beta1.MachineList, error) { // TODO(droot): double check if previous selector maps correctly to new one. // _, err := metav1.LabelSelectorAsSelector(&d.Spec.Selector) @@ -249,14 +249,14 @@ func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1alpha1.Mach if err != nil { return nil, err } - machines := &v1alpha1.MachineList{} + machines := &v1beta1.MachineList{} listOptions := &client.ListOptions{ Namespace: d.Namespace, // This is set so the fake client can be used for unit test. See: // https://github.com/kubernetes-sigs/controller-runtime/issues/168 Raw: &metav1.ListOptions{ TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), + APIVersion: v1beta1.SchemeGroupVersion.String(), Kind: "Machine", }, }, @@ -265,9 +265,9 @@ func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1alpha1.Mach return nil, err } // Group Machines by their controller (if it's in msList). - machineMap := make(map[types.UID]*v1alpha1.MachineList, len(msList)) + machineMap := make(map[types.UID]*v1beta1.MachineList, len(msList)) for _, ms := range msList { - machineMap[ms.UID] = &v1alpha1.MachineList{} + machineMap[ms.UID] = &v1beta1.MachineList{} } for idx := range machines.Items { machine := &machines.Items[idx] @@ -287,7 +287,7 @@ func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1alpha1.Mach func (r *ReconcileMachineDeployment) MachineSetToDeployments(o handler.MapObject) []reconcile.Request { result := []reconcile.Request{} - ms := &v1alpha1.MachineSet{} + ms := &v1beta1.MachineSet{} key := client.ObjectKey{Namespace: o.Meta.GetNamespace(), Name: o.Meta.GetName()} err := r.Client.Get(context.Background(), key, ms) if err != nil { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/rolling.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/rolling.go similarity index 82% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/rolling.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/rolling.go index b6786fb101..092a14639f 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/rolling.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/rolling.go @@ -17,19 +17,19 @@ limitations under the License. package machinedeployment import ( - "fmt" "sort" + "github.com/pkg/errors" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/integer" "k8s.io/klog" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - dutil "sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/util" + "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + dutil "github.com/openshift/cluster-api/pkg/controller/machinedeployment/util" ) // rolloutRolling implements the logic for rolling a new machine set. -func (r *ReconcileMachineDeployment) rolloutRolling(d *v1alpha1.MachineDeployment, msList []*v1alpha1.MachineSet, machineMap map[types.UID]*v1alpha1.MachineList) error { +func (r *ReconcileMachineDeployment) rolloutRolling(d *v1beta1.MachineDeployment, msList []*v1beta1.MachineSet, machineMap map[types.UID]*v1beta1.MachineList) error { newMS, oldMSs, err := r.getAllMachineSetsAndSyncRevision(d, msList, machineMap, true) if err != nil { return err @@ -67,12 +67,12 @@ func (r *ReconcileMachineDeployment) rolloutRolling(d *v1alpha1.MachineDeploymen return nil } -func (r *ReconcileMachineDeployment) reconcileNewMachineSet(allMSs []*v1alpha1.MachineSet, newMS *v1alpha1.MachineSet, deployment *v1alpha1.MachineDeployment) error { +func (r *ReconcileMachineDeployment) reconcileNewMachineSet(allMSs []*v1beta1.MachineSet, newMS *v1beta1.MachineSet, deployment *v1beta1.MachineDeployment) error { if deployment.Spec.Replicas == nil { - return fmt.Errorf("spec replicas for deployment set %v is nil, this is unexpected", deployment.Name) + return errors.Errorf("spec replicas for deployment set %v is nil, this is unexpected", deployment.Name) } if newMS.Spec.Replicas == nil { - return fmt.Errorf("spec replicas for machine set %v is nil, this is unexpected", newMS.Name) + return errors.Errorf("spec replicas for machine set %v is nil, this is unexpected", newMS.Name) } if *(newMS.Spec.Replicas) == *(deployment.Spec.Replicas) { @@ -92,12 +92,12 @@ func (r *ReconcileMachineDeployment) reconcileNewMachineSet(allMSs []*v1alpha1.M return err } -func (r *ReconcileMachineDeployment) reconcileOldMachineSets(allMSs []*v1alpha1.MachineSet, oldMSs []*v1alpha1.MachineSet, newMS *v1alpha1.MachineSet, deployment *v1alpha1.MachineDeployment) error { +func (r *ReconcileMachineDeployment) reconcileOldMachineSets(allMSs []*v1beta1.MachineSet, oldMSs []*v1beta1.MachineSet, newMS *v1beta1.MachineSet, deployment *v1beta1.MachineDeployment) error { if deployment.Spec.Replicas == nil { - return fmt.Errorf("spec replicas for deployment set %v is nil, this is unexpected", deployment.Name) + return errors.Errorf("spec replicas for deployment set %v is nil, this is unexpected", deployment.Name) } if newMS.Spec.Replicas == nil { - return fmt.Errorf("spec replicas for machine set %v is nil, this is unexpected", newMS.Name) + return errors.Errorf("spec replicas for machine set %v is nil, this is unexpected", newMS.Name) } oldMachinesCount := dutil.GetReplicaCountForMachineSets(oldMSs) @@ -167,7 +167,7 @@ func (r *ReconcileMachineDeployment) reconcileOldMachineSets(allMSs []*v1alpha1. } // cleanupUnhealthyReplicas will scale down old machine sets with unhealthy replicas, so that all unhealthy replicas will be deleted. -func (r *ReconcileMachineDeployment) cleanupUnhealthyReplicas(oldMSs []*v1alpha1.MachineSet, deployment *v1alpha1.MachineDeployment, maxCleanupCount int32) ([]*v1alpha1.MachineSet, int32, error) { +func (r *ReconcileMachineDeployment) cleanupUnhealthyReplicas(oldMSs []*v1beta1.MachineSet, deployment *v1beta1.MachineDeployment, maxCleanupCount int32) ([]*v1beta1.MachineSet, int32, error) { sort.Sort(dutil.MachineSetsByCreationTimestamp(oldMSs)) // Safely scale down all old machine sets with unhealthy replicas. Replica set will sort the machines in the order // such that not-ready < ready, unscheduled < scheduled, and pending < running. This ensures that unhealthy replicas will @@ -175,7 +175,7 @@ func (r *ReconcileMachineDeployment) cleanupUnhealthyReplicas(oldMSs []*v1alpha1 totalScaledDown := int32(0) for _, targetMS := range oldMSs { if targetMS.Spec.Replicas == nil { - return nil, 0, fmt.Errorf("spec replicas for machine set %v is nil, this is unexpected", targetMS.Name) + return nil, 0, errors.Errorf("spec replicas for machine set %v is nil, this is unexpected", targetMS.Name) } if totalScaledDown >= maxCleanupCount { @@ -199,7 +199,7 @@ func (r *ReconcileMachineDeployment) cleanupUnhealthyReplicas(oldMSs []*v1alpha1 newReplicasCount := oldMSReplicas - scaledDownCount if newReplicasCount > oldMSReplicas { - return nil, 0, fmt.Errorf("when cleaning up unhealthy replicas, got invalid request to scale down %s/%s %d -> %d", targetMS.Namespace, targetMS.Name, oldMSReplicas, newReplicasCount) + return nil, 0, errors.Errorf("when cleaning up unhealthy replicas, got invalid request to scale down %s/%s %d -> %d", targetMS.Namespace, targetMS.Name, oldMSReplicas, newReplicasCount) } _, err := r.scaleMachineSet(targetMS, newReplicasCount, deployment) if err != nil { @@ -212,9 +212,9 @@ func (r *ReconcileMachineDeployment) cleanupUnhealthyReplicas(oldMSs []*v1alpha1 // scaleDownOldMachineSetsForRollingUpdate scales down old machine sets when deployment strategy is "RollingUpdate". // Need check maxUnavailable to ensure availability -func (r *ReconcileMachineDeployment) scaleDownOldMachineSetsForRollingUpdate(allMSs []*v1alpha1.MachineSet, oldMSs []*v1alpha1.MachineSet, deployment *v1alpha1.MachineDeployment) (int32, error) { +func (r *ReconcileMachineDeployment) scaleDownOldMachineSetsForRollingUpdate(allMSs []*v1beta1.MachineSet, oldMSs []*v1beta1.MachineSet, deployment *v1beta1.MachineDeployment) (int32, error) { if deployment.Spec.Replicas == nil { - return 0, fmt.Errorf("spec replicas for deployment %v is nil, this is unexpected", deployment.Name) + return 0, errors.Errorf("spec replicas for deployment %v is nil, this is unexpected", deployment.Name) } maxUnavailable := dutil.MaxUnavailable(*deployment) @@ -235,7 +235,7 @@ func (r *ReconcileMachineDeployment) scaleDownOldMachineSetsForRollingUpdate(all totalScaleDownCount := availableMachineCount - minAvailable for _, targetMS := range oldMSs { if targetMS.Spec.Replicas == nil { - return 0, fmt.Errorf("spec replicas for machine set %v is nil, this is unexpected", targetMS.Name) + return 0, errors.Errorf("spec replicas for machine set %v is nil, this is unexpected", targetMS.Name) } if totalScaledDown >= totalScaleDownCount { @@ -250,7 +250,7 @@ func (r *ReconcileMachineDeployment) scaleDownOldMachineSetsForRollingUpdate(all scaleDownCount := int32(integer.Int32Min(*(targetMS.Spec.Replicas), totalScaleDownCount-totalScaledDown)) newReplicasCount := *(targetMS.Spec.Replicas) - scaleDownCount if newReplicasCount > *(targetMS.Spec.Replicas) { - return totalScaledDown, fmt.Errorf("when scaling down old MS, got invalid request to scale down %s/%s %d -> %d", targetMS.Namespace, targetMS.Name, *(targetMS.Spec.Replicas), newReplicasCount) + return totalScaledDown, errors.Errorf("when scaling down old MS, got invalid request to scale down %s/%s %d -> %d", targetMS.Namespace, targetMS.Name, *(targetMS.Spec.Replicas), newReplicasCount) } _, err := r.scaleMachineSet(targetMS, newReplicasCount, deployment) if err != nil { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/sync.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/sync.go similarity index 83% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/sync.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/sync.go index 557e49fdd1..f37c053abb 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/sync.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/sync.go @@ -23,22 +23,23 @@ import ( "sort" "strconv" + machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + "github.com/pkg/errors" "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/errors" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" apirand "k8s.io/apimachinery/pkg/util/rand" "k8s.io/client-go/util/retry" "k8s.io/klog" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" - dutil "sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/util" + dutil "github.com/openshift/cluster-api/pkg/controller/machinedeployment/util" ) // sync is responsible for reconciling deployments on scaling events or when they // are paused. -func (r *ReconcileMachineDeployment) sync(d *clusterv1alpha1.MachineDeployment, msList []*clusterv1alpha1.MachineSet, machineMap map[types.UID]*clusterv1alpha1.MachineList) error { +func (r *ReconcileMachineDeployment) sync(d *machinev1beta1.MachineDeployment, msList []*machinev1beta1.MachineSet, machineMap map[types.UID]*machinev1beta1.MachineList) error { newMS, oldMSs, err := r.getAllMachineSetsAndSyncRevision(d, msList, machineMap, false) if err != nil { return err @@ -68,7 +69,7 @@ func (r *ReconcileMachineDeployment) sync(d *clusterv1alpha1.MachineDeployment, // // Note that currently the deployment controller is using caches to avoid querying the server for reads. // This may lead to stale reads of machine sets, thus incorrect deployment status. -func (r *ReconcileMachineDeployment) getAllMachineSetsAndSyncRevision(d *clusterv1alpha1.MachineDeployment, msList []*clusterv1alpha1.MachineSet, machineMap map[types.UID]*clusterv1alpha1.MachineList, createIfNotExisted bool) (*clusterv1alpha1.MachineSet, []*clusterv1alpha1.MachineSet, error) { +func (r *ReconcileMachineDeployment) getAllMachineSetsAndSyncRevision(d *machinev1beta1.MachineDeployment, msList []*machinev1beta1.MachineSet, machineMap map[types.UID]*machinev1beta1.MachineList, createIfNotExisted bool) (*machinev1beta1.MachineSet, []*machinev1beta1.MachineSet, error) { _, allOldMSs := dutil.FindOldMachineSets(d, msList) // Get new machine set with the updated revision number @@ -85,7 +86,7 @@ func (r *ReconcileMachineDeployment) getAllMachineSetsAndSyncRevision(d *cluster // 2. If there's existing new MS, update its revision number if it's smaller than (maxOldRevision + 1), where maxOldRevision is the max revision number among all old MSes. // 3. If there's no existing new MS and createIfNotExisted is true, create one with appropriate revision number (maxOldRevision + 1) and replicas. // Note that the machine-template-hash will be added to adopted MSes and machines. -func (r *ReconcileMachineDeployment) getNewMachineSet(d *clusterv1alpha1.MachineDeployment, msList, oldMSs []*clusterv1alpha1.MachineSet, createIfNotExisted bool) (*clusterv1alpha1.MachineSet, error) { +func (r *ReconcileMachineDeployment) getNewMachineSet(d *machinev1beta1.MachineDeployment, msList, oldMSs []*machinev1beta1.MachineSet, createIfNotExisted bool) (*machinev1beta1.MachineSet, error) { existingNewMS := dutil.FindNewMachineSet(d, msList) // Calculate the max revision number among all old MSes @@ -110,7 +111,7 @@ func (r *ReconcileMachineDeployment) getNewMachineSet(d *clusterv1alpha1.Machine } // Apply revision annotation from existingNewMS if it is missing from the deployment. - err := r.updateMachineDeployment(d, func(innerDeployment *clusterv1alpha1.MachineDeployment) { + err := r.updateMachineDeployment(d, func(innerDeployment *machinev1beta1.MachineDeployment) { dutil.SetDeploymentRevision(d, msCopy.Annotations[dutil.RevisionAnnotation]) }) return msCopy, err @@ -133,7 +134,7 @@ func (r *ReconcileMachineDeployment) getNewMachineSet(d *clusterv1alpha1.Machine } // Create new MachineSet - newMS := clusterv1alpha1.MachineSet{ + newMS := machinev1beta1.MachineSet{ ObjectMeta: metav1.ObjectMeta{ // Make the name deterministic, to ensure idempotence Name: d.Name + "-" + apirand.SafeEncodeString(machineTemplateSpecHash), @@ -141,7 +142,7 @@ func (r *ReconcileMachineDeployment) getNewMachineSet(d *clusterv1alpha1.Machine Labels: newMSTemplate.Labels, OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(d, controllerKind)}, }, - Spec: clusterv1alpha1.MachineSetSpec{ + Spec: machinev1beta1.MachineSetSpec{ Replicas: new(int32), MinReadySeconds: minReadySeconds, Selector: *newMSSelector, @@ -165,10 +166,10 @@ func (r *ReconcileMachineDeployment) getNewMachineSet(d *clusterv1alpha1.Machine createdMS := &newMS switch { // We may end up hitting this due to a slow cache or a fast resync of the Deployment. - case errors.IsAlreadyExists(err): + case apierrors.IsAlreadyExists(err): alreadyExists = true - ms := &clusterv1alpha1.MachineSet{} + ms := &machinev1beta1.MachineSet{} msErr := r.Get(context.Background(), client.ObjectKey{Namespace: newMS.Namespace, Name: newMS.Name}, ms) if msErr != nil { return nil, msErr @@ -194,7 +195,7 @@ func (r *ReconcileMachineDeployment) getNewMachineSet(d *clusterv1alpha1.Machine if !alreadyExists { klog.V(4).Infof("Created new machine set %q", createdMS.Name) } - err = r.updateMachineDeployment(d, func(innerDeployment *clusterv1alpha1.MachineDeployment) { + err = r.updateMachineDeployment(d, func(innerDeployment *machinev1beta1.MachineDeployment) { dutil.SetDeploymentRevision(d, newRevision) }) return createdMS, err @@ -205,15 +206,15 @@ func (r *ReconcileMachineDeployment) getNewMachineSet(d *clusterv1alpha1.Machine // have the effect of hastening the rollout progress, which could produce a higher proportion of unavailable // replicas in the event of a problem with the rolled out template. Should run only on scaling events or // when a deployment is paused and not during the normal rollout process. -func (r *ReconcileMachineDeployment) scale(deployment *clusterv1alpha1.MachineDeployment, newMS *clusterv1alpha1.MachineSet, oldMSs []*clusterv1alpha1.MachineSet) error { +func (r *ReconcileMachineDeployment) scale(deployment *machinev1beta1.MachineDeployment, newMS *machinev1beta1.MachineSet, oldMSs []*machinev1beta1.MachineSet) error { if deployment.Spec.Replicas == nil { - return fmt.Errorf("spec replicas for deployment %v is nil, this is unexpected", deployment.Name) + return errors.Errorf("spec replicas for deployment %v is nil, this is unexpected", deployment.Name) } // If there is only one active machine set then we should scale that up to the full count of the // deployment. If there is no active machine set, then we should scale up the newest machine set. if activeOrLatest := dutil.FindOneActiveOrLatest(newMS, oldMSs); activeOrLatest != nil { if activeOrLatest.Spec.Replicas == nil { - return fmt.Errorf("spec replicas for machine set %v is nil, this is unexpected", activeOrLatest.Name) + return errors.Errorf("spec replicas for machine set %v is nil, this is unexpected", activeOrLatest.Name) } if *(activeOrLatest.Spec.Replicas) == *(deployment.Spec.Replicas) { return nil @@ -314,7 +315,7 @@ func (r *ReconcileMachineDeployment) scale(deployment *clusterv1alpha1.MachineDe } // syncDeploymentStatus checks if the status is up-to-date and sync it if necessary -func (r *ReconcileMachineDeployment) syncDeploymentStatus(allMSs []*clusterv1alpha1.MachineSet, newMS *clusterv1alpha1.MachineSet, d *clusterv1alpha1.MachineDeployment) error { +func (r *ReconcileMachineDeployment) syncDeploymentStatus(allMSs []*machinev1beta1.MachineSet, newMS *machinev1beta1.MachineSet, d *machinev1beta1.MachineDeployment) error { newStatus := calculateStatus(allMSs, newMS, d) if reflect.DeepEqual(d.Status, newStatus) { @@ -326,7 +327,7 @@ func (r *ReconcileMachineDeployment) syncDeploymentStatus(allMSs []*clusterv1alp } // calculateStatus calculates the latest status for the provided deployment by looking into the provided machine sets. -func calculateStatus(allMSs []*clusterv1alpha1.MachineSet, newMS *clusterv1alpha1.MachineSet, deployment *clusterv1alpha1.MachineDeployment) clusterv1alpha1.MachineDeploymentStatus { +func calculateStatus(allMSs []*machinev1beta1.MachineSet, newMS *machinev1beta1.MachineSet, deployment *machinev1beta1.MachineDeployment) machinev1beta1.MachineDeploymentStatus { availableReplicas := dutil.GetAvailableReplicaCountForMachineSets(allMSs) totalReplicas := dutil.GetReplicaCountForMachineSets(allMSs) unavailableReplicas := totalReplicas - availableReplicas @@ -336,11 +337,11 @@ func calculateStatus(allMSs []*clusterv1alpha1.MachineSet, newMS *clusterv1alpha unavailableReplicas = 0 } - status := clusterv1alpha1.MachineDeploymentStatus{ + status := machinev1beta1.MachineDeploymentStatus{ // TODO: Ensure that if we start retrying status updates, we won't pick up a new Generation value. ObservedGeneration: deployment.Generation, Replicas: dutil.GetActualReplicaCountForMachineSets(allMSs), - UpdatedReplicas: dutil.GetActualReplicaCountForMachineSets([]*clusterv1alpha1.MachineSet{newMS}), + UpdatedReplicas: dutil.GetActualReplicaCountForMachineSets([]*machinev1beta1.MachineSet{newMS}), ReadyReplicas: dutil.GetReadyReplicaCountForMachineSets(allMSs), AvailableReplicas: availableReplicas, UnavailableReplicas: unavailableReplicas, @@ -349,9 +350,9 @@ func calculateStatus(allMSs []*clusterv1alpha1.MachineSet, newMS *clusterv1alpha return status } -func (r *ReconcileMachineDeployment) scaleMachineSet(ms *clusterv1alpha1.MachineSet, newScale int32, deployment *clusterv1alpha1.MachineDeployment) (bool, error) { +func (r *ReconcileMachineDeployment) scaleMachineSet(ms *machinev1beta1.MachineSet, newScale int32, deployment *machinev1beta1.MachineDeployment) (bool, error) { if ms.Spec.Replicas == nil { - return false, fmt.Errorf("spec replicas for machine set %v is nil, this is unexpected", ms.Name) + return false, errors.Errorf("spec replicas for machine set %v is nil, this is unexpected", ms.Name) } // No need to scale if *(ms.Spec.Replicas) == newScale { @@ -368,9 +369,9 @@ func (r *ReconcileMachineDeployment) scaleMachineSet(ms *clusterv1alpha1.Machine return scaled, err } -func (r *ReconcileMachineDeployment) scaleMachineSetOperation(ms *clusterv1alpha1.MachineSet, newScale int32, deployment *clusterv1alpha1.MachineDeployment, scaleOperation string) (bool, error) { +func (r *ReconcileMachineDeployment) scaleMachineSetOperation(ms *machinev1beta1.MachineSet, newScale int32, deployment *machinev1beta1.MachineDeployment, scaleOperation string) (bool, error) { if ms.Spec.Replicas == nil { - return false, fmt.Errorf("spec replicas for machine set %v is nil, this is unexpected", ms.Name) + return false, errors.Errorf("spec replicas for machine set %v is nil, this is unexpected", ms.Name) } sizeNeedsUpdate := *(ms.Spec.Replicas) != newScale @@ -392,13 +393,13 @@ func (r *ReconcileMachineDeployment) scaleMachineSetOperation(ms *clusterv1alpha // cleanupDeployment is responsible for cleaning up a deployment i.e. retains all but the latest N old machine sets // where N=d.Spec.RevisionHistoryLimit. Old machine sets are older versions of the machinetemplate of a deployment kept // around by default 1) for historical reasons and 2) for the ability to rollback a deployment. -func (r *ReconcileMachineDeployment) cleanupDeployment(oldMSs []*clusterv1alpha1.MachineSet, deployment *clusterv1alpha1.MachineDeployment) error { +func (r *ReconcileMachineDeployment) cleanupDeployment(oldMSs []*machinev1beta1.MachineSet, deployment *machinev1beta1.MachineDeployment) error { if deployment.Spec.RevisionHistoryLimit == nil { return nil } // Avoid deleting machine set with deletion timestamp set - aliveFilter := func(ms *clusterv1alpha1.MachineSet) bool { + aliveFilter := func(ms *machinev1beta1.MachineSet) bool { return ms != nil && ms.ObjectMeta.DeletionTimestamp == nil } cleanableMSes := dutil.FilterMachineSets(oldMSs, aliveFilter) @@ -414,14 +415,14 @@ func (r *ReconcileMachineDeployment) cleanupDeployment(oldMSs []*clusterv1alpha1 for i := int32(0); i < diff; i++ { ms := cleanableMSes[i] if ms.Spec.Replicas == nil { - return fmt.Errorf("spec replicas for machine set %v is nil, this is unexpected", ms.Name) + return errors.Errorf("spec replicas for machine set %v is nil, this is unexpected", ms.Name) } // Avoid delete machine set with non-zero replica counts if ms.Status.Replicas != 0 || *(ms.Spec.Replicas) != 0 || ms.Generation > ms.Status.ObservedGeneration || ms.DeletionTimestamp != nil { continue } klog.V(4).Infof("Trying to cleanup machine set %q for deployment %q", ms.Name, deployment.Name) - if err := r.Delete(context.Background(), ms); err != nil && !errors.IsNotFound(err) { + if err := r.Delete(context.Background(), ms); err != nil && !apierrors.IsNotFound(err) { // Return error instead of aggregating and continuing DELETEs on the theory // that we may be overloading the api server. return err @@ -436,9 +437,9 @@ func (r *ReconcileMachineDeployment) cleanupDeployment(oldMSs []*clusterv1alpha1 // // msList should come from getMachineSetsForDeployment(d). // machineMap should come from getMachineMapForDeployment(d, msList). -func (r *ReconcileMachineDeployment) isScalingEvent(d *clusterv1alpha1.MachineDeployment, msList []*clusterv1alpha1.MachineSet, machineMap map[types.UID]*clusterv1alpha1.MachineList) (bool, error) { +func (r *ReconcileMachineDeployment) isScalingEvent(d *machinev1beta1.MachineDeployment, msList []*machinev1beta1.MachineSet, machineMap map[types.UID]*machinev1beta1.MachineList) (bool, error) { if d.Spec.Replicas == nil { - return false, fmt.Errorf("spec replicas for deployment %v is nil, this is unexpected", d.Name) + return false, errors.Errorf("spec replicas for deployment %v is nil, this is unexpected", d.Name) } newMS, oldMSs, err := r.getAllMachineSetsAndSyncRevision(d, msList, machineMap, false) if err != nil { @@ -457,12 +458,12 @@ func (r *ReconcileMachineDeployment) isScalingEvent(d *clusterv1alpha1.MachineDe return false, nil } -func (r *ReconcileMachineDeployment) updateMachineDeployment(d *clusterv1alpha1.MachineDeployment, modify func(*clusterv1alpha1.MachineDeployment)) error { +func (r *ReconcileMachineDeployment) updateMachineDeployment(d *machinev1beta1.MachineDeployment, modify func(*machinev1beta1.MachineDeployment)) error { return updateMachineDeployment(r.Client, d, modify) } // We have this as standalone variant to be able to use it from the tests -func updateMachineDeployment(c client.Client, d *clusterv1alpha1.MachineDeployment, modify func(*clusterv1alpha1.MachineDeployment)) error { +func updateMachineDeployment(c client.Client, d *machinev1beta1.MachineDeployment, modify func(*machinev1beta1.MachineDeployment)) error { dCopy := d.DeepCopy() modify(dCopy) if equality.Semantic.DeepEqual(dCopy, d) { @@ -474,7 +475,7 @@ func updateMachineDeployment(c client.Client, d *clusterv1alpha1.MachineDeployme return err } - clusterv1alpha1.PopulateDefaultsMachineDeployment(d) + machinev1beta1.PopulateDefaultsMachineDeployment(d) // Apply modifications modify(d) // Update the machineDeployment diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/util/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/util/BUILD.bazel similarity index 79% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/util/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/util/BUILD.bazel index 97d651bc83..fbe6d92303 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/util/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/util/BUILD.bazel @@ -3,11 +3,11 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["util.go"], - importpath = "sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/util", + importpath = "github.com/openshift/cluster-api/pkg/controller/machinedeployment/util", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/common:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/machine/common:go_default_library", + "//pkg/apis/machine/v1beta1:go_default_library", "//vendor/github.com/davecgh/go-spew/spew:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", @@ -25,9 +25,10 @@ go_test( srcs = ["util_test.go"], embed = [":go_default_library"], deps = [ - "//pkg/apis/cluster/common:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/machine/common:go_default_library", + "//pkg/apis/machine/v1beta1:go_default_library", "//pkg/client/clientset_generated/clientset/fake:go_default_library", + "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/util/util.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/util/util.go similarity index 88% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/util/util.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/util/util.go index f95739e0d9..2bade09b9d 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/util/util.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/util/util.go @@ -25,7 +25,7 @@ import ( "strings" "github.com/davecgh/go-spew/spew" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -34,8 +34,8 @@ import ( "k8s.io/client-go/util/integer" "k8s.io/klog" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "github.com/openshift/cluster-api/pkg/apis/machine/common" + "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" ) const ( @@ -73,7 +73,7 @@ const ( ) // MachineSetsByCreationTimestamp sorts a list of MachineSet by creation timestamp, using their names as a tie breaker. -type MachineSetsByCreationTimestamp []*v1alpha1.MachineSet +type MachineSetsByCreationTimestamp []*v1beta1.MachineSet func (o MachineSetsByCreationTimestamp) Len() int { return len(o) } func (o MachineSetsByCreationTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] } @@ -86,7 +86,7 @@ func (o MachineSetsByCreationTimestamp) Less(i, j int) bool { // MachineSetsBySizeOlder sorts a list of MachineSet by size in descending order, using their creation timestamp or name as a tie breaker. // By using the creation timestamp, this sorts from old to new machine sets. -type MachineSetsBySizeOlder []*v1alpha1.MachineSet +type MachineSetsBySizeOlder []*v1beta1.MachineSet func (o MachineSetsBySizeOlder) Len() int { return len(o) } func (o MachineSetsBySizeOlder) Swap(i, j int) { o[i], o[j] = o[j], o[i] } @@ -99,7 +99,7 @@ func (o MachineSetsBySizeOlder) Less(i, j int) bool { // MachineSetsBySizeNewer sorts a list of MachineSet by size in descending order, using their creation timestamp or name as a tie breaker. // By using the creation timestamp, this sorts from new to old machine sets. -type MachineSetsBySizeNewer []*v1alpha1.MachineSet +type MachineSetsBySizeNewer []*v1beta1.MachineSet func (o MachineSetsBySizeNewer) Len() int { return len(o) } func (o MachineSetsBySizeNewer) Swap(i, j int) { o[i], o[j] = o[j], o[i] } @@ -111,7 +111,7 @@ func (o MachineSetsBySizeNewer) Less(i, j int) bool { } // SetDeploymentRevision updates the revision for a deployment. -func SetDeploymentRevision(deployment *v1alpha1.MachineDeployment, revision string) bool { +func SetDeploymentRevision(deployment *v1beta1.MachineDeployment, revision string) bool { updated := false if deployment.Annotations == nil { @@ -126,7 +126,7 @@ func SetDeploymentRevision(deployment *v1alpha1.MachineDeployment, revision stri } // MaxRevision finds the highest revision in the machine sets -func MaxRevision(allMSs []*v1alpha1.MachineSet) int64 { +func MaxRevision(allMSs []*v1beta1.MachineSet) int64 { max := int64(0) for _, ms := range allMSs { if v, err := Revision(ms); err != nil { @@ -170,7 +170,7 @@ func skipCopyAnnotation(key string) bool { // copyDeploymentAnnotationsToMachineSet copies deployment's annotations to machine set's annotations, // and returns true if machine set's annotation is changed. // Note that apply and revision annotations are not copied. -func copyDeploymentAnnotationsToMachineSet(deployment *v1alpha1.MachineDeployment, ms *v1alpha1.MachineSet) bool { +func copyDeploymentAnnotationsToMachineSet(deployment *v1beta1.MachineDeployment, ms *v1beta1.MachineSet) bool { msAnnotationsChanged := false if ms.Annotations == nil { ms.Annotations = make(map[string]string) @@ -189,15 +189,15 @@ func copyDeploymentAnnotationsToMachineSet(deployment *v1alpha1.MachineDeploymen } // GetDesiredReplicasAnnotation returns the number of desired replicas -func GetDesiredReplicasAnnotation(ms *v1alpha1.MachineSet) (int32, bool) { +func GetDesiredReplicasAnnotation(ms *v1beta1.MachineSet) (int32, bool) { return getIntFromAnnotation(ms, DesiredReplicasAnnotation) } -func getMaxReplicasAnnotation(ms *v1alpha1.MachineSet) (int32, bool) { +func getMaxReplicasAnnotation(ms *v1beta1.MachineSet) (int32, bool) { return getIntFromAnnotation(ms, MaxReplicasAnnotation) } -func getIntFromAnnotation(ms *v1alpha1.MachineSet, annotationKey string) (int32, bool) { +func getIntFromAnnotation(ms *v1beta1.MachineSet, annotationKey string) (int32, bool) { annotationValue, ok := ms.Annotations[annotationKey] if !ok { return int32(0), false @@ -212,7 +212,7 @@ func getIntFromAnnotation(ms *v1alpha1.MachineSet, annotationKey string) (int32, // SetNewMachineSetAnnotations sets new machine set's annotations appropriately by updating its revision and // copying required deployment annotations to it; it returns true if machine set's annotation is changed. -func SetNewMachineSetAnnotations(deployment *v1alpha1.MachineDeployment, newMS *v1alpha1.MachineSet, newRevision string, exists bool) bool { +func SetNewMachineSetAnnotations(deployment *v1beta1.MachineDeployment, newMS *v1beta1.MachineSet, newRevision string, exists bool) bool { // First, copy deployment's annotations (except for apply and revision annotations) annotationChanged := copyDeploymentAnnotationsToMachineSet(deployment, newMS) // Then, update machine set's revision annotation @@ -266,7 +266,7 @@ func SetNewMachineSetAnnotations(deployment *v1alpha1.MachineDeployment, newMS * // FindOneActiveOrLatest returns the only active or the latest machine set in case there is at most one active // machine set. If there are more than one active machine sets, return nil so machine sets can be scaled down // to the point where there is only one active machine set. -func FindOneActiveOrLatest(newMS *v1alpha1.MachineSet, oldMSs []*v1alpha1.MachineSet) *v1alpha1.MachineSet { +func FindOneActiveOrLatest(newMS *v1beta1.MachineSet, oldMSs []*v1beta1.MachineSet) *v1beta1.MachineSet { if newMS == nil && len(oldMSs) == 0 { return nil } @@ -289,7 +289,7 @@ func FindOneActiveOrLatest(newMS *v1alpha1.MachineSet, oldMSs []*v1alpha1.Machin } // SetReplicasAnnotations sets the desiredReplicas and maxReplicas into the annotations -func SetReplicasAnnotations(ms *v1alpha1.MachineSet, desiredReplicas, maxReplicas int32) bool { +func SetReplicasAnnotations(ms *v1beta1.MachineSet, desiredReplicas, maxReplicas int32) bool { updated := false if ms.Annotations == nil { ms.Annotations = make(map[string]string) @@ -308,7 +308,7 @@ func SetReplicasAnnotations(ms *v1alpha1.MachineSet, desiredReplicas, maxReplica } // AnnotationsNeedUpdate return true if ReplicasAnnotations need to be updated -func ReplicasAnnotationsNeedUpdate(ms *v1alpha1.MachineSet, desiredReplicas, maxReplicas int32) bool { +func ReplicasAnnotationsNeedUpdate(ms *v1beta1.MachineSet, desiredReplicas, maxReplicas int32) bool { if ms.Annotations == nil { return true } @@ -324,7 +324,7 @@ func ReplicasAnnotationsNeedUpdate(ms *v1alpha1.MachineSet, desiredReplicas, max } // MaxUnavailable returns the maximum unavailable machines a rolling deployment can take. -func MaxUnavailable(deployment v1alpha1.MachineDeployment) int32 { +func MaxUnavailable(deployment v1beta1.MachineDeployment) int32 { if !IsRollingUpdate(&deployment) || *(deployment.Spec.Replicas) == 0 { return int32(0) } @@ -337,7 +337,7 @@ func MaxUnavailable(deployment v1alpha1.MachineDeployment) int32 { } // MaxSurge returns the maximum surge machines a rolling deployment can take. -func MaxSurge(deployment v1alpha1.MachineDeployment) int32 { +func MaxSurge(deployment v1beta1.MachineDeployment) int32 { if !IsRollingUpdate(&deployment) { return int32(0) } @@ -349,7 +349,7 @@ func MaxSurge(deployment v1alpha1.MachineDeployment) int32 { // GetProportion will estimate the proportion for the provided machine set using 1. the current size // of the parent deployment, 2. the replica count that needs be added on the machine sets of the // deployment, and 3. the total replicas added in the machine sets of the deployment so far. -func GetProportion(ms *v1alpha1.MachineSet, d v1alpha1.MachineDeployment, deploymentReplicasToAdd, deploymentReplicasAdded int32) int32 { +func GetProportion(ms *v1beta1.MachineSet, d v1beta1.MachineDeployment, deploymentReplicasToAdd, deploymentReplicasAdded int32) int32 { if ms == nil || *(ms.Spec.Replicas) == 0 || deploymentReplicasToAdd == 0 || deploymentReplicasToAdd == deploymentReplicasAdded { return int32(0) } @@ -371,7 +371,7 @@ func GetProportion(ms *v1alpha1.MachineSet, d v1alpha1.MachineDeployment, deploy // getMachineSetFraction estimates the fraction of replicas a machine set can have in // 1. a scaling event during a rollout or 2. when scaling a paused deployment. -func getMachineSetFraction(ms v1alpha1.MachineSet, d v1alpha1.MachineDeployment) int32 { +func getMachineSetFraction(ms v1beta1.MachineSet, d v1beta1.MachineDeployment) int32 { // If we are scaling down to zero then the fraction of this machine set is its whole size (negative) if *(d.Spec.Replicas) == int32(0) { return -*(ms.Spec.Replicas) @@ -398,7 +398,7 @@ func getMachineSetFraction(ms v1alpha1.MachineSet, d v1alpha1.MachineDeployment) // 1. The hash result would be different upon machineTemplateSpec API changes // (e.g. the addition of a new field will cause the hash code to change) // 2. The deployment template won't have hash labels -func EqualIgnoreHash(template1, template2 *v1alpha1.MachineTemplateSpec) bool { +func EqualIgnoreHash(template1, template2 *v1beta1.MachineTemplateSpec) bool { t1Copy := template1.DeepCopy() t2Copy := template2.DeepCopy() // Remove hash labels from template.Labels before comparing @@ -408,7 +408,7 @@ func EqualIgnoreHash(template1, template2 *v1alpha1.MachineTemplateSpec) bool { } // FindNewMachineSet returns the new MS this given deployment targets (the one with the same machine template). -func FindNewMachineSet(deployment *v1alpha1.MachineDeployment, msList []*v1alpha1.MachineSet) *v1alpha1.MachineSet { +func FindNewMachineSet(deployment *v1beta1.MachineDeployment, msList []*v1beta1.MachineSet) *v1beta1.MachineSet { sort.Sort(MachineSetsByCreationTimestamp(msList)) for i := range msList { if EqualIgnoreHash(&msList[i].Spec.Template, &deployment.Spec.Template) { @@ -427,9 +427,9 @@ func FindNewMachineSet(deployment *v1alpha1.MachineDeployment, msList []*v1alpha // Returns two list of machine sets // - the first contains all old machine sets with all non-zero replicas // - the second contains all old machine sets -func FindOldMachineSets(deployment *v1alpha1.MachineDeployment, msList []*v1alpha1.MachineSet) ([]*v1alpha1.MachineSet, []*v1alpha1.MachineSet) { - var requiredMSs []*v1alpha1.MachineSet - var allMSs []*v1alpha1.MachineSet +func FindOldMachineSets(deployment *v1beta1.MachineDeployment, msList []*v1beta1.MachineSet) ([]*v1beta1.MachineSet, []*v1beta1.MachineSet) { + var requiredMSs []*v1beta1.MachineSet + var allMSs []*v1beta1.MachineSet newMS := FindNewMachineSet(deployment, msList) for _, ms := range msList { // Filter out new machine set @@ -445,7 +445,7 @@ func FindOldMachineSets(deployment *v1alpha1.MachineDeployment, msList []*v1alph } // GetReplicaCountForMachineSets returns the sum of Replicas of the given machine sets. -func GetReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int32 { +func GetReplicaCountForMachineSets(machineSets []*v1beta1.MachineSet) int32 { totalReplicas := int32(0) for _, ms := range machineSets { if ms != nil { @@ -456,7 +456,7 @@ func GetReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int32 { } // GetActualReplicaCountForMachineSets returns the sum of actual replicas of the given machine sets. -func GetActualReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int32 { +func GetActualReplicaCountForMachineSets(machineSets []*v1beta1.MachineSet) int32 { totalActualReplicas := int32(0) for _, ms := range machineSets { if ms != nil { @@ -467,7 +467,7 @@ func GetActualReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int } // GetReadyReplicaCountForMachineSets returns the number of ready machines corresponding to the given machine sets. -func GetReadyReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int32 { +func GetReadyReplicaCountForMachineSets(machineSets []*v1beta1.MachineSet) int32 { totalReadyReplicas := int32(0) for _, ms := range machineSets { if ms != nil { @@ -478,7 +478,7 @@ func GetReadyReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int3 } // GetAvailableReplicaCountForMachineSets returns the number of available machines corresponding to the given machine sets. -func GetAvailableReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int32 { +func GetAvailableReplicaCountForMachineSets(machineSets []*v1beta1.MachineSet) int32 { totalAvailableReplicas := int32(0) for _, ms := range machineSets { if ms != nil { @@ -489,13 +489,13 @@ func GetAvailableReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) } // IsRollingUpdate returns true if the strategy type is a rolling update. -func IsRollingUpdate(deployment *v1alpha1.MachineDeployment) bool { +func IsRollingUpdate(deployment *v1beta1.MachineDeployment) bool { return deployment.Spec.Strategy.Type == common.RollingUpdateMachineDeploymentStrategyType } // DeploymentComplete considers a deployment to be complete once all of its desired replicas // are updated and available, and no old machines are running. -func DeploymentComplete(deployment *v1alpha1.MachineDeployment, newStatus *v1alpha1.MachineDeploymentStatus) bool { +func DeploymentComplete(deployment *v1beta1.MachineDeployment, newStatus *v1beta1.MachineDeploymentStatus) bool { return newStatus.UpdatedReplicas == *(deployment.Spec.Replicas) && newStatus.Replicas == *(deployment.Spec.Replicas) && newStatus.AvailableReplicas == *(deployment.Spec.Replicas) && @@ -506,7 +506,7 @@ func DeploymentComplete(deployment *v1alpha1.MachineDeployment, newStatus *v1alp // When one of the following is true, we're rolling out the deployment; otherwise, we're scaling it. // 1) The new MS is saturated: newMS's replicas == deployment's replicas // 2) Max number of machines allowed is reached: deployment's replicas + maxSurge == all MSs' replicas -func NewMSNewReplicas(deployment *v1alpha1.MachineDeployment, allMSs []*v1alpha1.MachineSet, newMS *v1alpha1.MachineSet) (int32, error) { +func NewMSNewReplicas(deployment *v1beta1.MachineDeployment, allMSs []*v1beta1.MachineSet, newMS *v1beta1.MachineSet) (int32, error) { switch deployment.Spec.Strategy.Type { case common.RollingUpdateMachineDeploymentStrategyType: // Check if we can scale up. @@ -544,7 +544,7 @@ func NewMSNewReplicas(deployment *v1alpha1.MachineDeployment, allMSs []*v1alpha1 // Do not exceed the number of desired replicas. scaleUpCount = int32(integer.Int32Min(scaleUpCount, *(deployment.Spec.Replicas)-*(newMS.Spec.Replicas))) return *(newMS.Spec.Replicas) + scaleUpCount, nil - // -- return 0, fmt.Errorf("deployment type %v isn't supported", deployment.Spec.Strategy.Type) + // -- return 0, errors.Errorf("deployment type %v isn't supported", deployment.Spec.Strategy.Type) } } @@ -552,7 +552,7 @@ func NewMSNewReplicas(deployment *v1alpha1.MachineDeployment, allMSs []*v1alpha1 // Both the deployment and the machine set have to believe this machine set can own all of the desired // replicas in the deployment and the annotation helps in achieving that. All machines of the MachineSet // need to be available. -func IsSaturated(deployment *v1alpha1.MachineDeployment, ms *v1alpha1.MachineSet) bool { +func IsSaturated(deployment *v1beta1.MachineDeployment, ms *v1beta1.MachineSet) bool { if ms == nil { return false } @@ -597,18 +597,18 @@ func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired } // FilterActiveMachineSets returns machine sets that have (or at least ought to have) machines. -func FilterActiveMachineSets(machineSets []*v1alpha1.MachineSet) []*v1alpha1.MachineSet { - activeFilter := func(ms *v1alpha1.MachineSet) bool { +func FilterActiveMachineSets(machineSets []*v1beta1.MachineSet) []*v1beta1.MachineSet { + activeFilter := func(ms *v1beta1.MachineSet) bool { return ms != nil && ms.Spec.Replicas != nil && *(ms.Spec.Replicas) > 0 } return FilterMachineSets(machineSets, activeFilter) } -type filterMS func(ms *v1alpha1.MachineSet) bool +type filterMS func(ms *v1beta1.MachineSet) bool // FilterMachineSets returns machine sets that are filtered by filterFn (all returned ones should match filterFn). -func FilterMachineSets(MSes []*v1alpha1.MachineSet, filterFn filterMS) []*v1alpha1.MachineSet { - var filtered []*v1alpha1.MachineSet +func FilterMachineSets(MSes []*v1beta1.MachineSet, filterFn filterMS) []*v1beta1.MachineSet { + var filtered []*v1beta1.MachineSet for i := range MSes { if filterFn(MSes[i]) { filtered = append(filtered, MSes[i]) @@ -687,7 +687,7 @@ func DeepHashObject(hasher hash.Hash, objectToWrite interface{}) { printer.Fprintf(hasher, "%#v", objectToWrite) } -func ComputeHash(template *v1alpha1.MachineTemplateSpec) uint32 { +func ComputeHash(template *v1beta1.MachineTemplateSpec) uint32 { machineTemplateSpecHasher := fnv.New32a() DeepHashObject(machineTemplateSpecHasher, *template) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/BUILD.bazel similarity index 82% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/controller/machineset/BUILD.bazel index 8aec373aac..94eb791b98 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/BUILD.bazel @@ -8,12 +8,13 @@ go_library( "machine.go", "status.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/controller/machineset", + 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", + "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", @@ -32,21 +33,25 @@ go_library( go_test( name = "go_default_test", srcs = [ + "controller_test.go", "delete_policy_test.go", + "machine_test.go", "machineset_controller_suite_test.go", "machineset_controller_test.go", ], embed = [":go_default_library"], deps = [ "//pkg/apis:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/machine/v1beta1:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/client:go_default_library", + "//vendor/sigs.k8s.io/controller-runtime/pkg/client/fake:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/envtest:go_default_library", + "//vendor/sigs.k8s.io/controller-runtime/pkg/handler:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/manager:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile:go_default_library", ], diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go similarity index 77% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/controller.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go index cb537bd4d1..550655d895 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go @@ -19,16 +19,18 @@ package machineset import ( "context" "fmt" + "sort" "strings" "sync" "time" - "k8s.io/apimachinery/pkg/api/errors" + machinev1beta1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + "github.com/openshift/cluster-api/pkg/util" + "github.com/pkg/errors" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/klog" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/util" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" @@ -37,7 +39,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/source" ) -var controllerKind = clusterv1alpha1.SchemeGroupVersion.WithKind("MachineSet") +var controllerKind = machinev1beta1.SchemeGroupVersion.WithKind("MachineSet") // stateConfirmationTimeout is the amount of time allowed to wait for desired state. var stateConfirmationTimeout = 10 * time.Second @@ -67,15 +69,15 @@ func add(mgr manager.Manager, r reconcile.Reconciler, mapFn handler.ToRequestsFu } // Watch for changes to MachineSet - err = c.Watch(&source.Kind{Type: &clusterv1alpha1.MachineSet{}}, &handler.EnqueueRequestForObject{}) + err = c.Watch(&source.Kind{Type: &machinev1beta1.MachineSet{}}, &handler.EnqueueRequestForObject{}) if err != nil { return err } // Map Machine changes to MachineSets using ControllerRef err = c.Watch( - &source.Kind{Type: &clusterv1alpha1.Machine{}}, - &handler.EnqueueRequestForOwner{IsController: true, OwnerType: &clusterv1alpha1.MachineSet{}}, + &source.Kind{Type: &machinev1beta1.Machine{}}, + &handler.EnqueueRequestForOwner{IsController: true, OwnerType: &machinev1beta1.MachineSet{}}, ) if err != nil { return err @@ -83,7 +85,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler, mapFn handler.ToRequestsFu // Map Machine changes to MachineSets by machining labels err = c.Watch( - &source.Kind{Type: &clusterv1alpha1.Machine{}}, + &source.Kind{Type: &machinev1beta1.Machine{}}, &handler.EnqueueRequestsFromMapFunc{ToRequests: mapFn}) if err != nil { return err @@ -102,7 +104,7 @@ type ReconcileMachineSet struct { func (r *ReconcileMachineSet) MachineToMachineSets(o handler.MapObject) []reconcile.Request { result := []reconcile.Request{} - m := &clusterv1alpha1.Machine{} + m := &machinev1beta1.Machine{} key := client.ObjectKey{Namespace: o.Meta.GetNamespace(), Name: o.Meta.GetName()} err := r.Client.Get(context.Background(), key, m) if err != nil { @@ -133,14 +135,14 @@ func (r *ReconcileMachineSet) MachineToMachineSets(o handler.MapObject) []reconc // Reconcile reads that state of the cluster for a MachineSet object and makes changes based on the state read // and what is in the MachineSet.Spec // Automatically generate RBAC rules to allow the Controller to read and write Deployments -// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machinesets,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machines,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=machine.openshift.io,resources=machinesets,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=machine.openshift.io,resources=machines,verbs=get;list;watch;create;update;patch;delete func (r *ReconcileMachineSet) Reconcile(request reconcile.Request) (reconcile.Result, error) { // Fetch the MachineSet instance - machineSet := &clusterv1alpha1.MachineSet{} + machineSet := &machinev1beta1.MachineSet{} err := r.Get(context.TODO(), request.NamespacedName, machineSet) if err != nil { - if errors.IsNotFound(err) { + if apierrors.IsNotFound(err) { // Object not found, return. Created objects are automatically garbage collected. // For additional cleanup logic use finalizers. return reconcile.Result{}, nil @@ -150,22 +152,22 @@ func (r *ReconcileMachineSet) Reconcile(request reconcile.Request) (reconcile.Re } klog.V(4).Infof("Reconcile machineset %v", machineSet.Name) - if errList := machineSet.Validate(); len(errList) > 0 { err := fmt.Errorf("%q machineset validation failed: %v", machineSet.Name, errList.ToAggregate().Error()) klog.Error(err) return reconcile.Result{}, err } - allMachines := &clusterv1alpha1.MachineList{} + allMachines := &machinev1beta1.MachineList{} err = r.Client.List(context.Background(), client.InNamespace(machineSet.Namespace), allMachines) if err != nil { - return reconcile.Result{}, fmt.Errorf("failed to list machines, %v", err) + return reconcile.Result{}, errors.Wrap(err, "failed to list machines") } // Filter out irrelevant machines (deleting/mismatch labels) and claim orphaned machines. - var filteredMachines []*clusterv1alpha1.Machine + var machineNames []string + machineSetMachines := make(map[string]*machinev1beta1.Machine) for idx := range allMachines.Items { machine := &allMachines.Items[idx] if shouldExcludeMachine(machineSet, machine) { @@ -178,7 +180,15 @@ func (r *ReconcileMachineSet) Reconcile(request reconcile.Request) (reconcile.Re continue } } - filteredMachines = append(filteredMachines, machine) + machineNames = append(machineNames, machine.Name) + machineSetMachines[machine.Name] = machine + } + // sort the filteredMachines from the oldest to the youngest + sort.Strings(machineNames) + + var filteredMachines []*machinev1beta1.Machine + for _, machineName := range machineNames { + filteredMachines = append(filteredMachines, machineSetMachines[machineName]) } syncErr := r.syncReplicas(machineSet, filteredMachines) @@ -190,9 +200,9 @@ func (r *ReconcileMachineSet) Reconcile(request reconcile.Request) (reconcile.Re updatedMS, err := updateMachineSetStatus(r.Client, machineSet, newStatus) if err != nil { if syncErr != nil { - return reconcile.Result{}, fmt.Errorf("failed to sync machines. %v. failed to update machine set status. %v", syncErr, err) + return reconcile.Result{}, errors.Wrapf(err, "failed to sync machines: %v. failed to update machine set status", syncErr) } - return reconcile.Result{}, fmt.Errorf("failed to update machine set status. %v", err) + return reconcile.Result{}, errors.Wrap(err, "failed to update machine set status") } var replicas int32 @@ -218,9 +228,9 @@ func (r *ReconcileMachineSet) Reconcile(request reconcile.Request) (reconcile.Re } // syncReplicas essentially scales machine resources up and down. -func (c *ReconcileMachineSet) syncReplicas(ms *clusterv1alpha1.MachineSet, machines []*clusterv1alpha1.Machine) error { +func (c *ReconcileMachineSet) syncReplicas(ms *machinev1beta1.MachineSet, machines []*machinev1beta1.Machine) error { if ms.Spec.Replicas == nil { - return fmt.Errorf("the Replicas field in Spec for machineset %v is nil, this should not be allowed.", ms.Name) + return errors.Errorf("the Replicas field in Spec for machineset %v is nil, this should not be allowed", ms.Name) } diff := len(machines) - int(*(ms.Spec.Replicas)) @@ -228,7 +238,7 @@ func (c *ReconcileMachineSet) syncReplicas(ms *clusterv1alpha1.MachineSet, machi diff *= -1 klog.Infof("Too few replicas for %v %s/%s, need %d, creating %d", controllerKind, ms.Namespace, ms.Name, *(ms.Spec.Replicas), diff) - var machineList []*clusterv1alpha1.Machine + var machineList []*machinev1beta1.Machine var errstrings []string for i := 0; i < diff; i++ { klog.Infof("creating machine %d of %d, ( spec.replicas(%d) > currentMachineCount(%d) )", i+1, diff, *(ms.Spec.Replicas), len(machines)) @@ -243,7 +253,7 @@ func (c *ReconcileMachineSet) syncReplicas(ms *clusterv1alpha1.MachineSet, machi } if len(errstrings) > 0 { - return fmt.Errorf(strings.Join(errstrings, "; ")) + return errors.New(strings.Join(errstrings, "; ")) } return c.waitForMachineCreation(machineList) } else if diff > 0 { @@ -257,7 +267,7 @@ func (c *ReconcileMachineSet) syncReplicas(ms *clusterv1alpha1.MachineSet, machi var wg sync.WaitGroup wg.Add(diff) for _, machine := range machinesToDelete { - go func(targetMachine *clusterv1alpha1.Machine) { + go func(targetMachine *machinev1beta1.Machine) { defer wg.Done() err := c.Client.Delete(context.Background(), targetMachine) if err != nil { @@ -284,9 +294,9 @@ func (c *ReconcileMachineSet) syncReplicas(ms *clusterv1alpha1.MachineSet, machi // createMachine creates a machine resource. // the name of the newly created resource is going to be created by the API server, we set the generateName field -func (c *ReconcileMachineSet) createMachine(machineSet *clusterv1alpha1.MachineSet) *clusterv1alpha1.Machine { - gv := clusterv1alpha1.SchemeGroupVersion - machine := &clusterv1alpha1.Machine{ +func (c *ReconcileMachineSet) createMachine(machineSet *machinev1beta1.MachineSet) *machinev1beta1.Machine { + gv := machinev1beta1.SchemeGroupVersion + machine := &machinev1beta1.Machine{ TypeMeta: metav1.TypeMeta{ Kind: gv.WithKind("Machine").Kind, APIVersion: gv.String(), @@ -302,7 +312,7 @@ func (c *ReconcileMachineSet) createMachine(machineSet *clusterv1alpha1.MachineS } // shouldExcludeMachine returns true if the machine should be filtered out, false otherwise. -func shouldExcludeMachine(machineSet *clusterv1alpha1.MachineSet, machine *clusterv1alpha1.Machine) bool { +func shouldExcludeMachine(machineSet *machinev1beta1.MachineSet, machine *machinev1beta1.Machine) bool { // Ignore inactive machines. if metav1.GetControllerOf(machine) != nil && !metav1.IsControlledBy(machine, machineSet) { klog.V(4).Infof("%s not controlled by %v", machine.Name, machineSet.Name) @@ -317,7 +327,7 @@ func shouldExcludeMachine(machineSet *clusterv1alpha1.MachineSet, machine *clust return false } -func (c *ReconcileMachineSet) adoptOrphan(machineSet *clusterv1alpha1.MachineSet, machine *clusterv1alpha1.Machine) error { +func (c *ReconcileMachineSet) adoptOrphan(machineSet *machinev1beta1.MachineSet, machine *machinev1beta1.Machine) error { // Add controller reference. ownerRefs := machine.ObjectMeta.GetOwnerReferences() if ownerRefs == nil { @@ -334,44 +344,44 @@ func (c *ReconcileMachineSet) adoptOrphan(machineSet *clusterv1alpha1.MachineSet return nil } -func (c *ReconcileMachineSet) waitForMachineCreation(machineList []*clusterv1alpha1.Machine) error { +func (c *ReconcileMachineSet) waitForMachineCreation(machineList []*machinev1beta1.Machine) error { for _, machine := range machineList { - pollErr := util.Poll(stateConfirmationInterval, stateConfirmationTimeout, func() (bool, error) { + pollErr := util.PollImmediate(stateConfirmationInterval, stateConfirmationTimeout, func() (bool, error) { err := c.Client.Get(context.Background(), client.ObjectKey{Namespace: machine.Namespace, Name: machine.Name}, - &clusterv1alpha1.Machine{}) + &machinev1beta1.Machine{}) if err == nil { return true, nil } klog.Error(err) - if errors.IsNotFound(err) { + if apierrors.IsNotFound(err) { return false, nil } return false, err }) if pollErr != nil { klog.Error(pollErr) - return fmt.Errorf("failed waiting for machine object to be created. %v", pollErr) + return errors.Wrap(pollErr, "failed waiting for machine object to be created") } } return nil } -func (c *ReconcileMachineSet) waitForMachineDeletion(machineList []*clusterv1alpha1.Machine) error { +func (c *ReconcileMachineSet) waitForMachineDeletion(machineList []*machinev1beta1.Machine) error { for _, machine := range machineList { - pollErr := util.Poll(stateConfirmationInterval, stateConfirmationTimeout, func() (bool, error) { - m := &clusterv1alpha1.Machine{} + pollErr := util.PollImmediate(stateConfirmationInterval, stateConfirmationTimeout, func() (bool, error) { + m := &machinev1beta1.Machine{} err := c.Client.Get(context.Background(), client.ObjectKey{Namespace: machine.Namespace, Name: machine.Name}, m) - if errors.IsNotFound(err) || !m.DeletionTimestamp.IsZero() { + if apierrors.IsNotFound(err) || !m.DeletionTimestamp.IsZero() { return true, nil } return false, err }) if pollErr != nil { klog.Error(pollErr) - return fmt.Errorf("failed waiting for machine object to be deleted. %v", pollErr) + return errors.Wrap(pollErr, "failed waiting for machine object to be deleted") } } return nil diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/delete_policy.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/delete_policy.go similarity index 76% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/delete_policy.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/machineset/delete_policy.go index 9f5e519b9d..f73e9ca088 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/delete_policy.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/delete_policy.go @@ -17,7 +17,7 @@ limitations under the License. package machineset import ( - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" ) type deletePriority int @@ -29,18 +29,19 @@ const ( mustNotDelete deletePriority = 0 ) -type deletePriorityFunc func(machine *v1alpha1.Machine) deletePriority +type deletePriorityFunc func(machine *v1beta1.Machine) deletePriority // machineDeleteAnnotationKey annotates machines to be delete among first ones -var machineDeleteAnnotationKey = "sigs.k8s.io/cluster-api-delete-machine" +var machineDeleteAnnotationKey = "machine.openshift.io/cluster-api-delete-machine" -func simpleDeletePriority(machine *v1alpha1.Machine) deletePriority { +func simpleDeletePriority(machine *v1beta1.Machine) deletePriority { if machine.DeletionTimestamp != nil && !machine.DeletionTimestamp.IsZero() { return mustDelete } if _, exists := machine.Annotations[machineDeleteAnnotationKey]; exists { return mustDelete } + if machine.Status.ErrorReason != nil || machine.Status.ErrorMessage != nil { return betterDelete } @@ -49,21 +50,21 @@ func simpleDeletePriority(machine *v1alpha1.Machine) deletePriority { // TODO: Define machines deletion policies. // see: https://github.com/kubernetes/kube-deploy/issues/625 -func getMachinesToDeletePrioritized(filteredMachines []*v1alpha1.Machine, diff int, fun deletePriorityFunc) []*v1alpha1.Machine { +func getMachinesToDeletePrioritized(filteredMachines []*v1beta1.Machine, diff int, fun deletePriorityFunc) []*v1beta1.Machine { if diff >= len(filteredMachines) { return filteredMachines } else if diff <= 0 { - return []*v1alpha1.Machine{} + return []*v1beta1.Machine{} } - machines := make(map[deletePriority][]*v1alpha1.Machine) + machines := make(map[deletePriority][]*v1beta1.Machine) for _, machine := range filteredMachines { priority := fun(machine) machines[priority] = append(machines[priority], machine) } - result := []*v1alpha1.Machine{} + result := []*v1beta1.Machine{} for _, priority := range []deletePriority{ mustDelete, betterDelete, diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/machine.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/machine.go similarity index 84% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/machine.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/machineset/machine.go index f6b6c0e6dd..8628700cfc 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/machine.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/machine.go @@ -18,27 +18,28 @@ package machineset import ( "context" + + "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/klog" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) -func (c *ReconcileMachineSet) getMachineSetsForMachine(m *v1alpha1.Machine) []*v1alpha1.MachineSet { +func (c *ReconcileMachineSet) getMachineSetsForMachine(m *v1beta1.Machine) []*v1beta1.MachineSet { if len(m.Labels) == 0 { klog.Warningf("No machine sets found for Machine %v because it has no labels", m.Name) return nil } - msList := &v1alpha1.MachineSetList{} + msList := &v1beta1.MachineSetList{} listOptions := &client.ListOptions{ Namespace: m.Namespace, // This is set so the fake client can be used for unit test. See: // https://github.com/kubernetes-sigs/controller-runtime/issues/168 Raw: &metav1.ListOptions{ TypeMeta: metav1.TypeMeta{ - APIVersion: v1alpha1.SchemeGroupVersion.String(), + APIVersion: v1beta1.SchemeGroupVersion.String(), Kind: "MachineSet", }, }, @@ -50,7 +51,7 @@ func (c *ReconcileMachineSet) getMachineSetsForMachine(m *v1alpha1.Machine) []*v return nil } - var mss []*v1alpha1.MachineSet + var mss []*v1beta1.MachineSet for idx := range msList.Items { ms := &msList.Items[idx] if hasMatchingLabels(ms, m) { @@ -61,7 +62,7 @@ func (c *ReconcileMachineSet) getMachineSetsForMachine(m *v1alpha1.Machine) []*v return mss } -func hasMatchingLabels(machineSet *v1alpha1.MachineSet, machine *v1alpha1.Machine) bool { +func hasMatchingLabels(machineSet *v1beta1.MachineSet, machine *v1beta1.Machine) bool { selector, err := metav1.LabelSelectorAsSelector(&machineSet.Spec.Selector) if err != nil { klog.Warningf("unable to convert selector: %v", err) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/status.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/status.go similarity index 89% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/status.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/machineset/status.go index fed150a29a..51e3758fe2 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/machineset/status.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/status.go @@ -17,17 +17,16 @@ limitations under the License. package machineset import ( + "context" "fmt" + "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + "github.com/openshift/cluster-api/pkg/controller/noderefutil" + "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/klog" - - "context" - - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/controller/noderefutil" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -36,7 +35,7 @@ const ( statusUpdateRetries = 1 ) -func (c *ReconcileMachineSet) calculateStatus(ms *v1alpha1.MachineSet, filteredMachines []*v1alpha1.Machine) v1alpha1.MachineSetStatus { +func (c *ReconcileMachineSet) calculateStatus(ms *v1beta1.MachineSet, filteredMachines []*v1beta1.Machine) v1beta1.MachineSetStatus { newStatus := ms.Status // Count the number of machines that have labels matching the labels of the machine // template of the replica set, the matching machines may have more @@ -72,7 +71,7 @@ func (c *ReconcileMachineSet) calculateStatus(ms *v1alpha1.MachineSet, filteredM } // updateMachineSetStatus attempts to update the Status.Replicas of the given MachineSet, with a single GET/PUT retry. -func updateMachineSetStatus(c client.Client, ms *v1alpha1.MachineSet, newStatus v1alpha1.MachineSetStatus) (*v1alpha1.MachineSet, error) { +func updateMachineSetStatus(c client.Client, ms *v1beta1.MachineSet, newStatus v1beta1.MachineSetStatus) (*v1beta1.MachineSet, error) { // This is the steady state. It happens when the MachineSet doesn't have any expectations, since // we do a periodic relist every 30s. If the generations differ but the replicas are // the same, a caller might've resized to the same replica count. @@ -123,10 +122,10 @@ func updateMachineSetStatus(c client.Client, ms *v1alpha1.MachineSet, newStatus return nil, updateErr } -func (c *ReconcileMachineSet) getMachineNode(machine *v1alpha1.Machine) (*corev1.Node, error) { +func (c *ReconcileMachineSet) getMachineNode(machine *v1beta1.Machine) (*corev1.Node, error) { nodeRef := machine.Status.NodeRef if nodeRef == nil { - return nil, fmt.Errorf("machine has no node ref") + return nil, errors.New("machine has no node ref") } node := &corev1.Node{} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/node/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/node/BUILD.bazel similarity index 94% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/node/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/controller/node/BUILD.bazel index 0af213d294..52fa662671 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/node/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/node/BUILD.bazel @@ -6,10 +6,10 @@ go_library( "node.go", "node_controller.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/controller/node", + importpath = "github.com/openshift/cluster-api/pkg/controller/node", 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", "//vendor/k8s.io/api/core/v1:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/node/node.go b/vendor/github.com/openshift/cluster-api/pkg/controller/node/node.go similarity index 87% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/node/node.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/node/node.go index a954342d39..12f59cbb65 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/node/node.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/node/node.go @@ -24,17 +24,18 @@ import ( "context" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/controller/noderefutil" - "sigs.k8s.io/cluster-api/pkg/util" + "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + "github.com/openshift/cluster-api/pkg/controller/noderefutil" + "github.com/openshift/cluster-api/pkg/util" "sigs.k8s.io/controller-runtime/pkg/client" ) const ( - machineAnnotationKey = "cluster.k8s.io/machine" + // MachineAnnotationKey annotation used to link node and machine resource + MachineAnnotationKey = "machine.openshift.io/machine" ) -// We are using "machine" annotation to link node and machine resource. The "machine" +// We are using "machine.openshift.io/machine" annotation to link node and machine resource. The "machine.openshift.io/machine" // annotation is an implementation detail of how the two objects can get linked together, but it is // not required behavior. However, in the event that a Machine.Spec update requires replacing the // Node, this can allow for faster turn-around time by allowing a new Node to be created with a new @@ -52,7 +53,7 @@ func (c *ReconcileNode) link(node *corev1.Node) error { } } - val, ok := node.ObjectMeta.Annotations[machineAnnotationKey] + val, ok := node.ObjectMeta.Annotations[MachineAnnotationKey] if !ok { return nil } @@ -65,7 +66,7 @@ func (c *ReconcileNode) link(node *corev1.Node) error { namespace = util.GetNamespaceOrDefault(namespace) key := client.ObjectKey{Namespace: namespace, Name: mach} - machine := &v1alpha1.Machine{} + machine := &v1beta1.Machine{} if err = c.Client.Get(context.Background(), key, machine); err != nil { klog.Errorf("Error getting machine %v: %v\n", mach, err) return err @@ -86,7 +87,7 @@ func (c *ReconcileNode) link(node *corev1.Node) error { } func (c *ReconcileNode) unlink(node *corev1.Node) error { - val, ok := node.ObjectMeta.Annotations[machineAnnotationKey] + val, ok := node.ObjectMeta.Annotations[MachineAnnotationKey] if !ok { return nil } @@ -99,7 +100,7 @@ func (c *ReconcileNode) unlink(node *corev1.Node) error { namespace = util.GetNamespaceOrDefault(namespace) key := client.ObjectKey{Namespace: namespace, Name: mach} - machine := &v1alpha1.Machine{} + machine := &v1beta1.Machine{} if err = c.Client.Get(context.Background(), key, machine); err != nil { klog.Errorf("Error getting machine %v: %v\n", mach, err) return err diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/node/node_controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/node/node_controller.go similarity index 96% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/node/node_controller.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/node/node_controller.go index d66fee4e1c..8e821a740d 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/node/node_controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/node/node_controller.go @@ -78,7 +78,7 @@ type ReconcileNode struct { // Reconcile reads that state of the cluster for a Node object and makes changes based on the state read // and what is in the Node.Spec // +kubebuilder:rbac:groups=core,resources=nodes,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machines,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=machine.openshift.io,resources=machines,verbs=get;list;watch;create;update;patch;delete func (r *ReconcileNode) Reconcile(request reconcile.Request) (reconcile.Result, error) { // Fetch the Node instance instance := &corev1.Node{} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/noderefutil/BUILD.bazel similarity index 88% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/controller/noderefutil/BUILD.bazel index 7868e41e82..50c7a2b345 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/noderefutil/BUILD.bazel @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["util.go"], - importpath = "sigs.k8s.io/cluster-api/pkg/controller/noderefutil", + importpath = "github.com/openshift/cluster-api/pkg/controller/noderefutil", visibility = ["//visibility:public"], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/util.go b/vendor/github.com/openshift/cluster-api/pkg/controller/noderefutil/util.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/controller/noderefutil/util.go rename to vendor/github.com/openshift/cluster-api/pkg/controller/noderefutil/util.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/errors/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/errors/BUILD.bazel similarity index 53% rename from vendor/sigs.k8s.io/cluster-api/pkg/errors/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/errors/BUILD.bazel index 3d2cd66d09..8e9c9e928b 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/errors/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/errors/BUILD.bazel @@ -7,7 +7,10 @@ go_library( "deployer.go", "machines.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/errors", + importpath = "github.com/openshift/cluster-api/pkg/errors", visibility = ["//visibility:public"], - deps = ["//pkg/apis/cluster/common:go_default_library"], + deps = [ + "//pkg/apis/machine/common:go_default_library", + "//vendor/github.com/pkg/errors:go_default_library", + ], ) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/errors/clusters.go b/vendor/github.com/openshift/cluster-api/pkg/errors/clusters.go similarity index 96% rename from vendor/sigs.k8s.io/cluster-api/pkg/errors/clusters.go rename to vendor/github.com/openshift/cluster-api/pkg/errors/clusters.go index f6a0f7809c..cdb63b3681 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/errors/clusters.go +++ b/vendor/github.com/openshift/cluster-api/pkg/errors/clusters.go @@ -19,7 +19,7 @@ package errors import ( "fmt" - commonerrors "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" + commonerrors "github.com/openshift/cluster-api/pkg/apis/machine/common" ) // A more descriptive kind of error that represents an error condition that diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/errors/deployer.go b/vendor/github.com/openshift/cluster-api/pkg/errors/deployer.go similarity index 87% rename from vendor/sigs.k8s.io/cluster-api/pkg/errors/deployer.go rename to vendor/github.com/openshift/cluster-api/pkg/errors/deployer.go index 8c7041dbfc..408871ecca 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/errors/deployer.go +++ b/vendor/github.com/openshift/cluster-api/pkg/errors/deployer.go @@ -16,8 +16,6 @@ limitations under the License. package errors -import ( - "fmt" -) +import "github.com/pkg/errors" -var NotImplementedError = fmt.Errorf("not implemented") +var NotImplementedError = errors.New("not implemented") diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/errors/machines.go b/vendor/github.com/openshift/cluster-api/pkg/errors/machines.go similarity index 96% rename from vendor/sigs.k8s.io/cluster-api/pkg/errors/machines.go rename to vendor/github.com/openshift/cluster-api/pkg/errors/machines.go index fcd50f9f87..eaf8c0cc2f 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/errors/machines.go +++ b/vendor/github.com/openshift/cluster-api/pkg/errors/machines.go @@ -19,7 +19,7 @@ package errors import ( "fmt" - commonerrors "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" + commonerrors "github.com/openshift/cluster-api/pkg/apis/machine/common" ) // A more descriptive kind of error that represents an error condition that diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/kubeadm/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/kubeadm/BUILD.bazel similarity index 63% rename from vendor/sigs.k8s.io/cluster-api/pkg/kubeadm/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/kubeadm/BUILD.bazel index d260f7ac7c..0f5c4b33ff 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/kubeadm/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/kubeadm/BUILD.bazel @@ -3,14 +3,14 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["kubeadm.go"], - importpath = "sigs.k8s.io/cluster-api/pkg/kubeadm", + importpath = "github.com/openshift/cluster-api/pkg/kubeadm", visibility = ["//visibility:public"], - deps = ["//pkg/cmd-runner:go_default_library"], + deps = ["//pkg/cmdrunner:go_default_library"], ) go_test( name = "go_default_test", srcs = ["kubeadm_test.go"], embed = [":go_default_library"], - deps = ["//pkg/test-cmd-runner:go_default_library"], + deps = ["//pkg/testcmdrunner:go_default_library"], ) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/kubeadm/kubeadm.go b/vendor/github.com/openshift/cluster-api/pkg/kubeadm/kubeadm.go similarity index 94% rename from vendor/sigs.k8s.io/cluster-api/pkg/kubeadm/kubeadm.go rename to vendor/github.com/openshift/cluster-api/pkg/kubeadm/kubeadm.go index e6cb3dc84b..4e3f4bb4e4 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/kubeadm/kubeadm.go +++ b/vendor/github.com/openshift/cluster-api/pkg/kubeadm/kubeadm.go @@ -20,13 +20,13 @@ import ( "strings" "time" - "sigs.k8s.io/cluster-api/pkg/cmd-runner" + "github.com/openshift/cluster-api/pkg/cmdrunner" ) // The purpose of Kubeadm and this file is to provide a unit tested wrapper around the 'kubeadm' exec command. Higher // level, application specific functionality built on top of kubeadm should be be in another location. type Kubeadm struct { - runner cmd_runner.CmdRunner + runner cmdrunner.Runner } // see https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-token/ for an explanation of the parameters @@ -41,14 +41,14 @@ type TokenCreateParams struct { Usages []string } -func NewWithCmdRunner(runner cmd_runner.CmdRunner) *Kubeadm { +func NewWithRunner(runner cmdrunner.Runner) *Kubeadm { return &Kubeadm{ runner: runner, } } func New() *Kubeadm { - return NewWithCmdRunner(cmd_runner.New()) + return NewWithRunner(cmdrunner.New()) } // TokenCreate execs `kubeadm token create` with the appropriate flags added by interpreting the params argument. The output of diff --git a/vendor/github.com/openshift/cluster-api/pkg/testcmdrunner/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/testcmdrunner/BUILD.bazel new file mode 100644 index 0000000000..48e6a2cb61 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/testcmdrunner/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["test_cmd_runner.go"], + importpath = "github.com/openshift/cluster-api/pkg/testcmdrunner", + visibility = ["//visibility:public"], +) diff --git a/vendor/github.com/openshift/cluster-api/pkg/testcmdrunner/test_cmd_runner.go b/vendor/github.com/openshift/cluster-api/pkg/testcmdrunner/test_cmd_runner.go new file mode 100644 index 0000000000..239b49214c --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/testcmdrunner/test_cmd_runner.go @@ -0,0 +1,46 @@ +/* +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 testcmdrunner + +import ( + "testing" +) + +// TestRunner mocks out command execution. +type TestRunner struct { + callback func(cmd string, args ...string) (string, error) +} + +// New builds a TestRunner to mock out command execution. +func New(callback func(cmd string, args ...string) (string, error)) (*TestRunner, error) { + return &TestRunner{ + callback: callback, + }, nil +} + +// NewOrDie builds a TestRunner or calls t.Fatal on error +func NewOrDie(t *testing.T, callback func(cmd string, args ...string) (string, error)) *TestRunner { + runner, err := New(callback) + if err != nil { + t.Fatal(err) + } + return runner +} + +func (runner *TestRunner) CombinedOutput(cmd string, args ...string) (string, error) { + return runner.callback(cmd, args...) +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/util/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/util/BUILD.bazel similarity index 92% rename from vendor/sigs.k8s.io/cluster-api/pkg/util/BUILD.bazel rename to vendor/github.com/openshift/cluster-api/pkg/util/BUILD.bazel index d0bc45d475..bf1bc17c0c 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/util/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/util/BUILD.bazel @@ -6,7 +6,7 @@ go_library( "retry.go", "util.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/util", + importpath = "github.com/openshift/cluster-api/pkg/util", visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/v1alpha1:go_default_library", diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/util/retry.go b/vendor/github.com/openshift/cluster-api/pkg/util/retry.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/pkg/util/retry.go rename to vendor/github.com/openshift/cluster-api/pkg/util/retry.go diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/util/util.go b/vendor/github.com/openshift/cluster-api/pkg/util/util.go similarity index 92% rename from vendor/sigs.k8s.io/cluster-api/pkg/util/util.go rename to vendor/github.com/openshift/cluster-api/pkg/util/util.go index b67bb00237..d476eccc36 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/util/util.go +++ b/vendor/github.com/openshift/cluster-api/pkg/util/util.go @@ -27,10 +27,10 @@ import ( "strings" "time" - "k8s.io/api/core/v1" + clusterv1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/klog" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" ) @@ -55,9 +55,9 @@ func RandomString(n int) string { return string(result) } -func GetMaster(machines []*clusterv1.Machine) *clusterv1.Machine { +func GetControlPlaneMachine(machines []*clusterv1.Machine) *clusterv1.Machine { for _, machine := range machines { - if IsMaster(machine) { + if IsControlPlaneMachine(machine) { return machine } } @@ -99,7 +99,7 @@ func GetDefaultKubeConfigPath() string { func GetMachineIfExists(c client.Client, namespace, name string) (*clusterv1.Machine, error) { if c == nil { - // Being called before k8s is setup as part of master VM creation + // Being called before k8s is setup as part of control plane VM creation return nil, nil } @@ -117,7 +117,7 @@ func GetMachineIfExists(c client.Client, namespace, name string) (*clusterv1.Mac } // TODO(robertbailey): Remove this function -func IsMaster(machine *clusterv1.Machine) bool { +func IsControlPlaneMachine(machine *clusterv1.Machine) bool { return machine.Spec.Versions.ControlPlane != "" } diff --git a/vendor/sigs.k8s.io/cluster-api/sample/cluster.yaml b/vendor/github.com/openshift/cluster-api/sample/cluster.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/sample/cluster.yaml rename to vendor/github.com/openshift/cluster-api/sample/cluster.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/sample/machine.yaml b/vendor/github.com/openshift/cluster-api/sample/machine.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/sample/machine.yaml rename to vendor/github.com/openshift/cluster-api/sample/machine.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/sample/machineclass.yaml b/vendor/github.com/openshift/cluster-api/sample/machineclass.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/sample/machineclass.yaml rename to vendor/github.com/openshift/cluster-api/sample/machineclass.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/sample/machinedeployment.yaml b/vendor/github.com/openshift/cluster-api/sample/machinedeployment.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/sample/machinedeployment.yaml rename to vendor/github.com/openshift/cluster-api/sample/machinedeployment.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/sample/machineset.yaml b/vendor/github.com/openshift/cluster-api/sample/machineset.yaml similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/sample/machineset.yaml rename to vendor/github.com/openshift/cluster-api/sample/machineset.yaml diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-build.sh b/vendor/github.com/openshift/cluster-api/scripts/ci-build.sh similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/scripts/ci-build.sh rename to vendor/github.com/openshift/cluster-api/scripts/ci-build.sh diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-is-vendor-in-sync.sh b/vendor/github.com/openshift/cluster-api/scripts/ci-is-vendor-in-sync.sh similarity index 91% rename from vendor/sigs.k8s.io/cluster-api/scripts/ci-is-vendor-in-sync.sh rename to vendor/github.com/openshift/cluster-api/scripts/ci-is-vendor-in-sync.sh index 88e42f7255..71c11a718a 100755 --- a/vendor/sigs.k8s.io/cluster-api/scripts/ci-is-vendor-in-sync.sh +++ b/vendor/github.com/openshift/cluster-api/scripts/ci-is-vendor-in-sync.sh @@ -20,4 +20,6 @@ set -o pipefail REPO_ROOT=$(dirname "${BASH_SOURCE}")/.. -cd $REPO_ROOT && dep status +cd $REPO_ROOT +find vendor -name 'BUILD.bazel' -delete +dep check diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-make.sh b/vendor/github.com/openshift/cluster-api/scripts/ci-make.sh similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/scripts/ci-make.sh rename to vendor/github.com/openshift/cluster-api/scripts/ci-make.sh diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/ci-test.sh b/vendor/github.com/openshift/cluster-api/scripts/ci-test.sh similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/scripts/ci-test.sh rename to vendor/github.com/openshift/cluster-api/scripts/ci-test.sh diff --git a/vendor/sigs.k8s.io/cluster-api/scripts/fetch_ext_bins.sh b/vendor/github.com/openshift/cluster-api/scripts/fetch_ext_bins.sh similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/scripts/fetch_ext_bins.sh rename to vendor/github.com/openshift/cluster-api/scripts/fetch_ext_bins.sh diff --git a/vendor/k8s.io/code-generator/Godeps/Godeps.json b/vendor/k8s.io/code-generator/Godeps/Godeps.json index 1427286aee..3f265cb6d3 100644 --- a/vendor/k8s.io/code-generator/Godeps/Godeps.json +++ b/vendor/k8s.io/code-generator/Godeps/Godeps.json @@ -1,6 +1,6 @@ { "ImportPath": "k8s.io/code-generator", - "GoVersion": "go1.11", + "GoVersion": "go1.9", "GodepVersion": "v80", "Packages": [ "./..." @@ -40,103 +40,103 @@ }, { "ImportPath": "github.com/gogo/protobuf/gogoproto", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/compare", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/defaultcheck", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/description", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/embedcheck", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/enumstringer", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/equal", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/face", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/gostring", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/marshalto", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/oneofcheck", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/populate", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/size", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/stringer", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/testgen", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/union", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/plugin/unmarshal", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/proto", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/descriptor", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/generator", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/grpc", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/plugin", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/sortkeys", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/vanity", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/gogo/protobuf/vanity/command", - "Rev": "342cbe0a04158f6dcb03ca0079991a51a4248c02" + "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" }, { "ImportPath": "github.com/golang/glog", @@ -216,67 +216,55 @@ }, { "ImportPath": "gopkg.in/yaml.v2", - "Rev": "5420a8b6744d3b0345ab293f6fcba19c978f1183" + "Rev": "670d4cfef0544295bc27a114dbac37980d83185a" }, { "ImportPath": "k8s.io/gengo/args", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" }, { "ImportPath": "k8s.io/gengo/examples/deepcopy-gen/generators", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" }, { "ImportPath": "k8s.io/gengo/examples/defaulter-gen/generators", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" }, { "ImportPath": "k8s.io/gengo/examples/import-boss/generators", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" }, { "ImportPath": "k8s.io/gengo/examples/set-gen/generators", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" }, { "ImportPath": "k8s.io/gengo/examples/set-gen/sets", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" }, { "ImportPath": "k8s.io/gengo/generator", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" }, { "ImportPath": "k8s.io/gengo/namer", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" }, { "ImportPath": "k8s.io/gengo/parser", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" }, { "ImportPath": "k8s.io/gengo/types", - "Rev": "fdcf9f9480fdd5bf2b3c3df9bf4ecd22b25b87e2" - }, - { - "ImportPath": "k8s.io/kube-openapi/cmd/openapi-gen/args", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + "Rev": "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + "Rev": "91cfa479c814065e420cee7ed227db0f63a5854e" }, { "ImportPath": "k8s.io/kube-openapi/pkg/generators", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/generators/rules", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" - }, - { - "ImportPath": "k8s.io/kube-openapi/pkg/util/sets", - "Rev": "72693cb1fadd73ae2742f6fe29af77d1aecdd8cd" + "Rev": "91cfa479c814065e420cee7ed227db0f63a5854e" } ] } diff --git a/vendor/k8s.io/code-generator/OWNERS b/vendor/k8s.io/code-generator/OWNERS index 4155fc60cc..ce432f59d8 100644 --- a/vendor/k8s.io/code-generator/OWNERS +++ b/vendor/k8s.io/code-generator/OWNERS @@ -6,6 +6,3 @@ reviewers: - lavalamp - wojtek-t - sttts -labels: -- sig/api-machinery -- area/code-generation diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/register.go b/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/register.go deleted file mode 100644 index 58371e0e94..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/register.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2015 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 v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var SchemeGroupVersion = schema.GroupVersion{Group: "example.crd.code-generator.k8s.io", Version: "v1"} - -var ( - // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - SchemeBuilder runtime.SchemeBuilder - localSchemeBuilder = &SchemeBuilder - AddToScheme = localSchemeBuilder.AddToScheme -) - -func init() { - // We only register manually written functions here. The registration of the - // generated functions takes place in the generated files. The separation - // makes the code compile even when the generated files are missing. - localSchemeBuilder.Register(addKnownTypes) -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &TestType{}, - &TestTypeList{}, - ) - - scheme.AddKnownTypes(SchemeGroupVersion, - &metav1.Status{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/types.go b/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/types.go deleted file mode 100644 index d79ea38b72..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/types.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright 2015 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 v1 - -import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// TestType is a top-level type. A client is created for it. -type TestType struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - // +optional - Status TestTypeStatus `json:"status,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// TestTypeList is a top-level list type. The client methods for lists are automatically created. -// You are not supposed to create a separated client for this one. -type TestTypeList struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - Items []TestType `json:"items"` -} - -type TestTypeStatus struct { - Blah string -} - -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -type ClusterTestTypeList struct { - metav1.TypeMeta - metav1.ListMeta - Items []ClusterTestType -} - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/kubernetes/pkg/apis/autoscaling.Scale -// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/kubernetes/pkg/apis/autoscaling.Scale,result=k8s.io/kubernetes/pkg/apis/autoscaling.Scale - -type ClusterTestType struct { - metav1.TypeMeta `json:",inline"` - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - // +optional - Status ClusterTestTypeStatus `json:"status,omitempty"` -} - -type ClusterTestTypeStatus struct { - Blah string -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.deepcopy.go b/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.deepcopy.go deleted file mode 100644 index a3b4bfa9c2..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,177 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterTestType) DeepCopyInto(out *ClusterTestType) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestType. -func (in *ClusterTestType) DeepCopy() *ClusterTestType { - if in == nil { - return nil - } - out := new(ClusterTestType) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterTestType) 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 *ClusterTestTypeList) DeepCopyInto(out *ClusterTestTypeList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterTestType, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestTypeList. -func (in *ClusterTestTypeList) DeepCopy() *ClusterTestTypeList { - if in == nil { - return nil - } - out := new(ClusterTestTypeList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterTestTypeList) 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 *ClusterTestTypeStatus) DeepCopyInto(out *ClusterTestTypeStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestTypeStatus. -func (in *ClusterTestTypeStatus) DeepCopy() *ClusterTestTypeStatus { - if in == nil { - return nil - } - out := new(ClusterTestTypeStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TestType) DeepCopyInto(out *TestType) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType. -func (in *TestType) DeepCopy() *TestType { - if in == nil { - return nil - } - out := new(TestType) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *TestType) 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 *TestTypeList) DeepCopyInto(out *TestTypeList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]TestType, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList. -func (in *TestTypeList) DeepCopy() *TestTypeList { - if in == nil { - return nil - } - out := new(TestTypeList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *TestTypeList) 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 *TestTypeStatus) DeepCopyInto(out *TestTypeStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus. -func (in *TestTypeStatus) DeepCopy() *TestTypeStatus { - if in == nil { - return nil - } - out := new(TestTypeStatus) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.defaults.go b/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.defaults.go deleted file mode 100644 index cce2e603a6..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.defaults.go +++ /dev/null @@ -1,32 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by defaulter-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// RegisterDefaults adds defaulters functions to the given scheme. -// Public to allow building arbitrary schemes. -// All generated defaulters are covering - they call all nested defaulters. -func RegisterDefaults(scheme *runtime.Scheme) error { - return nil -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/clientset.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/clientset.go deleted file mode 100644 index 72931e51ed..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/clientset.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package versioned - -import ( - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" - examplev1 "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - ExampleV1() examplev1.ExampleV1Interface - // Deprecated: please explicitly pick a version if possible. - Example() examplev1.ExampleV1Interface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - exampleV1 *examplev1.ExampleV1Client -} - -// ExampleV1 retrieves the ExampleV1Client -func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface { - return c.exampleV1 -} - -// Deprecated: Example retrieves the default version of ExampleClient. -// Please explicitly pick a version. -func (c *Clientset) Example() examplev1.ExampleV1Interface { - return c.exampleV1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.exampleV1, err = examplev1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.exampleV1 = examplev1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.exampleV1 = examplev1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/doc.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/doc.go deleted file mode 100644 index 41721ca52d..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/fake/clientset_generated.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/fake/clientset_generated.go deleted file mode 100644 index 9a7307606c..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/fake/clientset_generated.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" - clientset "k8s.io/code-generator/_examples/MixedCase/clientset/versioned" - examplev1 "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1" - fakeexamplev1 "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -var _ clientset.Interface = &Clientset{} - -// ExampleV1 retrieves the ExampleV1Client -func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface { - return &fakeexamplev1.FakeExampleV1{Fake: &c.Fake} -} - -// Example retrieves the ExampleV1Client -func (c *Clientset) Example() examplev1.ExampleV1Interface { - return &fakeexamplev1.FakeExampleV1{Fake: &c.Fake} -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/fake/register.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/fake/register.go deleted file mode 100644 index 7fe8bc6a5f..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/fake/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - examplev1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme/doc.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme/doc.go deleted file mode 100644 index 7dc3756168..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme/register.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme/register.go deleted file mode 100644 index 2cf84f85a9..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - examplev1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go deleted file mode 100644 index b6f023f944..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go +++ /dev/null @@ -1,193 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - metav1 "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" - v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" - scheme "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme" - autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" -) - -// ClusterTestTypesGetter has a method to return a ClusterTestTypeInterface. -// A group's client should implement this interface. -type ClusterTestTypesGetter interface { - ClusterTestTypes() ClusterTestTypeInterface -} - -// ClusterTestTypeInterface has methods to work with ClusterTestType resources. -type ClusterTestTypeInterface interface { - Create(*v1.ClusterTestType) (*v1.ClusterTestType, error) - Update(*v1.ClusterTestType) (*v1.ClusterTestType, error) - UpdateStatus(*v1.ClusterTestType) (*v1.ClusterTestType, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ClusterTestType, error) - List(opts metav1.ListOptions) (*v1.ClusterTestTypeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterTestType, err error) - GetScale(clusterTestTypeName string, options metav1.GetOptions) (*autoscaling.Scale, error) - UpdateScale(clusterTestTypeName string, scale *autoscaling.Scale) (*autoscaling.Scale, error) - - ClusterTestTypeExpansion -} - -// clusterTestTypes implements ClusterTestTypeInterface -type clusterTestTypes struct { - client rest.Interface -} - -// newClusterTestTypes returns a ClusterTestTypes -func newClusterTestTypes(c *ExampleV1Client) *clusterTestTypes { - return &clusterTestTypes{ - client: c.RESTClient(), - } -} - -// Get takes name of the clusterTestType, and returns the corresponding clusterTestType object, and an error if there is any. -func (c *clusterTestTypes) Get(name string, options metav1.GetOptions) (result *v1.ClusterTestType, err error) { - result = &v1.ClusterTestType{} - err = c.client.Get(). - Resource("clustertesttypes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterTestTypes that match those selectors. -func (c *clusterTestTypes) List(opts metav1.ListOptions) (result *v1.ClusterTestTypeList, err error) { - result = &v1.ClusterTestTypeList{} - err = c.client.Get(). - Resource("clustertesttypes"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterTestTypes. -func (c *clusterTestTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Resource("clustertesttypes"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a clusterTestType and creates it. Returns the server's representation of the clusterTestType, and an error, if there is any. -func (c *clusterTestTypes) Create(clusterTestType *v1.ClusterTestType) (result *v1.ClusterTestType, err error) { - result = &v1.ClusterTestType{} - err = c.client.Post(). - Resource("clustertesttypes"). - Body(clusterTestType). - Do(). - Into(result) - return -} - -// Update takes the representation of a clusterTestType and updates it. Returns the server's representation of the clusterTestType, and an error, if there is any. -func (c *clusterTestTypes) Update(clusterTestType *v1.ClusterTestType) (result *v1.ClusterTestType, err error) { - result = &v1.ClusterTestType{} - err = c.client.Put(). - Resource("clustertesttypes"). - Name(clusterTestType.Name). - Body(clusterTestType). - 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 *clusterTestTypes) UpdateStatus(clusterTestType *v1.ClusterTestType) (result *v1.ClusterTestType, err error) { - result = &v1.ClusterTestType{} - err = c.client.Put(). - Resource("clustertesttypes"). - Name(clusterTestType.Name). - SubResource("status"). - Body(clusterTestType). - Do(). - Into(result) - return -} - -// Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. -func (c *clusterTestTypes) Delete(name string, options *metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("clustertesttypes"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterTestTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { - return c.client.Delete(). - Resource("clustertesttypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched clusterTestType. -func (c *clusterTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterTestType, err error) { - result = &v1.ClusterTestType{} - err = c.client.Patch(pt). - Resource("clustertesttypes"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} - -// GetScale takes name of the clusterTestType, and returns the corresponding autoscaling.Scale object, and an error if there is any. -func (c *clusterTestTypes) GetScale(clusterTestTypeName string, options metav1.GetOptions) (result *autoscaling.Scale, err error) { - result = &autoscaling.Scale{} - err = c.client.Get(). - Resource("clustertesttypes"). - Name(clusterTestTypeName). - SubResource("scale"). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *clusterTestTypes) UpdateScale(clusterTestTypeName string, scale *autoscaling.Scale) (result *autoscaling.Scale, err error) { - result = &autoscaling.Scale{} - err = c.client.Put(). - Resource("clustertesttypes"). - Name(clusterTestTypeName). - SubResource("scale"). - Body(scale). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/example_client.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/example_client.go deleted file mode 100644 index 9fdbf4aad1..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/example_client.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" - v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" - "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme" -) - -type ExampleV1Interface interface { - RESTClient() rest.Interface - ClusterTestTypesGetter - TestTypesGetter -} - -// ExampleV1Client is used to interact with features provided by the example.crd.code-generator.k8s.io group. -type ExampleV1Client struct { - restClient rest.Interface -} - -func (c *ExampleV1Client) ClusterTestTypes() ClusterTestTypeInterface { - return newClusterTestTypes(c) -} - -func (c *ExampleV1Client) TestTypes(namespace string) TestTypeInterface { - return newTestTypes(c, namespace) -} - -// NewForConfig creates a new ExampleV1Client for the given config. -func NewForConfig(c *rest.Config) (*ExampleV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &ExampleV1Client{client}, nil -} - -// NewForConfigOrDie creates a new ExampleV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ExampleV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ExampleV1Client for the given RESTClient. -func New(c rest.Interface) *ExampleV1Client { - return &ExampleV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *ExampleV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go deleted file mode 100644 index edf217df0d..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go +++ /dev/null @@ -1,152 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - 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" - examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" - autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" -) - -// FakeClusterTestTypes implements ClusterTestTypeInterface -type FakeClusterTestTypes struct { - Fake *FakeExampleV1 -} - -var clustertesttypesResource = schema.GroupVersionResource{Group: "example.crd.code-generator.k8s.io", Version: "v1", Resource: "clustertesttypes"} - -var clustertesttypesKind = schema.GroupVersionKind{Group: "example.crd.code-generator.k8s.io", Version: "v1", Kind: "ClusterTestType"} - -// Get takes name of the clusterTestType, and returns the corresponding clusterTestType object, and an error if there is any. -func (c *FakeClusterTestTypes) Get(name string, options v1.GetOptions) (result *examplev1.ClusterTestType, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) - if obj == nil { - return nil, err - } - return obj.(*examplev1.ClusterTestType), err -} - -// List takes label and field selectors, and returns the list of ClusterTestTypes that match those selectors. -func (c *FakeClusterTestTypes) List(opts v1.ListOptions) (result *examplev1.ClusterTestTypeList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(clustertesttypesResource, clustertesttypesKind, opts), &examplev1.ClusterTestTypeList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &examplev1.ClusterTestTypeList{ListMeta: obj.(*examplev1.ClusterTestTypeList).ListMeta} - for _, item := range obj.(*examplev1.ClusterTestTypeList).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 clusterTestTypes. -func (c *FakeClusterTestTypes) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clustertesttypesResource, opts)) -} - -// Create takes the representation of a clusterTestType and creates it. Returns the server's representation of the clusterTestType, and an error, if there is any. -func (c *FakeClusterTestTypes) Create(clusterTestType *examplev1.ClusterTestType) (result *examplev1.ClusterTestType, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clustertesttypesResource, clusterTestType), &examplev1.ClusterTestType{}) - if obj == nil { - return nil, err - } - return obj.(*examplev1.ClusterTestType), err -} - -// Update takes the representation of a clusterTestType and updates it. Returns the server's representation of the clusterTestType, and an error, if there is any. -func (c *FakeClusterTestTypes) Update(clusterTestType *examplev1.ClusterTestType) (result *examplev1.ClusterTestType, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clustertesttypesResource, clusterTestType), &examplev1.ClusterTestType{}) - if obj == nil { - return nil, err - } - return obj.(*examplev1.ClusterTestType), 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 *FakeClusterTestTypes) UpdateStatus(clusterTestType *examplev1.ClusterTestType) (*examplev1.ClusterTestType, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "status", clusterTestType), &examplev1.ClusterTestType{}) - if obj == nil { - return nil, err - } - return obj.(*examplev1.ClusterTestType), err -} - -// Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. -func (c *FakeClusterTestTypes) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterTestTypes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clustertesttypesResource, listOptions) - - _, err := c.Fake.Invokes(action, &examplev1.ClusterTestTypeList{}) - return err -} - -// Patch applies the patch and returns the patched clusterTestType. -func (c *FakeClusterTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *examplev1.ClusterTestType, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustertesttypesResource, name, pt, data, subresources...), &examplev1.ClusterTestType{}) - if obj == nil { - return nil, err - } - return obj.(*examplev1.ClusterTestType), err -} - -// GetScale takes name of the clusterTestType, and returns the corresponding scale object, and an error if there is any. -func (c *FakeClusterTestTypes) GetScale(clusterTestTypeName string, options v1.GetOptions) (result *autoscaling.Scale, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(clustertesttypesResource, "scale", clusterTestTypeName), &autoscaling.Scale{}) - if obj == nil { - return nil, err - } - return obj.(*autoscaling.Scale), err -} - -// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *FakeClusterTestTypes) UpdateScale(clusterTestTypeName string, scale *autoscaling.Scale) (result *autoscaling.Scale, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "scale", scale), &autoscaling.Scale{}) - if obj == nil { - return nil, err - } - return obj.(*autoscaling.Scale), err -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_example_client.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_example_client.go deleted file mode 100644 index 265930a0e4..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_example_client.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" - v1 "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1" -) - -type FakeExampleV1 struct { - *testing.Fake -} - -func (c *FakeExampleV1) ClusterTestTypes() v1.ClusterTestTypeInterface { - return &FakeClusterTestTypes{c} -} - -func (c *FakeExampleV1) TestTypes(namespace string) v1.TestTypeInterface { - return &FakeTestTypes{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeExampleV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_testtype.go deleted file mode 100644 index 2ff811a969..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_testtype.go +++ /dev/null @@ -1,140 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - 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" - examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" -) - -// FakeTestTypes implements TestTypeInterface -type FakeTestTypes struct { - Fake *FakeExampleV1 - ns string -} - -var testtypesResource = schema.GroupVersionResource{Group: "example.crd.code-generator.k8s.io", Version: "v1", Resource: "testtypes"} - -var testtypesKind = schema.GroupVersionKind{Group: "example.crd.code-generator.k8s.io", Version: "v1", Kind: "TestType"} - -// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. -func (c *FakeTestTypes) Get(name string, options v1.GetOptions) (result *examplev1.TestType, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &examplev1.TestType{}) - - if obj == nil { - return nil, err - } - return obj.(*examplev1.TestType), err -} - -// List takes label and field selectors, and returns the list of TestTypes that match those selectors. -func (c *FakeTestTypes) List(opts v1.ListOptions) (result *examplev1.TestTypeList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &examplev1.TestTypeList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &examplev1.TestTypeList{ListMeta: obj.(*examplev1.TestTypeList).ListMeta} - for _, item := range obj.(*examplev1.TestTypeList).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 testTypes. -func (c *FakeTestTypes) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(testtypesResource, c.ns, opts)) - -} - -// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. -func (c *FakeTestTypes) Create(testType *examplev1.TestType) (result *examplev1.TestType, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) - - if obj == nil { - return nil, err - } - return obj.(*examplev1.TestType), err -} - -// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. -func (c *FakeTestTypes) Update(testType *examplev1.TestType) (result *examplev1.TestType, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) - - if obj == nil { - return nil, err - } - return obj.(*examplev1.TestType), 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 *FakeTestTypes) UpdateStatus(testType *examplev1.TestType) (*examplev1.TestType, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &examplev1.TestType{}) - - if obj == nil { - return nil, err - } - return obj.(*examplev1.TestType), err -} - -// Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *FakeTestTypes) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &examplev1.TestType{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeTestTypes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &examplev1.TestTypeList{}) - return err -} - -// Patch applies the patch and returns the patched testType. -func (c *FakeTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *examplev1.TestType, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &examplev1.TestType{}) - - if obj == nil { - return nil, err - } - return obj.(*examplev1.TestType), err -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go deleted file mode 100644 index 3c7b636e28..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - metav1 "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" - v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" - scheme "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme" -) - -// TestTypesGetter has a method to return a TestTypeInterface. -// A group's client should implement this interface. -type TestTypesGetter interface { - TestTypes(namespace string) TestTypeInterface -} - -// TestTypeInterface has methods to work with TestType resources. -type TestTypeInterface interface { - Create(*v1.TestType) (*v1.TestType, error) - Update(*v1.TestType) (*v1.TestType, error) - UpdateStatus(*v1.TestType) (*v1.TestType, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.TestType, error) - List(opts metav1.ListOptions) (*v1.TestTypeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.TestType, err error) - TestTypeExpansion -} - -// testTypes implements TestTypeInterface -type testTypes struct { - client rest.Interface - ns string -} - -// newTestTypes returns a TestTypes -func newTestTypes(c *ExampleV1Client, namespace string) *testTypes { - return &testTypes{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. -func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.TestType, err error) { - result = &v1.TestType{} - err = c.client.Get(). - Namespace(c.ns). - Resource("testtypes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of TestTypes that match those selectors. -func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err error) { - result = &v1.TestTypeList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("testtypes"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested testTypes. -func (c *testTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("testtypes"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. -func (c *testTypes) Create(testType *v1.TestType) (result *v1.TestType, err error) { - result = &v1.TestType{} - err = c.client.Post(). - Namespace(c.ns). - Resource("testtypes"). - Body(testType). - Do(). - Into(result) - return -} - -// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. -func (c *testTypes) Update(testType *v1.TestType) (result *v1.TestType, err error) { - result = &v1.TestType{} - err = c.client.Put(). - Namespace(c.ns). - Resource("testtypes"). - Name(testType.Name). - Body(testType). - 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 *testTypes) UpdateStatus(testType *v1.TestType) (result *v1.TestType, err error) { - result = &v1.TestType{} - err = c.client.Put(). - Namespace(c.ns). - Resource("testtypes"). - Name(testType.Name). - SubResource("status"). - Body(testType). - Do(). - Into(result) - return -} - -// Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("testtypes"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("testtypes"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched testType. -func (c *testTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.TestType, err error) { - result = &v1.TestType{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("testtypes"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/v1/clustertesttype.go b/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/v1/clustertesttype.go deleted file mode 100644 index e0607c11a0..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/v1/clustertesttype.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - time "time" - - metav1 "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" - examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" - versioned "k8s.io/code-generator/_examples/MixedCase/clientset/versioned" - internalinterfaces "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces" - v1 "k8s.io/code-generator/_examples/MixedCase/listers/example/v1" -) - -// ClusterTestTypeInformer provides access to a shared informer and lister for -// ClusterTestTypes. -type ClusterTestTypeInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.ClusterTestTypeLister -} - -type clusterTestTypeInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewClusterTestTypeInformer constructs a new informer for ClusterTestType 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 NewClusterTestTypeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredClusterTestTypeInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredClusterTestTypeInformer constructs a new informer for ClusterTestType 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 NewFilteredClusterTestTypeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ExampleV1().ClusterTestTypes().List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ExampleV1().ClusterTestTypes().Watch(options) - }, - }, - &examplev1.ClusterTestType{}, - resyncPeriod, - indexers, - ) -} - -func (f *clusterTestTypeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredClusterTestTypeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *clusterTestTypeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&examplev1.ClusterTestType{}, f.defaultInformer) -} - -func (f *clusterTestTypeInformer) Lister() v1.ClusterTestTypeLister { - return v1.NewClusterTestTypeLister(f.Informer().GetIndexer()) -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/v1/interface.go b/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/v1/interface.go deleted file mode 100644 index 5389d07fbb..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/v1/interface.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - internalinterfaces "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // ClusterTestTypes returns a ClusterTestTypeInformer. - ClusterTestTypes() ClusterTestTypeInformer - // TestTypes returns a TestTypeInformer. - TestTypes() TestTypeInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// ClusterTestTypes returns a ClusterTestTypeInformer. -func (v *version) ClusterTestTypes() ClusterTestTypeInformer { - return &clusterTestTypeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// TestTypes returns a TestTypeInformer. -func (v *version) TestTypes() TestTypeInformer { - return &testTypeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/v1/testtype.go deleted file mode 100644 index 18f3b88d0d..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/v1/testtype.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - time "time" - - metav1 "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" - examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" - versioned "k8s.io/code-generator/_examples/MixedCase/clientset/versioned" - internalinterfaces "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces" - v1 "k8s.io/code-generator/_examples/MixedCase/listers/example/v1" -) - -// TestTypeInformer provides access to a shared informer and lister for -// TestTypes. -type TestTypeInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.TestTypeLister -} - -type testTypeInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewTestTypeInformer constructs a new informer for TestType 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 NewTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredTestTypeInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredTestTypeInformer constructs a new informer for TestType 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 NewFilteredTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ExampleV1().TestTypes(namespace).List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ExampleV1().TestTypes(namespace).Watch(options) - }, - }, - &examplev1.TestType{}, - resyncPeriod, - indexers, - ) -} - -func (f *testTypeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredTestTypeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *testTypeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&examplev1.TestType{}, f.defaultInformer) -} - -func (f *testTypeInformer) Lister() v1.TestTypeLister { - return v1.NewTestTypeLister(f.Informer().GetIndexer()) -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/factory.go b/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/factory.go deleted file mode 100644 index 5a2d8f7487..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/factory.go +++ /dev/null @@ -1,180 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - reflect "reflect" - sync "sync" - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/code-generator/_examples/MixedCase/clientset/versioned" - example "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example" - internalinterfaces "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces" -) - -// SharedInformerOption defines the functional option type for SharedInformerFactory. -type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory - -type sharedInformerFactory struct { - client versioned.Interface - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc - lock sync.Mutex - defaultResync time.Duration - customResync map[reflect.Type]time.Duration - - informers map[reflect.Type]cache.SharedIndexInformer - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[reflect.Type]bool -} - -// WithCustomResyncConfig sets a custom resync period for the specified informer types. -func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - for k, v := range resyncConfig { - factory.customResync[reflect.TypeOf(k)] = v - } - return factory - } -} - -// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. -func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.tweakListOptions = tweakListOptions - return factory - } -} - -// WithNamespace limits the SharedInformerFactory to the specified namespace. -func WithNamespace(namespace string) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.namespace = namespace - return factory - } -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. -func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -// Deprecated: Please use NewSharedInformerFactoryWithOptions instead -func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) -} - -// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. -func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { - factory := &sharedInformerFactory{ - client: client, - namespace: v1.NamespaceAll, - defaultResync: defaultResync, - informers: make(map[reflect.Type]cache.SharedIndexInformer), - startedInformers: make(map[reflect.Type]bool), - customResync: make(map[reflect.Type]time.Duration), - } - - // Apply all options - for _, opt := range options { - factory = opt(factory) - } - - return factory -} - -// Start initializes all requested informers. -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - go informer.Run(stopCh) - f.startedInformers[informerType] = true - } - } -} - -// WaitForCacheSync waits for all started informers' cache were synced. -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func() map[reflect.Type]cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InternalInformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - - resyncPeriod, exists := f.customResync[informerType] - if !exists { - resyncPeriod = f.defaultResync - } - - informer = newFunc(f.client, resyncPeriod) - f.informers[informerType] = informer - - return informer -} - -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -type SharedInformerFactory interface { - internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - Example() example.Interface -} - -func (f *sharedInformerFactory) Example() example.Interface { - return example.New(f, f.namespace, f.tweakListOptions) -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/generic.go b/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/generic.go deleted file mode 100644 index e039c8edfb..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/generic.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - "fmt" - - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" - v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" -) - -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() cache.SharedIndexInformer - Lister() cache.GenericLister -} - -type genericInformer struct { - informer cache.SharedIndexInformer - resource schema.GroupResource -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() cache.GenericLister { - return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) -} - -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { - switch resource { - // Group=example.crd.code-generator.k8s.io, Version=v1 - case v1.SchemeGroupVersion.WithResource("clustertesttypes"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Example().V1().ClusterTestTypes().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("testtypes"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Example().V1().TestTypes().Informer()}, nil - - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces/factory_interfaces.go deleted file mode 100644 index 2ed31b44dd..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalinterfaces - -import ( - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/code-generator/_examples/MixedCase/clientset/versioned" -) - -// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. -type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer -} - -// TweakListOptionsFunc is a function that transforms a v1.ListOptions. -type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/listers/example/v1/clustertesttype.go b/vendor/k8s.io/code-generator/_examples/MixedCase/listers/example/v1/clustertesttype.go deleted file mode 100644 index 8e93b73f91..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/listers/example/v1/clustertesttype.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -import ( - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" - v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" -) - -// ClusterTestTypeLister helps list ClusterTestTypes. -type ClusterTestTypeLister interface { - // List lists all ClusterTestTypes in the indexer. - List(selector labels.Selector) (ret []*v1.ClusterTestType, err error) - // Get retrieves the ClusterTestType from the index for a given name. - Get(name string) (*v1.ClusterTestType, error) - ClusterTestTypeListerExpansion -} - -// clusterTestTypeLister implements the ClusterTestTypeLister interface. -type clusterTestTypeLister struct { - indexer cache.Indexer -} - -// NewClusterTestTypeLister returns a new ClusterTestTypeLister. -func NewClusterTestTypeLister(indexer cache.Indexer) ClusterTestTypeLister { - return &clusterTestTypeLister{indexer: indexer} -} - -// List lists all ClusterTestTypes in the indexer. -func (s *clusterTestTypeLister) List(selector labels.Selector) (ret []*v1.ClusterTestType, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ClusterTestType)) - }) - return ret, err -} - -// Get retrieves the ClusterTestType from the index for a given name. -func (s *clusterTestTypeLister) Get(name string) (*v1.ClusterTestType, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("clustertesttype"), name) - } - return obj.(*v1.ClusterTestType), nil -} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/listers/example/v1/expansion_generated.go b/vendor/k8s.io/code-generator/_examples/MixedCase/listers/example/v1/expansion_generated.go deleted file mode 100644 index 2681a29f47..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/listers/example/v1/expansion_generated.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -// ClusterTestTypeListerExpansion allows custom methods to be added to -// ClusterTestTypeLister. -type ClusterTestTypeListerExpansion interface{} - -// TestTypeListerExpansion allows custom methods to be added to -// TestTypeLister. -type TestTypeListerExpansion interface{} - -// TestTypeNamespaceListerExpansion allows custom methods to be added to -// TestTypeNamespaceLister. -type TestTypeNamespaceListerExpansion interface{} diff --git a/vendor/k8s.io/code-generator/_examples/MixedCase/listers/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/MixedCase/listers/example/v1/testtype.go deleted file mode 100644 index 292dcedd0b..0000000000 --- a/vendor/k8s.io/code-generator/_examples/MixedCase/listers/example/v1/testtype.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -import ( - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" - v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" -) - -// TestTypeLister helps list TestTypes. -type TestTypeLister interface { - // List lists all TestTypes in the indexer. - List(selector labels.Selector) (ret []*v1.TestType, err error) - // TestTypes returns an object that can list and get TestTypes. - TestTypes(namespace string) TestTypeNamespaceLister - TestTypeListerExpansion -} - -// testTypeLister implements the TestTypeLister interface. -type testTypeLister struct { - indexer cache.Indexer -} - -// NewTestTypeLister returns a new TestTypeLister. -func NewTestTypeLister(indexer cache.Indexer) TestTypeLister { - return &testTypeLister{indexer: indexer} -} - -// List lists all TestTypes in the indexer. -func (s *testTypeLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.TestType)) - }) - return ret, err -} - -// TestTypes returns an object that can list and get TestTypes. -func (s *testTypeLister) TestTypes(namespace string) TestTypeNamespaceLister { - return testTypeNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// TestTypeNamespaceLister helps list and get TestTypes. -type TestTypeNamespaceLister interface { - // List lists all TestTypes in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1.TestType, err error) - // Get retrieves the TestType from the indexer for a given namespace and name. - Get(name string) (*v1.TestType, error) - TestTypeNamespaceListerExpansion -} - -// testTypeNamespaceLister implements the TestTypeNamespaceLister -// interface. -type testTypeNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all TestTypes in the indexer for a given namespace. -func (s testTypeNamespaceLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.TestType)) - }) - return ret, err -} - -// Get retrieves the TestType from the indexer for a given namespace and name. -func (s testTypeNamespaceLister) Get(name string) (*v1.TestType, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("testtype"), name) - } - return obj.(*v1.TestType), nil -} diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/doc.go index 3285a056fa..b221d7eb49 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/doc.go @@ -16,5 +16,4 @@ limitations under the License. // +k8s:deepcopy-gen=package // +groupName=example.apiserver.code-generator.k8s.io - package example // import "k8s.io/code-generator/_examples/apiserver/apis/example" diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/doc.go index 6b1fe6c119..5b6bd5b306 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/doc.go @@ -18,5 +18,4 @@ limitations under the License. // +k8s:defaulter-gen=TypeMeta // +k8s:conversion-gen=k8s.io/code-generator/_examples/apiserver/apis/example // +groupName=example.apiserver.code-generator.k8s.io - package v1 diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversion.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversion.go index ba47dbe2e6..811031685c 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversion.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversion.go @@ -34,38 +34,15 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*TestType)(nil), (*example.TestType)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TestType_To_example_TestType(a.(*TestType), b.(*example.TestType), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*example.TestType)(nil), (*TestType)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_example_TestType_To_v1_TestType(a.(*example.TestType), b.(*TestType), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*TestTypeList)(nil), (*example.TestTypeList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TestTypeList_To_example_TestTypeList(a.(*TestTypeList), b.(*example.TestTypeList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*example.TestTypeList)(nil), (*TestTypeList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_example_TestTypeList_To_v1_TestTypeList(a.(*example.TestTypeList), b.(*TestTypeList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*TestTypeStatus)(nil), (*example.TestTypeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TestTypeStatus_To_example_TestTypeStatus(a.(*TestTypeStatus), b.(*example.TestTypeStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*example.TestTypeStatus)(nil), (*TestTypeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_example_TestTypeStatus_To_v1_TestTypeStatus(a.(*example.TestTypeStatus), b.(*TestTypeStatus), scope) - }); err != nil { - return err - } - return nil +func RegisterConversions(scheme *runtime.Scheme) error { + return scheme.AddGeneratedConversionFuncs( + Convert_v1_TestType_To_example_TestType, + Convert_example_TestType_To_v1_TestType, + Convert_v1_TestTypeList_To_example_TestTypeList, + Convert_example_TestTypeList_To_v1_TestTypeList, + Convert_v1_TestTypeStatus_To_example_TestTypeStatus, + Convert_example_TestTypeStatus_To_v1_TestTypeStatus, + ) } func autoConvert_v1_TestType_To_example_TestType(in *TestType, out *example.TestType, s conversion.Scope) error { diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/doc.go index 0edb56dcdd..3864803757 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/doc.go @@ -17,5 +17,4 @@ limitations under the License. // +k8s:deepcopy-gen=package // +groupName=example.test.apiserver.code-generator.k8s.io // +groupGoName=SecondExample - package example2 // import "k8s.io/code-generator/_examples/apiserver/apis/example2" diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/doc.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/doc.go index 211aefc8c4..36bd4549cd 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/doc.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/doc.go @@ -19,5 +19,4 @@ limitations under the License. // +groupName=example.test.apiserver.code-generator.k8s.io // +k8s:conversion-gen=k8s.io/code-generator/_examples/apiserver/apis/example2 // +groupGoName=SecondExample - package v1 diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go index 5bf9a98e95..88bf603d07 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go @@ -34,38 +34,15 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*TestType)(nil), (*example2.TestType)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TestType_To_example2_TestType(a.(*TestType), b.(*example2.TestType), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*example2.TestType)(nil), (*TestType)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_example2_TestType_To_v1_TestType(a.(*example2.TestType), b.(*TestType), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*TestTypeList)(nil), (*example2.TestTypeList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TestTypeList_To_example2_TestTypeList(a.(*TestTypeList), b.(*example2.TestTypeList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*example2.TestTypeList)(nil), (*TestTypeList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_example2_TestTypeList_To_v1_TestTypeList(a.(*example2.TestTypeList), b.(*TestTypeList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*TestTypeStatus)(nil), (*example2.TestTypeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_TestTypeStatus_To_example2_TestTypeStatus(a.(*TestTypeStatus), b.(*example2.TestTypeStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*example2.TestTypeStatus)(nil), (*TestTypeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_example2_TestTypeStatus_To_v1_TestTypeStatus(a.(*example2.TestTypeStatus), b.(*TestTypeStatus), scope) - }); err != nil { - return err - } - return nil +func RegisterConversions(scheme *runtime.Scheme) error { + return scheme.AddGeneratedConversionFuncs( + Convert_v1_TestType_To_example2_TestType, + Convert_example2_TestType_To_v1_TestType, + Convert_v1_TestTypeList_To_example2_TestTypeList, + Convert_example2_TestTypeList_To_v1_TestTypeList, + Convert_v1_TestTypeStatus_To_example2_TestTypeStatus, + Convert_example2_TestTypeStatus_To_v1_TestTypeStatus, + ) } func autoConvert_v1_TestType_To_example2_TestType(in *TestType, out *example2.TestType, s conversion.Scope) error { diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go index 5713015ce5..58b47c9faa 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go @@ -23,7 +23,6 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" exampleinternalversion "k8s.io/code-generator/_examples/apiserver/apis/example" secondexampleinternalversion "k8s.io/code-generator/_examples/apiserver/apis/example2" ) @@ -31,9 +30,10 @@ import ( var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - exampleinternalversion.AddToScheme, - secondexampleinternalversion.AddToScheme, + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + AddToScheme(scheme) } // AddToScheme adds all types of this clientset into the given scheme. This allows composition @@ -46,13 +46,11 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // ) // // kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) +func AddToScheme(scheme *runtime.Scheme) { + exampleinternalversion.AddToScheme(scheme) + secondexampleinternalversion.AddToScheme(scheme) } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go index abff7bb0d6..7b247ca950 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go @@ -131,7 +131,7 @@ func (c *FakeTestTypes) DeleteCollection(options *v1.DeleteOptions, listOptions // Patch applies the patch and returns the patched testType. func (c *FakeTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *example.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &example.TestType{}) + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, data, subresources...), &example.TestType{}) if obj == nil { return nil, err diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go index 0d63cf1033..2890ff19d5 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go @@ -131,7 +131,7 @@ func (c *FakeTestTypes) DeleteCollection(options *v1.DeleteOptions, listOptions // Patch applies the patch and returns the patched testType. func (c *FakeTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *example2.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &example2.TestType{}) + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, data, subresources...), &example2.TestType{}) if obj == nil { return nil, err diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/register.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/register.go index 75282b82f0..79e2005008 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/register.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/fake/register.go @@ -23,7 +23,6 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" examplev1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" secondexamplev1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" ) @@ -31,9 +30,10 @@ import ( var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - examplev1.AddToScheme, - secondexamplev1.AddToScheme, + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + AddToScheme(scheme) } // AddToScheme adds all types of this clientset into the given scheme. This allows composition @@ -46,13 +46,11 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // ) // // kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) +func AddToScheme(scheme *runtime.Scheme) { + examplev1.AddToScheme(scheme) + secondexamplev1.AddToScheme(scheme) } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go index e4c8dc1020..16f0196a81 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go @@ -23,7 +23,6 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" examplev1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" secondexamplev1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" ) @@ -31,9 +30,10 @@ import ( var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - examplev1.AddToScheme, - secondexamplev1.AddToScheme, + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + AddToScheme(Scheme) } // AddToScheme adds all types of this clientset into the given scheme. This allows composition @@ -46,13 +46,11 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // ) // // kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) +func AddToScheme(scheme *runtime.Scheme) { + examplev1.AddToScheme(scheme) + secondexamplev1.AddToScheme(scheme) } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go index f7e2aacdee..100de18092 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go @@ -25,7 +25,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - examplev1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" + example_v1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" ) // FakeTestTypes implements TestTypeInterface @@ -39,20 +39,20 @@ var testtypesResource = schema.GroupVersionResource{Group: "example.apiserver.co var testtypesKind = schema.GroupVersionKind{Group: "example.apiserver.code-generator.k8s.io", Version: "v1", Kind: "TestType"} // Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. -func (c *FakeTestTypes) Get(name string, options v1.GetOptions) (result *examplev1.TestType, err error) { +func (c *FakeTestTypes) Get(name string, options v1.GetOptions) (result *example_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &examplev1.TestType{}) + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &example_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.TestType), err + return obj.(*example_v1.TestType), err } // List takes label and field selectors, and returns the list of TestTypes that match those selectors. -func (c *FakeTestTypes) List(opts v1.ListOptions) (result *examplev1.TestTypeList, err error) { +func (c *FakeTestTypes) List(opts v1.ListOptions) (result *example_v1.TestTypeList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &examplev1.TestTypeList{}) + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &example_v1.TestTypeList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeTestTypes) List(opts v1.ListOptions) (result *examplev1.TestTypeLis if label == nil { label = labels.Everything() } - list := &examplev1.TestTypeList{ListMeta: obj.(*examplev1.TestTypeList).ListMeta} - for _, item := range obj.(*examplev1.TestTypeList).Items { + list := &example_v1.TestTypeList{ListMeta: obj.(*example_v1.TestTypeList).ListMeta} + for _, item := range obj.(*example_v1.TestTypeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakeTestTypes) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. -func (c *FakeTestTypes) Create(testType *examplev1.TestType) (result *examplev1.TestType, err error) { +func (c *FakeTestTypes) Create(testType *example_v1.TestType) (result *example_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &example_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.TestType), err + return obj.(*example_v1.TestType), err } // Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. -func (c *FakeTestTypes) Update(testType *examplev1.TestType) (result *examplev1.TestType, err error) { +func (c *FakeTestTypes) Update(testType *example_v1.TestType) (result *example_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &example_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.TestType), err + return obj.(*example_v1.TestType), 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 *FakeTestTypes) UpdateStatus(testType *examplev1.TestType) (*examplev1.TestType, error) { +func (c *FakeTestTypes) UpdateStatus(testType *example_v1.TestType) (*example_v1.TestType, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &examplev1.TestType{}) + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &example_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.TestType), err + return obj.(*example_v1.TestType), err } // Delete takes name of the testType and deletes it. Returns an error if one occurs. func (c *FakeTestTypes) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &examplev1.TestType{}) + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example_v1.TestType{}) return err } @@ -124,17 +124,17 @@ func (c *FakeTestTypes) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeTestTypes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &examplev1.TestTypeList{}) + _, err := c.Fake.Invokes(action, &example_v1.TestTypeList{}) return err } // Patch applies the patch and returns the patched testType. -func (c *FakeTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *examplev1.TestType, err error) { +func (c *FakeTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *example_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &examplev1.TestType{}) + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, data, subresources...), &example_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.TestType), err + return obj.(*example_v1.TestType), err } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go index 2a0606512f..d9aa3c5d6f 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + meta_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" @@ -38,11 +38,11 @@ type TestTypeInterface interface { Create(*v1.TestType) (*v1.TestType, error) Update(*v1.TestType) (*v1.TestType, error) UpdateStatus(*v1.TestType) (*v1.TestType, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.TestType, error) - List(opts metav1.ListOptions) (*v1.TestTypeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.TestType, error) + List(opts meta_v1.ListOptions) (*v1.TestTypeList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.TestType, err error) TestTypeExpansion } @@ -62,7 +62,7 @@ func newTestTypes(c *ExampleV1Client, namespace string) *testTypes { } // Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. -func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.TestType, err error) { +func (c *testTypes) Get(name string, options meta_v1.GetOptions) (result *v1.TestType, err error) { result = &v1.TestType{} err = c.client.Get(). Namespace(c.ns). @@ -75,7 +75,7 @@ func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.Test } // List takes label and field selectors, and returns the list of TestTypes that match those selectors. -func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err error) { +func (c *testTypes) List(opts meta_v1.ListOptions) (result *v1.TestTypeList, err error) { result = &v1.TestTypeList{} err = c.client.Get(). Namespace(c.ns). @@ -87,7 +87,7 @@ func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err } // Watch returns a watch.Interface that watches the requested testTypes. -func (c *testTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *testTypes) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { opts.Watch = true return c.client.Get(). Namespace(c.ns). @@ -138,7 +138,7 @@ func (c *testTypes) UpdateStatus(testType *v1.TestType) (result *v1.TestType, er } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { +func (c *testTypes) Delete(name string, options *meta_v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). @@ -149,7 +149,7 @@ func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *testTypes) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go index ce0782e6e0..296975e4d3 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go @@ -25,7 +25,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - example2v1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" + example2_v1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" ) // FakeTestTypes implements TestTypeInterface @@ -39,20 +39,20 @@ var testtypesResource = schema.GroupVersionResource{Group: "example.test.apiserv var testtypesKind = schema.GroupVersionKind{Group: "example.test.apiserver.code-generator.k8s.io", Version: "v1", Kind: "TestType"} // Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. -func (c *FakeTestTypes) Get(name string, options v1.GetOptions) (result *example2v1.TestType, err error) { +func (c *FakeTestTypes) Get(name string, options v1.GetOptions) (result *example2_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &example2v1.TestType{}) + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &example2_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*example2v1.TestType), err + return obj.(*example2_v1.TestType), err } // List takes label and field selectors, and returns the list of TestTypes that match those selectors. -func (c *FakeTestTypes) List(opts v1.ListOptions) (result *example2v1.TestTypeList, err error) { +func (c *FakeTestTypes) List(opts v1.ListOptions) (result *example2_v1.TestTypeList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &example2v1.TestTypeList{}) + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &example2_v1.TestTypeList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeTestTypes) List(opts v1.ListOptions) (result *example2v1.TestTypeLi if label == nil { label = labels.Everything() } - list := &example2v1.TestTypeList{ListMeta: obj.(*example2v1.TestTypeList).ListMeta} - for _, item := range obj.(*example2v1.TestTypeList).Items { + list := &example2_v1.TestTypeList{ListMeta: obj.(*example2_v1.TestTypeList).ListMeta} + for _, item := range obj.(*example2_v1.TestTypeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakeTestTypes) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. -func (c *FakeTestTypes) Create(testType *example2v1.TestType) (result *example2v1.TestType, err error) { +func (c *FakeTestTypes) Create(testType *example2_v1.TestType) (result *example2_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &example2v1.TestType{}) + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &example2_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*example2v1.TestType), err + return obj.(*example2_v1.TestType), err } // Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. -func (c *FakeTestTypes) Update(testType *example2v1.TestType) (result *example2v1.TestType, err error) { +func (c *FakeTestTypes) Update(testType *example2_v1.TestType) (result *example2_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &example2v1.TestType{}) + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &example2_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*example2v1.TestType), err + return obj.(*example2_v1.TestType), 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 *FakeTestTypes) UpdateStatus(testType *example2v1.TestType) (*example2v1.TestType, error) { +func (c *FakeTestTypes) UpdateStatus(testType *example2_v1.TestType) (*example2_v1.TestType, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &example2v1.TestType{}) + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &example2_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*example2v1.TestType), err + return obj.(*example2_v1.TestType), err } // Delete takes name of the testType and deletes it. Returns an error if one occurs. func (c *FakeTestTypes) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example2v1.TestType{}) + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example2_v1.TestType{}) return err } @@ -124,17 +124,17 @@ func (c *FakeTestTypes) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeTestTypes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &example2v1.TestTypeList{}) + _, err := c.Fake.Invokes(action, &example2_v1.TestTypeList{}) return err } // Patch applies the patch and returns the patched testType. -func (c *FakeTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *example2v1.TestType, err error) { +func (c *FakeTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *example2_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &example2v1.TestType{}) + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, data, subresources...), &example2_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*example2v1.TestType), err + return obj.(*example2_v1.TestType), err } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go index b29bd8118b..f199ee0922 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + meta_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" @@ -38,11 +38,11 @@ type TestTypeInterface interface { Create(*v1.TestType) (*v1.TestType, error) Update(*v1.TestType) (*v1.TestType, error) UpdateStatus(*v1.TestType) (*v1.TestType, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.TestType, error) - List(opts metav1.ListOptions) (*v1.TestTypeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.TestType, error) + List(opts meta_v1.ListOptions) (*v1.TestTypeList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.TestType, err error) TestTypeExpansion } @@ -62,7 +62,7 @@ func newTestTypes(c *SecondExampleV1Client, namespace string) *testTypes { } // Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. -func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.TestType, err error) { +func (c *testTypes) Get(name string, options meta_v1.GetOptions) (result *v1.TestType, err error) { result = &v1.TestType{} err = c.client.Get(). Namespace(c.ns). @@ -75,7 +75,7 @@ func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.Test } // List takes label and field selectors, and returns the list of TestTypes that match those selectors. -func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err error) { +func (c *testTypes) List(opts meta_v1.ListOptions) (result *v1.TestTypeList, err error) { result = &v1.TestTypeList{} err = c.client.Get(). Namespace(c.ns). @@ -87,7 +87,7 @@ func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err } // Watch returns a watch.Interface that watches the requested testTypes. -func (c *testTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *testTypes) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { opts.Watch = true return c.client.Get(). Namespace(c.ns). @@ -138,7 +138,7 @@ func (c *testTypes) UpdateStatus(testType *v1.TestType) (result *v1.TestType, er } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { +func (c *testTypes) Delete(name string, options *meta_v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). @@ -149,7 +149,7 @@ func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *testTypes) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1/testtype.go index 025113612c..84fc62975a 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1/testtype.go @@ -21,11 +21,11 @@ package v1 import ( time "time" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + meta_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" - examplev1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" + example_v1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned" internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" v1 "k8s.io/code-generator/_examples/apiserver/listers/example/v1" @@ -57,20 +57,20 @@ func NewTestTypeInformer(client versioned.Interface, namespace string, resyncPer func NewFilteredTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExampleV1().TestTypes(namespace).List(options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExampleV1().TestTypes(namespace).Watch(options) }, }, - &examplev1.TestType{}, + &example_v1.TestType{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *testTypeInformer) defaultInformer(client versioned.Interface, resyncPer } func (f *testTypeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&examplev1.TestType{}, f.defaultInformer) + return f.factory.InformerFor(&example_v1.TestType{}, f.defaultInformer) } func (f *testTypeInformer) Lister() v1.TestTypeLister { diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go index 979ee4d589..1d366be5ad 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go @@ -21,11 +21,11 @@ package v1 import ( time "time" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + meta_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" - example2v1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" + example2_v1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned" internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" v1 "k8s.io/code-generator/_examples/apiserver/listers/example2/v1" @@ -57,20 +57,20 @@ func NewTestTypeInformer(client versioned.Interface, namespace string, resyncPer func NewFilteredTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.SecondExampleV1().TestTypes(namespace).List(options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.SecondExampleV1().TestTypes(namespace).Watch(options) }, }, - &example2v1.TestType{}, + &example2_v1.TestType{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *testTypeInformer) defaultInformer(client versioned.Interface, resyncPer } func (f *testTypeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&example2v1.TestType{}, f.defaultInformer) + return f.factory.InformerFor(&example2_v1.TestType{}, f.defaultInformer) } func (f *testTypeInformer) Lister() v1.TestTypeLister { diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/generic.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/generic.go index feb7b2028f..aee8fad34a 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/generic.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/generic.go @@ -24,7 +24,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" v1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" - example2v1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" + example2_v1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other @@ -58,7 +58,7 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Example().V1().TestTypes().Informer()}, nil // Group=example.test.apiserver.code-generator.k8s.io, Version=v1 - case example2v1.SchemeGroupVersion.WithResource("testtypes"): + case example2_v1.SchemeGroupVersion.WithResource("testtypes"): return &genericInformer{resource: resource.GroupResource(), informer: f.SecondExample().V1().TestTypes().Informer()}, nil } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces/factory_interfaces.go index 21c6669028..6318f52841 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -27,7 +27,6 @@ import ( versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned" ) -// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer // SharedInformerFactory a small interface to allow for adding an informer without an import cycle @@ -36,5 +35,4 @@ type SharedInformerFactory interface { InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer } -// TweakListOptionsFunc is a function that transforms a v1.ListOptions. type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/testtype.go index 22d7610567..3745a315d0 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/testtype.go @@ -26,7 +26,7 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" example "k8s.io/code-generator/_examples/apiserver/apis/example" - clientsetinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" + clientset_internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" internalversion "k8s.io/code-generator/_examples/apiserver/listers/example/internalversion" ) @@ -47,14 +47,14 @@ type testTypeInformer struct { // NewTestTypeInformer constructs a new informer for TestType 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 NewTestTypeInformer(client clientsetinternalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { +func NewTestTypeInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredTestTypeInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredTestTypeInformer constructs a new informer for TestType 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 NewFilteredTestTypeInformer(client clientsetinternalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredTestTypeInformer(client clientset_internalversion.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) { @@ -76,7 +76,7 @@ func NewFilteredTestTypeInformer(client clientsetinternalversion.Interface, name ) } -func (f *testTypeInformer) defaultInformer(client clientsetinternalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { +func (f *testTypeInformer) defaultInformer(client clientset_internalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredTestTypeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go index dcac2ce84b..51518210df 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go @@ -26,7 +26,7 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" example2 "k8s.io/code-generator/_examples/apiserver/apis/example2" - clientsetinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" + clientset_internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" internalversion "k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion" ) @@ -47,14 +47,14 @@ type testTypeInformer struct { // NewTestTypeInformer constructs a new informer for TestType 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 NewTestTypeInformer(client clientsetinternalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { +func NewTestTypeInformer(client clientset_internalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredTestTypeInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredTestTypeInformer constructs a new informer for TestType 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 NewFilteredTestTypeInformer(client clientsetinternalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredTestTypeInformer(client clientset_internalversion.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) { @@ -76,7 +76,7 @@ func NewFilteredTestTypeInformer(client clientsetinternalversion.Interface, name ) } -func (f *testTypeInformer) defaultInformer(client clientsetinternalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { +func (f *testTypeInformer) defaultInformer(client clientset_internalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredTestTypeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } diff --git a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces/factory_interfaces.go index 5d01820f9c..03c679244d 100644 --- a/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces/factory_interfaces.go +++ b/vendor/k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces/factory_interfaces.go @@ -27,7 +27,6 @@ import ( internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" ) -// NewInformerFunc takes internalversion.Interface and time.Duration to return a SharedIndexInformer. type NewInformerFunc func(internalversion.Interface, time.Duration) cache.SharedIndexInformer // SharedInformerFactory a small interface to allow for adding an informer without an import cycle @@ -36,5 +35,4 @@ type SharedInformerFactory interface { InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer } -// TweakListOptionsFunc is a function that transforms a v1.ListOptions. type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/vendor/k8s.io/code-generator/_examples/crd/apis/example/v1/doc.go b/vendor/k8s.io/code-generator/_examples/crd/apis/example/v1/doc.go index 673ac55d7b..e6614c0da6 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/apis/example/v1/doc.go +++ b/vendor/k8s.io/code-generator/_examples/crd/apis/example/v1/doc.go @@ -17,5 +17,4 @@ limitations under the License. // +k8s:deepcopy-gen=package // +k8s:defaulter-gen=TypeMeta // +groupName=example.crd.code-generator.k8s.io - package v1 diff --git a/vendor/k8s.io/code-generator/_examples/crd/apis/example2/v1/doc.go b/vendor/k8s.io/code-generator/_examples/crd/apis/example2/v1/doc.go index 5d1cbec5ef..6521d83ff3 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/apis/example2/v1/doc.go +++ b/vendor/k8s.io/code-generator/_examples/crd/apis/example2/v1/doc.go @@ -18,5 +18,4 @@ limitations under the License. // +k8s:defaulter-gen=TypeMeta // +groupName=example.test.crd.code-generator.k8s.io // +groupGoName=SecondExample - package v1 diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/register.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/register.go index f3fd49d0da..d91e79dac3 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/register.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/fake/register.go @@ -23,7 +23,6 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" secondexamplev1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" ) @@ -31,9 +30,10 @@ import ( var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - examplev1.AddToScheme, - secondexamplev1.AddToScheme, + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + AddToScheme(scheme) } // AddToScheme adds all types of this clientset into the given scheme. This allows composition @@ -46,13 +46,11 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // ) // // kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) +func AddToScheme(scheme *runtime.Scheme) { + examplev1.AddToScheme(scheme) + secondexamplev1.AddToScheme(scheme) } diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/register.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/register.go index a98fc7ea77..7a5ad4f866 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/register.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/scheme/register.go @@ -23,7 +23,6 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" secondexamplev1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" ) @@ -31,9 +30,10 @@ import ( var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - examplev1.AddToScheme, - secondexamplev1.AddToScheme, + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + AddToScheme(Scheme) } // AddToScheme adds all types of this clientset into the given scheme. This allows composition @@ -46,13 +46,11 @@ var localSchemeBuilder = runtime.SchemeBuilder{ // ) // // kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) +func AddToScheme(scheme *runtime.Scheme) { + examplev1.AddToScheme(scheme) + secondexamplev1.AddToScheme(scheme) } diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go index 30e0e74980..a55b859e1f 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + meta_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" @@ -39,13 +39,13 @@ type ClusterTestTypeInterface interface { Create(*v1.ClusterTestType) (*v1.ClusterTestType, error) Update(*v1.ClusterTestType) (*v1.ClusterTestType, error) UpdateStatus(*v1.ClusterTestType) (*v1.ClusterTestType, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ClusterTestType, error) - List(opts metav1.ListOptions) (*v1.ClusterTestTypeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.ClusterTestType, error) + List(opts meta_v1.ListOptions) (*v1.ClusterTestTypeList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterTestType, err error) - GetScale(clusterTestTypeName string, options metav1.GetOptions) (*autoscaling.Scale, error) + GetScale(clusterTestTypeName string, options meta_v1.GetOptions) (*autoscaling.Scale, error) UpdateScale(clusterTestTypeName string, scale *autoscaling.Scale) (*autoscaling.Scale, error) ClusterTestTypeExpansion @@ -64,7 +64,7 @@ func newClusterTestTypes(c *ExampleV1Client) *clusterTestTypes { } // Get takes name of the clusterTestType, and returns the corresponding clusterTestType object, and an error if there is any. -func (c *clusterTestTypes) Get(name string, options metav1.GetOptions) (result *v1.ClusterTestType, err error) { +func (c *clusterTestTypes) Get(name string, options meta_v1.GetOptions) (result *v1.ClusterTestType, err error) { result = &v1.ClusterTestType{} err = c.client.Get(). Resource("clustertesttypes"). @@ -76,7 +76,7 @@ func (c *clusterTestTypes) Get(name string, options metav1.GetOptions) (result * } // List takes label and field selectors, and returns the list of ClusterTestTypes that match those selectors. -func (c *clusterTestTypes) List(opts metav1.ListOptions) (result *v1.ClusterTestTypeList, err error) { +func (c *clusterTestTypes) List(opts meta_v1.ListOptions) (result *v1.ClusterTestTypeList, err error) { result = &v1.ClusterTestTypeList{} err = c.client.Get(). Resource("clustertesttypes"). @@ -87,7 +87,7 @@ func (c *clusterTestTypes) List(opts metav1.ListOptions) (result *v1.ClusterTest } // Watch returns a watch.Interface that watches the requested clusterTestTypes. -func (c *clusterTestTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *clusterTestTypes) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { opts.Watch = true return c.client.Get(). Resource("clustertesttypes"). @@ -134,7 +134,7 @@ func (c *clusterTestTypes) UpdateStatus(clusterTestType *v1.ClusterTestType) (re } // Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. -func (c *clusterTestTypes) Delete(name string, options *metav1.DeleteOptions) error { +func (c *clusterTestTypes) Delete(name string, options *meta_v1.DeleteOptions) error { return c.client.Delete(). Resource("clustertesttypes"). Name(name). @@ -144,7 +144,7 @@ func (c *clusterTestTypes) Delete(name string, options *metav1.DeleteOptions) er } // DeleteCollection deletes a collection of objects. -func (c *clusterTestTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *clusterTestTypes) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { return c.client.Delete(). Resource("clustertesttypes"). VersionedParams(&listOptions, scheme.ParameterCodec). @@ -167,7 +167,7 @@ func (c *clusterTestTypes) Patch(name string, pt types.PatchType, data []byte, s } // GetScale takes name of the clusterTestType, and returns the corresponding autoscaling.Scale object, and an error if there is any. -func (c *clusterTestTypes) GetScale(clusterTestTypeName string, options metav1.GetOptions) (result *autoscaling.Scale, err error) { +func (c *clusterTestTypes) GetScale(clusterTestTypeName string, options meta_v1.GetOptions) (result *autoscaling.Scale, err error) { result = &autoscaling.Scale{} err = c.client.Get(). Resource("clustertesttypes"). diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go index 92d87b12fb..66eda8bc28 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go @@ -25,7 +25,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" + example_v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" ) @@ -39,19 +39,19 @@ var clustertesttypesResource = schema.GroupVersionResource{Group: "example.crd.c var clustertesttypesKind = schema.GroupVersionKind{Group: "example.crd.code-generator.k8s.io", Version: "v1", Kind: "ClusterTestType"} // Get takes name of the clusterTestType, and returns the corresponding clusterTestType object, and an error if there is any. -func (c *FakeClusterTestTypes) Get(name string, options v1.GetOptions) (result *examplev1.ClusterTestType, err error) { +func (c *FakeClusterTestTypes) Get(name string, options v1.GetOptions) (result *example_v1.ClusterTestType, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) + Invokes(testing.NewRootGetAction(clustertesttypesResource, name), &example_v1.ClusterTestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.ClusterTestType), err + return obj.(*example_v1.ClusterTestType), err } // List takes label and field selectors, and returns the list of ClusterTestTypes that match those selectors. -func (c *FakeClusterTestTypes) List(opts v1.ListOptions) (result *examplev1.ClusterTestTypeList, err error) { +func (c *FakeClusterTestTypes) List(opts v1.ListOptions) (result *example_v1.ClusterTestTypeList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(clustertesttypesResource, clustertesttypesKind, opts), &examplev1.ClusterTestTypeList{}) + Invokes(testing.NewRootListAction(clustertesttypesResource, clustertesttypesKind, opts), &example_v1.ClusterTestTypeList{}) if obj == nil { return nil, err } @@ -60,8 +60,8 @@ func (c *FakeClusterTestTypes) List(opts v1.ListOptions) (result *examplev1.Clus if label == nil { label = labels.Everything() } - list := &examplev1.ClusterTestTypeList{ListMeta: obj.(*examplev1.ClusterTestTypeList).ListMeta} - for _, item := range obj.(*examplev1.ClusterTestTypeList).Items { + list := &example_v1.ClusterTestTypeList{ListMeta: obj.(*example_v1.ClusterTestTypeList).ListMeta} + for _, item := range obj.(*example_v1.ClusterTestTypeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -76,40 +76,40 @@ func (c *FakeClusterTestTypes) Watch(opts v1.ListOptions) (watch.Interface, erro } // Create takes the representation of a clusterTestType and creates it. Returns the server's representation of the clusterTestType, and an error, if there is any. -func (c *FakeClusterTestTypes) Create(clusterTestType *examplev1.ClusterTestType) (result *examplev1.ClusterTestType, err error) { +func (c *FakeClusterTestTypes) Create(clusterTestType *example_v1.ClusterTestType) (result *example_v1.ClusterTestType, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clustertesttypesResource, clusterTestType), &examplev1.ClusterTestType{}) + Invokes(testing.NewRootCreateAction(clustertesttypesResource, clusterTestType), &example_v1.ClusterTestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.ClusterTestType), err + return obj.(*example_v1.ClusterTestType), err } // Update takes the representation of a clusterTestType and updates it. Returns the server's representation of the clusterTestType, and an error, if there is any. -func (c *FakeClusterTestTypes) Update(clusterTestType *examplev1.ClusterTestType) (result *examplev1.ClusterTestType, err error) { +func (c *FakeClusterTestTypes) Update(clusterTestType *example_v1.ClusterTestType) (result *example_v1.ClusterTestType, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clustertesttypesResource, clusterTestType), &examplev1.ClusterTestType{}) + Invokes(testing.NewRootUpdateAction(clustertesttypesResource, clusterTestType), &example_v1.ClusterTestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.ClusterTestType), err + return obj.(*example_v1.ClusterTestType), 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 *FakeClusterTestTypes) UpdateStatus(clusterTestType *examplev1.ClusterTestType) (*examplev1.ClusterTestType, error) { +func (c *FakeClusterTestTypes) UpdateStatus(clusterTestType *example_v1.ClusterTestType) (*example_v1.ClusterTestType, error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "status", clusterTestType), &examplev1.ClusterTestType{}) + Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "status", clusterTestType), &example_v1.ClusterTestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.ClusterTestType), err + return obj.(*example_v1.ClusterTestType), err } // Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. func (c *FakeClusterTestTypes) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) + Invokes(testing.NewRootDeleteAction(clustertesttypesResource, name), &example_v1.ClusterTestType{}) return err } @@ -117,24 +117,24 @@ func (c *FakeClusterTestTypes) Delete(name string, options *v1.DeleteOptions) er func (c *FakeClusterTestTypes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewRootDeleteCollectionAction(clustertesttypesResource, listOptions) - _, err := c.Fake.Invokes(action, &examplev1.ClusterTestTypeList{}) + _, err := c.Fake.Invokes(action, &example_v1.ClusterTestTypeList{}) return err } // Patch applies the patch and returns the patched clusterTestType. -func (c *FakeClusterTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *examplev1.ClusterTestType, err error) { +func (c *FakeClusterTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *example_v1.ClusterTestType, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustertesttypesResource, name, pt, data, subresources...), &examplev1.ClusterTestType{}) + Invokes(testing.NewRootPatchSubresourceAction(clustertesttypesResource, name, data, subresources...), &example_v1.ClusterTestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.ClusterTestType), err + return obj.(*example_v1.ClusterTestType), err } // GetScale takes name of the clusterTestType, and returns the corresponding scale object, and an error if there is any. func (c *FakeClusterTestTypes) GetScale(clusterTestTypeName string, options v1.GetOptions) (result *autoscaling.Scale, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(clustertesttypesResource, "scale", clusterTestTypeName), &autoscaling.Scale{}) + Invokes(testing.NewRootGetSubresourceAction(clustertesttypesResource, clusterTestTypeName), &autoscaling.Scale{}) if obj == nil { return nil, err } diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go index 3ef9885d2c..d925d9b394 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go @@ -25,7 +25,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" + example_v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" ) // FakeTestTypes implements TestTypeInterface @@ -39,20 +39,20 @@ var testtypesResource = schema.GroupVersionResource{Group: "example.crd.code-gen var testtypesKind = schema.GroupVersionKind{Group: "example.crd.code-generator.k8s.io", Version: "v1", Kind: "TestType"} // Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. -func (c *FakeTestTypes) Get(name string, options v1.GetOptions) (result *examplev1.TestType, err error) { +func (c *FakeTestTypes) Get(name string, options v1.GetOptions) (result *example_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &examplev1.TestType{}) + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &example_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.TestType), err + return obj.(*example_v1.TestType), err } // List takes label and field selectors, and returns the list of TestTypes that match those selectors. -func (c *FakeTestTypes) List(opts v1.ListOptions) (result *examplev1.TestTypeList, err error) { +func (c *FakeTestTypes) List(opts v1.ListOptions) (result *example_v1.TestTypeList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &examplev1.TestTypeList{}) + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &example_v1.TestTypeList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeTestTypes) List(opts v1.ListOptions) (result *examplev1.TestTypeLis if label == nil { label = labels.Everything() } - list := &examplev1.TestTypeList{ListMeta: obj.(*examplev1.TestTypeList).ListMeta} - for _, item := range obj.(*examplev1.TestTypeList).Items { + list := &example_v1.TestTypeList{ListMeta: obj.(*example_v1.TestTypeList).ListMeta} + for _, item := range obj.(*example_v1.TestTypeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakeTestTypes) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. -func (c *FakeTestTypes) Create(testType *examplev1.TestType) (result *examplev1.TestType, err error) { +func (c *FakeTestTypes) Create(testType *example_v1.TestType) (result *example_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &example_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.TestType), err + return obj.(*example_v1.TestType), err } // Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. -func (c *FakeTestTypes) Update(testType *examplev1.TestType) (result *examplev1.TestType, err error) { +func (c *FakeTestTypes) Update(testType *example_v1.TestType) (result *example_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &example_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.TestType), err + return obj.(*example_v1.TestType), 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 *FakeTestTypes) UpdateStatus(testType *examplev1.TestType) (*examplev1.TestType, error) { +func (c *FakeTestTypes) UpdateStatus(testType *example_v1.TestType) (*example_v1.TestType, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &examplev1.TestType{}) + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &example_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.TestType), err + return obj.(*example_v1.TestType), err } // Delete takes name of the testType and deletes it. Returns an error if one occurs. func (c *FakeTestTypes) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &examplev1.TestType{}) + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example_v1.TestType{}) return err } @@ -124,17 +124,17 @@ func (c *FakeTestTypes) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeTestTypes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &examplev1.TestTypeList{}) + _, err := c.Fake.Invokes(action, &example_v1.TestTypeList{}) return err } // Patch applies the patch and returns the patched testType. -func (c *FakeTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *examplev1.TestType, err error) { +func (c *FakeTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *example_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &examplev1.TestType{}) + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, data, subresources...), &example_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*examplev1.TestType), err + return obj.(*example_v1.TestType), err } diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go index 6fafb1e1b1..b5b510ff0e 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + meta_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" @@ -38,11 +38,11 @@ type TestTypeInterface interface { Create(*v1.TestType) (*v1.TestType, error) Update(*v1.TestType) (*v1.TestType, error) UpdateStatus(*v1.TestType) (*v1.TestType, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.TestType, error) - List(opts metav1.ListOptions) (*v1.TestTypeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.TestType, error) + List(opts meta_v1.ListOptions) (*v1.TestTypeList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.TestType, err error) TestTypeExpansion } @@ -62,7 +62,7 @@ func newTestTypes(c *ExampleV1Client, namespace string) *testTypes { } // Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. -func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.TestType, err error) { +func (c *testTypes) Get(name string, options meta_v1.GetOptions) (result *v1.TestType, err error) { result = &v1.TestType{} err = c.client.Get(). Namespace(c.ns). @@ -75,7 +75,7 @@ func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.Test } // List takes label and field selectors, and returns the list of TestTypes that match those selectors. -func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err error) { +func (c *testTypes) List(opts meta_v1.ListOptions) (result *v1.TestTypeList, err error) { result = &v1.TestTypeList{} err = c.client.Get(). Namespace(c.ns). @@ -87,7 +87,7 @@ func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err } // Watch returns a watch.Interface that watches the requested testTypes. -func (c *testTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *testTypes) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { opts.Watch = true return c.client.Get(). Namespace(c.ns). @@ -138,7 +138,7 @@ func (c *testTypes) UpdateStatus(testType *v1.TestType) (result *v1.TestType, er } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { +func (c *testTypes) Delete(name string, options *meta_v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). @@ -149,7 +149,7 @@ func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *testTypes) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go index c4efc6597d..8a51cbf8a4 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go @@ -25,7 +25,7 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - example2v1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" + example2_v1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" ) // FakeTestTypes implements TestTypeInterface @@ -39,20 +39,20 @@ var testtypesResource = schema.GroupVersionResource{Group: "example.test.crd.cod var testtypesKind = schema.GroupVersionKind{Group: "example.test.crd.code-generator.k8s.io", Version: "v1", Kind: "TestType"} // Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. -func (c *FakeTestTypes) Get(name string, options v1.GetOptions) (result *example2v1.TestType, err error) { +func (c *FakeTestTypes) Get(name string, options v1.GetOptions) (result *example2_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &example2v1.TestType{}) + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &example2_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*example2v1.TestType), err + return obj.(*example2_v1.TestType), err } // List takes label and field selectors, and returns the list of TestTypes that match those selectors. -func (c *FakeTestTypes) List(opts v1.ListOptions) (result *example2v1.TestTypeList, err error) { +func (c *FakeTestTypes) List(opts v1.ListOptions) (result *example2_v1.TestTypeList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &example2v1.TestTypeList{}) + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &example2_v1.TestTypeList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeTestTypes) List(opts v1.ListOptions) (result *example2v1.TestTypeLi if label == nil { label = labels.Everything() } - list := &example2v1.TestTypeList{ListMeta: obj.(*example2v1.TestTypeList).ListMeta} - for _, item := range obj.(*example2v1.TestTypeList).Items { + list := &example2_v1.TestTypeList{ListMeta: obj.(*example2_v1.TestTypeList).ListMeta} + for _, item := range obj.(*example2_v1.TestTypeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakeTestTypes) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. -func (c *FakeTestTypes) Create(testType *example2v1.TestType) (result *example2v1.TestType, err error) { +func (c *FakeTestTypes) Create(testType *example2_v1.TestType) (result *example2_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &example2v1.TestType{}) + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &example2_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*example2v1.TestType), err + return obj.(*example2_v1.TestType), err } // Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. -func (c *FakeTestTypes) Update(testType *example2v1.TestType) (result *example2v1.TestType, err error) { +func (c *FakeTestTypes) Update(testType *example2_v1.TestType) (result *example2_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &example2v1.TestType{}) + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &example2_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*example2v1.TestType), err + return obj.(*example2_v1.TestType), 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 *FakeTestTypes) UpdateStatus(testType *example2v1.TestType) (*example2v1.TestType, error) { +func (c *FakeTestTypes) UpdateStatus(testType *example2_v1.TestType) (*example2_v1.TestType, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &example2v1.TestType{}) + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &example2_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*example2v1.TestType), err + return obj.(*example2_v1.TestType), err } // Delete takes name of the testType and deletes it. Returns an error if one occurs. func (c *FakeTestTypes) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example2v1.TestType{}) + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example2_v1.TestType{}) return err } @@ -124,17 +124,17 @@ func (c *FakeTestTypes) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeTestTypes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &example2v1.TestTypeList{}) + _, err := c.Fake.Invokes(action, &example2_v1.TestTypeList{}) return err } // Patch applies the patch and returns the patched testType. -func (c *FakeTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *example2v1.TestType, err error) { +func (c *FakeTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *example2_v1.TestType, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &example2v1.TestType{}) + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, data, subresources...), &example2_v1.TestType{}) if obj == nil { return nil, err } - return obj.(*example2v1.TestType), err + return obj.(*example2_v1.TestType), err } diff --git a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go index 69b0e64c52..9691956eae 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + meta_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" @@ -38,11 +38,11 @@ type TestTypeInterface interface { Create(*v1.TestType) (*v1.TestType, error) Update(*v1.TestType) (*v1.TestType, error) UpdateStatus(*v1.TestType) (*v1.TestType, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.TestType, error) - List(opts metav1.ListOptions) (*v1.TestTypeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.TestType, error) + List(opts meta_v1.ListOptions) (*v1.TestTypeList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.TestType, err error) TestTypeExpansion } @@ -62,7 +62,7 @@ func newTestTypes(c *SecondExampleV1Client, namespace string) *testTypes { } // Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. -func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.TestType, err error) { +func (c *testTypes) Get(name string, options meta_v1.GetOptions) (result *v1.TestType, err error) { result = &v1.TestType{} err = c.client.Get(). Namespace(c.ns). @@ -75,7 +75,7 @@ func (c *testTypes) Get(name string, options metav1.GetOptions) (result *v1.Test } // List takes label and field selectors, and returns the list of TestTypes that match those selectors. -func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err error) { +func (c *testTypes) List(opts meta_v1.ListOptions) (result *v1.TestTypeList, err error) { result = &v1.TestTypeList{} err = c.client.Get(). Namespace(c.ns). @@ -87,7 +87,7 @@ func (c *testTypes) List(opts metav1.ListOptions) (result *v1.TestTypeList, err } // Watch returns a watch.Interface that watches the requested testTypes. -func (c *testTypes) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *testTypes) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { opts.Watch = true return c.client.Get(). Namespace(c.ns). @@ -138,7 +138,7 @@ func (c *testTypes) UpdateStatus(testType *v1.TestType) (result *v1.TestType, er } // Delete takes name of the testType and deletes it. Returns an error if one occurs. -func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { +func (c *testTypes) Delete(name string, options *meta_v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). @@ -149,7 +149,7 @@ func (c *testTypes) Delete(name string, options *metav1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *testTypes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *testTypes) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/clustertesttype.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/clustertesttype.go index 13c38e44fa..cef599f485 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/clustertesttype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/clustertesttype.go @@ -21,11 +21,11 @@ package v1 import ( time "time" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + meta_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" - examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" + example_v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" v1 "k8s.io/code-generator/_examples/crd/listers/example/v1" @@ -56,20 +56,20 @@ func NewClusterTestTypeInformer(client versioned.Interface, resyncPeriod time.Du func NewFilteredClusterTestTypeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExampleV1().ClusterTestTypes().List(options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExampleV1().ClusterTestTypes().Watch(options) }, }, - &examplev1.ClusterTestType{}, + &example_v1.ClusterTestType{}, resyncPeriod, indexers, ) @@ -80,7 +80,7 @@ func (f *clusterTestTypeInformer) defaultInformer(client versioned.Interface, re } func (f *clusterTestTypeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&examplev1.ClusterTestType{}, f.defaultInformer) + return f.factory.InformerFor(&example_v1.ClusterTestType{}, f.defaultInformer) } func (f *clusterTestTypeInformer) Lister() v1.ClusterTestTypeLister { diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/testtype.go index 47ca5b2872..04aa783374 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1/testtype.go @@ -21,11 +21,11 @@ package v1 import ( time "time" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + meta_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" - examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" + example_v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" v1 "k8s.io/code-generator/_examples/crd/listers/example/v1" @@ -57,20 +57,20 @@ func NewTestTypeInformer(client versioned.Interface, namespace string, resyncPer func NewFilteredTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExampleV1().TestTypes(namespace).List(options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.ExampleV1().TestTypes(namespace).Watch(options) }, }, - &examplev1.TestType{}, + &example_v1.TestType{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *testTypeInformer) defaultInformer(client versioned.Interface, resyncPer } func (f *testTypeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&examplev1.TestType{}, f.defaultInformer) + return f.factory.InformerFor(&example_v1.TestType{}, f.defaultInformer) } func (f *testTypeInformer) Lister() v1.TestTypeLister { diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1/testtype.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1/testtype.go index eb99c32d04..095237c451 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1/testtype.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1/testtype.go @@ -21,11 +21,11 @@ package v1 import ( time "time" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + meta_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" - example2v1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" + example2_v1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" v1 "k8s.io/code-generator/_examples/crd/listers/example2/v1" @@ -57,20 +57,20 @@ func NewTestTypeInformer(client versioned.Interface, namespace string, resyncPer func NewFilteredTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.SecondExampleV1().TestTypes(namespace).List(options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.SecondExampleV1().TestTypes(namespace).Watch(options) }, }, - &example2v1.TestType{}, + &example2_v1.TestType{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *testTypeInformer) defaultInformer(client versioned.Interface, resyncPer } func (f *testTypeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&example2v1.TestType{}, f.defaultInformer) + return f.factory.InformerFor(&example2_v1.TestType{}, f.defaultInformer) } func (f *testTypeInformer) Lister() v1.TestTypeLister { diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/generic.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/generic.go index f6b1174c6e..d89bd2a76f 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/generic.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/generic.go @@ -24,7 +24,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" - example2v1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" + example2_v1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other @@ -60,7 +60,7 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Example().V1().TestTypes().Informer()}, nil // Group=example.test.crd.code-generator.k8s.io, Version=v1 - case example2v1.SchemeGroupVersion.WithResource("testtypes"): + case example2_v1.SchemeGroupVersion.WithResource("testtypes"): return &genericInformer{resource: resource.GroupResource(), informer: f.SecondExample().V1().TestTypes().Informer()}, nil } diff --git a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces/factory_interfaces.go index 86d63f376f..02e0d6ac35 100644 --- a/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/vendor/k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -27,7 +27,6 @@ import ( versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" ) -// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer // SharedInformerFactory a small interface to allow for adding an informer without an import cycle @@ -36,5 +35,4 @@ type SharedInformerFactory interface { InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer } -// TweakListOptionsFunc is a function that transforms a v1.ListOptions. type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go index bf53687817..335e995c0a 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go @@ -130,7 +130,7 @@ func DefaultNameSystem() string { } func packageForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, clientsetPackage string, groupPackageName string, groupGoName string, apiPath string, srcTreePath string, inputPackage string, boilerplate []byte) generator.Package { - groupVersionClientPackage := filepath.Join(clientsetPackage, "typed", strings.ToLower(groupPackageName), strings.ToLower(gv.Version.NonEmpty())) + groupVersionClientPackage := strings.ToLower(filepath.Join(clientsetPackage, "typed", groupPackageName, gv.Version.NonEmpty())) return &generator.DefaultPackage{ PackageName: strings.ToLower(gv.Version.NonEmpty()), PackagePath: groupVersionClientPackage, diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go index 4b3854be6e..ec439c2f7a 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go @@ -30,9 +30,9 @@ import ( ) func PackageForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, clientsetPackage string, groupPackageName string, groupGoName string, inputPackage string, boilerplate []byte) generator.Package { - outputPackage := filepath.Join(clientsetPackage, "typed", strings.ToLower(groupPackageName), strings.ToLower(gv.Version.NonEmpty()), "fake") + outputPackage := strings.ToLower(filepath.Join(clientsetPackage, "typed", groupPackageName, gv.Version.NonEmpty(), "fake")) // TODO: should make this a function, called by here and in client-generator.go - realClientPackage := filepath.Join(clientsetPackage, "typed", strings.ToLower(groupPackageName), strings.ToLower(gv.Version.NonEmpty())) + realClientPackage := filepath.Join(clientsetPackage, "typed", groupPackageName, gv.Version.NonEmpty()) return &generator.DefaultPackage{ PackageName: "fake", PackagePath: outputPackage, diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go index 61b3334f40..f1225acb3d 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go @@ -60,12 +60,12 @@ func (g *genClientset) Imports(c *generator.Context) (imports []string) { imports = append(imports, g.imports.ImportLines()...) for _, group := range g.groups { for _, version := range group.Versions { - groupClientPackage := filepath.Join(g.fakeClientsetPackage, "typed", strings.ToLower(group.PackageName), strings.ToLower(version.NonEmpty())) + groupClientPackage := filepath.Join(g.fakeClientsetPackage, "typed", group.PackageName, version.NonEmpty()) fakeGroupClientPackage := filepath.Join(groupClientPackage, "fake") groupAlias := strings.ToLower(g.groupGoNames[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}]) - imports = append(imports, fmt.Sprintf("%s%s \"%s\"", groupAlias, strings.ToLower(version.NonEmpty()), groupClientPackage)) - imports = append(imports, fmt.Sprintf("fake%s%s \"%s\"", groupAlias, strings.ToLower(version.NonEmpty()), fakeGroupClientPackage)) + imports = append(imports, strings.ToLower(fmt.Sprintf("%s%s \"%s\"", groupAlias, version.NonEmpty(), groupClientPackage))) + imports = append(imports, strings.ToLower(fmt.Sprintf("fake%s%s \"%s\"", groupAlias, version.NonEmpty(), fakeGroupClientPackage))) } } // the package that has the clientset Interface diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go index 8f4d5785ef..675fa5f6f7 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go @@ -64,7 +64,7 @@ func (g *genFakeForGroup) Namers(c *generator.Context) namer.NameSystems { func (g *genFakeForGroup) Imports(c *generator.Context) (imports []string) { imports = g.imports.ImportLines() if len(g.types) != 0 { - imports = append(imports, fmt.Sprintf("%s \"%s\"", strings.ToLower(filepath.Base(g.realClientPackage)), g.realClientPackage)) + imports = append(imports, strings.ToLower(fmt.Sprintf("%s \"%s\"", filepath.Base(g.realClientPackage), g.realClientPackage))) } return imports } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go index f5888aef15..bf18c14c64 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go @@ -362,7 +362,7 @@ var getSubresourceTemplate = ` func (c *Fake$.type|publicPlural$) Get($.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { obj, err := c.Fake. $if .namespaced$Invokes($.NewGetSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, "$.subresourcePath$", $.type|private$Name), &$.resultType|raw${}) - $else$Invokes($.NewRootGetSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", $.type|private$Name), &$.resultType|raw${})$end$ + $else$Invokes($.NewRootGetSubresourceAction|raw$($.type|allLowercasePlural$Resource, $.type|private$Name), &$.resultType|raw${})$end$ if obj == nil { return nil, err } @@ -469,8 +469,8 @@ var patchTemplate = ` // Patch applies the patch and returns the patched $.resultType|private$. func (c *Fake$.type|publicPlural$) Patch(name string, pt $.PatchType|raw$, data []byte, subresources ...string) (result *$.resultType|raw$, err error) { obj, err := c.Fake. - $if .namespaced$Invokes($.NewPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, name, pt, data, subresources... ), &$.resultType|raw${}) - $else$Invokes($.NewRootPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, name, pt, data, subresources...), &$.resultType|raw${})$end$ + $if .namespaced$Invokes($.NewPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, name, data, subresources... ), &$.resultType|raw${}) + $else$Invokes($.NewRootPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, name, data, subresources...), &$.resultType|raw${})$end$ if obj == nil { return nil, err } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go index 6fdb29a94a..18ec09ac6f 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go @@ -58,9 +58,9 @@ func (g *genClientset) Imports(c *generator.Context) (imports []string) { imports = append(imports, g.imports.ImportLines()...) for _, group := range g.groups { for _, version := range group.Versions { - typedClientPath := filepath.Join(g.clientsetPackage, "typed", strings.ToLower(group.PackageName), strings.ToLower(version.NonEmpty())) + typedClientPath := filepath.Join(g.clientsetPackage, "typed", group.PackageName, version.NonEmpty()) groupAlias := strings.ToLower(g.groupGoNames[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}]) - imports = append(imports, fmt.Sprintf("%s%s \"%s\"", groupAlias, strings.ToLower(version.NonEmpty()), typedClientPath)) + imports = append(imports, strings.ToLower(fmt.Sprintf("%s%s \"%s\"", groupAlias, version.NonEmpty(), typedClientPath))) } } return diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go index a698a28b68..dd9afadbf3 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go @@ -69,11 +69,10 @@ func (g *GenScheme) Imports(c *generator.Context) (imports []string) { packagePath = filepath.Dir(packagePath) } packagePath = filepath.Join(packagePath, "install") - - imports = append(imports, fmt.Sprintf("%s \"%s\"", groupAlias, path.Vendorless(packagePath))) + imports = append(imports, strings.ToLower(fmt.Sprintf("%s \"%s\"", groupAlias, path.Vendorless(packagePath)))) break } else { - imports = append(imports, fmt.Sprintf("%s%s \"%s\"", groupAlias, strings.ToLower(version.Version.NonEmpty()), path.Vendorless(packagePath))) + imports = append(imports, strings.ToLower(fmt.Sprintf("%s%s \"%s\"", groupAlias, version.Version.NonEmpty(), path.Vendorless(packagePath)))) } } } @@ -94,8 +93,6 @@ func (g *GenScheme) GenerateType(c *generator.Context, t *types.Type, w io.Write "runtimeNewScheme": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "NewScheme"}), "serializerNewCodecFactory": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/serializer", Name: "NewCodecFactory"}), "runtimeScheme": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "Scheme"}), - "runtimeSchemeBuilder": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "SchemeBuilder"}), - "runtimeUtilMust": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/util/runtime", Name: "Must"}), "schemaGroupVersion": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersion"}), "metav1AddToGroupVersion": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "AddToGroupVersion"}), } @@ -133,10 +130,10 @@ func (g *GenScheme) GenerateType(c *generator.Context, t *types.Type, w io.Write var globalsTemplate = ` var $.Scheme$ = $.runtimeNewScheme|raw$() var $.Codecs$ = $.serializerNewCodecFactory|raw$($.Scheme$) -var $.ParameterCodec$ = $.runtimeNewParameterCodec|raw$($.Scheme$)` +var $.ParameterCodec$ = $.runtimeNewParameterCodec|raw$($.Scheme$) +` var registryRegistration = ` - func init() { $.metav1AddToGroupVersion|raw$($.Scheme$, $.schemaGroupVersion|raw${Version: "v1"}) Install($.Scheme$) @@ -154,13 +151,11 @@ func Install(scheme *$.runtimeScheme|raw$) { ` var simpleRegistration = ` -var localSchemeBuilder = $.runtimeSchemeBuilder|raw${ - $- range .allGroupVersions$ - $.PackageAlias$.AddToScheme, - $- end$ - $if .customRegister$ - ExtraAddToScheme, - $end -$ + + +func init() { + $.metav1AddToGroupVersion|raw$($.Scheme$, $.schemaGroupVersion|raw${Version: "v1"}) + AddToScheme($.Scheme$) } // AddToScheme adds all types of this clientset into the given scheme. This allows composition @@ -173,14 +168,16 @@ var localSchemeBuilder = $.runtimeSchemeBuilder|raw${ // ) // // kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - $.metav1AddToGroupVersion|raw$($.Scheme$, $.schemaGroupVersion|raw${Version: "v1"}) - $.runtimeUtilMust|raw$(AddToScheme($.Scheme$)) +func AddToScheme(scheme *$.runtimeScheme|raw$) { + $- range .allGroupVersions$ + $.PackageAlias$.AddToScheme(scheme) + $- end$ + $if .customRegister$ + ExtraAddToScheme(scheme) + $end -$ } ` diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go b/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go index 422237e117..3c16a85bfd 100644 --- a/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go +++ b/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go @@ -175,14 +175,10 @@ func getManualConversionFunctions(context *generator.Context, pkg *types.Package key := conversionPair{inType.Elem, outType.Elem} // We might scan the same package twice, and that's OK. if v, ok := manualMap[key]; ok && v != nil && v.Name.Package != pkg.Path { - panic(fmt.Sprintf("duplicate static conversion defined: %s -> %s from:\n%s.%s\n%s.%s", key.inType, key.outType, v.Name.Package, v.Name.Name, f.Name.Package, f.Name.Name)) + panic(fmt.Sprintf("duplicate static conversion defined: %s -> %s", key.inType, key.outType)) } manualMap[key] = f } else { - // prevent user error when they don't get the correct conversion signature - if strings.HasPrefix(f.Name.Name, "Convert_") { - glog.Errorf("Rename function %s %s -> %s to match expected conversion signature", f.Name.Package, f.Name.Name, buffer.String()) - } glog.V(8).Infof("%s has wrong name", f.Name) } buffer.Reset() @@ -610,34 +606,14 @@ func (g *genConversion) Init(c *generator.Context, w io.Writer) error { } sw.Do("// RegisterConversions adds conversion functions to the given scheme.\n", nil) sw.Do("// Public to allow building arbitrary schemes.\n", nil) - sw.Do("func RegisterConversions(s $.|raw$) error {\n", schemePtr) + sw.Do("func RegisterConversions(scheme $.|raw$) error {\n", schemePtr) + sw.Do("return scheme.AddGeneratedConversionFuncs(\n", nil) for _, t := range g.types { peerType := getPeerTypeFor(c, t, g.peerPackages) - args := argsFromType(t, peerType).With("Scope", types.Ref(conversionPackagePath, "Scope")) - sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) - args = argsFromType(peerType, t).With("Scope", types.Ref(conversionPackagePath, "Scope")) - sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) - } - var pairs []conversionPair - for pair, t := range g.manualConversions { - if t.Name.Package != g.outputPackage { - continue - } - pairs = append(pairs, pair) + sw.Do(nameTmpl+",\n", argsFromType(t, peerType)) + sw.Do(nameTmpl+",\n", argsFromType(peerType, t)) } - // sort by name of the conversion function - sort.Slice(pairs, func(i, j int) bool { - if g.manualConversions[pairs[i]].Name.Name < g.manualConversions[pairs[j]].Name.Name { - return true - } - return false - }) - for _, pair := range pairs { - args := argsFromType(pair.inType, pair.outType).With("Scope", types.Ref(conversionPackagePath, "Scope")).With("fn", g.manualConversions[pair]) - sw.Do("if err := s.AddConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return $.fn|raw$(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) - } - - sw.Do("return nil\n", nil) + sw.Do(")\n", nil) sw.Do("}\n\n", nil) return sw.Error() } diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go index 49e8297dbd..0e7a7d8ec3 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go @@ -724,10 +724,6 @@ func genComment(out io.Writer, lines []string, indent string) { lines = lines[:l-1] } for _, c := range lines { - if len(c) == 0 { - fmt.Fprintf(out, "%s//\n", indent) // avoid trailing whitespace - continue - } fmt.Fprintf(out, "%s// %s\n", indent, c) } } diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go index e3b21c6703..423577a12e 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go @@ -116,10 +116,7 @@ func assignGoTypeToProtoPackage(p *protobufPackage, t *types.Type, local, global } return } - if t.Name.Package == p.PackagePath { - // Associate types only to their own package - global[t.Name] = p - } + global[t.Name] = p if _, ok := local[t.Name]; ok { return } diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go index 92cde1486c..c781804387 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go @@ -76,7 +76,6 @@ func (g *factoryInterfaceGenerator) GenerateType(c *generator.Context, t *types. } var externalSharedInformerFactoryInterface = ` -// NewInformerFunc takes {{.clientSetPackage|raw}} and {{.timeDuration|raw}} to return a SharedIndexInformer. type NewInformerFunc func({{.clientSetPackage|raw}}, {{.timeDuration|raw}}) cache.SharedIndexInformer // SharedInformerFactory a small interface to allow for adding an informer without an import cycle @@ -85,6 +84,5 @@ type SharedInformerFactory interface { InformerFor(obj {{.runtimeObject|raw}}, newFunc NewInformerFunc) {{.cacheSharedIndexInformer|raw}} } -// TweakListOptionsFunc is a function that transforms a {{.v1ListOptions|raw}}. type TweakListOptionsFunc func(*{{.v1ListOptions|raw}}) ` diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go index 642f9a466e..2cc0372f89 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go @@ -320,9 +320,9 @@ func versionPackage(basePackage string, groupPkgName string, gv clientgentypes.G DefaultGen: generator.DefaultGen{ OptionalName: "interface", }, - outputPackage: packagePath, - imports: generator.NewImportTracker(), - types: typesToGenerate, + outputPackage: packagePath, + imports: generator.NewImportTracker(), + types: typesToGenerate, internalInterfacesPackage: packageForInternalInterfaces(basePackage), }) diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go index f80350c5f6..1cd27d5cdd 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go @@ -63,7 +63,7 @@ func (g *versionInterfaceGenerator) GenerateType(c *generator.Context, t *types. m := map[string]interface{}{ "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), "interfacesSharedInformerFactory": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), - "types": g.types, + "types": g.types, } sw.Do(versionTemplate, m) diff --git a/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go b/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go deleted file mode 100644 index ca13ca8579..0000000000 --- a/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go +++ /dev/null @@ -1,137 +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 generators - -import ( - "fmt" - "os" - "path" - "strings" - - "github.com/golang/glog" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{} -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -// Packages makes packages to generate. -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - glog.Fatalf("Failed loading boilerplate: %v", err) - } - - packages := generator.Packages{} - for _, inputDir := range arguments.InputDirs { - pkg := context.Universe.Package(inputDir) - internal, err := isInternal(pkg) - if err != nil { - glog.V(5).Infof("skipping the generation of %s file, due to err %v", arguments.OutputFileBaseName, err) - continue - } - if internal { - glog.V(5).Infof("skipping the generation of %s file because %s package contains internal types, note that internal types don't have \"json\" tags", arguments.OutputFileBaseName, pkg.Name) - continue - } - registerFileName := "register.go" - searchPath := path.Join(args.DefaultSourceTree(), inputDir, registerFileName) - if _, err := os.Stat(path.Join(searchPath)); err == nil { - glog.V(5).Infof("skipping the generation of %s file because %s already exists in the path %s", arguments.OutputFileBaseName, registerFileName, searchPath) - continue - } else if err != nil && !os.IsNotExist(err) { - glog.Fatalf("an error %v has occurred while checking if %s exists", err, registerFileName) - } - - gv := clientgentypes.GroupVersion{} - { - pathParts := strings.Split(pkg.Path, "/") - if len(pathParts) < 2 { - glog.Errorf("the path of the package must contain the group name and the version, path = %s", pkg.Path) - continue - } - gv.Group = clientgentypes.Group(pathParts[len(pathParts)-2]) - gv.Version = clientgentypes.Version(pathParts[len(pathParts)-1]) - - // if there is a comment of the form "// +groupName=somegroup" or "// +groupName=somegroup.foo.bar.io", - // extract the fully qualified API group name from it and overwrite the group inferred from the package path - if override := types.ExtractCommentTags("+", pkg.DocComments)["groupName"]; override != nil { - groupName := override[0] - glog.V(5).Infof("overriding the group name with = %s", groupName) - gv.Group = clientgentypes.Group(groupName) - } - } - - typesToRegister := []*types.Type{} - for _, t := range pkg.Types { - glog.V(5).Infof("considering type = %s", t.Name.String()) - for _, typeMember := range t.Members { - if typeMember.Name == "TypeMeta" && typeMember.Embedded == true { - typesToRegister = append(typesToRegister, t) - } - } - } - - packages = append(packages, - &generator.DefaultPackage{ - PackageName: pkg.Name, - PackagePath: pkg.Path, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{ - ®isterExternalGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: arguments.OutputFileBaseName, - }, - gv: gv, - typesToGenerate: typesToRegister, - outputPackage: pkg.Path, - imports: generator.NewImportTracker(), - }, - } - }, - }) - } - - return packages -} - -// isInternal determines whether the given package -// contains the internal types or not -func isInternal(p *types.Package) (bool, error) { - for _, t := range p.Types { - for _, member := range t.Members { - if member.Name == "TypeMeta" { - return !strings.Contains(member.Tags, "json"), nil - } - } - } - return false, fmt.Errorf("unable to find TypeMeta for any types in package %s", p.Path) -} diff --git a/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go b/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go deleted file mode 100644 index c831c575d6..0000000000 --- a/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go +++ /dev/null @@ -1,117 +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 generators - -import ( - "io" - "sort" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -type registerExternalGenerator struct { - generator.DefaultGen - outputPackage string - gv clientgentypes.GroupVersion - typesToGenerate []*types.Type - imports namer.ImportTracker -} - -var _ generator.Generator = ®isterExternalGenerator{} - -func (g *registerExternalGenerator) Filter(_ *generator.Context, _ *types.Type) bool { - return false -} - -func (g *registerExternalGenerator) Imports(c *generator.Context) (imports []string) { - return g.imports.ImportLines() -} - -func (g *registerExternalGenerator) Namers(_ *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *registerExternalGenerator) Finalize(context *generator.Context, w io.Writer) error { - typesToGenerateOnlyNames := make([]string, len(g.typesToGenerate)) - for index, typeToGenerate := range g.typesToGenerate { - typesToGenerateOnlyNames[index] = typeToGenerate.Name.Name - } - - // sort the list of types to register, so that the generator produces stable output - sort.Strings(typesToGenerateOnlyNames) - - sw := generator.NewSnippetWriter(w, context, "$", "$") - m := map[string]interface{}{ - "groupName": g.gv.Group, - "version": g.gv.Version, - "types": typesToGenerateOnlyNames, - "addToGroupVersion": context.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "AddToGroupVersion"}), - "groupVersion": context.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GroupVersion"}), - } - sw.Do(registerExternalTypesTemplate, m) - return sw.Error() -} - -var registerExternalTypesTemplate = ` -// GroupName specifies the group name used to register the objects. -const GroupName = "$.groupName$" - -// GroupVersion specifies the group and the version used to register the objects. -var GroupVersion = $.groupVersion|raw${Group: GroupName, Version: "$.version$"} - -// SchemeGroupVersion is group version used to register these objects -// Deprecated: use GroupVersion instead. -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "$.version$"} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - SchemeBuilder runtime.SchemeBuilder - localSchemeBuilder = &SchemeBuilder - // Depreciated: use Install instead - AddToScheme = localSchemeBuilder.AddToScheme - Install = localSchemeBuilder.AddToScheme -) - -func init() { - // We only register manually written functions here. The registration of the - // generated functions takes place in the generated files. The separation - // makes the code compile even when the generated files are missing. - localSchemeBuilder.Register(addKnownTypes) -} - -// Adds the list of known types to Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - $range .types -$ - &$.${}, - $end$ - ) - // AddToGroupVersion allows the serialization of client types like ListOptions. - $.addToGroupVersion|raw$(scheme, SchemeGroupVersion) - return nil -} -` diff --git a/vendor/k8s.io/code-generator/cmd/register-gen/main.go b/vendor/k8s.io/code-generator/cmd/register-gen/main.go deleted file mode 100644 index db02a4af4b..0000000000 --- a/vendor/k8s.io/code-generator/cmd/register-gen/main.go +++ /dev/null @@ -1,52 +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 main - -import ( - "flag" - "path/filepath" - - "github.com/golang/glog" - "github.com/spf13/pflag" - - generatorargs "k8s.io/code-generator/cmd/register-gen/args" - "k8s.io/code-generator/cmd/register-gen/generators" - "k8s.io/code-generator/pkg/util" - "k8s.io/gengo/args" -) - -func main() { - genericArgs := generatorargs.NewDefaults() - genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) - genericArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - - pflag.Parse() - if err := generatorargs.Validate(genericArgs); err != nil { - glog.Fatalf("Error: %v", err) - } - - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - glog.Fatalf("Error: %v", err) - } - glog.V(2).Info("Completed successfully.") -} diff --git a/vendor/k8s.io/code-generator/generate-groups.sh b/vendor/k8s.io/code-generator/generate-groups.sh index d8531a8d9d..6707221e42 100755 --- a/vendor/k8s.io/code-generator/generate-groups.sh +++ b/vendor/k8s.io/code-generator/generate-groups.sh @@ -50,7 +50,7 @@ shift 4 # To support running this script from anywhere, we have to first cd into this directory # so we can install the tools. cd $(dirname "${0}") - go install ${GOFLAGS:-} ./cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} + go install ./cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} ) function codegen::join() { local IFS="$1"; shift; echo "$*"; } @@ -72,8 +72,8 @@ if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then fi if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then - echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" - ${GOPATH}/bin/client-gen --clientset-name ${CLIENTSET_NAME_VERSIONED:-versioned} --input-base "" --input $(codegen::join , "${FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset} "$@" + echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/clientset" + ${GOPATH}/bin/client-gen --clientset-name versioned --input-base "" --input $(codegen::join , "${FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/clientset "$@" fi if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then @@ -85,7 +85,7 @@ if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" ${GOPATH}/bin/informer-gen \ --input-dirs $(codegen::join , "${FQ_APIS[@]}") \ - --versioned-clientset-package ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned} \ + --versioned-clientset-package ${OUTPUT_PKG}/clientset/versioned \ --listers-package ${OUTPUT_PKG}/listers \ --output-package ${OUTPUT_PKG}/informers \ "$@" diff --git a/vendor/k8s.io/code-generator/generate-internal-groups.sh b/vendor/k8s.io/code-generator/generate-internal-groups.sh index 6849ed9437..0de606d39a 100755 --- a/vendor/k8s.io/code-generator/generate-internal-groups.sh +++ b/vendor/k8s.io/code-generator/generate-internal-groups.sh @@ -47,7 +47,7 @@ EXT_APIS_PKG="$4" GROUPS_WITH_VERSIONS="$5" shift 5 -go install ${GOFLAGS:-} ./$(dirname "${0}")/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} +go install ./$(dirname "${0}")/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} function codegen::join() { local IFS="$1"; shift; echo "$*"; } # enumerate group versions @@ -85,11 +85,11 @@ if [ "${GENS}" = "all" ] || grep -qw "conversion" <<<"${GENS}"; then fi if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then - echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" + echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/clientset" if [ -n "${INT_APIS_PKG}" ]; then - ${GOPATH}/bin/client-gen --clientset-name ${CLIENTSET_NAME_INTERNAL:-internalversion} --input-base "" --input $(codegen::join , $(printf '%s/ ' "${INT_FQ_APIS[@]}")) --output-package ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset} "$@" + ${GOPATH}/bin/client-gen --clientset-name internalversion --input-base "" --input $(codegen::join , $(printf '%s/ ' "${INT_FQ_APIS[@]}")) --output-package ${OUTPUT_PKG}/clientset "$@" fi - ${GOPATH}/bin/client-gen --clientset-name ${CLIENTSET_NAME_VERSIONED:-versioned} --input-base "" --input $(codegen::join , "${EXT_FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset} "$@" + ${GOPATH}/bin/client-gen --clientset-name versioned --input-base "" --input $(codegen::join , "${EXT_FQ_APIS[@]}") --output-package ${OUTPUT_PKG}/clientset "$@" fi if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then @@ -101,8 +101,8 @@ if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" ${GOPATH}/bin/informer-gen \ --input-dirs $(codegen::join , "${ALL_FQ_APIS[@]}") \ - --versioned-clientset-package ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned} \ - --internal-clientset-package ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_INTERNAL:-internalversion} \ + --versioned-clientset-package ${OUTPUT_PKG}/clientset/versioned \ + --internal-clientset-package ${OUTPUT_PKG}/clientset/internalversion \ --listers-package ${OUTPUT_PKG}/listers \ --output-package ${OUTPUT_PKG}/informers \ "$@" diff --git a/vendor/k8s.io/code-generator/hack/update-codegen.sh b/vendor/k8s.io/code-generator/hack/update-codegen.sh index 2a14fe5277..767c2ab36b 100755 --- a/vendor/k8s.io/code-generator/hack/update-codegen.sh +++ b/vendor/k8s.io/code-generator/hack/update-codegen.sh @@ -30,7 +30,3 @@ $(dirname ${BASH_SOURCE})/../generate-groups.sh all \ k8s.io/code-generator/_examples/crd k8s.io/code-generator/_examples/crd/apis \ "example:v1 example2:v1" \ --output-base "$(dirname ${BASH_SOURCE})/../../.." - $(dirname ${BASH_SOURCE})/../generate-groups.sh all \ - k8s.io/code-generator/_examples/MixedCase k8s.io/code-generator/_examples/MixedCase/apis \ - "example:v1" \ - --output-base "$(dirname ${BASH_SOURCE})/../../.." diff --git a/vendor/k8s.io/code-generator/hack/verify-codegen.sh b/vendor/k8s.io/code-generator/hack/verify-codegen.sh index 497f2a484c..25302228df 100755 --- a/vendor/k8s.io/code-generator/hack/verify-codegen.sh +++ b/vendor/k8s.io/code-generator/hack/verify-codegen.sh @@ -50,6 +50,4 @@ fi # smoke test echo "Smoke testing _example by compiling..." -go build ./${SCRIPT_ROOT}/_examples/crd/... -go build ./${SCRIPT_ROOT}/_examples/apiserver/... -go build ./${SCRIPT_ROOT}/_examples/MixedCase/... +go build ${SCRIPT_ROOT}/_example/... \ No newline at end of file diff --git a/vendor/sigs.k8s.io/cluster-api/OWNERS b/vendor/sigs.k8s.io/cluster-api/OWNERS deleted file mode 100644 index d21d03dc2b..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/OWNERS +++ /dev/null @@ -1,9 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md - -approvers: - - sig-cluster-lifecycle-leads - - cluster-api-admins - - cluster-api-maintainers - -reviewers: - - cluster-api-maintainers diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/BUILD.bazel b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/BUILD.bazel deleted file mode 100644 index 0386d9ff20..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["minikube.go"], - importpath = "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/bootstrap/minikube", - visibility = ["//visibility:public"], - deps = ["//vendor/k8s.io/klog:go_default_library"], -) - -go_test( - name = "go_default_test", - srcs = ["minikube_test.go"], - embed = [":go_default_library"], -) diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden deleted file mode 100644 index b58867c78f..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args-invalid-flag.golden +++ /dev/null @@ -1,30 +0,0 @@ -Error: unknown flag: --invalid-flag -Usage: - clusterctl create cluster [flags] - -Flags: - -a, --addon-components string A yaml file containing cluster addons to apply to the internal cluster - --cleanup-bootstrap-cluster Whether to cleanup the bootstrap cluster after bootstrap (default true) - -c, --cluster string A yaml file containing cluster object definition - -e, --existing-bootstrap-cluster-kubeconfig string Path to an existing cluster's kubeconfig for bootstrapping (intead of using minikube) - -h, --help help for cluster - --kubeconfig-out string Where to output the kubeconfig for the provisioned cluster (default "kubeconfig") - -m, --machines string A yaml file containing machine object definition(s) - --minikube strings Minikube options - --provider string Which provider deployment logic to use (google/vsphere/azure) - -p, --provider-components string A yaml file containing cluster api provider controllers and supporting objects - --vm-driver string Which vm driver to use for minikube - -Global Flags: - --alsologtostderr log to standard error as well as files - --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. - --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --logtostderr log to standard error instead of files (default true) - --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs - --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging - -unknown flag: --invalid-flag diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden deleted file mode 100644 index ff3fa0c33f..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/create-cluster-no-args.golden +++ /dev/null @@ -1,30 +0,0 @@ -Please provide yaml file for cluster definition. -Create a kubernetes cluster with one command - -Usage: - clusterctl create cluster [flags] - -Flags: - -a, --addon-components string A yaml file containing cluster addons to apply to the internal cluster - --cleanup-bootstrap-cluster Whether to cleanup the bootstrap cluster after bootstrap (default true) - -c, --cluster string A yaml file containing cluster object definition - -e, --existing-bootstrap-cluster-kubeconfig string Path to an existing cluster's kubeconfig for bootstrapping (intead of using minikube) - -h, --help help for cluster - --kubeconfig-out string Where to output the kubeconfig for the provisioned cluster (default "kubeconfig") - -m, --machines string A yaml file containing machine object definition(s) - --minikube strings Minikube options - --provider string Which provider deployment logic to use (google/vsphere/azure) - -p, --provider-components string A yaml file containing cluster api provider controllers and supporting objects - --vm-driver string Which vm driver to use for minikube - -Global Flags: - --alsologtostderr log to standard error as well as files - --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. - --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --logtostderr log to standard error instead of files (default true) - --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs - --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging diff --git a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden b/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden deleted file mode 100644 index cdb500afe4..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/cmd/clusterctl/testdata/delete-cluster-no-args-invalid-flag.golden +++ /dev/null @@ -1,29 +0,0 @@ -Error: unknown flag: --invalid-flag -Usage: - clusterctl delete cluster [flags] - -Flags: - --cleanup-bootstrap-cluster Whether to cleanup the bootstrap cluster after bootstrap (default true) - --cluster string The name of the kubeconfig cluster to use - --cluster-namespace string Namespace where the cluster to be deleted resides (default "default") - -e, --existing-bootstrap-cluster-kubeconfig string Path to an existing cluster's kubeconfig for bootstrapping (intead of using minikube) - -h, --help help for cluster - --minikube strings Minikube options - -n, --namespace string If present, the namespace scope for this CLI request - -p, --provider-components string A yaml file containing cluster api provider controllers and supporting objects, if empty the value is loaded from the cluster's configuration store. - --user string The name of the kubeconfig user to use - --vm-driver string Which vm driver to use for minikube - -Global Flags: - --alsologtostderr log to standard error as well as files - --kubeconfig string Paths to a kubeconfig. Only required if out-of-cluster. - --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) - --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) - --log_dir string If non-empty, write log files in this directory - --logtostderr log to standard error instead of files (default true) - --master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. - --stderrthreshold severity logs at or above this threshold go to stderr (default 2) - -v, --v Level log level for V logs - --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging - -unknown flag: --invalid-flag diff --git a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_cluster.yaml b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_cluster.yaml deleted file mode 100644 index ac8250c707..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_cluster.yaml +++ /dev/null @@ -1,98 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" - name: clusters.cluster.k8s.io -spec: - group: cluster.k8s.io - names: - kind: Cluster - plural: clusters - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - clusterNetwork: - properties: - pods: - properties: - cidrBlocks: - items: - type: string - type: array - required: - - cidrBlocks - type: object - serviceDomain: - type: string - services: - properties: - cidrBlocks: - items: - type: string - type: array - required: - - cidrBlocks - type: object - required: - - services - - pods - - serviceDomain - type: object - providerSpec: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - required: - - clusterNetwork - type: object - status: - properties: - apiEndpoints: - items: - properties: - host: - type: string - port: - format: int64 - type: integer - required: - - host - - port - type: object - type: array - errorMessage: - type: string - errorReason: - type: string - providerStatus: - type: object - type: object - version: v1alpha1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machine.yaml b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machine.yaml deleted file mode 100644 index e53b5a6351..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machine.yaml +++ /dev/null @@ -1,111 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" - name: machines.cluster.k8s.io -spec: - group: cluster.k8s.io - names: - kind: Machine - plural: machines - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - configSource: - type: object - metadata: - type: object - providerSpec: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - taints: - items: - type: object - type: array - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet - type: object - required: - - providerSpec - type: object - status: - properties: - addresses: - items: - type: object - type: array - conditions: - items: - type: object - type: array - errorMessage: - type: string - errorReason: - type: string - lastOperation: - properties: - description: - type: string - lastUpdated: - format: date-time - type: string - state: - type: string - type: - type: string - type: object - lastUpdated: - format: date-time - type: string - nodeRef: - type: object - phase: - type: string - providerStatus: - type: object - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet - type: object - type: object - version: v1alpha1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineclass.yaml b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineclass.yaml deleted file mode 100644 index 5de01dc582..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineclass.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" - name: machineclasses.cluster.k8s.io -spec: - group: cluster.k8s.io - names: - kind: MachineClass - plural: machineclasses - scope: Namespaced - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - providerSpec: - type: object - required: - - providerSpec - version: v1alpha1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml deleted file mode 100644 index cc174de47b..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml +++ /dev/null @@ -1,128 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" - name: machinedeployments.cluster.k8s.io -spec: - group: cluster.k8s.io - names: - kind: MachineDeployment - plural: machinedeployments - scope: Namespaced - subresources: - scale: - labelSelectorPath: .status.labelSelector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - minReadySeconds: - format: int32 - type: integer - paused: - type: boolean - progressDeadlineSeconds: - format: int32 - type: integer - replicas: - format: int32 - type: integer - revisionHistoryLimit: - format: int32 - type: integer - selector: - type: object - strategy: - properties: - rollingUpdate: - properties: - maxSurge: {} - maxUnavailable: {} - type: object - type: - type: string - type: object - template: - properties: - metadata: - type: object - spec: - properties: - configSource: - type: object - metadata: - type: object - providerSpec: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - taints: - items: - type: object - type: array - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet - type: object - required: - - providerSpec - type: object - type: object - required: - - selector - - template - type: object - status: - properties: - availableReplicas: - format: int32 - type: integer - observedGeneration: - format: int64 - type: integer - readyReplicas: - format: int32 - type: integer - replicas: - format: int32 - type: integer - unavailableReplicas: - format: int32 - type: integer - updatedReplicas: - format: int32 - type: integer - type: object - version: v1alpha1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml b/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml deleted file mode 100644 index 101db09963..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml +++ /dev/null @@ -1,112 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" - name: machinesets.cluster.k8s.io -spec: - group: cluster.k8s.io - names: - kind: MachineSet - plural: machinesets - scope: Namespaced - subresources: - scale: - labelSelectorPath: .status.labelSelector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - minReadySeconds: - format: int32 - type: integer - replicas: - format: int32 - type: integer - selector: - type: object - template: - properties: - metadata: - type: object - spec: - properties: - configSource: - type: object - metadata: - type: object - providerSpec: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - taints: - items: - type: object - type: array - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet - type: object - required: - - providerSpec - type: object - type: object - required: - - selector - type: object - status: - properties: - availableReplicas: - format: int32 - type: integer - errorMessage: - type: string - errorReason: - type: string - fullyLabeledReplicas: - format: int32 - type: integer - observedGeneration: - format: int64 - type: integer - readyReplicas: - format: int32 - type: integer - replicas: - format: int32 - type: integer - required: - - replicas - type: object - version: v1alpha1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/BUILD.bazel b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/BUILD.bazel deleted file mode 100644 index 899f3e11d8..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "consts.go", - "plugins.go", - ], - importpath = "sigs.k8s.io/cluster-api/pkg/apis/cluster/common", - visibility = ["//visibility:public"], - deps = ["//vendor/k8s.io/klog:go_default_library"], -) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/test-cmd-runner/BUILD.bazel b/vendor/sigs.k8s.io/cluster-api/pkg/test-cmd-runner/BUILD.bazel deleted file mode 100644 index e0fb797d38..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/pkg/test-cmd-runner/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["test_cmd_runner.go"], - importpath = "sigs.k8s.io/cluster-api/pkg/test-cmd-runner", - visibility = ["//visibility:public"], -) - -go_test( - name = "go_default_test", - srcs = ["test_cmd_runner_test.go"], - embed = [":go_default_library"], -) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/test-cmd-runner/test_cmd_runner.go b/vendor/sigs.k8s.io/cluster-api/pkg/test-cmd-runner/test_cmd_runner.go deleted file mode 100644 index 88de1b5948..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/pkg/test-cmd-runner/test_cmd_runner.go +++ /dev/null @@ -1,119 +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 test_cmd_runner - -import ( - "flag" - "fmt" - "os" - "os/exec" - "reflect" - "runtime" - "strings" - "testing" -) - -type TestRunner struct { - callback func(string, ...string) int -} - -var ( - TestModeEnvVar = "GO_TEST_MODE" - CallbackTestMode = "CALLBACK" - CallbackFunctionName = "GO_CALLBACK_FUNCTION_NAME" - reggedFunctions = make(map[string]func(string, ...string) int) -) - -// TestRunner makes it easy to mock out shell commands. It will start a new program that calls into the callback function -// supplied when creating TestRunner. -// -// To use TestRunner from your test, you must do the following: -// 1. In your test file's init() method call RegisterCallback with the same callback function you passed into TestRunner -// 2. Copy the TestMain below and insert it into your test file: -// func TestMain(m *testing.M) { -// cmd_runner.TestMain(m) -// } -func NewTestRunner(callback func(cmd string, args ...string) (exitCode int)) (*TestRunner, error) { - name := getFullyQualifiedFunctionName(callback) - if _, ok := reggedFunctions[name]; !ok { - shortName := getUnqualifiedFunctionName(name) - registerCallbackShortName := getUnqualifiedFunctionName(getFullyQualifiedFunctionName(RegisterCallback)) - return nil, fmt.Errorf("unregistered function: '%v', you must add the following to your package's init() method, %v(%v)", name, registerCallbackShortName, shortName) - } - return &TestRunner{ - callback: callback, - }, nil -} - -func NewTestRunnerFailOnErr(t *testing.T, callback func(cmd string, args ...string) int) *TestRunner { - runner, err := NewTestRunner(callback) - if err != nil { - t.Fatal(err) - } - return runner -} - -// Call this method to register your callback function from your init() method. This is required before creating a TestRunner that uses your function. -func RegisterCallback(fn func(cmd string, args ...string) int) { - name := getFullyQualifiedFunctionName(fn) - reggedFunctions[name] = fn -} - -func (runner *TestRunner) CombinedOutput(cmd string, args ...string) (string, error) { - args = append([]string{cmd}, args...) - command := exec.Command(os.Args[0], args...) - command.Env = []string{ - fmt.Sprintf("%v=%v", TestModeEnvVar, CallbackTestMode), - fmt.Sprintf("%v=%v", CallbackFunctionName, getFullyQualifiedFunctionName(runner.callback)), - } - output, err := command.CombinedOutput() - return string(output), err -} - -func TestMain(m *testing.M) { - flag.Parse() - os.Exit(run(m)) -} - -func run(m *testing.M) int { - switch os.Getenv(TestModeEnvVar) { - case CallbackTestMode: - return runTestExec() - default: - return m.Run() - } -} - -func runTestExec() int { - functionName := os.Getenv(CallbackFunctionName) - fn := reggedFunctions[functionName] - if fn == nil { - panic(fmt.Errorf("unregistered function name: %v", functionName)) - } - return fn(os.Args[1], os.Args[2:len(os.Args)]...) -} - -// given the output of getFullyQualifiedFunctionName(...) this function returns the actual 'short' function name stripping off the package path and file name. -func getUnqualifiedFunctionName(fullyQualifiedName string) string { - parts := strings.Split(fullyQualifiedName, ".") - return parts[len(parts)-1] -} - -// code assumes that the 'fn' parameter has a kind of 'Func' -func getFullyQualifiedFunctionName(fn interface{}) string { - return runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name() -}