diff --git a/Gopkg.lock b/Gopkg.lock index a18fe1ddef..4de01b393d 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -350,6 +350,30 @@ pruneopts = "NUT" revision = "960f72aa32a8e9b4dd769b90ff1cb5bd4c898eec" +[[projects]] + digest = "1:72fe9aecc0c2e30d051a236236d9e175542b64245ea4e8b025eb1cbc58980ba0" + name = "github.com/openshift/cluster-api" + packages = [ + "pkg/apis/cluster/common", + "pkg/apis/cluster/v1alpha1", + "pkg/apis/machine/common", + "pkg/apis/machine/v1beta1", + "pkg/client/clientset_generated/clientset", + "pkg/client/clientset_generated/clientset/scheme", + "pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1", + "pkg/client/clientset_generated/clientset/typed/machine/v1beta1", + "pkg/client/informers_generated/externalversions", + "pkg/client/informers_generated/externalversions/cluster", + "pkg/client/informers_generated/externalversions/cluster/v1alpha1", + "pkg/client/informers_generated/externalversions/internalinterfaces", + "pkg/client/informers_generated/externalversions/machine", + "pkg/client/informers_generated/externalversions/machine/v1beta1", + "pkg/client/listers_generated/cluster/v1alpha1", + "pkg/client/listers_generated/machine/v1beta1", + ] + pruneopts = "NUT" + revision = "91fca585a85b163ddfd119fd09c128c9feadddca" + [[projects]] digest = "1:88a77d15e6ccd75e18697c7b7c1a4956f601e3481ea26ddc67d78d25518a535e" name = "github.com/openshift/cluster-autoscaler-operator" @@ -405,6 +429,14 @@ revision = "5f041e8faa004a95c88a202771f4cc3e991971e6" version = "v2.0.1" +[[projects]] + digest = "1:14715f705ff5dfe0ffd6571d7d201dd8e921030f8070321a79380d8ca4ec1a24" + name = "github.com/pkg/errors" + packages = ["."] + pruneopts = "NUT" + revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4" + version = "v0.8.1" + [[projects]] digest = "1:b2339e83ce9b5c4f79405f949429a7f68a9a904fed903c672aac1e7ceb7f5f02" name = "github.com/sirupsen/logrus" @@ -925,25 +957,6 @@ pruneopts = "NUT" revision = "045dc31ee5c40e8240241ce28dc24d7b56130373" -[[projects]] - branch = "master" - digest = "1:06e72e0584260bfbd3f221c9bff1b9676df283c306cbe97600dabbf6727933e9" - name = "sigs.k8s.io/cluster-api" - packages = [ - "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/client/informers_generated/externalversions", - "pkg/client/informers_generated/externalversions/cluster", - "pkg/client/informers_generated/externalversions/cluster/v1alpha1", - "pkg/client/informers_generated/externalversions/internalinterfaces", - "pkg/client/listers_generated/cluster/v1alpha1", - ] - pruneopts = "NUT" - revision = "63aeb2752b5f250636358b795793f2f53ce1c077" - [[projects]] digest = "1:2c27ba82e6c5027fb2412bdb8f91a68a02128864b1b62ebb2fd4749a0bdfe719" name = "sigs.k8s.io/controller-runtime" @@ -994,6 +1007,13 @@ "github.com/openshift/api/config/v1", "github.com/openshift/client-go/config/clientset/versioned", "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1", + "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1", + "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1", + "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset", + "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme", + "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions", + "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1", + "github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1", "github.com/openshift/cluster-autoscaler-operator/pkg/apis", "github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1alpha1", "github.com/openshift/cluster-version-operator/lib/resourceapply", @@ -1048,12 +1068,6 @@ "k8s.io/code-generator/cmd/openapi-gen", "k8s.io/gengo/args", "k8s.io/utils/pointer", - "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/client/clientset_generated/clientset/scheme", - "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions", - "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1", - "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1", "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 e74e4eea5c..ce54975976 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -31,8 +31,8 @@ required = [ branch = "release-1.10" [[override]] - name = "sigs.k8s.io/cluster-api" - branch = "master" + name = "github.com/openshift/cluster-api" + revision = "91fca585a85b163ddfd119fd09c128c9feadddca" [[override]] name = "k8s.io/code-generator" diff --git a/cmd/machine-healthcheck/main.go b/cmd/machine-healthcheck/main.go index 0d2d829bd7..24aa2f422b 100644 --- a/cmd/machine-healthcheck/main.go +++ b/cmd/machine-healthcheck/main.go @@ -5,11 +5,11 @@ import ( "runtime" "github.com/golang/glog" + mapiv1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" "github.com/openshift/machine-api-operator/pkg/apis" "github.com/openshift/machine-api-operator/pkg/controller" sdkVersion "github.com/operator-framework/operator-sdk/version" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" - capiv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/runtime/signals" @@ -43,7 +43,7 @@ func main() { if err := apis.AddToScheme(mgr.GetScheme()); err != nil { glog.Fatal(err) } - if err := capiv1.AddToScheme(mgr.GetScheme()); err != nil { + if err := mapiv1.AddToScheme(mgr.GetScheme()); err != nil { glog.Fatal(err) } diff --git a/cmd/nodelink-controller/controller_test.go b/cmd/nodelink-controller/controller_test.go index 2dcfa09004..e424ae9be4 100644 --- a/cmd/nodelink-controller/controller_test.go +++ b/cmd/nodelink-controller/controller_test.go @@ -20,8 +20,8 @@ import ( "reflect" "testing" + mapiv1alpha1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" corev1 "k8s.io/api/core/v1" - capiv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) func node(taints *[]corev1.Taint) *corev1.Node { @@ -32,9 +32,9 @@ func node(taints *[]corev1.Taint) *corev1.Node { } } -func machine(taints *[]corev1.Taint) *capiv1alpha1.Machine { - return &capiv1alpha1.Machine{ - Spec: capiv1alpha1.MachineSpec{ +func machine(taints *[]corev1.Taint) *mapiv1alpha1.Machine { + return &mapiv1alpha1.Machine{ + Spec: mapiv1alpha1.MachineSpec{ Taints: *taints, }, } diff --git a/cmd/nodelink-controller/main.go b/cmd/nodelink-controller/main.go index f25d7dea65..014decc3ba 100644 --- a/cmd/nodelink-controller/main.go +++ b/cmd/nodelink-controller/main.go @@ -41,12 +41,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/config" - capiv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - capiclient "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - capiinformersfactory "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions" - capiinformers "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1" - lister "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" + mapiv1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" + "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" + mapiclient "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" + mapiinformersfactory "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions" + mapiinformers "github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/v1beta1" + lister "github.com/openshift/cluster-api/pkg/client/listers_generated/machine/v1beta1" kubeinformers "k8s.io/client-go/informers" ) @@ -61,15 +61,15 @@ const ( controllerName = "nodelink" // machineAnnotationKey is the annotation storing a link between a node and it's machine. Should match upstream cluster-api machine controller. (node.go) - machineAnnotationKey = "cluster.k8s.io/machine" + machineAnnotationKey = "machine.openshift.io/machine" ) // NewController returns a new *Controller. func NewController( nodeInformer coreinformers.NodeInformer, - machineInformer capiinformers.MachineInformer, + machineInformer mapiinformers.MachineInformer, kubeClient kubeclientset.Interface, - capiClient capiclient.Interface, + capiClient mapiclient.Interface, ) *Controller { eventBroadcaster := record.NewBroadcaster() @@ -104,14 +104,14 @@ func NewController( c.syncHandler = c.syncNode c.enqueueNode = c.enqueue - c.machineAddress = make(map[string]*capiv1.Machine) + c.machineAddress = make(map[string]*mapiv1.Machine) return c } // Controller monitors nodes and links them to their machines when possible, as well as applies desired labels and taints. type Controller struct { - capiClient capiclient.Interface + capiClient mapiclient.Interface kubeClient kubeclientset.Interface // To allow injection for testing. @@ -130,7 +130,7 @@ type Controller struct { queue workqueue.RateLimitingInterface // machines cache map[internalIP]machine - machineAddress map[string]*capiv1.Machine + machineAddress map[string]*mapiv1.Machine machineAddressMux sync.Mutex } @@ -169,7 +169,7 @@ func (c *Controller) deleteNode(obj interface{}) { } func (c *Controller) addMachine(obj interface{}) { - machine := obj.(*capiv1.Machine) + machine := obj.(*mapiv1.Machine) c.machineAddressMux.Lock() defer c.machineAddressMux.Unlock() @@ -185,7 +185,7 @@ func (c *Controller) addMachine(obj interface{}) { } func (c *Controller) updateMachine(old, cur interface{}) { - machine := cur.(*capiv1.Machine) + machine := cur.(*mapiv1.Machine) c.machineAddressMux.Lock() defer c.machineAddressMux.Unlock() @@ -201,7 +201,7 @@ func (c *Controller) updateMachine(old, cur interface{}) { } func (c *Controller) deleteMachine(obj interface{}) { - machine := obj.(*capiv1.Machine) + machine := obj.(*mapiv1.Machine) c.machineAddressMux.Lock() defer c.machineAddressMux.Unlock() @@ -332,7 +332,7 @@ func (c *Controller) processNode(node *corev1.Node) error { machineKey, ok := node.Annotations[machineAnnotationKey] // No machine annotation, this is likely the first time we've seen the node, // need to load all machines and search for one with matching IP. - var matchingMachine *capiv1.Machine + var matchingMachine *mapiv1.Machine if ok { var err error namespace, machineName, err := cache.SplitMetaNamespaceKey(machineKey) @@ -408,7 +408,7 @@ func (c *Controller) processNode(node *corev1.Node) error { // addTaintsToNode adds taints from machine object to the node object // Taints are to be an authoritative list on the machine spec per cluster-api comments. // However, we believe many components can directly taint a node and there is no direct source of truth that should enforce a single writer of taints -func addTaintsToNode(node *corev1.Node, machine *capiv1.Machine) { +func addTaintsToNode(node *corev1.Node, machine *mapiv1.Machine) { for _, mTaint := range machine.Spec.Taints { glog.V(3).Infof("machine taint: %v", mTaint) alreadyPresent := false @@ -451,18 +451,18 @@ func main() { // TODO(jchaloup): set the resync period reasonably kubeSharedInformers := kubeinformers.NewSharedInformerFactory(kubeClient, 5*time.Second) - capiInformers := capiinformersfactory.NewSharedInformerFactory(client, 5*time.Second) + mapiInformers := mapiinformersfactory.NewSharedInformerFactory(client, 5*time.Second) ctrl := NewController( kubeSharedInformers.Core().V1().Nodes(), - capiInformers.Cluster().V1alpha1().Machines(), + mapiInformers.Machine().V1beta1().Machines(), kubeClient, client, ) go ctrl.Run(1, wait.NeverStop) - capiInformers.Start(wait.NeverStop) + mapiInformers.Start(wait.NeverStop) kubeSharedInformers.Start(wait.NeverStop) select {} diff --git a/install/0000_50_machine-api-operator_01_images.configmap.yaml b/install/0000_50_machine-api-operator_01_images.configmap.yaml index 743b8a3f3e..9cea341f8b 100644 --- a/install/0000_50_machine-api-operator_01_images.configmap.yaml +++ b/install/0000_50_machine-api-operator_01_images.configmap.yaml @@ -4,4 +4,4 @@ metadata: name: machine-api-operator-images namespace: openshift-cluster-api data: - images.json: '{"machineAPIOperator": "docker.io/openshift/origin-machine-api-operator:v4.0.0", "clusterAPIControllerAWS": "docker.io/openshift/origin-aws-machine-controllers:v4.0.0", "clusterAPIControllerOpenStack": "docker.io/openshift/origin-openstack-machine-controllers:v4.0.0", "clusterAPIControllerLibvirt": "docker.io/openshift/origin-libvirt-machine-controllers:v4.0.0"}' + images.json: '{"machineAPIOperator": "docker.io/openshift/origin-machine-api-operator:v4.0.0", "clusterAPIControllerAWS": "docker.io/openshift/origin-aws-machine-controllers:v4.0.0", "clusterAPIControllerOpenStack": "docker.io/openshift/origin-openstack-machine-controllers:v4.0.0", "clusterAPIControllerLibvirt": "docker.io/openshift/origin-libvirt-machine-controllers:v4.0.0", "clusterAPIControllerLibvirtDeprecated": "quay.io/coreos/cluster-api-provider-libvirt:origin-v4.0-2019-01-31-041134", "clusterAPIControllerAWSDeprecated": "quay.io/coreos/cluster-api-provider-aws:origin-v4.0-2019-01-31-041134"}' diff --git a/owned-manifests/clusterapi-manager-controllers.yaml b/owned-manifests/clusterapi-manager-controllers.yaml index c7e89e4cc0..d008f14ce9 100644 --- a/owned-manifests/clusterapi-manager-controllers.yaml +++ b/owned-manifests/clusterapi-manager-controllers.yaml @@ -35,8 +35,8 @@ spec: key: node.alpha.kubernetes.io/unreachable operator: Exists containers: - - name: controller-manager - image: {{ .Controllers.Provider }} + - name: controller-manager-deprecated + image: {{ .Controllers.ProviderDeprecated }} command: - "./manager" args: @@ -49,8 +49,8 @@ spec: limits: cpu: 100m memory: 30Mi - - name: machine-controller - image: {{ .Controllers.Provider }} + - name: machine-controller-deprecated + image: {{ .Controllers.ProviderDeprecated }} env: - name: NODE_NAME valueFrom: @@ -61,6 +61,20 @@ spec: args: - --logtostderr=true - --v=3 + - name: nodelink-controller-deprecated + image: quay.io/coreos/machine-api-operator:origin-v4.0-2019-01-31-041134 + command: + - /nodelink-controller + args: + - --logtostderr=true + - --v=3 + resources: + requests: + cpu: 100m + memory: 20Mi + limits: + cpu: 100m + memory: 30Mi - name: nodelink-controller image: {{ .Controllers.NodeLink }} command: @@ -75,6 +89,20 @@ spec: limits: cpu: 100m memory: 30Mi + - name: machine-healthcheck-deprecated + image: quay.io/coreos/machine-api-operator:origin-v4.0-2019-01-31-041134 + command: + - /machine-healthcheck + args: + - --logtostderr=true + - --v=3 + resources: + requests: + cpu: 100m + memory: 20Mi + limits: + cpu: 100m + memory: 30Mi - name: machine-healthcheck image: {{ .Controllers.MachineHealthCheck }} command: diff --git a/pkg/controller/machinehealthcheck/machinehealthcheck_controller.go b/pkg/controller/machinehealthcheck/machinehealthcheck_controller.go index 7dd4dfc093..379af0b38b 100644 --- a/pkg/controller/machinehealthcheck/machinehealthcheck_controller.go +++ b/pkg/controller/machinehealthcheck/machinehealthcheck_controller.go @@ -7,6 +7,7 @@ import ( "time" "github.com/golang/glog" + mapiv1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" healthcheckingv1alpha1 "github.com/openshift/machine-api-operator/pkg/apis/healthchecking/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -15,7 +16,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/cache" - capiv1 "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" @@ -25,7 +25,7 @@ import ( ) const ( - machineAnnotationKey = "cluster.k8s.io/machine" + machineAnnotationKey = "machine.openshift.io/machine" // TODO(alberto) ensure we handle the case for when a new machine comes up // so remediation doesn't kill it before it goes healthy remediationWaitTime = 5 * time.Minute @@ -94,7 +94,7 @@ func (r *ReconcileMachineHealthCheck) Reconcile(request reconcile.Request) (reco } glog.Infof("Node %s is annotated with machine %s", node.Name, machineKey) - machine := &capiv1.Machine{} + machine := &mapiv1.Machine{} namespace, machineName, err := cache.SplitMetaNamespaceKey(machineKey) if err != nil { return reconcile.Result{}, err @@ -149,7 +149,7 @@ func getMachineHealthCheckListOptions() *client.ListOptions { } } -func remediate(r *ReconcileMachineHealthCheck, machine *capiv1.Machine) (reconcile.Result, error) { +func remediate(r *ReconcileMachineHealthCheck, machine *mapiv1.Machine) (reconcile.Result, error) { glog.Infof("Initialising remediation logic for machine %s", machine.Name) if isMaster(*machine, r.client) { glog.Infof("The machine %s is a master node, skipping remediation", machine.Name) @@ -191,7 +191,7 @@ func remediate(r *ReconcileMachineHealthCheck, machine *capiv1.Machine) (reconci return reconcile.Result{}, nil } -func getNodeFromMachine(machine capiv1.Machine, client client.Client) (*corev1.Node, error) { +func getNodeFromMachine(machine mapiv1.Machine, client client.Client) (*corev1.Node, error) { if machine.Status.NodeRef == nil { glog.Errorf("node NodeRef not found in machine %s", machine.Name) return nil, golangerrors.New("node NodeRef not found in machine") @@ -214,7 +214,7 @@ func unhealthyForTooLong(node *corev1.Node) bool { return false } -func hasMachineSetOwner(machine capiv1.Machine) bool { +func hasMachineSetOwner(machine mapiv1.Machine) bool { ownerRefs := machine.ObjectMeta.GetOwnerReferences() for _, or := range ownerRefs { if or.Kind == ownerControllerKind { @@ -249,7 +249,7 @@ func getNodeCondition(node *corev1.Node, conditionType corev1.NodeConditionType) return nil } -func hasMatchingLabels(machineHealthCheck *healthcheckingv1alpha1.MachineHealthCheck, machine *capiv1.Machine) bool { +func hasMatchingLabels(machineHealthCheck *healthcheckingv1alpha1.MachineHealthCheck, machine *mapiv1.Machine) bool { selector, err := metav1.LabelSelectorAsSelector(&machineHealthCheck.Spec.Selector) if err != nil { glog.Warningf("unable to convert selector: %v", err) @@ -267,7 +267,7 @@ func hasMatchingLabels(machineHealthCheck *healthcheckingv1alpha1.MachineHealthC return true } -func isMaster(machine capiv1.Machine, client client.Client) bool { +func isMaster(machine mapiv1.Machine, client client.Client) bool { machineMasterLabels := []string{ "sigs.k8s.io/cluster-api-machine-role", "sigs.k8s.io/cluster-api-machine-type", diff --git a/pkg/controller/machinehealthcheck/machinehealthcheck_controller_test.go b/pkg/controller/machinehealthcheck/machinehealthcheck_controller_test.go index 0b96cf7533..96f2bb3ca4 100644 --- a/pkg/controller/machinehealthcheck/machinehealthcheck_controller_test.go +++ b/pkg/controller/machinehealthcheck/machinehealthcheck_controller_test.go @@ -2,20 +2,21 @@ package machinehealthcheck import ( "fmt" + "reflect" + "testing" + "time" + + mapiv1alpha1 "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" healthcheckingapis "github.com/openshift/machine-api-operator/pkg/apis" healthcheckingv1alpha1 "github.com/openshift/machine-api-operator/pkg/apis/healthchecking/v1alpha1" - "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" - "reflect" - capiv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "testing" - "time" ) const ( @@ -28,7 +29,7 @@ var ( func init() { // Add types to scheme - capiv1alpha1.AddToScheme(scheme.Scheme) + mapiv1alpha1.AddToScheme(scheme.Scheme) healthcheckingapis.AddToScheme(scheme.Scheme) } @@ -62,8 +63,8 @@ func node(name string, ready bool) *v1.Node { } } -func machine(name string) *capiv1alpha1.Machine { - return &capiv1alpha1.Machine{ +func machine(name string) *mapiv1alpha1.Machine { + return &mapiv1alpha1.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: namespace, @@ -80,7 +81,7 @@ func machine(name string) *capiv1alpha1.Machine { TypeMeta: metav1.TypeMeta{ Kind: "Machine", }, - Spec: capiv1alpha1.MachineSpec{}, + Spec: mapiv1alpha1.MachineSpec{}, } } @@ -108,7 +109,7 @@ func machineHealthCheck(name string) *healthcheckingv1alpha1.MachineHealthCheck func TestHasMatchingLabels(t *testing.T) { machine := machine("machine") testsCases := []struct { - machine *capiv1alpha1.Machine + machine *mapiv1alpha1.Machine machineHealthCheck *healthcheckingv1alpha1.MachineHealthCheck expected bool }{ @@ -227,7 +228,7 @@ func TestReconcile(t *testing.T) { nodeAnnotatedWithNoExistentMachine := node("noExistentMachine", true) nodeAnnotatedWithNoExistentMachine.Annotations[machineAnnotationKey] = "noExistentMachine" fakeMachine := machine("fakeMachine") - fakeMachine.Status = capiv1alpha1.MachineStatus{ + fakeMachine.Status = mapiv1alpha1.MachineStatus{ NodeRef: &corev1.ObjectReference{ Namespace: "", Name: "healthy", @@ -312,7 +313,7 @@ func TestHasMachineSetOwner(t *testing.T) { machineWithNoMachineSet.OwnerReferences = nil testsCases := []struct { - machine *capiv1alpha1.Machine + machine *mapiv1alpha1.Machine expected bool }{ { @@ -397,7 +398,7 @@ func TestRemediate(t *testing.T) { } machineWithNodeRecentlyUnhealthy := machine("machineWithNodeRecentlyUnhealthy") - machineWithNodeRecentlyUnhealthy.Status = capiv1alpha1.MachineStatus{ + machineWithNodeRecentlyUnhealthy.Status = mapiv1alpha1.MachineStatus{ NodeRef: &corev1.ObjectReference{ Namespace: "", Name: "nodeRecentlyUnhealthy", @@ -405,7 +406,7 @@ func TestRemediate(t *testing.T) { } machineWithNodeHealthy := machine("machineWithNodehealthy") - machineWithNodeHealthy.Status = capiv1alpha1.MachineStatus{ + machineWithNodeHealthy.Status = mapiv1alpha1.MachineStatus{ NodeRef: &corev1.ObjectReference{ Namespace: "", Name: "nodeHealthy", @@ -418,7 +419,7 @@ func TestRemediate(t *testing.T) { machineWithNoNodeRef := machine("machineWithNoNodeRef") testsCases := []struct { - machine *capiv1alpha1.Machine + machine *mapiv1alpha1.Machine expected expectedReconcile }{ { @@ -480,7 +481,7 @@ func TestIsMaster(t *testing.T) { masterMachine := machine("master") masterMachine.Labels["sigs.k8s.io/cluster-api-machine-role"] = "master" masterMachine.Labels["sigs.k8s.io/cluster-api-machine-type"] = "master" - masterMachine.Status = capiv1alpha1.MachineStatus{ + masterMachine.Status = mapiv1alpha1.MachineStatus{ NodeRef: &corev1.ObjectReference{ Namespace: "", Name: "master", @@ -496,7 +497,7 @@ func TestIsMaster(t *testing.T) { workerMachine.Labels["sigs.k8s.io/cluster-api-machine-role"] = "worker" workerMachine.Labels["sigs.k8s.io/cluster-api-machine-type"] = "worker" - workerMachine.Status = capiv1alpha1.MachineStatus{ + workerMachine.Status = mapiv1alpha1.MachineStatus{ NodeRef: &corev1.ObjectReference{ Namespace: "", Name: "worker", @@ -509,7 +510,7 @@ func TestIsMaster(t *testing.T) { workerNode.Labels["node-role.kubernetes.io/worker"] = "" testCases := []struct { - machine *capiv1alpha1.Machine + machine *mapiv1alpha1.Machine expected bool }{ { diff --git a/pkg/operator/config.go b/pkg/operator/config.go index 67ec485699..21c14c7336 100644 --- a/pkg/operator/config.go +++ b/pkg/operator/config.go @@ -8,11 +8,12 @@ import ( "github.com/ghodss/yaml" "bytes" + "reflect" + "text/template" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" - "reflect" - "text/template" ) const ( @@ -40,16 +41,19 @@ type OperatorConfig struct { type Controllers struct { Provider string + ProviderDeprecated string NodeLink string MachineHealthCheck string } // Images allows build systems to inject images for MAO components type Images struct { - MachineAPIOperator string `json:"machineAPIOperator"` - ClusterAPIControllerAWS string `json:"clusterAPIControllerAWS"` - ClusterAPIControllerOpenStack string `json:"clusterAPIControllerOpenStack"` - ClusterAPIControllerLibvirt string `json:"clusterAPIControllerLibvirt"` + MachineAPIOperator string `json:"machineAPIOperator"` + ClusterAPIControllerAWS string `json:"clusterAPIControllerAWS"` + ClusterAPIControllerAWSDeprecated string `json:"clusterAPIControllerAWSDeprecated"` + ClusterAPIControllerOpenStack string `json:"clusterAPIControllerOpenStack"` + ClusterAPIControllerLibvirt string `json:"clusterAPIControllerLibvirt"` + ClusterAPIControllerLibvirtDeprecated string `json:"clusterAPIControllerLibvirtDeprecated"` } // InstallConfig contains the mao relevant config coming from the install config, i.e provider diff --git a/pkg/operator/config_test.go b/pkg/operator/config_test.go index 5735c5d22e..1e2a98796f 100644 --- a/pkg/operator/config_test.go +++ b/pkg/operator/config_test.go @@ -3,7 +3,7 @@ package operator import ( "testing" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" ) var ( @@ -12,6 +12,8 @@ var ( expectedLibvirtImage = "docker.io/openshift/origin-libvirt-machine-controllers:v4.0.0" expectedOpenstackImage = "docker.io/openshift/origin-openstack-machine-controllers:v4.0.0" expectedMachineAPIOperatorImage = "docker.io/openshift/origin-machine-api-operator:v4.0.0" + expectedAWSImageDeprecated = "quay.io/coreos/cluster-api-provider-aws:origin-v4.0-2019-01-31-041134" + expectedLibvirtImageDeprecated = "quay.io/coreos/cluster-api-provider-libvirt:origin-v4.0-2019-01-31-041134" ) func TestInstallConfigFromClusterConfig(t *testing.T) { @@ -134,6 +136,12 @@ func TestGetImagesFromJSONFile(t *testing.T) { if img.ClusterAPIControllerOpenStack != expectedOpenstackImage { t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedOpenstackImage, img.ClusterAPIControllerOpenStack) } + if img.ClusterAPIControllerAWSDeprecated != expectedAWSImageDeprecated { + t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedAWSImageDeprecated, img.ClusterAPIControllerAWSDeprecated) + } + if img.ClusterAPIControllerLibvirtDeprecated != expectedLibvirtImageDeprecated { + t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedLibvirtImageDeprecated, img.ClusterAPIControllerLibvirtDeprecated) + } } func TestGetProviderControllerFromImages(t *testing.T) { diff --git a/pkg/operator/fixtures/images.json b/pkg/operator/fixtures/images.json index 40c303dc99..1d193a5bc3 100644 --- a/pkg/operator/fixtures/images.json +++ b/pkg/operator/fixtures/images.json @@ -2,5 +2,7 @@ "clusterAPIControllerAWS": "docker.io/openshift/origin-aws-machine-controllers:v4.0.0", "clusterAPIControllerOpenStack": "docker.io/openshift/origin-openstack-machine-controllers:v4.0.0", "clusterAPIControllerLibvirt": "docker.io/openshift/origin-libvirt-machine-controllers:v4.0.0", - "machineAPIOperator": "docker.io/openshift/origin-machine-api-operator:v4.0.0" + "machineAPIOperator": "docker.io/openshift/origin-machine-api-operator:v4.0.0", + "clusterAPIControllerLibvirtDeprecated": "quay.io/coreos/cluster-api-provider-libvirt:origin-v4.0-2019-01-31-041134", + "clusterAPIControllerAWSDeprecated": "quay.io/coreos/cluster-api-provider-aws:origin-v4.0-2019-01-31-041134" } diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index 76b1567ed3..85c8956fce 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -7,7 +7,7 @@ import ( "github.com/golang/glog" osclientset "github.com/openshift/client-go/config/clientset/versioned" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" appsinformersv1 "k8s.io/client-go/informers/apps/v1" @@ -20,7 +20,7 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" - "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" + "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) const ( @@ -210,10 +210,20 @@ func (optr *Operator) maoConfigFromInstallConfig() (*OperatorConfig, error) { return nil, err } + // TODO: Remove once we transition over machine.openshift.io group + var providerDreprecatedControllerImage string + switch provider { + case AWSProvider: + providerDreprecatedControllerImage = images.ClusterAPIControllerAWSDeprecated + case LibvirtProvider: + providerDreprecatedControllerImage = images.ClusterAPIControllerLibvirtDeprecated + } + return &OperatorConfig{ optr.namespace, Controllers{ providerControllerImage, + providerDreprecatedControllerImage, machineAPIOperatorImage, machineAPIOperatorImage, }, diff --git a/test/e2e/main.go b/test/e2e/main.go index 894f6b6c23..04d74deaad 100644 --- a/test/e2e/main.go +++ b/test/e2e/main.go @@ -5,9 +5,9 @@ import ( "github.com/golang/glog" osconfigv1 "github.com/openshift/api/config/v1" + capiv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" caov1alpha1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis" "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/operator_expectations.go b/test/e2e/operator_expectations.go index 9bbc425552..99e75ff204 100644 --- a/test/e2e/operator_expectations.go +++ b/test/e2e/operator_expectations.go @@ -10,6 +10,7 @@ import ( "github.com/golang/glog" osconfigv1 "github.com/openshift/api/config/v1" + capiv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" caov1alpha1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis/autoscaling/v1alpha1" cvoresourcemerge "github.com/openshift/cluster-version-operator/lib/resourcemerge" kappsapi "k8s.io/api/apps/v1" @@ -20,7 +21,6 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" - capiv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/integration/main.go b/test/integration/main.go index f72317e240..834d42e9f5 100644 --- a/test/integration/main.go +++ b/test/integration/main.go @@ -25,9 +25,9 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/clientcmd" - capiv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - capiv1alpha1scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" + capiv1alpha1 "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1" + "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset" + capiv1alpha1scheme "github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) const ( diff --git a/test/integration/manifests/images.configmap.yaml b/test/integration/manifests/images.configmap.yaml index cba0a0fa6d..e307a5f9eb 100644 --- a/test/integration/manifests/images.configmap.yaml +++ b/test/integration/manifests/images.configmap.yaml @@ -7,5 +7,7 @@ data: images.json: '{ "clusterAPIControllerAWS": "docker.io/openshift/origin-aws-machine-controllers:v4.0.0", "clusterAPIControllerLibvirt": "docker.io/openshift/origin-libvirt-machine-controllers:v4.0.0", - "machineAPIOperator": "{{ .Image }}" + "machineAPIOperator": "{{ .Image }}", + "clusterAPIControllerLibvirtDeprecated": "quay.io/coreos/cluster-api-provider-libvirt:origin-v4.0-2019-01-31-041134", + "clusterAPIControllerAWSDeprecated": "quay.io/coreos/cluster-api-provider-aws:origin-v4.0-2019-01-31-041134" }' \ No newline at end of file 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/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/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/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/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/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/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/doc.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/doc.go new file mode 100644 index 0000000000..ca985dc5b9 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/doc.go @@ -0,0 +1,23 @@ +/* +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 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 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/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/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/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/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/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/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/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/doc.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/doc.go new file mode 100644 index 0000000000..11ae7049d1 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* +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. + +// This package has the automatically generated typed clients. +package v1beta1 diff --git a/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/generated_expansion.go b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/generated_expansion.go new file mode 100644 index 0000000000..e4cc014464 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/clientset_generated/clientset/typed/machine/v1beta1/generated_expansion.go @@ -0,0 +1,29 @@ +/* +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 + +type ClusterExpansion 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/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/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/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/interface.go b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/interface.go new file mode 100644 index 0000000000..ef2ffff994 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/pkg/client/informers_generated/externalversions/machine/interface.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. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package machine + +import ( + 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 { + // V1beta1 provides access to shared informers for resources in V1beta1. + V1beta1() v1beta1.Interface +} + +type group 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 &group{factory: f, namespace: namespace, tweakListOptions: 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/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/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/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/github.com/pkg/errors/LICENSE b/vendor/github.com/pkg/errors/LICENSE new file mode 100644 index 0000000000..835ba3e755 --- /dev/null +++ b/vendor/github.com/pkg/errors/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2015, Dave Cheney +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/pkg/errors/errors.go new file mode 100644 index 0000000000..7421f326ff --- /dev/null +++ b/vendor/github.com/pkg/errors/errors.go @@ -0,0 +1,282 @@ +// Package errors provides simple error handling primitives. +// +// The traditional error handling idiom in Go is roughly akin to +// +// if err != nil { +// return err +// } +// +// which when applied recursively up the call stack results in error reports +// without context or debugging information. The errors package allows +// programmers to add context to the failure path in their code in a way +// that does not destroy the original value of the error. +// +// Adding context to an error +// +// The errors.Wrap function returns a new error that adds context to the +// original error by recording a stack trace at the point Wrap is called, +// together with the supplied message. For example +// +// _, err := ioutil.ReadAll(r) +// if err != nil { +// return errors.Wrap(err, "read failed") +// } +// +// If additional control is required, the errors.WithStack and +// errors.WithMessage functions destructure errors.Wrap into its component +// operations: annotating an error with a stack trace and with a message, +// respectively. +// +// Retrieving the cause of an error +// +// Using errors.Wrap constructs a stack of errors, adding context to the +// preceding error. Depending on the nature of the error it may be necessary +// to reverse the operation of errors.Wrap to retrieve the original error +// for inspection. Any error value which implements this interface +// +// type causer interface { +// Cause() error +// } +// +// can be inspected by errors.Cause. errors.Cause will recursively retrieve +// the topmost error that does not implement causer, which is assumed to be +// the original cause. For example: +// +// switch err := errors.Cause(err).(type) { +// case *MyError: +// // handle specifically +// default: +// // unknown error +// } +// +// Although the causer interface is not exported by this package, it is +// considered a part of its stable public interface. +// +// Formatted printing of errors +// +// All error values returned from this package implement fmt.Formatter and can +// be formatted by the fmt package. The following verbs are supported: +// +// %s print the error. If the error has a Cause it will be +// printed recursively. +// %v see %s +// %+v extended format. Each Frame of the error's StackTrace will +// be printed in detail. +// +// Retrieving the stack trace of an error or wrapper +// +// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are +// invoked. This information can be retrieved with the following interface: +// +// type stackTracer interface { +// StackTrace() errors.StackTrace +// } +// +// The returned errors.StackTrace type is defined as +// +// type StackTrace []Frame +// +// The Frame type represents a call site in the stack trace. Frame supports +// the fmt.Formatter interface that can be used for printing information about +// the stack trace of this error. For example: +// +// if err, ok := err.(stackTracer); ok { +// for _, f := range err.StackTrace() { +// fmt.Printf("%+s:%d", f) +// } +// } +// +// Although the stackTracer interface is not exported by this package, it is +// considered a part of its stable public interface. +// +// See the documentation for Frame.Format for more details. +package errors + +import ( + "fmt" + "io" +) + +// New returns an error with the supplied message. +// New also records the stack trace at the point it was called. +func New(message string) error { + return &fundamental{ + msg: message, + stack: callers(), + } +} + +// Errorf formats according to a format specifier and returns the string +// as a value that satisfies error. +// Errorf also records the stack trace at the point it was called. +func Errorf(format string, args ...interface{}) error { + return &fundamental{ + msg: fmt.Sprintf(format, args...), + stack: callers(), + } +} + +// fundamental is an error that has a message and a stack, but no caller. +type fundamental struct { + msg string + *stack +} + +func (f *fundamental) Error() string { return f.msg } + +func (f *fundamental) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + if s.Flag('+') { + io.WriteString(s, f.msg) + f.stack.Format(s, verb) + return + } + fallthrough + case 's': + io.WriteString(s, f.msg) + case 'q': + fmt.Fprintf(s, "%q", f.msg) + } +} + +// WithStack annotates err with a stack trace at the point WithStack was called. +// If err is nil, WithStack returns nil. +func WithStack(err error) error { + if err == nil { + return nil + } + return &withStack{ + err, + callers(), + } +} + +type withStack struct { + error + *stack +} + +func (w *withStack) Cause() error { return w.error } + +func (w *withStack) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + if s.Flag('+') { + fmt.Fprintf(s, "%+v", w.Cause()) + w.stack.Format(s, verb) + return + } + fallthrough + case 's': + io.WriteString(s, w.Error()) + case 'q': + fmt.Fprintf(s, "%q", w.Error()) + } +} + +// Wrap returns an error annotating err with a stack trace +// at the point Wrap is called, and the supplied message. +// If err is nil, Wrap returns nil. +func Wrap(err error, message string) error { + if err == nil { + return nil + } + err = &withMessage{ + cause: err, + msg: message, + } + return &withStack{ + err, + callers(), + } +} + +// Wrapf returns an error annotating err with a stack trace +// at the point Wrapf is called, and the format specifier. +// If err is nil, Wrapf returns nil. +func Wrapf(err error, format string, args ...interface{}) error { + if err == nil { + return nil + } + err = &withMessage{ + cause: err, + msg: fmt.Sprintf(format, args...), + } + return &withStack{ + err, + callers(), + } +} + +// WithMessage annotates err with a new message. +// If err is nil, WithMessage returns nil. +func WithMessage(err error, message string) error { + if err == nil { + return nil + } + return &withMessage{ + cause: err, + msg: message, + } +} + +// WithMessagef annotates err with the format specifier. +// If err is nil, WithMessagef returns nil. +func WithMessagef(err error, format string, args ...interface{}) error { + if err == nil { + return nil + } + return &withMessage{ + cause: err, + msg: fmt.Sprintf(format, args...), + } +} + +type withMessage struct { + cause error + msg string +} + +func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() } +func (w *withMessage) Cause() error { return w.cause } + +func (w *withMessage) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + if s.Flag('+') { + fmt.Fprintf(s, "%+v\n", w.Cause()) + io.WriteString(s, w.msg) + return + } + fallthrough + case 's', 'q': + io.WriteString(s, w.Error()) + } +} + +// Cause returns the underlying cause of the error, if possible. +// An error value has a cause if it implements the following +// interface: +// +// type causer interface { +// Cause() error +// } +// +// If the error does not implement Cause, the original error will +// be returned. If the error is nil, nil will be returned without further +// investigation. +func Cause(err error) error { + type causer interface { + Cause() error + } + + for err != nil { + cause, ok := err.(causer) + if !ok { + break + } + err = cause.Cause() + } + return err +} diff --git a/vendor/github.com/pkg/errors/stack.go b/vendor/github.com/pkg/errors/stack.go new file mode 100644 index 0000000000..2874a048cf --- /dev/null +++ b/vendor/github.com/pkg/errors/stack.go @@ -0,0 +1,147 @@ +package errors + +import ( + "fmt" + "io" + "path" + "runtime" + "strings" +) + +// Frame represents a program counter inside a stack frame. +type Frame uintptr + +// pc returns the program counter for this frame; +// multiple frames may have the same PC value. +func (f Frame) pc() uintptr { return uintptr(f) - 1 } + +// file returns the full path to the file that contains the +// function for this Frame's pc. +func (f Frame) file() string { + fn := runtime.FuncForPC(f.pc()) + if fn == nil { + return "unknown" + } + file, _ := fn.FileLine(f.pc()) + return file +} + +// line returns the line number of source code of the +// function for this Frame's pc. +func (f Frame) line() int { + fn := runtime.FuncForPC(f.pc()) + if fn == nil { + return 0 + } + _, line := fn.FileLine(f.pc()) + return line +} + +// Format formats the frame according to the fmt.Formatter interface. +// +// %s source file +// %d source line +// %n function name +// %v equivalent to %s:%d +// +// Format accepts flags that alter the printing of some verbs, as follows: +// +// %+s function name and path of source file relative to the compile time +// GOPATH separated by \n\t (\n\t) +// %+v equivalent to %+s:%d +func (f Frame) Format(s fmt.State, verb rune) { + switch verb { + case 's': + switch { + case s.Flag('+'): + pc := f.pc() + fn := runtime.FuncForPC(pc) + if fn == nil { + io.WriteString(s, "unknown") + } else { + file, _ := fn.FileLine(pc) + fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file) + } + default: + io.WriteString(s, path.Base(f.file())) + } + case 'd': + fmt.Fprintf(s, "%d", f.line()) + case 'n': + name := runtime.FuncForPC(f.pc()).Name() + io.WriteString(s, funcname(name)) + case 'v': + f.Format(s, 's') + io.WriteString(s, ":") + f.Format(s, 'd') + } +} + +// StackTrace is stack of Frames from innermost (newest) to outermost (oldest). +type StackTrace []Frame + +// Format formats the stack of Frames according to the fmt.Formatter interface. +// +// %s lists source files for each Frame in the stack +// %v lists the source file and line number for each Frame in the stack +// +// Format accepts flags that alter the printing of some verbs, as follows: +// +// %+v Prints filename, function, and line number for each Frame in the stack. +func (st StackTrace) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + switch { + case s.Flag('+'): + for _, f := range st { + fmt.Fprintf(s, "\n%+v", f) + } + case s.Flag('#'): + fmt.Fprintf(s, "%#v", []Frame(st)) + default: + fmt.Fprintf(s, "%v", []Frame(st)) + } + case 's': + fmt.Fprintf(s, "%s", []Frame(st)) + } +} + +// stack represents a stack of program counters. +type stack []uintptr + +func (s *stack) Format(st fmt.State, verb rune) { + switch verb { + case 'v': + switch { + case st.Flag('+'): + for _, pc := range *s { + f := Frame(pc) + fmt.Fprintf(st, "\n%+v", f) + } + } + } +} + +func (s *stack) StackTrace() StackTrace { + f := make([]Frame, len(*s)) + for i := 0; i < len(f); i++ { + f[i] = Frame((*s)[i]) + } + return f +} + +func callers() *stack { + const depth = 32 + var pcs [depth]uintptr + n := runtime.Callers(3, pcs[:]) + var st stack = pcs[0:n] + return &st +} + +// funcname removes the path prefix component of a function's name reported by func.Name(). +func funcname(name string) string { + i := strings.LastIndex(name, "/") + name = name[i+1:] + i = strings.Index(name, ".") + return name[i+1:] +}