From 688f73dd8a745962c022172d5fafb820c7799a70 Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Mon, 24 Jun 2019 14:55:47 -0700 Subject: [PATCH] the great renaming Signed-off-by: Vince Prignano --- Makefile | 8 +- cmd/clusterctl/clusterdeployer/BUILD.bazel | 4 +- .../clusterdeployer/clusterclient/BUILD.bazel | 2 +- .../clusterclient/clusterclient.go | 178 +- .../clusterdeployer/clusterdeployer.go | 7 +- .../clusterdeployer/clusterdeployer_test.go | 52 +- .../clusterdeployer/provider/BUILD.bazel | 2 +- .../clusterdeployer/provider/provider.go | 2 +- cmd/clusterctl/phases/BUILD.bazel | 4 +- cmd/clusterctl/phases/applycluster.go | 2 +- .../phases/applyclusterapicomponents.go | 2 +- cmd/clusterctl/phases/applymachines.go | 2 +- cmd/clusterctl/phases/pivot.go | 87 +- cmd/clusterctl/phases/pivot_test.go | 64 +- cmd/clusterctl/providercomponents/BUILD.bazel | 2 +- .../providercomponents_test.go | 4 +- cmd/clusterctl/validation/BUILD.bazel | 6 +- .../validate_cluster_api_objects.go | 18 +- .../validate_cluster_api_objects_test.go | 38 +- cmd/example-provider/main.go | 4 +- config/crds/cluster.k8s.io_clusters.yaml | 1412 ++++++--- .../crds/cluster.k8s.io_machineclasses.yaml | 736 ++--- .../cluster.k8s.io_machinedeployments.yaml | 2592 +++++++++++------ config/crds/cluster.k8s.io_machines.yaml | 2289 ++++++++++----- config/crds/cluster.k8s.io_machinesets.yaml | 2485 +++++++++++----- config/crds/cluster_v1alpha2_machine.yaml | 185 -- .../cluster_v1alpha2_machinedeployment.yaml | 232 -- config/crds/cluster_v1alpha2_machineset.yaml | 195 -- config/samples/cluster_v1alpha1_cluster.yaml | 2 +- config/samples/cluster_v1alpha1_machine.yaml | 2 +- .../cluster_v1alpha1_machinedeployment.yaml | 4 +- .../samples/cluster_v1alpha1_machineset.yaml | 2 +- .../create_actuators.md | 4 +- docs/examples/cluster/cluster.yaml | 2 +- docs/examples/machine/machine.yaml | 2 +- .../machinedeployment/machinedeployment.yaml | 2 +- docs/examples/machineset/machineset.yaml | 2 +- pkg/apis/cluster/v1alpha2/BUILD.bazel | 3 +- pkg/apis/cluster/v1alpha2/cluster_types.go | 3 +- pkg/apis/cluster/v1alpha2/common_type.go | 105 + pkg/apis/cluster/v1alpha2/defaults.go | 74 + pkg/apis/cluster/v1alpha2/machine_types.go | 8 +- .../v1alpha2/machinedeployment_types.go | 3 +- pkg/apis/cluster/v1alpha2/machineset_types.go | 7 +- pkg/apis/cluster/v1alpha2/register.go | 2 +- .../cluster/v1alpha2/testutil/BUILD.bazel | 9 + .../cluster/v1alpha2/testutil/testutil.go} | 24 +- .../cluster/v1alpha2/zz_generated.deepcopy.go | 38 + .../clientset_generated/clientset/BUILD.bazel | 2 +- .../clientset/clientset.go | 18 +- .../clientset/fake/BUILD.bazel | 6 +- .../clientset/fake/clientset_generated.go | 10 +- .../clientset/fake/register.go | 4 +- .../clientset/scheme/BUILD.bazel | 2 +- .../clientset/scheme/register.go | 4 +- .../v1alpha1/fake/fake_machineclass.go | 128 - .../typed/cluster/v1alpha1/machineclass.go | 174 -- .../{v1alpha1 => v1alpha2}/BUILD.bazel | 5 +- .../cluster/{v1alpha1 => v1alpha2}/cluster.go | 42 +- .../{v1alpha1 => v1alpha2}/cluster_client.go | 43 +- .../cluster/{v1alpha1 => v1alpha2}/doc.go | 2 +- .../{v1alpha1 => v1alpha2}/fake/BUILD.bazel | 7 +- .../{v1alpha1 => v1alpha2}/fake/doc.go | 0 .../fake/fake_cluster.go | 50 +- .../fake/fake_cluster_client.go | 18 +- .../fake/fake_machine.go | 50 +- .../fake/fake_machinedeployment.go | 50 +- .../fake/fake_machineset.go | 50 +- .../generated_expansion.go | 4 +- .../cluster/{v1alpha1 => v1alpha2}/machine.go | 42 +- .../machinedeployment.go | 42 +- .../{v1alpha1 => v1alpha2}/machineset.go | 42 +- .../externalversions/BUILD.bazel | 2 +- .../externalversions/cluster/BUILD.bazel | 2 +- .../externalversions/cluster/interface.go | 12 +- .../cluster/v1alpha1/machineclass.go | 89 - .../{v1alpha1 => v1alpha2}/BUILD.bazel | 7 +- .../cluster/{v1alpha1 => v1alpha2}/cluster.go | 20 +- .../{v1alpha1 => v1alpha2}/interface.go | 9 +- .../cluster/{v1alpha1 => v1alpha2}/machine.go | 20 +- .../machinedeployment.go | 20 +- .../{v1alpha1 => v1alpha2}/machineset.go | 20 +- .../externalversions/generic.go | 22 +- .../cluster/v1alpha1/machineclass.go | 94 - .../{v1alpha1 => v1alpha2}/BUILD.bazel | 5 +- .../cluster/{v1alpha1 => v1alpha2}/cluster.go | 24 +- .../expansion_generated.go | 10 +- .../cluster/{v1alpha1 => v1alpha2}/machine.go | 24 +- .../machinedeployment.go | 24 +- .../{v1alpha1 => v1alpha2}/machineset.go | 24 +- pkg/controller/cluster/BUILD.bazel | 4 +- pkg/controller/cluster/actuator.go | 2 +- pkg/controller/cluster/cluster_controller.go | 4 +- .../cluster/cluster_reconciler_test.go | 12 +- pkg/controller/cluster/testactuator.go | 6 +- pkg/controller/machine/BUILD.bazel | 12 +- pkg/controller/machine/actuator.go | 39 - pkg/controller/machine/machine_controller.go | 163 +- .../machine/machine_controller_test.go | 58 +- .../machine/machine_reconciler_test.go | 9 +- pkg/controller/machine/testactuator.go | 101 - pkg/controller/machinedeployment/BUILD.bazel | 4 +- .../machinedeployment_controller.go | 52 +- .../machinedeployment_controller_test.go | 80 +- .../machinedeployment_reconciler_test.go | 9 +- pkg/controller/machinedeployment/rolling.go | 12 +- pkg/controller/machinedeployment/sync.go | 2 +- .../machinedeployment/util/BUILD.bazel | 4 +- pkg/controller/machinedeployment/util/util.go | 74 +- .../machinedeployment/util/util_test.go | 150 +- pkg/controller/machineset/BUILD.bazel | 4 +- pkg/controller/machineset/delete_policy.go | 26 +- .../machineset/delete_policy_test.go | 128 +- pkg/controller/machineset/machine.go | 10 +- pkg/controller/machineset/machine_test.go | 18 +- .../machineset/machineset_controller.go | 2 +- .../machineset/machineset_controller_test.go | 56 +- .../machineset/machineset_reconciler_test.go | 19 +- pkg/controller/machineset/status.go | 8 +- pkg/controller/node/BUILD.bazel | 51 - pkg/controller/node/node.go | 141 - pkg/controller/node/node_controller.go | 99 - .../node/node_reconciler_suite_test.go | 74 - pkg/controller/node/node_reconciler_test.go | 77 - pkg/controller/noderef/BUILD.bazel | 4 +- pkg/controller/noderef/noderef_controller.go | 18 +- .../noderef/noderef_controller_test.go | 6 +- pkg/controller/remote/BUILD.bazel | 4 +- pkg/controller/remote/cluster.go | 6 +- pkg/controller/remote/cluster_test.go | 8 +- .../example/actuators/cluster/BUILD.bazel | 4 +- .../actuators/cluster/clusteractuator.go | 8 +- .../example/actuators/machine/BUILD.bazel | 4 +- .../actuators/machine/machineactuator.go | 8 +- pkg/util/BUILD.bazel | 2 +- pkg/util/util.go | 4 +- pkg/util/util_test.go | 32 +- test/integration/cluster/BUILD.bazel | 4 +- test/integration/cluster/cluster_test.go | 2 +- 139 files changed, 7546 insertions(+), 6213 deletions(-) delete mode 100644 config/crds/cluster_v1alpha2_machine.yaml delete mode 100644 config/crds/cluster_v1alpha2_machinedeployment.yaml delete mode 100644 config/crds/cluster_v1alpha2_machineset.yaml create mode 100644 pkg/apis/cluster/v1alpha2/common_type.go create mode 100644 pkg/apis/cluster/v1alpha2/defaults.go create mode 100644 pkg/apis/cluster/v1alpha2/testutil/BUILD.bazel rename pkg/{controller/add_node.go => apis/cluster/v1alpha2/testutil/testutil.go} (51%) delete mode 100644 pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineclass.go delete mode 100644 pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/BUILD.bazel (87%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/cluster.go (81%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/cluster_client.go (62%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/doc.go (97%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/fake/BUILD.bazel (85%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/fake/doc.go (100%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/fake/fake_cluster.go (75%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/fake/fake_cluster_client.go (59%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/fake/fake_machine.go (75%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/fake/fake_machinedeployment.go (74%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/fake/fake_machineset.go (74%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/generated_expansion.go (93%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/machine.go (81%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/machinedeployment.go (81%) rename pkg/client/clientset_generated/clientset/typed/cluster/{v1alpha1 => v1alpha2}/machineset.go (80%) delete mode 100644 pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go rename pkg/client/informers_generated/externalversions/cluster/{v1alpha1 => v1alpha2}/BUILD.bazel (81%) rename pkg/client/informers_generated/externalversions/cluster/{v1alpha1 => v1alpha2}/cluster.go (84%) rename pkg/client/informers_generated/externalversions/cluster/{v1alpha1 => v1alpha2}/interface.go (88%) rename pkg/client/informers_generated/externalversions/cluster/{v1alpha1 => v1alpha2}/machine.go (84%) rename pkg/client/informers_generated/externalversions/cluster/{v1alpha1 => v1alpha2}/machinedeployment.go (85%) rename pkg/client/informers_generated/externalversions/cluster/{v1alpha1 => v1alpha2}/machineset.go (84%) delete mode 100644 pkg/client/listers_generated/cluster/v1alpha1/machineclass.go rename pkg/client/listers_generated/cluster/{v1alpha1 => v1alpha2}/BUILD.bazel (84%) rename pkg/client/listers_generated/cluster/{v1alpha1 => v1alpha2}/cluster.go (81%) rename pkg/client/listers_generated/cluster/{v1alpha1 => v1alpha2}/expansion_generated.go (84%) rename pkg/client/listers_generated/cluster/{v1alpha1 => v1alpha2}/machine.go (81%) rename pkg/client/listers_generated/cluster/{v1alpha1 => v1alpha2}/machinedeployment.go (82%) rename pkg/client/listers_generated/cluster/{v1alpha1 => v1alpha2}/machineset.go (81%) delete mode 100644 pkg/controller/machine/actuator.go delete mode 100644 pkg/controller/machine/testactuator.go delete mode 100644 pkg/controller/node/BUILD.bazel delete mode 100644 pkg/controller/node/node.go delete mode 100644 pkg/controller/node/node_controller.go delete mode 100644 pkg/controller/node/node_reconciler_suite_test.go delete mode 100644 pkg/controller/node/node_reconciler_test.go diff --git a/Makefile b/Makefile index 0e0721f2f3a7..7b0efbefa850 100644 --- a/Makefile +++ b/Makefile @@ -102,15 +102,15 @@ generate-clientset: ## Generate a typed clientset go run ./vendor/k8s.io/code-generator/cmd/client-gen/main.go \ --clientset-name clientset \ --input-base sigs.k8s.io/cluster-api/pkg/apis \ - --input cluster/v1alpha1 \ + --input cluster/v1alpha2 \ --output-package sigs.k8s.io/cluster-api/pkg/client/clientset_generated \ --go-header-file=./hack/boilerplate/boilerplate.generatego.txt go run ./vendor/k8s.io/code-generator/cmd/lister-gen/main.go \ - --input-dirs sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1 \ + --input-dirs sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2 \ --output-package sigs.k8s.io/cluster-api/pkg/client/listers_generated \ --go-header-file=./hack/boilerplate/boilerplate.generatego.txt go run ./vendor/k8s.io/code-generator/cmd/informer-gen/main.go \ - --input-dirs sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1 \ + --input-dirs sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2 \ --versioned-clientset-package sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset \ --listers-package sigs.k8s.io/cluster-api/pkg/client/listers_generated \ --output-package sigs.k8s.io/cluster-api/pkg/client/informers_generated \ @@ -120,7 +120,7 @@ generate-clientset: ## Generate a typed clientset generate-manifests: ## Generate manifests e.g. CRD, RBAC etc. go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go \ paths=./pkg/... \ - crd:trivialVersions=true \ + crd \ rbac:roleName=manager-role \ output:crd:dir=./config/crds cp -f ./config/rbac/role*.yaml ./config/ci/rbac/ diff --git a/cmd/clusterctl/clusterdeployer/BUILD.bazel b/cmd/clusterctl/clusterdeployer/BUILD.bazel index 0fdbfaafc620..63bd96599baf 100644 --- a/cmd/clusterctl/clusterdeployer/BUILD.bazel +++ b/cmd/clusterctl/clusterdeployer/BUILD.bazel @@ -14,7 +14,7 @@ go_library( "//cmd/clusterctl/clusterdeployer/provider:go_default_library", "//cmd/clusterctl/phases:go_default_library", "//cmd/clusterctl/providercomponents:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/client-go/kubernetes:go_default_library", "//vendor/k8s.io/klog:go_default_library", @@ -28,7 +28,7 @@ go_test( deps = [ "//cmd/clusterctl/clusterdeployer/clusterclient:go_default_library", "//cmd/clusterctl/clusterdeployer/provider:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/cmd/clusterctl/clusterdeployer/clusterclient/BUILD.bazel b/cmd/clusterctl/clusterdeployer/clusterclient/BUILD.bazel index 69dad4597633..3b105d0be027 100644 --- a/cmd/clusterctl/clusterdeployer/clusterclient/BUILD.bazel +++ b/cmd/clusterctl/clusterdeployer/clusterclient/BUILD.bazel @@ -10,7 +10,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//cmd/clusterctl/clientcmd:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/client/clientset_generated/clientset:go_default_library", "//pkg/util:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", diff --git a/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go b/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go index 810b04f89bdb..8c8f861be8e8 100644 --- a/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go +++ b/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go @@ -38,7 +38,7 @@ import ( tcmd "k8s.io/client-go/tools/clientcmd" "k8s.io/klog" "sigs.k8s.io/cluster-api/cmd/clusterctl/clientcmd" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" "sigs.k8s.io/cluster-api/pkg/util" ) @@ -64,15 +64,12 @@ type Client interface { Apply(string) error Close() error CreateClusterObject(*clusterv1.Cluster) error - CreateMachineClass(*clusterv1.MachineClass) error CreateMachineDeployments([]*clusterv1.MachineDeployment, string) error CreateMachineSets([]*clusterv1.MachineSet, string) error CreateMachines([]*clusterv1.Machine, string) error Delete(string) error DeleteClusters(string) error DeleteNamespace(string) error - DeleteMachineClasses(string) error - DeleteMachineClass(namespace, name string) error DeleteMachineDeployments(string) error DeleteMachineSets(string) error DeleteMachines(string) error @@ -84,7 +81,6 @@ type Client interface { GetClusters(string) ([]*clusterv1.Cluster, error) GetCluster(string, string) (*clusterv1.Cluster, error) GetContextNamespace() string - GetMachineClasses(namespace string) ([]*clusterv1.MachineClass, error) GetMachineDeployment(namespace, name string) (*clusterv1.MachineDeployment, error) GetMachineDeploymentsForCluster(*clusterv1.Cluster) ([]*clusterv1.MachineDeployment, error) GetMachineDeployments(string) ([]*clusterv1.MachineDeployment, error) @@ -96,7 +92,7 @@ type Client interface { GetMachinesForCluster(*clusterv1.Cluster) ([]*clusterv1.Machine, error) GetMachinesForMachineSet(*clusterv1.MachineSet) ([]*clusterv1.Machine, error) ScaleStatefulSet(namespace, name string, scale int32) error - WaitForClusterV1alpha1Ready() error + WaitForClusterV1alpha2Ready() error UpdateClusterObjectEndpoint(string, string, string) error WaitForResourceStatuses() error } @@ -238,18 +234,18 @@ func (c *client) GetCluster(name, ns string) (*clusterv1.Cluster, error) { // ForceDeleteCluster removes the finalizer for a Cluster prior to deleting, this is used during pivot func (c *client) ForceDeleteCluster(namespace, name string) error { - cluster, err := c.clientSet.ClusterV1alpha1().Clusters(namespace).Get(name, metav1.GetOptions{}) + cluster, err := c.clientSet.ClusterV1alpha2().Clusters(namespace).Get(name, metav1.GetOptions{}) if err != nil { return errors.Wrapf(err, "error getting cluster %s/%s", namespace, name) } cluster.ObjectMeta.SetFinalizers([]string{}) - if _, err := c.clientSet.ClusterV1alpha1().Clusters(namespace).Update(cluster); err != nil { + if _, err := c.clientSet.ClusterV1alpha2().Clusters(namespace).Update(cluster); err != nil { return errors.Wrapf(err, "error removing finalizer on cluster %s/%s", namespace, name) } - if err := c.clientSet.ClusterV1alpha1().Clusters(namespace).Delete(name, &metav1.DeleteOptions{}); err != nil { + if err := c.clientSet.ClusterV1alpha2().Clusters(namespace).Delete(name, &metav1.DeleteOptions{}); err != nil { return errors.Wrapf(err, "error deleting cluster %s/%s", namespace, name) } @@ -258,7 +254,7 @@ func (c *client) ForceDeleteCluster(namespace, name string) error { func (c *client) GetClusters(namespace string) ([]*clusterv1.Cluster, error) { clusters := []*clusterv1.Cluster{} - clusterlist, err := c.clientSet.ClusterV1alpha1().Clusters(namespace).List(metav1.ListOptions{}) + clusterlist, err := c.clientSet.ClusterV1alpha2().Clusters(namespace).List(metav1.ListOptions{}) if err != nil { return nil, errors.Wrapf(err, "error listing cluster objects in namespace %q", namespace) } @@ -269,20 +265,8 @@ func (c *client) GetClusters(namespace string) ([]*clusterv1.Cluster, error) { return clusters, nil } -func (c *client) GetMachineClasses(namespace string) ([]*clusterv1.MachineClass, error) { - machineClassesList, err := c.clientSet.ClusterV1alpha1().MachineClasses(namespace).List(metav1.ListOptions{}) - if err != nil { - return nil, errors.Wrapf(err, "error listing MachineClasses in namespace %q", namespace) - } - var machineClasses []*clusterv1.MachineClass - for i := 0; i < len(machineClassesList.Items); i++ { - machineClasses = append(machineClasses, &machineClassesList.Items[i]) - } - return machineClasses, nil -} - func (c *client) GetMachineDeployment(namespace, name string) (*clusterv1.MachineDeployment, error) { - machineDeployment, err := c.clientSet.ClusterV1alpha1().MachineDeployments(namespace).Get(name, metav1.GetOptions{}) + machineDeployment, err := c.clientSet.ClusterV1alpha2().MachineDeployments(namespace).Get(name, metav1.GetOptions{}) if err != nil { return nil, errors.Wrapf(err, "error getting MachineDeployment: %s/%s", namespace, name) } @@ -290,7 +274,7 @@ func (c *client) GetMachineDeployment(namespace, name string) (*clusterv1.Machin } func (c *client) GetMachineDeploymentsForCluster(cluster *clusterv1.Cluster) ([]*clusterv1.MachineDeployment, error) { - machineDeploymentList, err := c.clientSet.ClusterV1alpha1().MachineDeployments(cluster.Namespace).List(metav1.ListOptions{ + machineDeploymentList, err := c.clientSet.ClusterV1alpha2().MachineDeployments(cluster.Namespace).List(metav1.ListOptions{ LabelSelector: fmt.Sprintf("%s=%s", machineClusterLabelName, cluster.Name), }) if err != nil { @@ -309,7 +293,7 @@ func (c *client) GetMachineDeploymentsForCluster(cluster *clusterv1.Cluster) ([] } func (c *client) GetMachineDeployments(namespace string) ([]*clusterv1.MachineDeployment, error) { - machineDeploymentList, err := c.clientSet.ClusterV1alpha1().MachineDeployments(namespace).List(metav1.ListOptions{}) + machineDeploymentList, err := c.clientSet.ClusterV1alpha2().MachineDeployments(namespace).List(metav1.ListOptions{}) if err != nil { return nil, errors.Wrapf(err, "error listing machine deployment objects in namespace %q", namespace) } @@ -321,7 +305,7 @@ func (c *client) GetMachineDeployments(namespace string) ([]*clusterv1.MachineDe } func (c *client) GetMachineSet(namespace, name string) (*clusterv1.MachineSet, error) { - machineSet, err := c.clientSet.ClusterV1alpha1().MachineSets(namespace).Get(name, metav1.GetOptions{}) + machineSet, err := c.clientSet.ClusterV1alpha2().MachineSets(namespace).Get(name, metav1.GetOptions{}) if err != nil { return nil, errors.Wrapf(err, "error getting MachineSet: %s/%s", namespace, name) } @@ -329,7 +313,7 @@ func (c *client) GetMachineSet(namespace, name string) (*clusterv1.MachineSet, e } func (c *client) GetMachineSets(namespace string) ([]*clusterv1.MachineSet, error) { - machineSetList, err := c.clientSet.ClusterV1alpha1().MachineSets(namespace).List(metav1.ListOptions{}) + machineSetList, err := c.clientSet.ClusterV1alpha2().MachineSets(namespace).List(metav1.ListOptions{}) if err != nil { return nil, errors.Wrapf(err, "error listing MachineSets in namespace %q", namespace) } @@ -341,7 +325,7 @@ func (c *client) GetMachineSets(namespace string) ([]*clusterv1.MachineSet, erro } func (c *client) GetMachineSetsForCluster(cluster *clusterv1.Cluster) ([]*clusterv1.MachineSet, error) { - machineSetList, err := c.clientSet.ClusterV1alpha1().MachineSets(cluster.Namespace).List(metav1.ListOptions{ + machineSetList, err := c.clientSet.ClusterV1alpha2().MachineSets(cluster.Namespace).List(metav1.ListOptions{ LabelSelector: fmt.Sprintf("%s=%s", machineClusterLabelName, cluster.Name), }) if err != nil { @@ -375,7 +359,7 @@ func (c *client) GetMachineSetsForMachineDeployment(md *clusterv1.MachineDeploym func (c *client) GetMachines(namespace string) ([]*clusterv1.Machine, error) { machines := []*clusterv1.Machine{} - machineslist, err := c.clientSet.ClusterV1alpha1().Machines(namespace).List(metav1.ListOptions{}) + machineslist, err := c.clientSet.ClusterV1alpha2().Machines(namespace).List(metav1.ListOptions{}) if err != nil { return nil, errors.Wrapf(err, "error listing Machines in namespace %q", namespace) } @@ -387,7 +371,7 @@ func (c *client) GetMachines(namespace string) ([]*clusterv1.Machine, error) { } func (c *client) GetMachinesForCluster(cluster *clusterv1.Cluster) ([]*clusterv1.Machine, error) { - machineslist, err := c.clientSet.ClusterV1alpha1().Machines(cluster.Namespace).List(metav1.ListOptions{ + machineslist, err := c.clientSet.ClusterV1alpha2().Machines(cluster.Namespace).List(metav1.ListOptions{ LabelSelector: fmt.Sprintf("%s=%s", machineClusterLabelName, cluster.Name), }) if err != nil { @@ -423,28 +407,13 @@ func (c *client) GetMachinesForMachineSet(ms *clusterv1.MachineSet) ([]*clusterv return controlledMachines, nil } -func (c *client) CreateMachineClass(machineClass *clusterv1.MachineClass) error { - _, err := c.clientSet.ClusterV1alpha1().MachineClasses(machineClass.Namespace).Create(machineClass) - if err != nil { - return errors.Wrapf(err, "error creating MachineClass %s/%s", machineClass.Namespace, machineClass.Name) - } - return nil -} - -func (c *client) DeleteMachineClass(namespace, name string) error { - if err := c.clientSet.ClusterV1alpha1().MachineClasses(namespace).Delete(name, newDeleteOptions()); err != nil { - return errors.Wrapf(err, "error deleting MachineClass %s/%s", namespace, name) - } - return nil -} - func (c *client) CreateClusterObject(cluster *clusterv1.Cluster) error { namespace := c.GetContextNamespace() if cluster.Namespace != "" { namespace = cluster.Namespace } - _, err := c.clientSet.ClusterV1alpha1().Clusters(namespace).Create(cluster) + _, err := c.clientSet.ClusterV1alpha2().Clusters(namespace).Create(cluster) if err != nil { return errors.Wrapf(err, "error creating cluster in namespace %v", namespace) } @@ -454,7 +423,7 @@ func (c *client) CreateClusterObject(cluster *clusterv1.Cluster) error { func (c *client) CreateMachineDeployments(deployments []*clusterv1.MachineDeployment, namespace string) error { for _, deploy := range deployments { // TODO: Run in parallel https://github.com/kubernetes-sigs/cluster-api/issues/258 - _, err := c.clientSet.ClusterV1alpha1().MachineDeployments(namespace).Create(deploy) + _, err := c.clientSet.ClusterV1alpha2().MachineDeployments(namespace).Create(deploy) if err != nil { return errors.Wrapf(err, "error creating a machine deployment object in namespace %q", namespace) } @@ -465,7 +434,7 @@ func (c *client) CreateMachineDeployments(deployments []*clusterv1.MachineDeploy func (c *client) CreateMachineSets(machineSets []*clusterv1.MachineSet, namespace string) error { for _, ms := range machineSets { // TODO: Run in parallel https://github.com/kubernetes-sigs/cluster-api/issues/258 - _, err := c.clientSet.ClusterV1alpha1().MachineSets(namespace).Create(ms) + _, err := c.clientSet.ClusterV1alpha2().MachineSets(namespace).Create(ms) if err != nil { return errors.Wrapf(err, "error creating a machine set object in namespace %q", namespace) } @@ -486,7 +455,7 @@ func (c *client) CreateMachines(machines []*clusterv1.Machine, namespace string) go func(machine *clusterv1.Machine) { defer wg.Done() - createdMachine, err := c.clientSet.ClusterV1alpha1().Machines(namespace).Create(machine) + createdMachine, err := c.clientSet.ClusterV1alpha2().Machines(namespace).Create(machine) if err != nil { errOnce.Do(func() { gerr = errors.Wrapf(err, "error creating a machine object in namespace %v", namespace) @@ -510,7 +479,7 @@ func (c *client) DeleteClusters(namespace string) error { if namespace != "" { seen[namespace] = true } else { - clusters, err := c.clientSet.ClusterV1alpha1().Clusters("").List(metav1.ListOptions{}) + clusters, err := c.clientSet.ClusterV1alpha2().Clusters("").List(metav1.ListOptions{}) if err != nil { return errors.Wrap(err, "error listing Clusters in all namespaces") } @@ -521,7 +490,7 @@ func (c *client) DeleteClusters(namespace string) error { } } for ns := range seen { - err := c.clientSet.ClusterV1alpha1().Clusters(ns).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) + err := c.clientSet.ClusterV1alpha2().Clusters(ns).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) if err != nil { return errors.Wrapf(err, "error deleting Clusters in namespace %q", ns) } @@ -534,41 +503,6 @@ func (c *client) DeleteClusters(namespace string) error { return nil } -// DeleteMachineClasses deletes all MachineClasses in a namespace. If the namespace is empty then all MachineClasses in all namespaces are deleted. -func (c *client) DeleteMachineClasses(namespace string) error { - seen := make(map[string]bool) - - if namespace != "" { - seen[namespace] = true - } else { - machineClasses, err := c.clientSet.ClusterV1alpha1().MachineClasses("").List(metav1.ListOptions{}) - if err != nil { - return errors.Wrap(err, "error listing MachineClasses in all namespaces") - } - for _, mc := range machineClasses.Items { - if _, ok := seen[mc.Namespace]; !ok { - seen[mc.Namespace] = true - } - } - } - - for ns := range seen { - if err := c.DeleteMachineClasses(ns); err != nil { - return err - } - err := c.clientSet.ClusterV1alpha1().MachineClasses(ns).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) - if err != nil { - return errors.Wrapf(err, "error deleting MachineClasses in namespace %q", ns) - } - err = c.waitForMachineClassesDelete(ns) - if err != nil { - return errors.Wrapf(err, "error waiting for MachineClass(es) deletion to complete in ns %q", ns) - } - } - - return nil -} - // DeleteMachineDeployments deletes all MachineDeployments in a namespace. If the namespace is empty then all MachineDeployments in all namespaces are deleted. func (c *client) DeleteMachineDeployments(namespace string) error { seen := make(map[string]bool) @@ -576,7 +510,7 @@ func (c *client) DeleteMachineDeployments(namespace string) error { if namespace != "" { seen[namespace] = true } else { - machineDeployments, err := c.clientSet.ClusterV1alpha1().MachineDeployments("").List(metav1.ListOptions{}) + machineDeployments, err := c.clientSet.ClusterV1alpha2().MachineDeployments("").List(metav1.ListOptions{}) if err != nil { return errors.Wrap(err, "error listing MachineDeployments in all namespaces") } @@ -587,7 +521,7 @@ func (c *client) DeleteMachineDeployments(namespace string) error { } } for ns := range seen { - err := c.clientSet.ClusterV1alpha1().MachineDeployments(ns).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) + err := c.clientSet.ClusterV1alpha2().MachineDeployments(ns).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) if err != nil { return errors.Wrapf(err, "error deleting MachineDeployments in namespace %q", ns) } @@ -607,7 +541,7 @@ func (c *client) DeleteMachineSets(namespace string) error { if namespace != "" { seen[namespace] = true } else { - machineSets, err := c.clientSet.ClusterV1alpha1().MachineSets("").List(metav1.ListOptions{}) + machineSets, err := c.clientSet.ClusterV1alpha2().MachineSets("").List(metav1.ListOptions{}) if err != nil { return errors.Wrap(err, "error listing MachineSets in all namespaces") } @@ -618,7 +552,7 @@ func (c *client) DeleteMachineSets(namespace string) error { } } for ns := range seen { - err := c.clientSet.ClusterV1alpha1().MachineSets(ns).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) + err := c.clientSet.ClusterV1alpha2().MachineSets(ns).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) if err != nil { return errors.Wrapf(err, "error deleting MachineSets in namespace %q", ns) } @@ -638,7 +572,7 @@ func (c *client) DeleteMachines(namespace string) error { if namespace != "" { seen[namespace] = true } else { - machines, err := c.clientSet.ClusterV1alpha1().Machines("").List(metav1.ListOptions{}) + machines, err := c.clientSet.ClusterV1alpha2().Machines("").List(metav1.ListOptions{}) if err != nil { return errors.Wrap(err, "error listing Machines in all namespaces") } @@ -649,7 +583,7 @@ func (c *client) DeleteMachines(namespace string) error { } } for ns := range seen { - err := c.clientSet.ClusterV1alpha1().Machines(ns).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) + err := c.clientSet.ClusterV1alpha2().Machines(ns).DeleteCollection(newDeleteOptions(), metav1.ListOptions{}) if err != nil { return errors.Wrapf(err, "error deleting Machines in namespace %q", ns) } @@ -663,45 +597,45 @@ func (c *client) DeleteMachines(namespace string) error { } func (c *client) ForceDeleteMachine(namespace, name string) error { - machine, err := c.clientSet.ClusterV1alpha1().Machines(namespace).Get(name, metav1.GetOptions{}) + machine, err := c.clientSet.ClusterV1alpha2().Machines(namespace).Get(name, metav1.GetOptions{}) if err != nil { return errors.Wrapf(err, "error getting Machine %s/%s", namespace, name) } machine.SetFinalizers([]string{}) - if _, err := c.clientSet.ClusterV1alpha1().Machines(namespace).Update(machine); err != nil { + if _, err := c.clientSet.ClusterV1alpha2().Machines(namespace).Update(machine); err != nil { return errors.Wrapf(err, "error removing finalizer for Machine %s/%s", namespace, name) } - if err := c.clientSet.ClusterV1alpha1().Machines(namespace).Delete(name, newDeleteOptions()); err != nil { + if err := c.clientSet.ClusterV1alpha2().Machines(namespace).Delete(name, newDeleteOptions()); err != nil { return errors.Wrapf(err, "error deleting Machine %s/%s", namespace, name) } return nil } func (c *client) ForceDeleteMachineSet(namespace, name string) error { - ms, err := c.clientSet.ClusterV1alpha1().MachineSets(namespace).Get(name, metav1.GetOptions{}) + ms, err := c.clientSet.ClusterV1alpha2().MachineSets(namespace).Get(name, metav1.GetOptions{}) if err != nil { return errors.Wrapf(err, "error getting MachineSet %s/%s", namespace, name) } ms.SetFinalizers([]string{}) - if _, err := c.clientSet.ClusterV1alpha1().MachineSets(namespace).Update(ms); err != nil { + if _, err := c.clientSet.ClusterV1alpha2().MachineSets(namespace).Update(ms); err != nil { return errors.Wrapf(err, "error removing finalizer for MachineSet %s/%s", namespace, name) } - if err := c.clientSet.ClusterV1alpha1().MachineSets(namespace).Delete(name, newDeleteOptions()); err != nil { + if err := c.clientSet.ClusterV1alpha2().MachineSets(namespace).Delete(name, newDeleteOptions()); err != nil { return errors.Wrapf(err, "error deleting MachineSet %s/%s", namespace, name) } return nil } func (c *client) ForceDeleteMachineDeployment(namespace, name string) error { - md, err := c.clientSet.ClusterV1alpha1().MachineDeployments(namespace).Get(name, metav1.GetOptions{}) + md, err := c.clientSet.ClusterV1alpha2().MachineDeployments(namespace).Get(name, metav1.GetOptions{}) if err != nil { return errors.Wrapf(err, "error getting MachineDeployment %s/%s", namespace, name) } md.SetFinalizers([]string{}) - if _, err := c.clientSet.ClusterV1alpha1().MachineDeployments(namespace).Update(md); err != nil { + if _, err := c.clientSet.ClusterV1alpha2().MachineDeployments(namespace).Update(md); err != nil { return errors.Wrapf(err, "error removing finalizer for MachineDeployment %s/%s", namespace, name) } - if err := c.clientSet.ClusterV1alpha1().MachineDeployments(namespace).Delete(name, newDeleteOptions()); err != nil { + if err := c.clientSet.ClusterV1alpha2().MachineDeployments(namespace).Delete(name, newDeleteOptions()); err != nil { return errors.Wrapf(err, "error deleting MachineDeployment %s/%s", namespace, name) } return nil @@ -738,11 +672,11 @@ func (c *client) UpdateClusterObjectEndpoint(clusterEndpoint, clusterName, names Host: endpointHost, Port: endpointPortInt, }) - _, err = c.clientSet.ClusterV1alpha1().Clusters(namespace).UpdateStatus(cluster) + _, err = c.clientSet.ClusterV1alpha2().Clusters(namespace).UpdateStatus(cluster) return err } -func (c *client) WaitForClusterV1alpha1Ready() error { +func (c *client) WaitForClusterV1alpha2Ready() error { return waitForClusterResourceReady(c.clientSet) } @@ -752,7 +686,7 @@ func (c *client) WaitForResourceStatuses() error { timeout := time.Until(deadline) return util.PollImmediate(retryIntervalResourceReady, timeout, func() (bool, error) { klog.V(2).Info("Waiting for Cluster API resources to have statuses...") - clusters, err := c.clientSet.ClusterV1alpha1().Clusters("").List(metav1.ListOptions{}) + clusters, err := c.clientSet.ClusterV1alpha2().Clusters("").List(metav1.ListOptions{}) if err != nil { klog.V(10).Infof("retrying: failed to list clusters: %v", err) return false, nil @@ -767,7 +701,7 @@ func (c *client) WaitForResourceStatuses() error { return false, nil } } - machineDeployments, err := c.clientSet.ClusterV1alpha1().MachineDeployments("").List(metav1.ListOptions{}) + machineDeployments, err := c.clientSet.ClusterV1alpha2().MachineDeployments("").List(metav1.ListOptions{}) if err != nil { klog.V(10).Infof("retrying: failed to list machine deployment: %v", err) return false, nil @@ -778,7 +712,7 @@ func (c *client) WaitForResourceStatuses() error { return false, nil } } - machineSets, err := c.clientSet.ClusterV1alpha1().MachineSets("").List(metav1.ListOptions{}) + machineSets, err := c.clientSet.ClusterV1alpha2().MachineSets("").List(metav1.ListOptions{}) if err != nil { klog.V(10).Infof("retrying: failed to list machinesets: %v", err) return false, nil @@ -789,7 +723,7 @@ func (c *client) WaitForResourceStatuses() error { return false, nil } } - machines, err := c.clientSet.ClusterV1alpha1().Machines("").List(metav1.ListOptions{}) + machines, err := c.clientSet.ClusterV1alpha2().Machines("").List(metav1.ListOptions{}) if err != nil { klog.V(10).Infof("retrying: failed to list machines: %v", err) return false, nil @@ -812,21 +746,7 @@ func (c *client) WaitForResourceStatuses() error { func (c *client) waitForClusterDelete(namespace string) error { return util.PollImmediate(retryIntervalResourceDelete, timeoutResourceDelete, func() (bool, error) { klog.V(2).Infof("Waiting for Clusters to be deleted...") - response, err := c.clientSet.ClusterV1alpha1().Clusters(namespace).List(metav1.ListOptions{}) - if err != nil { - return false, nil - } - if len(response.Items) > 0 { - return false, nil - } - return true, nil - }) -} - -func (c *client) waitForMachineClassesDelete(namespace string) error { - return util.PollImmediate(retryIntervalResourceDelete, timeoutResourceDelete, func() (bool, error) { - klog.V(2).Infof("Waiting for MachineClasses to be deleted...") - response, err := c.clientSet.ClusterV1alpha1().MachineClasses(namespace).List(metav1.ListOptions{}) + response, err := c.clientSet.ClusterV1alpha2().Clusters(namespace).List(metav1.ListOptions{}) if err != nil { return false, nil } @@ -840,7 +760,7 @@ func (c *client) waitForMachineClassesDelete(namespace string) error { func (c *client) waitForMachineDeploymentsDelete(namespace string) error { return util.PollImmediate(retryIntervalResourceDelete, timeoutResourceDelete, func() (bool, error) { klog.V(2).Infof("Waiting for MachineDeployments to be deleted...") - response, err := c.clientSet.ClusterV1alpha1().MachineDeployments(namespace).List(metav1.ListOptions{}) + response, err := c.clientSet.ClusterV1alpha2().MachineDeployments(namespace).List(metav1.ListOptions{}) if err != nil { return false, nil } @@ -854,7 +774,7 @@ func (c *client) waitForMachineDeploymentsDelete(namespace string) error { func (c *client) waitForMachineSetsDelete(namespace string) error { return util.PollImmediate(retryIntervalResourceDelete, timeoutResourceDelete, func() (bool, error) { klog.V(2).Infof("Waiting for MachineSets to be deleted...") - response, err := c.clientSet.ClusterV1alpha1().MachineSets(namespace).List(metav1.ListOptions{}) + response, err := c.clientSet.ClusterV1alpha2().MachineSets(namespace).List(metav1.ListOptions{}) if err != nil { return false, nil } @@ -868,7 +788,7 @@ func (c *client) waitForMachineSetsDelete(namespace string) error { func (c *client) waitForMachinesDelete(namespace string) error { return util.PollImmediate(retryIntervalResourceDelete, timeoutResourceDelete, func() (bool, error) { klog.V(2).Infof("Waiting for Machines to be deleted...") - response, err := c.clientSet.ClusterV1alpha1().Machines(namespace).List(metav1.ListOptions{}) + response, err := c.clientSet.ClusterV1alpha2().Machines(namespace).List(metav1.ListOptions{}) if err != nil { return false, nil } @@ -882,7 +802,7 @@ func (c *client) waitForMachinesDelete(namespace string) error { func (c *client) waitForMachineDelete(namespace, name string) error { return util.PollImmediate(retryIntervalResourceDelete, timeoutResourceDelete, func() (bool, error) { klog.V(2).Infof("Waiting for Machine %s/%s to be deleted...", namespace, name) - response, err := c.clientSet.ClusterV1alpha1().Machines(namespace).Get(name, metav1.GetOptions{}) + response, err := c.clientSet.ClusterV1alpha2().Machines(namespace).Get(name, metav1.GetOptions{}) if err != nil { return false, nil } @@ -960,7 +880,7 @@ func waitForClusterResourceReady(cs clientset.Interface) error { deadline := time.Now().Add(timeoutResourceReady) err := util.PollImmediate(retryIntervalResourceReady, timeoutResourceReady, func() (bool, error) { klog.V(2).Info("Waiting for Cluster v1alpha resources to become available...") - _, err := cs.Discovery().ServerResourcesForGroupVersion("cluster.k8s.io/v1alpha1") + _, err := cs.Discovery().ServerResourcesForGroupVersion("cluster.k8s.io/v1alpha2") if err == nil { return true, nil } @@ -973,7 +893,7 @@ func waitForClusterResourceReady(cs clientset.Interface) error { timeout := time.Until(deadline) return util.PollImmediate(retryIntervalResourceReady, timeout, func() (bool, error) { klog.V(2).Info("Waiting for Cluster v1alpha resources to be listable...") - _, err := cs.ClusterV1alpha1().Clusters(apiv1.NamespaceDefault).List(metav1.ListOptions{}) + _, err := cs.ClusterV1alpha2().Clusters(apiv1.NamespaceDefault).List(metav1.ListOptions{}) if err == nil { return true, nil } @@ -994,7 +914,7 @@ func waitForMachineReady(cs clientset.Interface, machine *clusterv1.Machine) err err := util.PollImmediate(retryIntervalResourceReady, timeout, func() (bool, error) { klog.V(2).Infof("Waiting for Machine %v to become ready...", machine.Name) - m, err := cs.ClusterV1alpha1().Machines(machine.Namespace).Get(machine.Name, metav1.GetOptions{}) + m, err := cs.ClusterV1alpha2().Machines(machine.Namespace).Get(machine.Name, metav1.GetOptions{}) if err != nil { return false, nil } diff --git a/cmd/clusterctl/clusterdeployer/clusterdeployer.go b/cmd/clusterctl/clusterdeployer/clusterdeployer.go index 499c33c71113..24edf518801b 100644 --- a/cmd/clusterctl/clusterdeployer/clusterdeployer.go +++ b/cmd/clusterctl/clusterdeployer/clusterdeployer.go @@ -26,7 +26,7 @@ import ( "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/provider" "sigs.k8s.io/cluster-api/cmd/clusterctl/phases" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) type ClusterDeployer struct { @@ -237,11 +237,6 @@ func deleteClusterAPIObjectsInAllNamespaces(client clusterclient.Client) error { err = errors.Wrap(err, "error deleting Machines") errorList = append(errorList, err.Error()) } - klog.Infof("Deleting MachineClasses in all namespaces") - if err := client.DeleteMachineClasses(""); err != nil { - err = errors.Wrap(err, "error deleting MachineClasses") - errorList = append(errorList, err.Error()) - } klog.Infof("Deleting Clusters in all namespaces") if err := client.DeleteClusters(""); err != nil { err = errors.Wrap(err, "error deleting Clusters") diff --git a/cmd/clusterctl/clusterdeployer/clusterdeployer_test.go b/cmd/clusterctl/clusterdeployer/clusterdeployer_test.go index 1a9e39e1a254..7d490946e5b0 100644 --- a/cmd/clusterctl/clusterdeployer/clusterdeployer_test.go +++ b/cmd/clusterctl/clusterdeployer/clusterdeployer_test.go @@ -28,7 +28,7 @@ import ( "k8s.io/client-go/kubernetes" "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/provider" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) type testClusterProvisioner struct { @@ -91,7 +91,7 @@ type stringCheckFunc func(string) error type testClusterClient struct { ApplyErr error DeleteErr error - WaitForClusterV1alpha1ReadyErr error + WaitForClusterV1alpha2ReadyErr error GetClustersErr error GetClusterErr error GetMachineClassesErr error @@ -117,7 +117,6 @@ type testClusterClient struct { ApplyFunc stringCheckFunc clusters map[string][]*clusterv1.Cluster - machineClasses map[string][]*clusterv1.MachineClass machineDeployments map[string][]*clusterv1.MachineDeployment machineSets map[string][]*clusterv1.MachineSet machines map[string][]*clusterv1.Machine @@ -143,8 +142,8 @@ func (c *testClusterClient) GetContextNamespace() string { return c.contextNamespace } -func (c *testClusterClient) WaitForClusterV1alpha1Ready() error { - return c.WaitForClusterV1alpha1ReadyErr +func (c *testClusterClient) WaitForClusterV1alpha2Ready() error { + return c.WaitForClusterV1alpha2ReadyErr } func (c *testClusterClient) GetCluster(clusterName, namespace string) (*clusterv1.Cluster, error) { @@ -273,18 +272,6 @@ func (c *testClusterClient) DeleteClusters(ns string) error { return nil } -func (c *testClusterClient) DeleteMachineClasses(ns string) error { - if c.DeleteMachineClassesErr != nil { - return c.DeleteMachineClassesErr - } - if ns == "" { - c.machineClasses = make(map[string][]*clusterv1.MachineClass) - } else { - delete(c.machineClasses, ns) - } - return nil -} - func (c *testClusterClient) DeleteMachineDeployments(ns string) error { if c.DeleteMachineDeploymentsErr != nil { return c.DeleteMachineDeploymentsErr @@ -490,21 +477,6 @@ func (c *testClusterClient) WaitForResourceStatuses() error { return nil } -// TODO: implement GetMachineClasses for testClusterClient and add tests -func (c *testClusterClient) GetMachineClasses(namespace string) ([]*clusterv1.MachineClass, error) { - return c.machineClasses[namespace], c.GetMachineClassesErr -} - -// TODO: implement CreateMachineClass for testClusterClient and add tests -func (c *testClusterClient) CreateMachineClass(*clusterv1.MachineClass) error { - return errors.Errorf("CreateMachineClass Not yet implemented.") -} - -// TODO: implement DeleteMachineClass for testClusterClient and add tests -func (c *testClusterClient) DeleteMachineClass(namespace, name string) error { - return errors.Errorf("DeleteMachineClass Not yet implemented.") -} - func contains(s []string, e string) bool { exists := false for _, existingNs := range s { @@ -702,7 +674,7 @@ func TestClusterCreate(t *testing.T) { { name: "fail waiting for api ready on bootstrap cluster", targetClient: &testClusterClient{ApplyFunc: func(yaml string) error { return nil }}, - bootstrapClient: &testClusterClient{WaitForClusterV1alpha1ReadyErr: errors.New("Test failure")}, + bootstrapClient: &testClusterClient{WaitForClusterV1alpha2ReadyErr: errors.New("Test failure")}, namespaceToExpectedInternalMachines: make(map[string]int), namespaceToInputCluster: map[string][]*clusterv1.Cluster{metav1.NamespaceDefault: getClustersForNamespace(metav1.NamespaceDefault, 1)}, cleanupExternal: true, @@ -771,7 +743,7 @@ func TestClusterCreate(t *testing.T) { }, { name: "fail wait for api ready on target cluster", - targetClient: &testClusterClient{WaitForClusterV1alpha1ReadyErr: errors.New("Test failure")}, + targetClient: &testClusterClient{WaitForClusterV1alpha2ReadyErr: errors.New("Test failure")}, bootstrapClient: &testClusterClient{}, namespaceToExpectedInternalMachines: make(map[string]int), namespaceToInputCluster: map[string][]*clusterv1.Cluster{metav1.NamespaceDefault: getClustersForNamespace(metav1.NamespaceDefault, 1)}, @@ -1376,9 +1348,6 @@ func TestClusterDelete(t *testing.T) { for _, machineSets := range testCase.bootstrapClient.machineSets { bootstrapMachineSets = bootstrapMachineSets + len(machineSets) } - for _, machineClasses := range testCase.bootstrapClient.machineClasses { - bootstrapMachineClasses = bootstrapMachineClasses + len(machineClasses) - } for _, clusters := range testCase.targetClient.clusters { targetClusters = targetClusters + len(clusters) } @@ -1391,9 +1360,6 @@ func TestClusterDelete(t *testing.T) { for _, machineSets := range testCase.targetClient.machineSets { targetMachineSets = targetMachineSets + len(machineSets) } - for _, machineClasses := range testCase.targetClient.machineClasses { - targetMachineClasses = targetMachineClasses + len(machineClasses) - } if bootstrapClusters != 0 { t.Fatalf("Unexpected Cluster count in bootstrap cluster. Got: %d, Want: 0", bootstrapClusters) @@ -1434,10 +1400,8 @@ func generateTestControlPlaneMachines(cluster *clusterv1.Cluster, ns string, nam machines := make([]*clusterv1.Machine, 0, len(names)) for _, name := range names { machine := generateTestNodeMachine(cluster, ns, name) - machine.Spec = clusterv1.MachineSpec{ - Versions: clusterv1.MachineVersionInfo{ - ControlPlane: "1.10.1", - }, + machine.ObjectMeta.Labels = map[string]string{ + clusterv1.MachineControlPlaneLabelName: "true", } machines = append(machines, machine) } diff --git a/cmd/clusterctl/clusterdeployer/provider/BUILD.bazel b/cmd/clusterctl/clusterdeployer/provider/BUILD.bazel index b6db884d1e1a..1cb6c7039985 100644 --- a/cmd/clusterctl/clusterdeployer/provider/BUILD.bazel +++ b/cmd/clusterctl/clusterdeployer/provider/BUILD.bazel @@ -6,7 +6,7 @@ go_library( importpath = "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/provider", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/k8s.io/client-go/kubernetes:go_default_library", ], ) diff --git a/cmd/clusterctl/clusterdeployer/provider/provider.go b/cmd/clusterctl/clusterdeployer/provider/provider.go index 060f19858249..8610958e74cf 100644 --- a/cmd/clusterctl/clusterdeployer/provider/provider.go +++ b/cmd/clusterctl/clusterdeployer/provider/provider.go @@ -18,7 +18,7 @@ package provider import ( "k8s.io/client-go/kubernetes" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) // Deployer is a deprecated interface for Provider specific logic. Please do not extend or add. This interface should be removed diff --git a/cmd/clusterctl/phases/BUILD.bazel b/cmd/clusterctl/phases/BUILD.bazel index 716245bf44d9..209ce800e69a 100644 --- a/cmd/clusterctl/phases/BUILD.bazel +++ b/cmd/clusterctl/phases/BUILD.bazel @@ -18,7 +18,7 @@ go_library( "//cmd/clusterctl/clusterdeployer/bootstrap:go_default_library", "//cmd/clusterctl/clusterdeployer/clusterclient:go_default_library", "//cmd/clusterctl/clusterdeployer/provider:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/util:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/apps/v1:go_default_library", @@ -32,7 +32,7 @@ go_test( srcs = ["pivot_test.go"], embed = [":go_default_library"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", ], ) diff --git a/cmd/clusterctl/phases/applycluster.go b/cmd/clusterctl/phases/applycluster.go index 08a41bfc6fd0..25304616d458 100644 --- a/cmd/clusterctl/phases/applycluster.go +++ b/cmd/clusterctl/phases/applycluster.go @@ -20,7 +20,7 @@ import ( "github.com/pkg/errors" "k8s.io/klog" "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) func ApplyCluster(client clusterclient.Client, cluster *clusterv1.Cluster) error { diff --git a/cmd/clusterctl/phases/applyclusterapicomponents.go b/cmd/clusterctl/phases/applyclusterapicomponents.go index e9bcf3e8070a..a901e389fb05 100644 --- a/cmd/clusterctl/phases/applyclusterapicomponents.go +++ b/cmd/clusterctl/phases/applyclusterapicomponents.go @@ -28,5 +28,5 @@ func ApplyClusterAPIComponents(client clusterclient.Client, providerComponents s return errors.Wrap(err, "unable to apply cluster api controllers") } - return client.WaitForClusterV1alpha1Ready() + return client.WaitForClusterV1alpha2Ready() } diff --git a/cmd/clusterctl/phases/applymachines.go b/cmd/clusterctl/phases/applymachines.go index ffc8f1af1425..8f650befcabd 100644 --- a/cmd/clusterctl/phases/applymachines.go +++ b/cmd/clusterctl/phases/applymachines.go @@ -20,7 +20,7 @@ import ( "github.com/pkg/errors" "k8s.io/klog" "sigs.k8s.io/cluster-api/cmd/clusterctl/clusterdeployer/clusterclient" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) func ApplyMachines(client clusterclient.Client, namespace string, machines []*clusterv1.Machine) error { diff --git a/cmd/clusterctl/phases/pivot.go b/cmd/clusterctl/phases/pivot.go index d83ee6bd42a0..643b4dc26be8 100644 --- a/cmd/clusterctl/phases/pivot.go +++ b/cmd/clusterctl/phases/pivot.go @@ -24,18 +24,16 @@ import ( appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/util/yaml" "k8s.io/klog" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) type sourceClient interface { Delete(string) error - DeleteMachineClass(namespace, name string) error ForceDeleteCluster(string, string) error ForceDeleteMachine(string, string) error ForceDeleteMachineDeployment(string, string) error ForceDeleteMachineSet(namespace, name string) error GetClusters(string) ([]*clusterv1.Cluster, error) - GetMachineClasses(string) ([]*clusterv1.MachineClass, error) GetMachineDeployments(string) ([]*clusterv1.MachineDeployment, error) GetMachineDeploymentsForCluster(*clusterv1.Cluster) ([]*clusterv1.MachineDeployment, error) GetMachines(namespace string) ([]*clusterv1.Machine, error) @@ -45,20 +43,19 @@ type sourceClient interface { GetMachinesForCluster(*clusterv1.Cluster) ([]*clusterv1.Machine, error) GetMachinesForMachineSet(*clusterv1.MachineSet) ([]*clusterv1.Machine, error) ScaleStatefulSet(string, string, int32) error - WaitForClusterV1alpha1Ready() error + WaitForClusterV1alpha2Ready() error } type targetClient interface { Apply(string) error CreateClusterObject(*clusterv1.Cluster) error - CreateMachineClass(*clusterv1.MachineClass) error CreateMachineDeployments([]*clusterv1.MachineDeployment, string) error CreateMachines([]*clusterv1.Machine, string) error CreateMachineSets([]*clusterv1.MachineSet, string) error EnsureNamespace(string) error GetMachineDeployment(namespace, name string) (*clusterv1.MachineDeployment, error) GetMachineSet(string, string) (*clusterv1.MachineSet, error) - WaitForClusterV1alpha1Ready() error + WaitForClusterV1alpha2Ready() error } // Pivot deploys the provided provider components to a target cluster and then migrates @@ -80,14 +77,14 @@ func Pivot(source sourceClient, target targetClient, providerComponents string) func pivot(from sourceClient, to targetClient, providerComponents string) error { // TODO: Attempt to handle rollback in case of pivot failure - klog.V(4).Info("Ensuring cluster v1alpha1 resources are available on the source cluster") - if err := from.WaitForClusterV1alpha1Ready(); err != nil { - return errors.New("cluster v1alpha1 resource not ready on source cluster") + klog.V(4).Info("Ensuring cluster v1alpha2 resources are available on the source cluster") + if err := from.WaitForClusterV1alpha2Ready(); err != nil { + return errors.New("cluster v1alpha2 resource not ready on source cluster") } - klog.V(4).Info("Ensuring cluster v1alpha1 resources are available on the target cluster") - if err := to.WaitForClusterV1alpha1Ready(); err != nil { - return errors.New("cluster v1alpha1 resource not ready on target cluster") + klog.V(4).Info("Ensuring cluster v1alpha2 resources are available on the target cluster") + if err := to.WaitForClusterV1alpha2Ready(); err != nil { + return errors.New("cluster v1alpha2 resource not ready on target cluster") } klog.V(4).Info("Parsing list of cluster-api controllers from provider components") @@ -104,16 +101,6 @@ func pivot(from sourceClient, to targetClient, providerComponents string) error } } - klog.V(4).Info("Retrieving list of MachineClasses to move") - machineClasses, err := from.GetMachineClasses("") - if err != nil { - return err - } - - if err := copyMachineClasses(from, to, machineClasses); err != nil { - return err - } - klog.V(4).Info("Retrieving list of Clusters to move") clusters, err := from.GetClusters("") if err != nil { @@ -151,10 +138,6 @@ func pivot(from sourceClient, to targetClient, providerComponents string) error return err } - if err := deleteMachineClasses(from, machineClasses); err != nil { - return err - } - klog.V(4).Infof("Deleting provider components from source cluster") if err := from.Delete(providerComponents); err != nil { klog.Warningf("Could not delete the provider components from the source cluster: %v", err) @@ -178,58 +161,6 @@ func moveClusters(from sourceClient, to targetClient, clusters []*clusterv1.Clus return nil } -func deleteMachineClasses(client sourceClient, machineClasses []*clusterv1.MachineClass) error { - machineClassNames := make([]string, 0, len(machineClasses)) - for _, mc := range machineClasses { - machineClassNames = append(machineClassNames, mc.Name) - } - klog.V(4).Infof("Preparing to delete MachineClasses: %v", machineClassNames) - - for _, mc := range machineClasses { - if err := deleteMachineClass(client, mc); err != nil { - return errors.Wrapf(err, "failed to delete MachineClass %s:%s", mc.Namespace, mc.Name) - } - } - return nil -} - -func deleteMachineClass(client sourceClient, machineClass *clusterv1.MachineClass) error { - // New objects cannot have a specified resource version. Clear it out. - machineClass.SetResourceVersion("") - if err := client.DeleteMachineClass(machineClass.Namespace, machineClass.Name); err != nil { - return errors.Wrapf(err, "error deleting MachineClass %s/%s from source cluster", machineClass.Namespace, machineClass.Name) - } - - klog.V(4).Infof("Successfully deleted MachineClass %s/%s from source cluster", machineClass.Namespace, machineClass.Name) - return nil -} - -func copyMachineClasses(from sourceClient, to targetClient, machineClasses []*clusterv1.MachineClass) error { - machineClassNames := make([]string, 0, len(machineClasses)) - for _, mc := range machineClasses { - machineClassNames = append(machineClassNames, mc.Name) - } - klog.V(4).Infof("Preparing to copy MachineClasses: %v", machineClassNames) - - for _, mc := range machineClasses { - if err := copyMachineClass(from, to, mc); err != nil { - return errors.Wrapf(err, "failed to copy MachineClass %s:%s", mc.Namespace, mc.Name) - } - } - return nil -} - -func copyMachineClass(from sourceClient, to targetClient, machineClass *clusterv1.MachineClass) error { - // New objects cannot have a specified resource version. Clear it out. - machineClass.SetResourceVersion("") - if err := to.CreateMachineClass(machineClass); err != nil { - return errors.Wrapf(err, "error copying MachineClass %s/%s to target cluster", machineClass.Namespace, machineClass.Name) - } - - klog.V(4).Infof("Successfully copied MachineClass %s/%s", machineClass.Namespace, machineClass.Name) - return nil -} - func moveCluster(from sourceClient, to targetClient, cluster *clusterv1.Cluster) error { klog.V(4).Infof("Moving Cluster %s/%s", cluster.Namespace, cluster.Name) diff --git a/cmd/clusterctl/phases/pivot_test.go b/cmd/clusterctl/phases/pivot_test.go index 2c7dc5a1ce14..5bfe08c6b466 100644 --- a/cmd/clusterctl/phases/pivot_test.go +++ b/cmd/clusterctl/phases/pivot_test.go @@ -22,7 +22,7 @@ import ( "testing" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) // sourcer map keys are namespaces @@ -32,7 +32,6 @@ type sourcer struct { machineDeployments map[string][]*clusterv1.MachineDeployment machineSets map[string][]*clusterv1.MachineSet machines map[string][]*clusterv1.Machine - machineClasses map[string][]*clusterv1.MachineClass } func newSourcer() *sourcer { @@ -41,7 +40,6 @@ func newSourcer() *sourcer { machineDeployments: make(map[string][]*clusterv1.MachineDeployment), machineSets: make(map[string][]*clusterv1.MachineSet), machines: make(map[string][]*clusterv1.Machine), - machineClasses: make(map[string][]*clusterv1.MachineClass), } } func (s *sourcer) WithCluster(ns, name string) *sourcer { @@ -148,31 +146,11 @@ func (s *sourcer) WithMachine(ns, cluster, ms, name string) *sourcer { return s } -func (s *sourcer) WithMachineClass(ns, name string) *sourcer { - s.machineClasses[ns] = append(s.machineClasses[ns], &clusterv1.MachineClass{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: ns, - }, - }) - return s -} - // Interface implementation below func (s *sourcer) Delete(string) error { return nil } -func (s *sourcer) DeleteMachineClass(ns, name string) error { - newMachineClasses := []*clusterv1.MachineClass{} - for _, mc := range s.machineClasses[ns] { - if mc.Name != name { - newMachineClasses = append(newMachineClasses, mc) - } - } - s.machineClasses[ns] = newMachineClasses - return nil -} func (s *sourcer) ForceDeleteCluster(ns, name string) error { newClusters := []*clusterv1.Cluster{} for _, d := range s.clusters[ns] { @@ -226,19 +204,7 @@ func (s *sourcer) GetClusters(ns string) ([]*clusterv1.Cluster, error) { } return s.clusters[ns], nil } -func (s *sourcer) GetMachineClasses(ns string) ([]*clusterv1.MachineClass, error) { - // empty ns implies all namespaces - if ns == "" { - out := []*clusterv1.MachineClass{} - for _, mcs := range s.machineClasses { - for _, mc := range mcs { - out = append(out, mc) - } - } - return out, nil - } - return s.machineClasses[ns], nil -} + func (s *sourcer) GetMachineDeployments(ns string) ([]*clusterv1.MachineDeployment, error) { // empty ns implies all namespaces if ns == "" { @@ -335,7 +301,7 @@ func (s *sourcer) GetMachinesForMachineSet(ms *clusterv1.MachineSet) ([]*cluster func (s *sourcer) ScaleStatefulSet(string, string, int32) error { return nil } -func (s *sourcer) WaitForClusterV1alpha1Ready() error { +func (s *sourcer) WaitForClusterV1alpha2Ready() error { return nil } @@ -344,7 +310,6 @@ type target struct { machineDeployments map[string][]*clusterv1.MachineDeployment machineSets map[string][]*clusterv1.MachineSet machines map[string][]*clusterv1.Machine - machineClasses map[string][]*clusterv1.MachineClass } func (t *target) Apply(string) error { @@ -354,10 +319,6 @@ func (t *target) CreateClusterObject(c *clusterv1.Cluster) error { t.clusters[c.Namespace] = append(t.clusters[c.Namespace], c) return nil } -func (t *target) CreateMachineClass(mc *clusterv1.MachineClass) error { - t.machineClasses[mc.Namespace] = append(t.machineClasses[mc.Namespace], mc) - return nil -} func (t *target) CreateMachineDeployments(deployments []*clusterv1.MachineDeployment, ns string) error { t.machineDeployments[ns] = append(t.machineDeployments[ns], deployments...) return nil @@ -390,7 +351,7 @@ func (t *target) GetMachineSet(ns, name string) (*clusterv1.MachineSet, error) { } return nil, fmt.Errorf("no machineset found with name %q in namespace %q", ns, name) } -func (t *target) WaitForClusterV1alpha1Ready() error { +func (t *target) WaitForClusterV1alpha2Ready() error { return nil } @@ -431,7 +392,6 @@ func TestPivot(t *testing.T) { WithMachineSet(ns1, "cluster1", "", "machineset3"). WithMachine(ns1, "cluster1", "machineset3", "machine4"). WithMachine(ns1, "cluster1", "", "machine5"). - WithMachineClass(ns1, "my-machine-class"). WithMachineDeployment(ns1, "", "deployment2"). WithMachineSet(ns1, "", "deployment2", "machineset4"). WithMachine(ns1, "", "machineset4", "machine6"). @@ -444,14 +404,12 @@ func TestPivot(t *testing.T) { expectedMachineDeployments := len(source.machineDeployments[ns1]) + len(source.machineDeployments[ns2]) expectedMachineSets := len(source.machineSets[ns1]) + len(source.machineSets[ns2]) expectedMachines := len(source.machines[ns1]) + len(source.machines[ns2]) - expectedMachineClasses := len(source.machineClasses[ns1]) + len(source.machineClasses[ns2]) target := &target{ clusters: make(map[string][]*clusterv1.Cluster), machineDeployments: make(map[string][]*clusterv1.MachineDeployment), machineSets: make(map[string][]*clusterv1.MachineSet), machines: make(map[string][]*clusterv1.Machine), - machineClasses: make(map[string][]*clusterv1.MachineClass), } if err := Pivot(source, target, pc.String()); err != nil { @@ -478,11 +436,6 @@ func TestPivot(t *testing.T) { t.Logf("target: %v", target.machines) t.Fatal("should have deleted all machines from source k8s cluster") } - if len(source.machineClasses[ns1])+len(source.machineClasses[ns2]) != 0 { - t.Logf("source: %v", source.machineClasses) - t.Logf("target: %v", target.machineClasses) - t.Fatal("should have deleted all machine classes from source k8s cluster") - } if len(target.clusters[ns1])+len(target.clusters[ns2]) != expectedClusters { t.Logf("source: %v", source.clusters) @@ -514,11 +467,6 @@ func TestPivot(t *testing.T) { } t.Fatal("expected machines to pivot") } - if len(target.machineClasses[ns1])+len(target.machineClasses[ns2]) != expectedMachineClasses { - t.Logf("source: %v", source.machineClasses) - t.Logf("target: %v", target.machineClasses) - t.Fatal("expected machine classes to pivot") - } } // An example of testing a failure scenario @@ -528,10 +476,10 @@ type waitFailSourcer struct { *sourcer } -func (s *waitFailSourcer) WaitForClusterV1alpha1Ready() error { +func (s *waitFailSourcer) WaitForClusterV1alpha2Ready() error { return errors.New("failed to wait for ready cluster resources") } -func TestWaitForV1alpha1Failure(t *testing.T) { +func TestWaitForV1alpha2Failure(t *testing.T) { w := &waitFailSourcer{ newSourcer(), diff --git a/cmd/clusterctl/providercomponents/BUILD.bazel b/cmd/clusterctl/providercomponents/BUILD.bazel index a701ef843457..cd48a0119631 100644 --- a/cmd/clusterctl/providercomponents/BUILD.bazel +++ b/cmd/clusterctl/providercomponents/BUILD.bazel @@ -20,7 +20,7 @@ go_test( srcs = ["providercomponents_test.go"], embed = [":go_default_library"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", diff --git a/cmd/clusterctl/providercomponents/providercomponents_test.go b/cmd/clusterctl/providercomponents/providercomponents_test.go index 9a3569ca8e2b..06b25e32e072 100644 --- a/cmd/clusterctl/providercomponents/providercomponents_test.go +++ b/cmd/clusterctl/providercomponents/providercomponents_test.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" "sigs.k8s.io/cluster-api/cmd/clusterctl/providercomponents" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) func TestLoadFromConfigMap(t *testing.T) { @@ -73,7 +73,7 @@ func TestSaveToConfigMap(t *testing.T) { providerComponentsContent := "content\nmore content >>" configMapName := "clusterctl" providerComponentsKey := "provider-components" - notFoundErr := apierrors.NewNotFound(v1alpha1.Resource("configmap"), configMapName) + notFoundErr := apierrors.NewNotFound(v1alpha2.Resource("configmap"), configMapName) testCases := []struct { name string getResult *core.ConfigMap diff --git a/cmd/clusterctl/validation/BUILD.bazel b/cmd/clusterctl/validation/BUILD.bazel index 20bc2c589f49..bb3815ec4e2d 100644 --- a/cmd/clusterctl/validation/BUILD.bazel +++ b/cmd/clusterctl/validation/BUILD.bazel @@ -10,7 +10,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/common:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/controller/noderefutil:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", @@ -31,8 +31,8 @@ go_test( deps = [ "//pkg/apis:go_default_library", "//pkg/apis/cluster/common:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", - "//pkg/apis/cluster/v1alpha1/testutil:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", + "//pkg/apis/cluster/v1alpha2/testutil:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", diff --git a/cmd/clusterctl/validation/validate_cluster_api_objects.go b/cmd/clusterctl/validation/validate_cluster_api_objects.go index c0c6bff893f1..a252fbbfc1a4 100644 --- a/cmd/clusterctl/validation/validate_cluster_api_objects.go +++ b/cmd/clusterctl/validation/validate_cluster_api_objects.go @@ -25,8 +25,8 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/cluster-api/pkg/controller/noderefutil" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -42,7 +42,7 @@ func ValidateClusterAPIObjects(ctx context.Context, w io.Writer, c client.Client return err } - machines := &clusterv1alpha1.MachineList{} + machines := &clusterv1alpha2.MachineList{} if err := c.List(ctx, machines, client.InNamespace(namespace)); err != nil { return errors.Wrapf(err, "failed to get the machines from the apiserver in namespace %q", namespace) } @@ -50,14 +50,14 @@ func ValidateClusterAPIObjects(ctx context.Context, w io.Writer, c client.Client return validateMachineObjects(ctx, w, machines, c) } -func getClusterObject(ctx context.Context, c client.Reader, clusterName string, namespace string) (*v1alpha1.Cluster, error) { +func getClusterObject(ctx context.Context, c client.Reader, clusterName string, namespace string) (*v1alpha2.Cluster, error) { if clusterName != "" { - cluster := &clusterv1alpha1.Cluster{} + cluster := &clusterv1alpha2.Cluster{} err := c.Get(ctx, types.NamespacedName{Name: clusterName, Namespace: namespace}, cluster) return cluster, err } - clusters := &clusterv1alpha1.ClusterList{} + clusters := &clusterv1alpha2.ClusterList{} if err := c.List(ctx, clusters, client.InNamespace(namespace)); err != nil { return nil, errors.Wrapf(err, "failed to get the clusters from the apiserver in namespace %q", namespace) } @@ -71,7 +71,7 @@ func getClusterObject(ctx context.Context, c client.Reader, clusterName string, return &clusters.Items[0], nil } -func validateClusterObject(w io.Writer, cluster *v1alpha1.Cluster) error { +func validateClusterObject(w io.Writer, cluster *v1alpha2.Cluster) error { fmt.Fprintf(w, "Checking cluster object %q... ", cluster.Name) if cluster.Status.ErrorReason != "" || cluster.Status.ErrorMessage != "" { fmt.Fprintf(w, "FAIL\n") @@ -82,7 +82,7 @@ func validateClusterObject(w io.Writer, cluster *v1alpha1.Cluster) error { return nil } -func validateMachineObjects(ctx context.Context, w io.Writer, machines *v1alpha1.MachineList, client client.Client) error { +func validateMachineObjects(ctx context.Context, w io.Writer, machines *v1alpha2.MachineList, client client.Client) error { pass := true for _, machine := range machines.Items { if !validateMachineObject(ctx, w, machine, client) { @@ -95,7 +95,7 @@ func validateMachineObjects(ctx context.Context, w io.Writer, machines *v1alpha1 return nil } -func validateMachineObject(ctx context.Context, w io.Writer, machine v1alpha1.Machine, client client.Client) bool { +func validateMachineObject(ctx context.Context, w io.Writer, machine v1alpha2.Machine, client client.Client) bool { fmt.Fprintf(w, "Checking machine object %q... ", machine.Name) if machine.Status.ErrorReason != nil || machine.Status.ErrorMessage != nil { var reason common.MachineStatusError diff --git a/cmd/clusterctl/validation/validate_cluster_api_objects_test.go b/cmd/clusterctl/validation/validate_cluster_api_objects_test.go index 3d18b899070d..745c8aaf1b1f 100644 --- a/cmd/clusterctl/validation/validate_cluster_api_objects_test.go +++ b/cmd/clusterctl/validation/validate_cluster_api_objects_test.go @@ -27,31 +27,31 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/testutil" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2/testutil" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" ) var c client.Client -func newClusterStatus(errorReason common.ClusterStatusError, errorMessage string) v1alpha1.ClusterStatus { - return v1alpha1.ClusterStatus{ +func newClusterStatus(errorReason common.ClusterStatusError, errorMessage string) v1alpha2.ClusterStatus { + return v1alpha2.ClusterStatus{ ErrorReason: errorReason, ErrorMessage: errorMessage, } } -func newMachineStatus(nodeRef *v1.ObjectReference, errorReason *common.MachineStatusError, errorMessage *string) v1alpha1.MachineStatus { - return v1alpha1.MachineStatus{ +func newMachineStatus(nodeRef *v1.ObjectReference, errorReason *common.MachineStatusError, errorMessage *string) v1alpha2.MachineStatus { + return v1alpha2.MachineStatus{ NodeRef: nodeRef, ErrorReason: errorReason, ErrorMessage: errorMessage, } } -func getMachineWithError(machineName, namespace string, nodeRef *v1.ObjectReference, errorReason *common.MachineStatusError, errorMessage *string) v1alpha1.Machine { - return v1alpha1.Machine{ +func getMachineWithError(machineName, namespace string, nodeRef *v1.ObjectReference, errorReason *common.MachineStatusError, errorMessage *string) v1alpha2.Machine { + return v1alpha2.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: machineName, Namespace: namespace, @@ -328,8 +328,8 @@ func TestValidateMachineObjects(t *testing.T) { } for _, testcase := range testcases { t.Run(testcase.name, func(t *testing.T) { - machines := v1alpha1.MachineList{ - Items: []v1alpha1.Machine{ + machines := v1alpha2.MachineList{ + Items: []v1alpha2.Machine{ getMachineWithError("test-machine-with-no-error", "default", &testNodeRef, nil, nil), getMachineWithError("test-machine", "default", testcase.nodeRef, testcase.errorReason, testcase.errorMessage), }, @@ -394,8 +394,8 @@ func TestValidateMachineObjectWithReferredNode(t *testing.T) { } for _, testcase := range testcases { t.Run(testcase.name, func(t *testing.T) { - machines := v1alpha1.MachineList{ - Items: []v1alpha1.Machine{ + machines := v1alpha2.MachineList{ + Items: []v1alpha2.Machine{ getMachineWithError("test-machine", "default", &testcase.nodeRef, nil, nil), }, } @@ -441,16 +441,16 @@ func TestValidateClusterAPIObjectsOutput(t *testing.T) { var testcases = []struct { name string namespace string - clusterStatus v1alpha1.ClusterStatus - machine1Status v1alpha1.MachineStatus - machine2Status v1alpha1.MachineStatus + clusterStatus v1alpha2.ClusterStatus + machine1Status v1alpha2.MachineStatus + machine2Status v1alpha2.MachineStatus expectErr bool outputFileName string }{ { name: "Pass", namespace: "validate-cluster-objects", - clusterStatus: v1alpha1.ClusterStatus{}, + clusterStatus: v1alpha2.ClusterStatus{}, machine1Status: newMachineStatus(&testNodeRef1, nil, nil), machine2Status: newMachineStatus(&testNodeRef2, nil, nil), expectErr: false, @@ -468,16 +468,16 @@ func TestValidateClusterAPIObjectsOutput(t *testing.T) { { name: "Failed to validate machine objects with errors", namespace: "validate-machine-objects-errors", - clusterStatus: v1alpha1.ClusterStatus{}, + clusterStatus: v1alpha2.ClusterStatus{}, machine1Status: newMachineStatus(&testNodeRef1, &machineErrorReason, &machineErrorMessage), - machine2Status: v1alpha1.MachineStatus{}, // newMachineStatus(nil, nil, nil), + machine2Status: v1alpha2.MachineStatus{}, // newMachineStatus(nil, nil, nil), expectErr: true, outputFileName: "fail-to-validate-machine-objects-with-errors.golden", }, { name: "Failed to validate machine objects with node ref errors", namespace: "validate-machine-objects-node-ref-errors", - clusterStatus: v1alpha1.ClusterStatus{}, + clusterStatus: v1alpha2.ClusterStatus{}, machine1Status: newMachineStatus(&testNodeRefNotReady, nil, nil), machine2Status: newMachineStatus(&testNodeRefNotExist, nil, nil), expectErr: true, diff --git a/cmd/example-provider/main.go b/cmd/example-provider/main.go index 6eeaa63d981a..c0b3416a85e4 100644 --- a/cmd/example-provider/main.go +++ b/cmd/example-provider/main.go @@ -53,10 +53,10 @@ func main() { recorder := mgr.GetEventRecorderFor("clusterapi-controller") // Initialize cluster actuator. - clusterActuator, _ := cluster.NewClusterActuator(cs.ClusterV1alpha1(), recorder) + clusterActuator, _ := cluster.NewClusterActuator(cs.ClusterV1alpha2(), recorder) // Initialize machine actuator. - machineActuator, _ := machine.NewMachineActuator(cs.ClusterV1alpha1(), recorder) + machineActuator, _ := machine.NewMachineActuator(cs.ClusterV1alpha2(), recorder) // Register cluster deployer common.RegisterClusterProvisioner("example", clusterActuator) diff --git a/config/crds/cluster.k8s.io_clusters.yaml b/config/crds/cluster.k8s.io_clusters.yaml index 4d49e6e72efe..e82b0a4163e1 100644 --- a/config/crds/cluster.k8s.io_clusters.yaml +++ b/config/crds/cluster.k8s.io_clusters.yaml @@ -13,514 +13,982 @@ spec: shortNames: - cl scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - description: / [Cluster] Cluster is the Schema for the clusters API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - properties: - annotations: - additionalProperties: + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: / [Cluster] Cluster is the Schema for the clusters API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored + with a resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object belongs to. + This is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right now + and apiserver is going to ignore it if set in create or update request. + type: string + creationTimestamp: + description: "CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients may + not set this value. It is represented in RFC3339 form and is in + UTC. \n Populated by the system. Read-only. Null for lists. More + info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time type: string - description: 'Annotations is an unstructured key value map stored with - a resource that may be set by external tools to store and retrieve - arbitrary metadata. They are not queryable and should be preserved - when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' - type: object - clusterName: - description: The name of the cluster which the object belongs to. This - is used to distinguish resources with same name and namespace in different - clusters. This field is not set anywhere right now and apiserver is - going to ignore it if set in create or update request. - type: string - creationTimestamp: - description: "CreationTimestamp is a timestamp representing the server - time when this object was created. It is not guaranteed to be set - in happens-before order across separate operations. Clients may not - set this value. It is represented in RFC3339 form and is in UTC. \n - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - deletionGracePeriodSeconds: - description: Number of seconds allowed for this object to gracefully - terminate before it will be removed from the system. Only set when - deletionTimestamp is also set. May only be shortened. Read-only. - format: int64 - type: integer - deletionTimestamp: - description: "DeletionTimestamp is RFC 3339 date and time at which this - resource will be deleted. This field is set by the server when a graceful - deletion is requested by the user, and is not directly settable by - a client. The resource is expected to be deleted (no longer visible - from resource lists, and not reachable by name) after the time in - this field, once the finalizers list is empty. As long as the finalizers - list contains items, deletion is blocked. Once the deletionTimestamp - is set, this value may not be unset or be set further into the future, - although it may be shortened or the resource may be deleted prior - to this time. For example, a user may request that a pod is deleted - in 30 seconds. The Kubelet will react by sending a graceful termination - signal to the containers in the pod. After that 30 seconds, the Kubelet - will send a hard termination signal (SIGKILL) to the container and - after cleanup, remove the pod from the API. In the presence of network - partitions, this object may still exist after this timestamp, until - an administrator or automated process can determine the resource is - fully terminated. If not set, graceful deletion of the object has - not been requested. \n Populated by the system when a graceful deletion - is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - finalizers: - description: Must be empty before the object is deleted from the registry. - Each entry is an identifier for the responsible component that will - remove the entry from the list. If the deletionTimestamp of the object - is non-nil, entries in this list can only be removed. - items: + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only set when + deletionTimestamp is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time at which + this resource will be deleted. This field is set by the server when + a graceful deletion is requested by the user, and is not directly + settable by a client. The resource is expected to be deleted (no + longer visible from resource lists, and not reachable by name) after + the time in this field, once the finalizers list is empty. As long + as the finalizers list contains items, deletion is blocked. Once + the deletionTimestamp is set, this value may not be unset or be + set further into the future, although it may be shortened or the + resource may be deleted prior to this time. For example, a user + may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + \n Populated by the system when a graceful deletion is requested. + Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time type: string - type: array - generateName: - description: "GenerateName is an optional prefix, used by the server, - to generate a unique name ONLY IF the Name field has not been provided. - If this field is used, the name returned to the client will be different - than the name passed. This value will also be combined with a unique - suffix. The provided value has the same validation rules as the Name - field, and may be truncated by the length of the suffix required to - make the value unique on the server. \n If this field is specified - and the generated name exists, the server will NOT return a 409 - - instead, it will either return 201 Created or 500 with Reason ServerTimeout - indicating a unique name could not be found in the time allotted, - and the client should retry (optionally after the time indicated in - the Retry-After header). \n Applied only if Name is not specified. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - type: string - generation: - description: A sequence number representing a specific generation of - the desired state. Populated by the system. Read-only. - format: int64 - type: integer - initializers: - description: "An initializer is a controller which enforces some system - invariant at object creation time. This field is a list of initializers - that have not yet acted on this object. If nil or empty, this object - has been completely initialized. Otherwise, the object is considered - uninitialized and is hidden (in list/watch and get calls) from clients - that haven't explicitly asked to observe uninitialized objects. \n - When an object is created, the system will populate this list with - the current set of initializers. Only privileged users may set or - modify this list. Once it is empty, it may not be modified further - by any user. \n DEPRECATED - initializers are an alpha field and will - be removed in v1.15." - properties: - pending: - description: Pending is a list of initializers that must execute - in order before this object is visible. When the last pending - initializer is removed, and no failing result is set, the initializers - struct will be set to nil and the object is considered as initialized - and visible to all clients. - items: + finalizers: + description: Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that will + remove the entry from the list. If the deletionTimestamp of the + object is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not been provided. + If this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a unique + suffix. The provided value has the same validation rules as the + Name field, and may be truncated by the length of the suffix required + to make the value unique on the server. \n If this field is specified + and the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the + time indicated in the Retry-After header). \n Applied only if Name + is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific generation + of the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces some system + invariant at object creation time. This field is a list of initializers + that have not yet acted on this object. If nil or empty, this object + has been completely initialized. Otherwise, the object is considered + uninitialized and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. + \n When an object is created, the system will populate this list + with the current set of initializers. Only privileged users may + set or modify this list. Once it is empty, it may not be modified + further by any user. \n DEPRECATED - initializers are an alpha field + and will be removed in v1.15." + properties: + pending: + description: Pending is a list of initializers that must execute + in order before this object is visible. When the last pending + initializer is removed, and no failing result is set, the initializers + struct will be set to nil and the object is considered as initialized + and visible to all clients. + items: + properties: + name: + description: name of the process that is responsible for + initializing this object. + type: string + required: + - name + type: object + type: array + result: + description: If result is set with the Failure field, the object + will be persisted to storage and then deleted, ensuring that + other clients can observe the deletion. properties: - name: - description: name of the process that is responsible for initializing - this object. + apiVersion: + description: 'APIVersion defines the versioned schema of this + representation of an object. Servers should convert recognized + schemas to the latest internal value, and may reject unrecognized + values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + code: + description: Suggested HTTP return code for this status, 0 + if not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This field is + optional and the data returned is not guaranteed to conform + to any schema except that defined by the reason type. + properties: + causes: + description: The Causes array includes more details associated + with the StatusReason failure. Not all StatusReasons + may provide detailed causes. + items: + properties: + field: + description: "The field of the resource that has + caused this error, as named by its JSON serialization. + May include dot and postfix notation for nested + attributes. Arrays are zero-indexed. Fields may + appear more than once in an array of causes due + to fields having multiple errors. Optional. \n + Examples: \"name\" - the field \"name\" on the + current resource \"items[0].name\" - the field + \"name\" on the first array entry in \"items\"" + type: string + message: + description: A human-readable description of the + cause of the error. This field may be presented + as-is to a reader. + type: string + reason: + description: A machine-readable description of the + cause of the error. If this value is empty there + is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource associated + with the status StatusReason. + type: string + kind: + description: 'The kind attribute of the resource associated + with the status StatusReason. On some operations may + differ from the requested resource Kind. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: The name attribute of the resource associated + with the status StatusReason (when there is a single + name which can be described). + type: string + retryAfterSeconds: + description: If specified, the time in seconds before + the operation should be retried. Some errors may indicate + the client must take an alternate action - for those + errors this field may indicate how long to wait before + taking the alternate action. + format: int32 + type: integer + uid: + description: 'UID of the resource. (when there is a single + resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + type: object + kind: + description: 'Kind is a string value representing the REST + resource this object represents. Servers may infer this + from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status of + this operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set a limit + on the number of items returned, and indicates that + the server has more data available. The value is opaque + and may be used to issue another request to the endpoint + that served this list to retrieve the next set of available + objects. Continuing a consistent list may not be possible + if the server configuration has changed or more than + a few minutes have passed. The resourceVersion field + returned when using this continue value will be identical + to the value in the first response, unless you have + received this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s internal + version of this object that can be used by clients to + determine when objects have changed. Value must be treated + as opaque by clients and passed unmodified back to the + server. Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why this operation + is in the "Failure" status. If this value is empty there + is no information available. A Reason clarifies an HTTP + status code but does not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" or + "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' type: string - required: - - name type: object - type: array - result: - description: If result is set with the Failure field, the object - will be persisted to storage and then deleted, ensuring that other - clients can observe the deletion. + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors of + replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + managedFields: + description: "ManagedFields maps workflow-id and version to the set + of fields that are managed by that workflow. This is mostly for + internal housekeeping, and users typically shouldn't need to set + or understand this field. A workflow can be the user's name, a controller's + name, or the name of a specific apply path like \"ci-cd\". The set + of fields is always in the version that the workflow used when modifying + the object. \n This field is alpha and can be changed or removed + without notice." + items: properties: apiVersion: - description: 'APIVersion defines the versioned schema of this - representation of an object. Servers should convert recognized - schemas to the latest internal value, and may reject unrecognized - values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + description: APIVersion defines the version of this resource + that this field set applies to. The format is "group/version" + just like the top-level APIVersion field. It is necessary + to track the version of a field set because it cannot be automatically + converted. type: string - code: - description: Suggested HTTP return code for this status, 0 if - not set. - format: int32 - type: integer - details: - description: Extended data associated with the reason. Each - reason may define its own extended details. This field is - optional and the data returned is not guaranteed to conform - to any schema except that defined by the reason type. - properties: - causes: - description: The Causes array includes more details associated - with the StatusReason failure. Not all StatusReasons may - provide detailed causes. - items: - properties: - field: - description: "The field of the resource that has caused - this error, as named by its JSON serialization. - May include dot and postfix notation for nested - attributes. Arrays are zero-indexed. Fields may - appear more than once in an array of causes due - to fields having multiple errors. Optional. \n Examples: - \ \"name\" - the field \"name\" on the current - resource \"items[0].name\" - the field \"name\" - on the first array entry in \"items\"" - type: string - message: - description: A human-readable description of the cause - of the error. This field may be presented as-is - to a reader. - type: string - reason: - description: A machine-readable description of the - cause of the error. If this value is empty there - is no information available. - type: string - type: object - type: array - group: - description: The group attribute of the resource associated - with the status StatusReason. - type: string - kind: - description: 'The kind attribute of the resource associated - with the status StatusReason. On some operations may differ - from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: The name attribute of the resource associated - with the status StatusReason (when there is a single name - which can be described). - type: string - retryAfterSeconds: - description: If specified, the time in seconds before the - operation should be retried. Some errors may indicate - the client must take an alternate action - for those errors - this field may indicate how long to wait before taking - the alternate action. - format: int32 - type: integer - uid: - description: 'UID of the resource. (when there is a single - resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string + fields: + additionalProperties: true + description: Fields identifies a set of fields. type: object - kind: - description: 'Kind is a string value representing the REST resource - this object represents. Servers may infer this from the endpoint - the client submits requests to. Cannot be updated. In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + manager: + description: Manager is an identifier of the workflow managing + these fields. type: string - message: - description: A human-readable description of the status of this - operation. + operation: + description: Operation is the type of operation which lead to + this ManagedFieldsEntry being created. The only valid values + for this field are 'Apply' and 'Update'. type: string - metadata: - description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - properties: - continue: - description: continue may be set if the user set a limit - on the number of items returned, and indicates that the - server has more data available. The value is opaque and - may be used to issue another request to the endpoint that - served this list to retrieve the next set of available - objects. Continuing a consistent list may not be possible - if the server configuration has changed or more than a - few minutes have passed. The resourceVersion field returned - when using this continue value will be identical to the - value in the first response, unless you have received - this token from an error message. - type: string - resourceVersion: - description: 'String that identifies the server''s internal - version of this object that can be used by clients to - determine when objects have changed. Value must be treated - as opaque by clients and passed unmodified back to the - server. Populated by the system. Read-only. More info: - https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' - type: string - selfLink: - description: selfLink is a URL representing this object. - Populated by the system. Read-only. - type: string - type: object - reason: - description: A machine-readable description of why this operation - is in the "Failure" status. If this value is empty there is - no information available. A Reason clarifies an HTTP status - code but does not override it. + time: + description: Time is timestamp of when these fields were set. + It should always be empty if Operation is 'Apply' + format: date-time type: string - status: - description: 'Status of the operation. One of: "Success" or - "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: object + type: array + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow a client + to request the generation of an appropriate name automatically. + Name is primarily intended for creation idempotence and configuration + definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must be + unique. An empty namespace is equivalent to the \"default\" namespace, + but \"default\" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. Cannot + be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field set + to true. There cannot be more than one managing controller. + items: + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. + To set this field, a user needs "delete" permission of the + owner, otherwise 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid type: object - required: - - pending - type: object - labels: - additionalProperties: + type: array + resourceVersion: + description: "An opaque value that represents the internal version + of this object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. \n Populated by the system. Read-only. Value must + be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. \n Populated + by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" type: string - description: 'Map of string keys and values that can be used to organize - and categorize (scope and select) objects. May match selectors of - replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' - type: object - managedFields: - description: "ManagedFields maps workflow-id and version to the set - of fields that are managed by that workflow. This is mostly for internal - housekeeping, and users typically shouldn't need to set or understand - this field. A workflow can be the user's name, a controller's name, - or the name of a specific apply path like \"ci-cd\". The set of fields - is always in the version that the workflow used when modifying the - object. \n This field is alpha and can be changed or removed without - notice." - items: + type: object + spec: + properties: + clusterNetwork: + description: Cluster network configuration properties: - apiVersion: - description: APIVersion defines the version of this resource that - this field set applies to. The format is "group/version" just - like the top-level APIVersion field. It is necessary to track - the version of a field set because it cannot be automatically - converted. - type: string - fields: - additionalProperties: true - description: Fields identifies a set of fields. + pods: + description: The network ranges from which Pod networks are allocated. + properties: + cidrBlocks: + items: + type: string + type: array + required: + - cidrBlocks type: object - manager: - description: Manager is an identifier of the workflow managing - these fields. - type: string - operation: - description: Operation is the type of operation which lead to - this ManagedFieldsEntry being created. The only valid values - for this field are 'Apply' and 'Update'. - type: string - time: - description: Time is timestamp of when these fields were set. - It should always be empty if Operation is 'Apply' - format: date-time + serviceDomain: + description: Domain name for services. type: string + services: + description: The network ranges from which service VIPs are allocated. + properties: + cidrBlocks: + items: + type: string + type: array + required: + - cidrBlocks + type: object + required: + - services + - pods + - serviceDomain type: object - type: array - name: - description: 'Name must be unique within a namespace. Is required when - creating resources, although some resources may allow a client to - request the generation of an appropriate name automatically. Name - is primarily intended for creation idempotence and configuration definition. - Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - namespace: - description: "Namespace defines the space within each name must be unique. - An empty namespace is equivalent to the \"default\" namespace, but - \"default\" is the canonical representation. Not all objects are required - to be scoped to a namespace - the value of this field for those objects - will be empty. \n Must be a DNS_LABEL. Cannot be updated. More info: - http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: List of objects depended by this object. If ALL objects - in the list have been deleted, this object will be garbage collected. - If this object is managed by a controller, then an entry in this list - will point to this controller, with the controller field set to true. - There cannot be more than one managing controller. - items: + providerSpec: + description: Provider-specific serialized configuration to use during + cluster creation. It is recommended that providers maintain their + own versioned API types that should be serialized/deserialized from + this field. properties: - apiVersion: - description: API version of the referent. - type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" - finalizer, then the owner cannot be deleted from the key-value - store until this reference is removed. Defaults to false. To - set this field, a user needs "delete" permission of the owner, - otherwise 422 (Unprocessable Entity) will be returned. - type: boolean - controller: - description: If true, this reference points to the managing controller. - type: boolean - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string - required: - - apiVersion - - kind - - name - - uid + value: + description: Value is an inlined, serialized representation of + the resource configuration. It is recommended that providers + maintain their own versioned API types that should be serialized/deserialized + from this field, akin to component config. + type: object + valueFrom: + description: Source for the provider configuration. Cannot be + used if value is not empty. + properties: + machineClass: + description: The machine class from which the provider config + should be sourced. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead + of an entire object, this string should contain a valid + JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this + pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object. TODO: this design + is not final and this field is subject to change in + the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + provider: + description: Provider is the name of the cloud-provider + which MachineClass is intended for. + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + type: object type: object - type: array - resourceVersion: - description: "An opaque value that represents the internal version of - this object that can be used by clients to determine when objects - have changed. May be used for optimistic concurrency, change detection, - and the watch operation on a resource or set of resources. Clients - must treat these values as opaque and passed unmodified back to the - server. They may only be valid for a particular resource or set of - resources. \n Populated by the system. Read-only. Value must be treated - as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - type: string - selfLink: - description: SelfLink is a URL representing this object. Populated by - the system. Read-only. - type: string - uid: - description: "UID is the unique in time and space value for this object. - It is typically generated by the server on successful creation of - a resource and is not allowed to change on PUT operations. \n Populated - by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - type: string - type: object - spec: - properties: - clusterNetwork: - description: Cluster network configuration - properties: - pods: - description: The network ranges from which Pod networks are allocated. + required: + - clusterNetwork + type: object + status: + properties: + apiEndpoints: + description: APIEndpoint represents the endpoint to communicate with + the IP. + items: properties: - cidrBlocks: - items: - type: string - type: array + host: + description: The hostname on which the API server is serving. + type: string + port: + description: The port on which the API server is serving. + type: integer required: - - cidrBlocks + - host + - port type: object - serviceDomain: - description: Domain name for services. + type: array + errorMessage: + description: If set, indicates that there is a problem reconciling + the state, and will be set to a descriptive error message. + type: string + errorReason: + description: If set, indicates that there is a problem reconciling + the state, and will be set to a token value suitable for programmatic + interpretation. + type: string + providerStatus: + description: Provider-specific status. It is recommended that providers + maintain their own versioned API types that should be serialized/deserialized + from this field. + type: object + type: object + type: object + served: true + storage: false + subresources: + status: {} + - name: v1alpha2 + schema: + openAPIV3Schema: + description: / [Cluster] Cluster is the Schema for the clusters API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + properties: + annotations: + additionalProperties: type: string - services: - description: The network ranges from which service VIPs are allocated. - properties: - cidrBlocks: - items: - type: string - type: array - required: - - cidrBlocks - type: object - required: - - services - - pods - - serviceDomain - type: object - providerSpec: - description: Provider-specific serialized configuration to use during - cluster creation. It is recommended that providers maintain their - own versioned API types that should be serialized/deserialized from - this field. - properties: - value: - description: Value is an inlined, serialized representation of the - resource configuration. It is recommended that providers maintain - their own versioned API types that should be serialized/deserialized - from this field, akin to component config. - type: object - valueFrom: - description: Source for the provider configuration. Cannot be used - if value is not empty. - properties: - machineClass: - description: The machine class from which the provider config - should be sourced. + description: 'Annotations is an unstructured key value map stored + with a resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object belongs to. + This is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right now + and apiserver is going to ignore it if set in create or update request. + type: string + creationTimestamp: + description: "CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients may + not set this value. It is represented in RFC3339 form and is in + UTC. \n Populated by the system. Read-only. Null for lists. More + info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only set when + deletionTimestamp is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time at which + this resource will be deleted. This field is set by the server when + a graceful deletion is requested by the user, and is not directly + settable by a client. The resource is expected to be deleted (no + longer visible from resource lists, and not reachable by name) after + the time in this field, once the finalizers list is empty. As long + as the finalizers list contains items, deletion is blocked. Once + the deletionTimestamp is set, this value may not be unset or be + set further into the future, although it may be shortened or the + resource may be deleted prior to this time. For example, a user + may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + \n Populated by the system when a graceful deletion is requested. + Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + finalizers: + description: Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that will + remove the entry from the list. If the deletionTimestamp of the + object is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not been provided. + If this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a unique + suffix. The provided value has the same validation rules as the + Name field, and may be truncated by the length of the suffix required + to make the value unique on the server. \n If this field is specified + and the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the + time indicated in the Retry-After header). \n Applied only if Name + is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific generation + of the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces some system + invariant at object creation time. This field is a list of initializers + that have not yet acted on this object. If nil or empty, this object + has been completely initialized. Otherwise, the object is considered + uninitialized and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. + \n When an object is created, the system will populate this list + with the current set of initializers. Only privileged users may + set or modify this list. Once it is empty, it may not be modified + further by any user. \n DEPRECATED - initializers are an alpha field + and will be removed in v1.15." + properties: + pending: + description: Pending is a list of initializers that must execute + in order before this object is visible. When the last pending + initializer is removed, and no failing result is set, the initializers + struct will be set to nil and the object is considered as initialized + and visible to all clients. + items: properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead - of an entire object, this string should contain a valid - JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container - within a pod, this would take on a value like: "spec.containers{name}" - (where "name" refers to the name of the container that - triggered the event) or if no container name is specified - "spec.containers[2]" (container with index 2 in this pod). - This syntax is chosen only to have some well-defined way - of referencing a part of an object. TODO: this design - is not final and this field is subject to change in the - future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - provider: - description: Provider is the name of the cloud-provider - which MachineClass is intended for. - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference - is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + description: name of the process that is responsible for + initializing this object. type: string + required: + - name + type: object + type: array + result: + description: If result is set with the Failure field, the object + will be persisted to storage and then deleted, ensuring that + other clients can observe the deletion. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this + representation of an object. Servers should convert recognized + schemas to the latest internal value, and may reject unrecognized + values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + code: + description: Suggested HTTP return code for this status, 0 + if not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This field is + optional and the data returned is not guaranteed to conform + to any schema except that defined by the reason type. + properties: + causes: + description: The Causes array includes more details associated + with the StatusReason failure. Not all StatusReasons + may provide detailed causes. + items: + properties: + field: + description: "The field of the resource that has + caused this error, as named by its JSON serialization. + May include dot and postfix notation for nested + attributes. Arrays are zero-indexed. Fields may + appear more than once in an array of causes due + to fields having multiple errors. Optional. \n + Examples: \"name\" - the field \"name\" on the + current resource \"items[0].name\" - the field + \"name\" on the first array entry in \"items\"" + type: string + message: + description: A human-readable description of the + cause of the error. This field may be presented + as-is to a reader. + type: string + reason: + description: A machine-readable description of the + cause of the error. If this value is empty there + is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource associated + with the status StatusReason. + type: string + kind: + description: 'The kind attribute of the resource associated + with the status StatusReason. On some operations may + differ from the requested resource Kind. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: The name attribute of the resource associated + with the status StatusReason (when there is a single + name which can be described). + type: string + retryAfterSeconds: + description: If specified, the time in seconds before + the operation should be retried. Some errors may indicate + the client must take an alternate action - for those + errors this field may indicate how long to wait before + taking the alternate action. + format: int32 + type: integer + uid: + description: 'UID of the resource. (when there is a single + resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + type: object + kind: + description: 'Kind is a string value representing the REST + resource this object represents. Servers may infer this + from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status of + this operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set a limit + on the number of items returned, and indicates that + the server has more data available. The value is opaque + and may be used to issue another request to the endpoint + that served this list to retrieve the next set of available + objects. Continuing a consistent list may not be possible + if the server configuration has changed or more than + a few minutes have passed. The resourceVersion field + returned when using this continue value will be identical + to the value in the first response, unless you have + received this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s internal + version of this object that can be used by clients to + determine when objects have changed. Value must be treated + as opaque by clients and passed unmodified back to the + server. Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why this operation + is in the "Failure" status. If this value is empty there + is no information available. A Reason clarifies an HTTP + status code but does not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" or + "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: string + type: object + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors of + replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + managedFields: + description: "ManagedFields maps workflow-id and version to the set + of fields that are managed by that workflow. This is mostly for + internal housekeeping, and users typically shouldn't need to set + or understand this field. A workflow can be the user's name, a controller's + name, or the name of a specific apply path like \"ci-cd\". The set + of fields is always in the version that the workflow used when modifying + the object. \n This field is alpha and can be changed or removed + without notice." + items: + properties: + apiVersion: + description: APIVersion defines the version of this resource + that this field set applies to. The format is "group/version" + just like the top-level APIVersion field. It is necessary + to track the version of a field set because it cannot be automatically + converted. + type: string + fields: + additionalProperties: true + description: Fields identifies a set of fields. type: object + manager: + description: Manager is an identifier of the workflow managing + these fields. + type: string + operation: + description: Operation is the type of operation which lead to + this ManagedFieldsEntry being created. The only valid values + for this field are 'Apply' and 'Update'. + type: string + time: + description: Time is timestamp of when these fields were set. + It should always be empty if Operation is 'Apply' + format: date-time + type: string + type: object + type: array + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow a client + to request the generation of an appropriate name automatically. + Name is primarily intended for creation idempotence and configuration + definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must be + unique. An empty namespace is equivalent to the \"default\" namespace, + but \"default\" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. Cannot + be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field set + to true. There cannot be more than one managing controller. + items: + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. + To set this field, a user needs "delete" permission of the + owner, otherwise 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid type: object - type: object - required: - - clusterNetwork - type: object - status: - properties: - apiEndpoints: - description: APIEndpoint represents the endpoint to communicate with - the IP. - items: + type: array + resourceVersion: + description: "An opaque value that represents the internal version + of this object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. \n Populated by the system. Read-only. Value must + be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. \n Populated + by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + spec: + properties: + clusterNetwork: + description: Cluster network configuration properties: - host: - description: The hostname on which the API server is serving. + pods: + description: The network ranges from which Pod networks are allocated. + properties: + cidrBlocks: + items: + type: string + type: array + required: + - cidrBlocks + type: object + serviceDomain: + description: Domain name for services. type: string - port: - description: The port on which the API server is serving. - type: integer + services: + description: The network ranges from which service VIPs are allocated. + properties: + cidrBlocks: + items: + type: string + type: array + required: + - cidrBlocks + type: object required: - - host - - port + - services + - pods + - serviceDomain type: object - type: array - errorMessage: - description: If set, indicates that there is a problem reconciling the - state, and will be set to a descriptive error message. - type: string - errorReason: - description: If set, indicates that there is a problem reconciling the - state, and will be set to a token value suitable for programmatic - interpretation. - type: string - providerStatus: - description: Provider-specific status. It is recommended that providers - maintain their own versioned API types that should be serialized/deserialized - from this field. - type: object - type: object - type: object - versions: - - name: v1alpha1 + providerSpec: + description: Provider-specific serialized configuration to use during + cluster creation. It is recommended that providers maintain their + own versioned API types that should be serialized/deserialized from + this field. + properties: + value: + description: Value is an inlined, serialized representation of + the resource configuration. It is recommended that providers + maintain their own versioned API types that should be serialized/deserialized + from this field, akin to component config. + type: object + type: object + required: + - clusterNetwork + type: object + status: + properties: + apiEndpoints: + description: APIEndpoint represents the endpoint to communicate with + the IP. + items: + properties: + host: + description: The hostname on which the API server is serving. + type: string + port: + description: The port on which the API server is serving. + type: integer + required: + - host + - port + type: object + type: array + errorMessage: + description: If set, indicates that there is a problem reconciling + the state, and will be set to a descriptive error message. + type: string + errorReason: + description: If set, indicates that there is a problem reconciling + the state, and will be set to a token value suitable for programmatic + interpretation. + type: string + providerStatus: + description: Provider-specific status. It is recommended that providers + maintain their own versioned API types that should be serialized/deserialized + from this field. + type: object + type: object + type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/config/crds/cluster.k8s.io_machineclasses.yaml b/config/crds/cluster.k8s.io_machineclasses.yaml index 60c74df96411..20ceed82b447 100644 --- a/config/crds/cluster.k8s.io_machineclasses.yaml +++ b/config/crds/cluster.k8s.io_machineclasses.yaml @@ -13,387 +13,391 @@ spec: shortNames: - mc scope: Namespaced - validation: - openAPIV3Schema: - description: / [MachineClass] MachineClass can be used to templatize and re-use - provider configuration across multiple Machines / MachineSets / MachineDeployments. - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - properties: - annotations: - additionalProperties: + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: / [MachineClass] MachineClass can be used to templatize and re-use + provider configuration across multiple Machines / MachineSets / MachineDeployments. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored + with a resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object belongs to. + This is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right now + and apiserver is going to ignore it if set in create or update request. type: string - description: 'Annotations is an unstructured key value map stored with - a resource that may be set by external tools to store and retrieve - arbitrary metadata. They are not queryable and should be preserved - when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' - type: object - clusterName: - description: The name of the cluster which the object belongs to. This - is used to distinguish resources with same name and namespace in different - clusters. This field is not set anywhere right now and apiserver is - going to ignore it if set in create or update request. - type: string - creationTimestamp: - description: "CreationTimestamp is a timestamp representing the server - time when this object was created. It is not guaranteed to be set - in happens-before order across separate operations. Clients may not - set this value. It is represented in RFC3339 form and is in UTC. \n - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - deletionGracePeriodSeconds: - description: Number of seconds allowed for this object to gracefully - terminate before it will be removed from the system. Only set when - deletionTimestamp is also set. May only be shortened. Read-only. - format: int64 - type: integer - deletionTimestamp: - description: "DeletionTimestamp is RFC 3339 date and time at which this - resource will be deleted. This field is set by the server when a graceful - deletion is requested by the user, and is not directly settable by - a client. The resource is expected to be deleted (no longer visible - from resource lists, and not reachable by name) after the time in - this field, once the finalizers list is empty. As long as the finalizers - list contains items, deletion is blocked. Once the deletionTimestamp - is set, this value may not be unset or be set further into the future, - although it may be shortened or the resource may be deleted prior - to this time. For example, a user may request that a pod is deleted - in 30 seconds. The Kubelet will react by sending a graceful termination - signal to the containers in the pod. After that 30 seconds, the Kubelet - will send a hard termination signal (SIGKILL) to the container and - after cleanup, remove the pod from the API. In the presence of network - partitions, this object may still exist after this timestamp, until - an administrator or automated process can determine the resource is - fully terminated. If not set, graceful deletion of the object has - not been requested. \n Populated by the system when a graceful deletion - is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - finalizers: - description: Must be empty before the object is deleted from the registry. - Each entry is an identifier for the responsible component that will - remove the entry from the list. If the deletionTimestamp of the object - is non-nil, entries in this list can only be removed. - items: + creationTimestamp: + description: "CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients may + not set this value. It is represented in RFC3339 form and is in + UTC. \n Populated by the system. Read-only. Null for lists. More + info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time type: string - type: array - generateName: - description: "GenerateName is an optional prefix, used by the server, - to generate a unique name ONLY IF the Name field has not been provided. - If this field is used, the name returned to the client will be different - than the name passed. This value will also be combined with a unique - suffix. The provided value has the same validation rules as the Name - field, and may be truncated by the length of the suffix required to - make the value unique on the server. \n If this field is specified - and the generated name exists, the server will NOT return a 409 - - instead, it will either return 201 Created or 500 with Reason ServerTimeout - indicating a unique name could not be found in the time allotted, - and the client should retry (optionally after the time indicated in - the Retry-After header). \n Applied only if Name is not specified. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - type: string - generation: - description: A sequence number representing a specific generation of - the desired state. Populated by the system. Read-only. - format: int64 - type: integer - initializers: - description: "An initializer is a controller which enforces some system - invariant at object creation time. This field is a list of initializers - that have not yet acted on this object. If nil or empty, this object - has been completely initialized. Otherwise, the object is considered - uninitialized and is hidden (in list/watch and get calls) from clients - that haven't explicitly asked to observe uninitialized objects. \n - When an object is created, the system will populate this list with - the current set of initializers. Only privileged users may set or - modify this list. Once it is empty, it may not be modified further - by any user. \n DEPRECATED - initializers are an alpha field and will - be removed in v1.15." - properties: - pending: - description: Pending is a list of initializers that must execute - in order before this object is visible. When the last pending - initializer is removed, and no failing result is set, the initializers - struct will be set to nil and the object is considered as initialized - and visible to all clients. - items: + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only set when + deletionTimestamp is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time at which + this resource will be deleted. This field is set by the server when + a graceful deletion is requested by the user, and is not directly + settable by a client. The resource is expected to be deleted (no + longer visible from resource lists, and not reachable by name) after + the time in this field, once the finalizers list is empty. As long + as the finalizers list contains items, deletion is blocked. Once + the deletionTimestamp is set, this value may not be unset or be + set further into the future, although it may be shortened or the + resource may be deleted prior to this time. For example, a user + may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + \n Populated by the system when a graceful deletion is requested. + Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + finalizers: + description: Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that will + remove the entry from the list. If the deletionTimestamp of the + object is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not been provided. + If this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a unique + suffix. The provided value has the same validation rules as the + Name field, and may be truncated by the length of the suffix required + to make the value unique on the server. \n If this field is specified + and the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the + time indicated in the Retry-After header). \n Applied only if Name + is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific generation + of the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces some system + invariant at object creation time. This field is a list of initializers + that have not yet acted on this object. If nil or empty, this object + has been completely initialized. Otherwise, the object is considered + uninitialized and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. + \n When an object is created, the system will populate this list + with the current set of initializers. Only privileged users may + set or modify this list. Once it is empty, it may not be modified + further by any user. \n DEPRECATED - initializers are an alpha field + and will be removed in v1.15." + properties: + pending: + description: Pending is a list of initializers that must execute + in order before this object is visible. When the last pending + initializer is removed, and no failing result is set, the initializers + struct will be set to nil and the object is considered as initialized + and visible to all clients. + items: + properties: + name: + description: name of the process that is responsible for + initializing this object. + type: string + required: + - name + type: object + type: array + result: + description: If result is set with the Failure field, the object + will be persisted to storage and then deleted, ensuring that + other clients can observe the deletion. properties: - name: - description: name of the process that is responsible for initializing - this object. + apiVersion: + description: 'APIVersion defines the versioned schema of this + representation of an object. Servers should convert recognized + schemas to the latest internal value, and may reject unrecognized + values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + code: + description: Suggested HTTP return code for this status, 0 + if not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This field is + optional and the data returned is not guaranteed to conform + to any schema except that defined by the reason type. + properties: + causes: + description: The Causes array includes more details associated + with the StatusReason failure. Not all StatusReasons + may provide detailed causes. + items: + properties: + field: + description: "The field of the resource that has + caused this error, as named by its JSON serialization. + May include dot and postfix notation for nested + attributes. Arrays are zero-indexed. Fields may + appear more than once in an array of causes due + to fields having multiple errors. Optional. \n + Examples: \"name\" - the field \"name\" on the + current resource \"items[0].name\" - the field + \"name\" on the first array entry in \"items\"" + type: string + message: + description: A human-readable description of the + cause of the error. This field may be presented + as-is to a reader. + type: string + reason: + description: A machine-readable description of the + cause of the error. If this value is empty there + is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource associated + with the status StatusReason. + type: string + kind: + description: 'The kind attribute of the resource associated + with the status StatusReason. On some operations may + differ from the requested resource Kind. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: The name attribute of the resource associated + with the status StatusReason (when there is a single + name which can be described). + type: string + retryAfterSeconds: + description: If specified, the time in seconds before + the operation should be retried. Some errors may indicate + the client must take an alternate action - for those + errors this field may indicate how long to wait before + taking the alternate action. + format: int32 + type: integer + uid: + description: 'UID of the resource. (when there is a single + resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + type: object + kind: + description: 'Kind is a string value representing the REST + resource this object represents. Servers may infer this + from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status of + this operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set a limit + on the number of items returned, and indicates that + the server has more data available. The value is opaque + and may be used to issue another request to the endpoint + that served this list to retrieve the next set of available + objects. Continuing a consistent list may not be possible + if the server configuration has changed or more than + a few minutes have passed. The resourceVersion field + returned when using this continue value will be identical + to the value in the first response, unless you have + received this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s internal + version of this object that can be used by clients to + determine when objects have changed. Value must be treated + as opaque by clients and passed unmodified back to the + server. Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why this operation + is in the "Failure" status. If this value is empty there + is no information available. A Reason clarifies an HTTP + status code but does not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" or + "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' type: string - required: - - name type: object - type: array - result: - description: If result is set with the Failure field, the object - will be persisted to storage and then deleted, ensuring that other - clients can observe the deletion. + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors of + replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + managedFields: + description: "ManagedFields maps workflow-id and version to the set + of fields that are managed by that workflow. This is mostly for + internal housekeeping, and users typically shouldn't need to set + or understand this field. A workflow can be the user's name, a controller's + name, or the name of a specific apply path like \"ci-cd\". The set + of fields is always in the version that the workflow used when modifying + the object. \n This field is alpha and can be changed or removed + without notice." + items: properties: apiVersion: - description: 'APIVersion defines the versioned schema of this - representation of an object. Servers should convert recognized - schemas to the latest internal value, and may reject unrecognized - values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + description: APIVersion defines the version of this resource + that this field set applies to. The format is "group/version" + just like the top-level APIVersion field. It is necessary + to track the version of a field set because it cannot be automatically + converted. type: string - code: - description: Suggested HTTP return code for this status, 0 if - not set. - format: int32 - type: integer - details: - description: Extended data associated with the reason. Each - reason may define its own extended details. This field is - optional and the data returned is not guaranteed to conform - to any schema except that defined by the reason type. - properties: - causes: - description: The Causes array includes more details associated - with the StatusReason failure. Not all StatusReasons may - provide detailed causes. - items: - properties: - field: - description: "The field of the resource that has caused - this error, as named by its JSON serialization. - May include dot and postfix notation for nested - attributes. Arrays are zero-indexed. Fields may - appear more than once in an array of causes due - to fields having multiple errors. Optional. \n Examples: - \ \"name\" - the field \"name\" on the current - resource \"items[0].name\" - the field \"name\" - on the first array entry in \"items\"" - type: string - message: - description: A human-readable description of the cause - of the error. This field may be presented as-is - to a reader. - type: string - reason: - description: A machine-readable description of the - cause of the error. If this value is empty there - is no information available. - type: string - type: object - type: array - group: - description: The group attribute of the resource associated - with the status StatusReason. - type: string - kind: - description: 'The kind attribute of the resource associated - with the status StatusReason. On some operations may differ - from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: The name attribute of the resource associated - with the status StatusReason (when there is a single name - which can be described). - type: string - retryAfterSeconds: - description: If specified, the time in seconds before the - operation should be retried. Some errors may indicate - the client must take an alternate action - for those errors - this field may indicate how long to wait before taking - the alternate action. - format: int32 - type: integer - uid: - description: 'UID of the resource. (when there is a single - resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string + fields: + additionalProperties: true + description: Fields identifies a set of fields. type: object - kind: - description: 'Kind is a string value representing the REST resource - this object represents. Servers may infer this from the endpoint - the client submits requests to. Cannot be updated. In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + manager: + description: Manager is an identifier of the workflow managing + these fields. type: string - message: - description: A human-readable description of the status of this - operation. + operation: + description: Operation is the type of operation which lead to + this ManagedFieldsEntry being created. The only valid values + for this field are 'Apply' and 'Update'. type: string - metadata: - description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - properties: - continue: - description: continue may be set if the user set a limit - on the number of items returned, and indicates that the - server has more data available. The value is opaque and - may be used to issue another request to the endpoint that - served this list to retrieve the next set of available - objects. Continuing a consistent list may not be possible - if the server configuration has changed or more than a - few minutes have passed. The resourceVersion field returned - when using this continue value will be identical to the - value in the first response, unless you have received - this token from an error message. - type: string - resourceVersion: - description: 'String that identifies the server''s internal - version of this object that can be used by clients to - determine when objects have changed. Value must be treated - as opaque by clients and passed unmodified back to the - server. Populated by the system. Read-only. More info: - https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' - type: string - selfLink: - description: selfLink is a URL representing this object. - Populated by the system. Read-only. - type: string - type: object - reason: - description: A machine-readable description of why this operation - is in the "Failure" status. If this value is empty there is - no information available. A Reason clarifies an HTTP status - code but does not override it. + time: + description: Time is timestamp of when these fields were set. + It should always be empty if Operation is 'Apply' + format: date-time + type: string + type: object + type: array + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow a client + to request the generation of an appropriate name automatically. + Name is primarily intended for creation idempotence and configuration + definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must be + unique. An empty namespace is equivalent to the \"default\" namespace, + but \"default\" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. Cannot + be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field set + to true. There cannot be more than one managing controller. + items: + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. + To set this field, a user needs "delete" permission of the + owner, otherwise 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' type: string - status: - description: 'Status of the operation. One of: "Success" or - "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' type: string + required: + - apiVersion + - kind + - name + - uid type: object - required: - - pending - type: object - labels: - additionalProperties: + type: array + resourceVersion: + description: "An opaque value that represents the internal version + of this object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. \n Populated by the system. Read-only. Value must + be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" type: string - description: 'Map of string keys and values that can be used to organize - and categorize (scope and select) objects. May match selectors of - replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' - type: object - managedFields: - description: "ManagedFields maps workflow-id and version to the set - of fields that are managed by that workflow. This is mostly for internal - housekeeping, and users typically shouldn't need to set or understand - this field. A workflow can be the user's name, a controller's name, - or the name of a specific apply path like \"ci-cd\". The set of fields - is always in the version that the workflow used when modifying the - object. \n This field is alpha and can be changed or removed without - notice." - items: - properties: - apiVersion: - description: APIVersion defines the version of this resource that - this field set applies to. The format is "group/version" just - like the top-level APIVersion field. It is necessary to track - the version of a field set because it cannot be automatically - converted. - type: string - fields: - additionalProperties: true - description: Fields identifies a set of fields. - type: object - manager: - description: Manager is an identifier of the workflow managing - these fields. - type: string - operation: - description: Operation is the type of operation which lead to - this ManagedFieldsEntry being created. The only valid values - for this field are 'Apply' and 'Update'. - type: string - time: - description: Time is timestamp of when these fields were set. - It should always be empty if Operation is 'Apply' - format: date-time - type: string - type: object - type: array - name: - description: 'Name must be unique within a namespace. Is required when - creating resources, although some resources may allow a client to - request the generation of an appropriate name automatically. Name - is primarily intended for creation idempotence and configuration definition. - Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - namespace: - description: "Namespace defines the space within each name must be unique. - An empty namespace is equivalent to the \"default\" namespace, but - \"default\" is the canonical representation. Not all objects are required - to be scoped to a namespace - the value of this field for those objects - will be empty. \n Must be a DNS_LABEL. Cannot be updated. More info: - http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: List of objects depended by this object. If ALL objects - in the list have been deleted, this object will be garbage collected. - If this object is managed by a controller, then an entry in this list - will point to this controller, with the controller field set to true. - There cannot be more than one managing controller. - items: - properties: - apiVersion: - description: API version of the referent. - type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" - finalizer, then the owner cannot be deleted from the key-value - store until this reference is removed. Defaults to false. To - set this field, a user needs "delete" permission of the owner, - otherwise 422 (Unprocessable Entity) will be returned. - type: boolean - controller: - description: If true, this reference points to the managing controller. - type: boolean - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string - required: - - apiVersion - - kind - - name - - uid - type: object - type: array - resourceVersion: - description: "An opaque value that represents the internal version of - this object that can be used by clients to determine when objects - have changed. May be used for optimistic concurrency, change detection, - and the watch operation on a resource or set of resources. Clients - must treat these values as opaque and passed unmodified back to the - server. They may only be valid for a particular resource or set of - resources. \n Populated by the system. Read-only. Value must be treated - as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - type: string - selfLink: - description: SelfLink is a URL representing this object. Populated by - the system. Read-only. - type: string - uid: - description: "UID is the unique in time and space value for this object. - It is typically generated by the server on successful creation of - a resource and is not allowed to change on PUT operations. \n Populated - by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - type: string - type: object - providerSpec: - description: Provider-specific configuration to use during node creation. - type: object - required: - - providerSpec - type: object - versions: - - name: v1alpha1 + selfLink: + description: SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. \n Populated + by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + providerSpec: + description: Provider-specific configuration to use during node creation. + type: object + required: + - providerSpec + type: object served: true storage: true status: diff --git a/config/crds/cluster.k8s.io_machinedeployments.yaml b/config/crds/cluster.k8s.io_machinedeployments.yaml index 59ce8eb9e03d..4a5d9bd1fa1e 100644 --- a/config/crds/cluster.k8s.io_machinedeployments.yaml +++ b/config/crds/cluster.k8s.io_machinedeployments.yaml @@ -13,922 +13,1840 @@ spec: shortNames: - md scope: Namespaced - subresources: - scale: - labelSelectorPath: .status.labelSelector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} - validation: - openAPIV3Schema: - description: / [MachineDeployment] MachineDeployment is the Schema for the machinedeployments - API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - properties: - annotations: - additionalProperties: + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: / [MachineDeployment] MachineDeployment is the Schema for the + machinedeployments API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored + with a resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object belongs to. + This is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right now + and apiserver is going to ignore it if set in create or update request. + type: string + creationTimestamp: + description: "CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients may + not set this value. It is represented in RFC3339 form and is in + UTC. \n Populated by the system. Read-only. Null for lists. More + info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only set when + deletionTimestamp is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time at which + this resource will be deleted. This field is set by the server when + a graceful deletion is requested by the user, and is not directly + settable by a client. The resource is expected to be deleted (no + longer visible from resource lists, and not reachable by name) after + the time in this field, once the finalizers list is empty. As long + as the finalizers list contains items, deletion is blocked. Once + the deletionTimestamp is set, this value may not be unset or be + set further into the future, although it may be shortened or the + resource may be deleted prior to this time. For example, a user + may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + \n Populated by the system when a graceful deletion is requested. + Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time type: string - description: 'Annotations is an unstructured key value map stored with - a resource that may be set by external tools to store and retrieve - arbitrary metadata. They are not queryable and should be preserved - when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' - type: object - clusterName: - description: The name of the cluster which the object belongs to. This - is used to distinguish resources with same name and namespace in different - clusters. This field is not set anywhere right now and apiserver is - going to ignore it if set in create or update request. - type: string - creationTimestamp: - description: "CreationTimestamp is a timestamp representing the server - time when this object was created. It is not guaranteed to be set - in happens-before order across separate operations. Clients may not - set this value. It is represented in RFC3339 form and is in UTC. \n - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - deletionGracePeriodSeconds: - description: Number of seconds allowed for this object to gracefully - terminate before it will be removed from the system. Only set when - deletionTimestamp is also set. May only be shortened. Read-only. - format: int64 - type: integer - deletionTimestamp: - description: "DeletionTimestamp is RFC 3339 date and time at which this - resource will be deleted. This field is set by the server when a graceful - deletion is requested by the user, and is not directly settable by - a client. The resource is expected to be deleted (no longer visible - from resource lists, and not reachable by name) after the time in - this field, once the finalizers list is empty. As long as the finalizers - list contains items, deletion is blocked. Once the deletionTimestamp - is set, this value may not be unset or be set further into the future, - although it may be shortened or the resource may be deleted prior - to this time. For example, a user may request that a pod is deleted - in 30 seconds. The Kubelet will react by sending a graceful termination - signal to the containers in the pod. After that 30 seconds, the Kubelet - will send a hard termination signal (SIGKILL) to the container and - after cleanup, remove the pod from the API. In the presence of network - partitions, this object may still exist after this timestamp, until - an administrator or automated process can determine the resource is - fully terminated. If not set, graceful deletion of the object has - not been requested. \n Populated by the system when a graceful deletion - is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - finalizers: - description: Must be empty before the object is deleted from the registry. - Each entry is an identifier for the responsible component that will - remove the entry from the list. If the deletionTimestamp of the object - is non-nil, entries in this list can only be removed. - items: + finalizers: + description: Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that will + remove the entry from the list. If the deletionTimestamp of the + object is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not been provided. + If this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a unique + suffix. The provided value has the same validation rules as the + Name field, and may be truncated by the length of the suffix required + to make the value unique on the server. \n If this field is specified + and the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the + time indicated in the Retry-After header). \n Applied only if Name + is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" type: string - type: array - generateName: - description: "GenerateName is an optional prefix, used by the server, - to generate a unique name ONLY IF the Name field has not been provided. - If this field is used, the name returned to the client will be different - than the name passed. This value will also be combined with a unique - suffix. The provided value has the same validation rules as the Name - field, and may be truncated by the length of the suffix required to - make the value unique on the server. \n If this field is specified - and the generated name exists, the server will NOT return a 409 - - instead, it will either return 201 Created or 500 with Reason ServerTimeout - indicating a unique name could not be found in the time allotted, - and the client should retry (optionally after the time indicated in - the Retry-After header). \n Applied only if Name is not specified. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - type: string - generation: - description: A sequence number representing a specific generation of - the desired state. Populated by the system. Read-only. - format: int64 - type: integer - initializers: - description: "An initializer is a controller which enforces some system - invariant at object creation time. This field is a list of initializers - that have not yet acted on this object. If nil or empty, this object - has been completely initialized. Otherwise, the object is considered - uninitialized and is hidden (in list/watch and get calls) from clients - that haven't explicitly asked to observe uninitialized objects. \n - When an object is created, the system will populate this list with - the current set of initializers. Only privileged users may set or - modify this list. Once it is empty, it may not be modified further - by any user. \n DEPRECATED - initializers are an alpha field and will - be removed in v1.15." - properties: - pending: - description: Pending is a list of initializers that must execute - in order before this object is visible. When the last pending - initializer is removed, and no failing result is set, the initializers - struct will be set to nil and the object is considered as initialized - and visible to all clients. - items: + generation: + description: A sequence number representing a specific generation + of the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces some system + invariant at object creation time. This field is a list of initializers + that have not yet acted on this object. If nil or empty, this object + has been completely initialized. Otherwise, the object is considered + uninitialized and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. + \n When an object is created, the system will populate this list + with the current set of initializers. Only privileged users may + set or modify this list. Once it is empty, it may not be modified + further by any user. \n DEPRECATED - initializers are an alpha field + and will be removed in v1.15." + properties: + pending: + description: Pending is a list of initializers that must execute + in order before this object is visible. When the last pending + initializer is removed, and no failing result is set, the initializers + struct will be set to nil and the object is considered as initialized + and visible to all clients. + items: + properties: + name: + description: name of the process that is responsible for + initializing this object. + type: string + required: + - name + type: object + type: array + result: + description: If result is set with the Failure field, the object + will be persisted to storage and then deleted, ensuring that + other clients can observe the deletion. properties: - name: - description: name of the process that is responsible for initializing - this object. + apiVersion: + description: 'APIVersion defines the versioned schema of this + representation of an object. Servers should convert recognized + schemas to the latest internal value, and may reject unrecognized + values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + code: + description: Suggested HTTP return code for this status, 0 + if not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This field is + optional and the data returned is not guaranteed to conform + to any schema except that defined by the reason type. + properties: + causes: + description: The Causes array includes more details associated + with the StatusReason failure. Not all StatusReasons + may provide detailed causes. + items: + properties: + field: + description: "The field of the resource that has + caused this error, as named by its JSON serialization. + May include dot and postfix notation for nested + attributes. Arrays are zero-indexed. Fields may + appear more than once in an array of causes due + to fields having multiple errors. Optional. \n + Examples: \"name\" - the field \"name\" on the + current resource \"items[0].name\" - the field + \"name\" on the first array entry in \"items\"" + type: string + message: + description: A human-readable description of the + cause of the error. This field may be presented + as-is to a reader. + type: string + reason: + description: A machine-readable description of the + cause of the error. If this value is empty there + is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource associated + with the status StatusReason. + type: string + kind: + description: 'The kind attribute of the resource associated + with the status StatusReason. On some operations may + differ from the requested resource Kind. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: The name attribute of the resource associated + with the status StatusReason (when there is a single + name which can be described). + type: string + retryAfterSeconds: + description: If specified, the time in seconds before + the operation should be retried. Some errors may indicate + the client must take an alternate action - for those + errors this field may indicate how long to wait before + taking the alternate action. + format: int32 + type: integer + uid: + description: 'UID of the resource. (when there is a single + resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + type: object + kind: + description: 'Kind is a string value representing the REST + resource this object represents. Servers may infer this + from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status of + this operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set a limit + on the number of items returned, and indicates that + the server has more data available. The value is opaque + and may be used to issue another request to the endpoint + that served this list to retrieve the next set of available + objects. Continuing a consistent list may not be possible + if the server configuration has changed or more than + a few minutes have passed. The resourceVersion field + returned when using this continue value will be identical + to the value in the first response, unless you have + received this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s internal + version of this object that can be used by clients to + determine when objects have changed. Value must be treated + as opaque by clients and passed unmodified back to the + server. Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why this operation + is in the "Failure" status. If this value is empty there + is no information available. A Reason clarifies an HTTP + status code but does not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" or + "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' type: string - required: - - name type: object - type: array - result: - description: If result is set with the Failure field, the object - will be persisted to storage and then deleted, ensuring that other - clients can observe the deletion. + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors of + replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + managedFields: + description: "ManagedFields maps workflow-id and version to the set + of fields that are managed by that workflow. This is mostly for + internal housekeeping, and users typically shouldn't need to set + or understand this field. A workflow can be the user's name, a controller's + name, or the name of a specific apply path like \"ci-cd\". The set + of fields is always in the version that the workflow used when modifying + the object. \n This field is alpha and can be changed or removed + without notice." + items: properties: apiVersion: - description: 'APIVersion defines the versioned schema of this - representation of an object. Servers should convert recognized - schemas to the latest internal value, and may reject unrecognized - values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + description: APIVersion defines the version of this resource + that this field set applies to. The format is "group/version" + just like the top-level APIVersion field. It is necessary + to track the version of a field set because it cannot be automatically + converted. type: string - code: - description: Suggested HTTP return code for this status, 0 if - not set. - format: int32 - type: integer - details: - description: Extended data associated with the reason. Each - reason may define its own extended details. This field is - optional and the data returned is not guaranteed to conform - to any schema except that defined by the reason type. - properties: - causes: - description: The Causes array includes more details associated - with the StatusReason failure. Not all StatusReasons may - provide detailed causes. - items: - properties: - field: - description: "The field of the resource that has caused - this error, as named by its JSON serialization. - May include dot and postfix notation for nested - attributes. Arrays are zero-indexed. Fields may - appear more than once in an array of causes due - to fields having multiple errors. Optional. \n Examples: - \ \"name\" - the field \"name\" on the current - resource \"items[0].name\" - the field \"name\" - on the first array entry in \"items\"" - type: string - message: - description: A human-readable description of the cause - of the error. This field may be presented as-is - to a reader. - type: string - reason: - description: A machine-readable description of the - cause of the error. If this value is empty there - is no information available. - type: string - type: object - type: array - group: - description: The group attribute of the resource associated - with the status StatusReason. - type: string - kind: - description: 'The kind attribute of the resource associated - with the status StatusReason. On some operations may differ - from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: The name attribute of the resource associated - with the status StatusReason (when there is a single name - which can be described). - type: string - retryAfterSeconds: - description: If specified, the time in seconds before the - operation should be retried. Some errors may indicate - the client must take an alternate action - for those errors - this field may indicate how long to wait before taking - the alternate action. - format: int32 - type: integer - uid: - description: 'UID of the resource. (when there is a single - resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string + fields: + additionalProperties: true + description: Fields identifies a set of fields. type: object + manager: + description: Manager is an identifier of the workflow managing + these fields. + type: string + operation: + description: Operation is the type of operation which lead to + this ManagedFieldsEntry being created. The only valid values + for this field are 'Apply' and 'Update'. + type: string + time: + description: Time is timestamp of when these fields were set. + It should always be empty if Operation is 'Apply' + format: date-time + type: string + type: object + type: array + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow a client + to request the generation of an appropriate name automatically. + Name is primarily intended for creation idempotence and configuration + definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must be + unique. An empty namespace is equivalent to the \"default\" namespace, + but \"default\" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. Cannot + be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field set + to true. There cannot be more than one managing controller. + items: + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. + To set this field, a user needs "delete" permission of the + owner, otherwise 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean kind: - description: 'Kind is a string value representing the REST resource - this object represents. Servers may infer this from the endpoint - the client submits requests to. Cannot be updated. In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string - message: - description: A human-readable description of the status of this - operation. + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' type: string - metadata: - description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + resourceVersion: + description: "An opaque value that represents the internal version + of this object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. \n Populated by the system. Read-only. Value must + be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. \n Populated + by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + spec: + properties: + minReadySeconds: + description: Minimum number of seconds for which a newly created machine + should be ready. Defaults to 0 (machine will be considered available + as soon as it is ready) + format: int32 + type: integer + paused: + description: Indicates that the deployment is paused. + type: boolean + progressDeadlineSeconds: + description: The maximum time in seconds for a deployment to make + progress before it is considered to be failed. The deployment controller + will continue to process failed deployments and a condition with + a ProgressDeadlineExceeded reason will be surfaced in the deployment + status. Note that progress will not be estimated during the time + a deployment is paused. Defaults to 600s. + format: int32 + type: integer + replicas: + description: Number of desired machines. Defaults to 1. This is a + pointer to distinguish between explicit zero and not specified. + format: int32 + type: integer + revisionHistoryLimit: + description: The number of old MachineSets to retain to allow rollback. + This is a pointer to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + selector: + description: Label selector for machines. Existing MachineSets whose + machines are selected by this will be the ones affected by this + deployment. It must match the machine template's labels. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: properties: - continue: - description: continue may be set if the user set a limit - on the number of items returned, and indicates that the - server has more data available. The value is opaque and - may be used to issue another request to the endpoint that - served this list to retrieve the next set of available - objects. Continuing a consistent list may not be possible - if the server configuration has changed or more than a - few minutes have passed. The resourceVersion field returned - when using this continue value will be identical to the - value in the first response, unless you have received - this token from an error message. - type: string - resourceVersion: - description: 'String that identifies the server''s internal - version of this object that can be used by clients to - determine when objects have changed. Value must be treated - as opaque by clients and passed unmodified back to the - server. Populated by the system. Read-only. More info: - https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + key: + description: key is the label key that the selector applies + to. type: string - selfLink: - description: selfLink is a URL representing this object. - Populated by the system. Read-only. + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator type: object - reason: - description: A machine-readable description of why this operation - is in the "Failure" status. If this value is empty there is - no information available. A Reason clarifies an HTTP status - code but does not override it. - type: string - status: - description: 'Status of the operation. One of: "Success" or - "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: array + matchLabels: + additionalProperties: type: string - type: object - required: - - pending - type: object - labels: - additionalProperties: - type: string - description: 'Map of string keys and values that can be used to organize - and categorize (scope and select) objects. May match selectors of - replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' - type: object - managedFields: - description: "ManagedFields maps workflow-id and version to the set - of fields that are managed by that workflow. This is mostly for internal - housekeeping, and users typically shouldn't need to set or understand - this field. A workflow can be the user's name, a controller's name, - or the name of a specific apply path like \"ci-cd\". The set of fields - is always in the version that the workflow used when modifying the - object. \n This field is alpha and can be changed or removed without - notice." - items: - properties: - apiVersion: - description: APIVersion defines the version of this resource that - this field set applies to. The format is "group/version" just - like the top-level APIVersion field. It is necessary to track - the version of a field set because it cannot be automatically - converted. - type: string - fields: - additionalProperties: true - description: Fields identifies a set of fields. + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. type: object - manager: - description: Manager is an identifier of the workflow managing - these fields. - type: string - operation: - description: Operation is the type of operation which lead to - this ManagedFieldsEntry being created. The only valid values - for this field are 'Apply' and 'Update'. - type: string - time: - description: Time is timestamp of when these fields were set. - It should always be empty if Operation is 'Apply' - format: date-time - type: string type: object - type: array - name: - description: 'Name must be unique within a namespace. Is required when - creating resources, although some resources may allow a client to - request the generation of an appropriate name automatically. Name - is primarily intended for creation idempotence and configuration definition. - Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - namespace: - description: "Namespace defines the space within each name must be unique. - An empty namespace is equivalent to the \"default\" namespace, but - \"default\" is the canonical representation. Not all objects are required - to be scoped to a namespace - the value of this field for those objects - will be empty. \n Must be a DNS_LABEL. Cannot be updated. More info: - http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: List of objects depended by this object. If ALL objects - in the list have been deleted, this object will be garbage collected. - If this object is managed by a controller, then an entry in this list - will point to this controller, with the controller field set to true. - There cannot be more than one managing controller. - items: + strategy: + description: The deployment strategy to use to replace existing machines + with new ones. properties: - apiVersion: - description: API version of the referent. - type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" - finalizer, then the owner cannot be deleted from the key-value - store until this reference is removed. Defaults to false. To - set this field, a user needs "delete" permission of the owner, - otherwise 422 (Unprocessable Entity) will be returned. - type: boolean - controller: - description: If true, this reference points to the managing controller. - type: boolean - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + rollingUpdate: + description: Rolling update config params. Present only if MachineDeploymentStrategyType + = RollingUpdate. + properties: + maxSurge: + anyOf: + - type: string + - type: integer + description: 'The maximum number of machines that can be scheduled + above the desired number of machines. Value can be an absolute + number (ex: 5) or a percentage of desired machines (ex: + 10%). This can not be 0 if MaxUnavailable is 0. Absolute + number is calculated from percentage by rounding up. Defaults + to 1. Example: when this is set to 30%, the new MachineSet + can be scaled up immediately when the rolling update starts, + such that the total number of old and new machines do not + exceed 130% of desired machines. Once old machines have + been killed, new MachineSet can be scaled up further, ensuring + that total number of machines running at any time during + the update is at most 130% of desired machines.' + maxUnavailable: + anyOf: + - type: string + - type: integer + description: 'The maximum number of machines that can be unavailable + during the update. Value can be an absolute number (ex: + 5) or a percentage of desired machines (ex: 10%). Absolute + number is calculated from percentage by rounding down. This + can not be 0 if MaxSurge is 0. Defaults to 0. Example: when + this is set to 30%, the old MachineSet can be scaled down + to 70% of desired machines immediately when the rolling + update starts. Once new machines are ready, old MachineSet + can be scaled down further, followed by scaling up the new + MachineSet, ensuring that the total number of machines available + at all times during the update is at least 70% of desired + machines.' + type: object + type: + description: Type of deployment. Currently the only supported + strategy is "RollingUpdate". Default is RollingUpdate. type: string - required: - - apiVersion - - kind - - name - - uid type: object - type: array - resourceVersion: - description: "An opaque value that represents the internal version of - this object that can be used by clients to determine when objects - have changed. May be used for optimistic concurrency, change detection, - and the watch operation on a resource or set of resources. Clients - must treat these values as opaque and passed unmodified back to the - server. They may only be valid for a particular resource or set of - resources. \n Populated by the system. Read-only. Value must be treated - as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - type: string - selfLink: - description: SelfLink is a URL representing this object. Populated by - the system. Read-only. - type: string - uid: - description: "UID is the unique in time and space value for this object. - It is typically generated by the server on successful creation of - a resource and is not allowed to change on PUT operations. \n Populated - by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - type: string - type: object - spec: - properties: - minReadySeconds: - description: Minimum number of seconds for which a newly created machine - should be ready. Defaults to 0 (machine will be considered available - as soon as it is ready) - format: int32 - type: integer - paused: - description: Indicates that the deployment is paused. - type: boolean - progressDeadlineSeconds: - description: The maximum time in seconds for a deployment to make progress - before it is considered to be failed. The deployment controller will - continue to process failed deployments and a condition with a ProgressDeadlineExceeded - reason will be surfaced in the deployment status. Note that progress - will not be estimated during the time a deployment is paused. Defaults - to 600s. - format: int32 - type: integer - replicas: - description: Number of desired machines. Defaults to 1. This is a pointer - to distinguish between explicit zero and not specified. - format: int32 - type: integer - revisionHistoryLimit: - description: The number of old MachineSets to retain to allow rollback. - This is a pointer to distinguish between explicit zero and not specified. - Defaults to 1. - format: int32 - type: integer - selector: - description: Label selector for machines. Existing MachineSets whose - machines are selected by this will be the ones affected by this deployment. - It must match the machine template's labels. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. - items: + template: + description: Template describes the machines that will be created. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' properties: - key: - description: key is the label key that the selector applies - to. + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map + stored with a resource that may be set by external tools + to store and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. More info: + http://kubernetes.io/docs/user-guide/annotations' + type: object + generateName: + description: "GenerateName is an optional prefix, used by + the server, to generate a unique name ONLY IF the Name field + has not been provided. If this field is used, the name returned + to the client will be different than the name passed. This + value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and + may be truncated by the length of the suffix required to + make the value unique on the server. \n If this field is + specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created + or 500 with Reason ServerTimeout indicating a unique name + could not be found in the time allotted, and the client + should retry (optionally after the time indicated in the + Retry-After header). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used + to organize and categorize (scope and select) objects. May + match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow + a client to request the generation of an appropriate name + automatically. Name is primarily intended for creation idempotence + and configuration definition. Cannot be updated. More info: + http://kubernetes.io/docs/user-guide/identifiers#names' type: string - operator: - description: operator represents a key's relationship to a - set of values. Valid operators are In, NotIn, Exists and - DoesNotExist. + namespace: + description: "Namespace defines the space within each name + must be unique. An empty namespace is equivalent to the + \"default\" namespace, but \"default\" is the canonical + representation. Not all objects are required to be scoped + to a namespace - the value of this field for those objects + will be empty. \n Must be a DNS_LABEL. Cannot be updated. + More info: http://kubernetes.io/docs/user-guide/namespaces" type: string - values: - description: values is an array of string values. If the operator - is In or NotIn, the values array must be non-empty. If the - operator is Exists or DoesNotExist, the values array must - be empty. This array is replaced during a strategic merge - patch. + ownerReferences: + description: List of objects depended by this object. If ALL + objects in the list have been deleted, this object will + be garbage collected. If this object is managed by a controller, + then an entry in this list will point to this controller, + with the controller field set to true. There cannot be more + than one managing controller. items: - type: string + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the + key-value store until this reference is removed. Defaults + to false. To set this field, a user needs "delete" + permission of the owner, otherwise 422 (Unprocessable + Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object type: array + type: object + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + properties: + configSource: + description: ConfigSource is used to populate in the associated + Node for dynamic kubelet config. This field already exists + in Node, so any updates to it in the Machine spec will be + automatically copied to the linked NodeRef from the status. + The rest of dynamic kubelet config support should then work + as-is. + properties: + configMap: + description: ConfigMap is a reference to a Node's ConfigMap + properties: + kubeletConfigKey: + description: KubeletConfigKey declares which key of + the referenced ConfigMap corresponds to the KubeletConfiguration + structure This field is required in all cases. + type: string + name: + description: Name is the metadata.name of the referenced + ConfigMap. This field is required in all cases. + type: string + namespace: + description: Namespace is the metadata.namespace of + the referenced ConfigMap. This field is required + in all cases. + type: string + resourceVersion: + description: ResourceVersion is the metadata.ResourceVersion + of the referenced ConfigMap. This field is forbidden + in Node.Spec, and required in Node.Status. + type: string + uid: + description: UID is the metadata.UID of the referenced + ConfigMap. This field is forbidden in Node.Spec, + and required in Node.Status. + type: string + required: + - namespace + - name + - kubeletConfigKey + type: object + type: object + metadata: + description: ObjectMeta will autopopulate the Node created. + Use this to indicate what labels, annotations, name prefix, + etc., should be used when creating the Node. + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value + map stored with a resource that may be set by external + tools to store and retrieve arbitrary metadata. They + are not queryable and should be preserved when modifying + objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + generateName: + description: "GenerateName is an optional prefix, used + by the server, to generate a unique name ONLY IF the + Name field has not been provided. If this field is used, + the name returned to the client will be different than + the name passed. This value will also be combined with + a unique suffix. The provided value has the same validation + rules as the Name field, and may be truncated by the + length of the suffix required to make the value unique + on the server. \n If this field is specified and the + generated name exists, the server will NOT return a + 409 - instead, it will either return 201 Created or + 500 with Reason ServerTimeout indicating a unique name + could not be found in the time allotted, and the client + should retry (optionally after the time indicated in + the Retry-After header). \n Applied only if Name is + not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be + used to organize and categorize (scope and select) objects. + May match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + name: + description: 'Name must be unique within a namespace. + Is required when creating resources, although some resources + may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be + updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each + name must be unique. An empty namespace is equivalent + to the \"default\" namespace, but \"default\" is the + canonical representation. Not all objects are required + to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. + Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. + If ALL objects in the list have been deleted, this object + will be garbage collected. If this object is managed + by a controller, then an entry in this list will point + to this controller, with the controller field set to + true. There cannot be more than one managing controller. + items: + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from + the key-value store until this reference is removed. + Defaults to false. To set this field, a user needs + "delete" permission of the owner, otherwise 422 + (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the + managing controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + type: object + providerID: + description: ProviderID is the identification ID of the machine + provided by the provider. This field must match the provider + ID as seen on the node object corresponding to this machine. + This field is required by higher level consumers of cluster-api. + Example use case is cluster autoscaler with cluster-api + as provider. Clean-up logic in the autoscaler compares machines + to nodes to find out machines at provider which could not + get registered as Kubernetes nodes. With cluster-api as + a generic out-of-tree provider for autoscaler, this field + is required by autoscaler to be able to have a provider + view of the list of machines. Another list of nodes is queried + from the k8s apiserver and then a comparison is done to + find out unregistered machines and are marked for delete. + This field will be set by the actuators and consumed by + higher level entities like autoscaler that will be interfacing + with cluster-api as generic provider. + type: string + providerSpec: + description: ProviderSpec details Provider-specific configuration + to use during node creation. + properties: + value: + description: Value is an inlined, serialized representation + of the resource configuration. It is recommended that + providers maintain their own versioned API types that + should be serialized/deserialized from this field, akin + to component config. + type: object + valueFrom: + description: Source for the provider configuration. Cannot + be used if value is not empty. + properties: + machineClass: + description: The machine class from which the provider + config should be sourced. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object + instead of an entire object, this string should + contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. + For example, if the object reference is to a + container within a pod, this would take on a + value like: "spec.containers{name}" (where "name" + refers to the name of the container that triggered + the event) or if no container name is specified + "spec.containers[2]" (container with index 2 + in this pod). This syntax is chosen only to + have some well-defined way of referencing a + part of an object. TODO: this design is not + final and this field is subject to change in + the future.' + type: string + kind: + description: 'Kind of the referent. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + provider: + description: Provider is the name of the cloud-provider + which MachineClass is intended for. + type: string + resourceVersion: + description: 'Specific resourceVersion to which + this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + type: object + type: object + taints: + description: The list of the taints to be applied to the corresponding + Node in additive manner. This list will not overwrite any + other taints added to the Node on an ongoing basis by other + entities. These taints should be actively reconciled e.g. + if you ask the machine controller to apply a taint and then + manually remove the taint the machine controller will put + it back) but not have the machine controller remove any + taints + items: + properties: + effect: + description: Required. The effect of the taint on pods + that do not tolerate the taint. Valid effects are + NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Required. The taint key to be applied to + a node. + type: string + timeAdded: + description: TimeAdded represents the time at which + the taint was added. It is only written for NoExecute + taints. + format: date-time + type: string + value: + description: Required. The taint value corresponding + to the taint key. + type: string + required: + - key + - effect + type: object + type: array + versions: + description: Versions of key software to use. This field is + optional at cluster creation time, and omitting the field + indicates that the cluster installation tool should select + defaults for the user. These defaults may differ based on + the cluster installer, but the tool should populate the + values it uses when persisting Machine objects. A Machine + spec missing this field at runtime is invalid. + properties: + controlPlane: + description: ControlPlane is the semantic version of the + Kubernetes control plane to run. This should only be + populated when the machine is a control plane. + type: string + kubelet: + description: Kubelet is the semantic version of kubelet + to run + type: string + required: + - kubelet + type: object required: - - key - - operator + - providerSpec type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single - {key,value} in the matchLabels map is equivalent to an element - of matchExpressions, whose key field is "key", the operator is - "In", and the values array contains only "value". The requirements - are ANDed. - type: object - type: object - strategy: - description: The deployment strategy to use to replace existing machines - with new ones. - properties: - rollingUpdate: - description: Rolling update config params. Present only if MachineDeploymentStrategyType - = RollingUpdate. - properties: - maxSurge: - anyOf: - - type: string - - type: integer - description: 'The maximum number of machines that can be scheduled - above the desired number of machines. Value can be an absolute - number (ex: 5) or a percentage of desired machines (ex: 10%). - This can not be 0 if MaxUnavailable is 0. Absolute number - is calculated from percentage by rounding up. Defaults to - 1. Example: when this is set to 30%, the new MachineSet can - be scaled up immediately when the rolling update starts, such - that the total number of old and new machines do not exceed - 130% of desired machines. Once old machines have been killed, - new MachineSet can be scaled up further, ensuring that total - number of machines running at any time during the update is - at most 130% of desired machines.' - maxUnavailable: - anyOf: - - type: string - - type: integer - description: 'The maximum number of machines that can be unavailable - during the update. Value can be an absolute number (ex: 5) - or a percentage of desired machines (ex: 10%). Absolute number - is calculated from percentage by rounding down. This can not - be 0 if MaxSurge is 0. Defaults to 0. Example: when this is - set to 30%, the old MachineSet can be scaled down to 70% of - desired machines immediately when the rolling update starts. - Once new machines are ready, old MachineSet can be scaled - down further, followed by scaling up the new MachineSet, ensuring - that the total number of machines available at all times during - the update is at least 70% of desired machines.' - type: object - type: - description: Type of deployment. Currently the only supported strategy - is "RollingUpdate". Default is RollingUpdate. + type: object + required: + - selector + - template + type: object + status: + properties: + availableReplicas: + description: Total number of available machines (ready for at least + minReadySeconds) targeted by this deployment. + format: int32 + type: integer + observedGeneration: + description: The generation observed by the deployment controller. + format: int64 + type: integer + readyReplicas: + description: Total number of ready machines targeted by this deployment. + format: int32 + type: integer + replicas: + description: Total number of non-terminated machines targeted by this + deployment (their labels match the selector). + format: int32 + type: integer + unavailableReplicas: + description: Total number of unavailable machines targeted by this + deployment. This is the total number of machines that are still + required for the deployment to have 100% available capacity. They + may either be machines that are running but not yet available or + machines that still have not been created. + format: int32 + type: integer + updatedReplicas: + description: Total number of non-terminated machines targeted by this + deployment that have the desired template spec. + format: int32 + type: integer + type: object + type: object + served: true + storage: false + subresources: + scale: + labelSelectorPath: .status.labelSelector + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} + - name: v1alpha2 + schema: + openAPIV3Schema: + description: / [MachineDeployment] MachineDeployment is the Schema for the + machinedeployments API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + properties: + annotations: + additionalProperties: type: string - type: object - template: - description: Template describes the machines that will be created. - properties: - metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' - properties: - annotations: - additionalProperties: - type: string - description: 'Annotations is an unstructured key value map stored - with a resource that may be set by external tools to store - and retrieve arbitrary metadata. They are not queryable and - should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + description: 'Annotations is an unstructured key value map stored + with a resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object belongs to. + This is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right now + and apiserver is going to ignore it if set in create or update request. + type: string + creationTimestamp: + description: "CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients may + not set this value. It is represented in RFC3339 form and is in + UTC. \n Populated by the system. Read-only. Null for lists. More + info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only set when + deletionTimestamp is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time at which + this resource will be deleted. This field is set by the server when + a graceful deletion is requested by the user, and is not directly + settable by a client. The resource is expected to be deleted (no + longer visible from resource lists, and not reachable by name) after + the time in this field, once the finalizers list is empty. As long + as the finalizers list contains items, deletion is blocked. Once + the deletionTimestamp is set, this value may not be unset or be + set further into the future, although it may be shortened or the + resource may be deleted prior to this time. For example, a user + may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + \n Populated by the system when a graceful deletion is requested. + Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + finalizers: + description: Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that will + remove the entry from the list. If the deletionTimestamp of the + object is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not been provided. + If this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a unique + suffix. The provided value has the same validation rules as the + Name field, and may be truncated by the length of the suffix required + to make the value unique on the server. \n If this field is specified + and the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the + time indicated in the Retry-After header). \n Applied only if Name + is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific generation + of the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces some system + invariant at object creation time. This field is a list of initializers + that have not yet acted on this object. If nil or empty, this object + has been completely initialized. Otherwise, the object is considered + uninitialized and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. + \n When an object is created, the system will populate this list + with the current set of initializers. Only privileged users may + set or modify this list. Once it is empty, it may not be modified + further by any user. \n DEPRECATED - initializers are an alpha field + and will be removed in v1.15." + properties: + pending: + description: Pending is a list of initializers that must execute + in order before this object is visible. When the last pending + initializer is removed, and no failing result is set, the initializers + struct will be set to nil and the object is considered as initialized + and visible to all clients. + items: + properties: + name: + description: name of the process that is responsible for + initializing this object. + type: string + required: + - name type: object - generateName: - description: "GenerateName is an optional prefix, used by the - server, to generate a unique name ONLY IF the Name field has - not been provided. If this field is used, the name returned - to the client will be different than the name passed. This - value will also be combined with a unique suffix. The provided - value has the same validation rules as the Name field, and - may be truncated by the length of the suffix required to make - the value unique on the server. \n If this field is specified - and the generated name exists, the server will NOT return - a 409 - instead, it will either return 201 Created or 500 - with Reason ServerTimeout indicating a unique name could not - be found in the time allotted, and the client should retry - (optionally after the time indicated in the Retry-After header). - \n Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - type: string - labels: - additionalProperties: + type: array + result: + description: If result is set with the Failure field, the object + will be persisted to storage and then deleted, ensuring that + other clients can observe the deletion. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this + representation of an object. Servers should convert recognized + schemas to the latest internal value, and may reject unrecognized + values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' type: string - description: 'Map of string keys and values that can be used - to organize and categorize (scope and select) objects. May - match selectors of replication controllers and services. More - info: http://kubernetes.io/docs/user-guide/labels' - type: object - name: - description: 'Name must be unique within a namespace. Is required - when creating resources, although some resources may allow - a client to request the generation of an appropriate name - automatically. Name is primarily intended for creation idempotence - and configuration definition. Cannot be updated. More info: - http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - namespace: - description: "Namespace defines the space within each name must - be unique. An empty namespace is equivalent to the \"default\" - namespace, but \"default\" is the canonical representation. - Not all objects are required to be scoped to a namespace - - the value of this field for those objects will be empty. \n - Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: List of objects depended by this object. If ALL - objects in the list have been deleted, this object will be - garbage collected. If this object is managed by a controller, - then an entry in this list will point to this controller, - with the controller field set to true. There cannot be more - than one managing controller. - items: + code: + description: Suggested HTTP return code for this status, 0 + if not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This field is + optional and the data returned is not guaranteed to conform + to any schema except that defined by the reason type. properties: - apiVersion: - description: API version of the referent. + causes: + description: The Causes array includes more details associated + with the StatusReason failure. Not all StatusReasons + may provide detailed causes. + items: + properties: + field: + description: "The field of the resource that has + caused this error, as named by its JSON serialization. + May include dot and postfix notation for nested + attributes. Arrays are zero-indexed. Fields may + appear more than once in an array of causes due + to fields having multiple errors. Optional. \n + Examples: \"name\" - the field \"name\" on the + current resource \"items[0].name\" - the field + \"name\" on the first array entry in \"items\"" + type: string + message: + description: A human-readable description of the + cause of the error. This field may be presented + as-is to a reader. + type: string + reason: + description: A machine-readable description of the + cause of the error. If this value is empty there + is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource associated + with the status StatusReason. type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" - finalizer, then the owner cannot be deleted from the - key-value store until this reference is removed. Defaults - to false. To set this field, a user needs "delete" permission - of the owner, otherwise 422 (Unprocessable Entity) will - be returned. - type: boolean - controller: - description: If true, this reference points to the managing - controller. - type: boolean kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + description: 'The kind attribute of the resource associated + with the status StatusReason. On some operations may + differ from the requested resource Kind. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + description: The name attribute of the resource associated + with the status StatusReason (when there is a single + name which can be described). type: string + retryAfterSeconds: + description: If specified, the time in seconds before + the operation should be retried. Some errors may indicate + the client must take an alternate action - for those + errors this field may indicate how long to wait before + taking the alternate action. + format: int32 + type: integer uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + description: 'UID of the resource. (when there is a single + resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' type: string - required: - - apiVersion - - kind - - name - - uid type: object - type: array + kind: + description: 'Kind is a string value representing the REST + resource this object represents. Servers may infer this + from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status of + this operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set a limit + on the number of items returned, and indicates that + the server has more data available. The value is opaque + and may be used to issue another request to the endpoint + that served this list to retrieve the next set of available + objects. Continuing a consistent list may not be possible + if the server configuration has changed or more than + a few minutes have passed. The resourceVersion field + returned when using this continue value will be identical + to the value in the first response, unless you have + received this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s internal + version of this object that can be used by clients to + determine when objects have changed. Value must be treated + as opaque by clients and passed unmodified back to the + server. Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why this operation + is in the "Failure" status. If this value is empty there + is no information available. A Reason clarifies an HTTP + status code but does not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" or + "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: string + type: object + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors of + replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + managedFields: + description: "ManagedFields maps workflow-id and version to the set + of fields that are managed by that workflow. This is mostly for + internal housekeeping, and users typically shouldn't need to set + or understand this field. A workflow can be the user's name, a controller's + name, or the name of a specific apply path like \"ci-cd\". The set + of fields is always in the version that the workflow used when modifying + the object. \n This field is alpha and can be changed or removed + without notice." + items: + properties: + apiVersion: + description: APIVersion defines the version of this resource + that this field set applies to. The format is "group/version" + just like the top-level APIVersion field. It is necessary + to track the version of a field set because it cannot be automatically + converted. + type: string + fields: + additionalProperties: true + description: Fields identifies a set of fields. + type: object + manager: + description: Manager is an identifier of the workflow managing + these fields. + type: string + operation: + description: Operation is the type of operation which lead to + this ManagedFieldsEntry being created. The only valid values + for this field are 'Apply' and 'Update'. + type: string + time: + description: Time is timestamp of when these fields were set. + It should always be empty if Operation is 'Apply' + format: date-time + type: string type: object - spec: - description: 'Specification of the desired behavior of the machine. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: array + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow a client + to request the generation of an appropriate name automatically. + Name is primarily intended for creation idempotence and configuration + definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must be + unique. An empty namespace is equivalent to the \"default\" namespace, + but \"default\" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. Cannot + be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field set + to true. There cannot be more than one managing controller. + items: properties: - configSource: - description: ConfigSource is used to populate in the associated - Node for dynamic kubelet config. This field already exists - in Node, so any updates to it in the Machine spec will be - automatically copied to the linked NodeRef from the status. - The rest of dynamic kubelet config support should then work - as-is. + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. + To set this field, a user needs "delete" permission of the + owner, otherwise 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + resourceVersion: + description: "An opaque value that represents the internal version + of this object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. \n Populated by the system. Read-only. Value must + be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. \n Populated + by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + spec: + properties: + minReadySeconds: + description: Minimum number of seconds for which a newly created machine + should be ready. Defaults to 0 (machine will be considered available + as soon as it is ready) + format: int32 + type: integer + paused: + description: Indicates that the deployment is paused. + type: boolean + progressDeadlineSeconds: + description: The maximum time in seconds for a deployment to make + progress before it is considered to be failed. The deployment controller + will continue to process failed deployments and a condition with + a ProgressDeadlineExceeded reason will be surfaced in the deployment + status. Note that progress will not be estimated during the time + a deployment is paused. Defaults to 600s. + format: int32 + type: integer + replicas: + description: Number of desired machines. Defaults to 1. This is a + pointer to distinguish between explicit zero and not specified. + format: int32 + type: integer + revisionHistoryLimit: + description: The number of old MachineSets to retain to allow rollback. + This is a pointer to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + selector: + description: Label selector for machines. Existing MachineSets whose + machines are selected by this will be the ones affected by this + deployment. It must match the machine template's labels. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: properties: - configMap: - description: ConfigMap is a reference to a Node's ConfigMap + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + strategy: + description: The deployment strategy to use to replace existing machines + with new ones. + properties: + rollingUpdate: + description: Rolling update config params. Present only if MachineDeploymentStrategyType + = RollingUpdate. + properties: + maxSurge: + anyOf: + - type: string + - type: integer + description: 'The maximum number of machines that can be scheduled + above the desired number of machines. Value can be an absolute + number (ex: 5) or a percentage of desired machines (ex: + 10%). This can not be 0 if MaxUnavailable is 0. Absolute + number is calculated from percentage by rounding up. Defaults + to 1. Example: when this is set to 30%, the new MachineSet + can be scaled up immediately when the rolling update starts, + such that the total number of old and new machines do not + exceed 130% of desired machines. Once old machines have + been killed, new MachineSet can be scaled up further, ensuring + that total number of machines running at any time during + the update is at most 130% of desired machines.' + maxUnavailable: + anyOf: + - type: string + - type: integer + description: 'The maximum number of machines that can be unavailable + during the update. Value can be an absolute number (ex: + 5) or a percentage of desired machines (ex: 10%). Absolute + number is calculated from percentage by rounding down. This + can not be 0 if MaxSurge is 0. Defaults to 0. Example: when + this is set to 30%, the old MachineSet can be scaled down + to 70% of desired machines immediately when the rolling + update starts. Once new machines are ready, old MachineSet + can be scaled down further, followed by scaling up the new + MachineSet, ensuring that the total number of machines available + at all times during the update is at least 70% of desired + machines.' + type: object + type: + description: Type of deployment. Currently the only supported + strategy is "RollingUpdate". Default is RollingUpdate. + type: string + type: object + template: + description: Template describes the machines that will be created. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map + stored with a resource that may be set by external tools + to store and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. More info: + http://kubernetes.io/docs/user-guide/annotations' + type: object + generateName: + description: "GenerateName is an optional prefix, used by + the server, to generate a unique name ONLY IF the Name field + has not been provided. If this field is used, the name returned + to the client will be different than the name passed. This + value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and + may be truncated by the length of the suffix required to + make the value unique on the server. \n If this field is + specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created + or 500 with Reason ServerTimeout indicating a unique name + could not be found in the time allotted, and the client + should retry (optionally after the time indicated in the + Retry-After header). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used + to organize and categorize (scope and select) objects. May + match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow + a client to request the generation of an appropriate name + automatically. Name is primarily intended for creation idempotence + and configuration definition. Cannot be updated. More info: + http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name + must be unique. An empty namespace is equivalent to the + \"default\" namespace, but \"default\" is the canonical + representation. Not all objects are required to be scoped + to a namespace - the value of this field for those objects + will be empty. \n Must be a DNS_LABEL. Cannot be updated. + More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL + objects in the list have been deleted, this object will + be garbage collected. If this object is managed by a controller, + then an entry in this list will point to this controller, + with the controller field set to true. There cannot be more + than one managing controller. + items: properties: - kubeletConfigKey: - description: KubeletConfigKey declares which key of - the referenced ConfigMap corresponds to the KubeletConfiguration - structure This field is required in all cases. + apiVersion: + description: API version of the referent. type: string - name: - description: Name is the metadata.name of the referenced - ConfigMap. This field is required in all cases. - type: string - namespace: - description: Namespace is the metadata.namespace of - the referenced ConfigMap. This field is required in - all cases. + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the + key-value store until this reference is removed. Defaults + to false. To set this field, a user needs "delete" + permission of the owner, otherwise 422 (Unprocessable + Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string - resourceVersion: - description: ResourceVersion is the metadata.ResourceVersion - of the referenced ConfigMap. This field is forbidden - in Node.Spec, and required in Node.Status. + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' type: string uid: - description: UID is the metadata.UID of the referenced - ConfigMap. This field is forbidden in Node.Spec, and - required in Node.Status. + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' type: string required: - - namespace + - apiVersion + - kind - name - - kubeletConfigKey - type: object - type: object - metadata: - description: ObjectMeta will autopopulate the Node created. - Use this to indicate what labels, annotations, name prefix, - etc., should be used when creating the Node. - properties: - annotations: - additionalProperties: - type: string - description: 'Annotations is an unstructured key value map - stored with a resource that may be set by external tools - to store and retrieve arbitrary metadata. They are not - queryable and should be preserved when modifying objects. - More info: http://kubernetes.io/docs/user-guide/annotations' - type: object - generateName: - description: "GenerateName is an optional prefix, used by - the server, to generate a unique name ONLY IF the Name - field has not been provided. If this field is used, the - name returned to the client will be different than the - name passed. This value will also be combined with a unique - suffix. The provided value has the same validation rules - as the Name field, and may be truncated by the length - of the suffix required to make the value unique on the - server. \n If this field is specified and the generated - name exists, the server will NOT return a 409 - instead, - it will either return 201 Created or 500 with Reason ServerTimeout - indicating a unique name could not be found in the time - allotted, and the client should retry (optionally after - the time indicated in the Retry-After header). \n Applied - only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - type: string - labels: - additionalProperties: - type: string - description: 'Map of string keys and values that can be - used to organize and categorize (scope and select) objects. - May match selectors of replication controllers and services. - More info: http://kubernetes.io/docs/user-guide/labels' + - uid type: object - name: - description: 'Name must be unique within a namespace. Is - required when creating resources, although some resources - may allow a client to request the generation of an appropriate - name automatically. Name is primarily intended for creation - idempotence and configuration definition. Cannot be updated. - More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - namespace: - description: "Namespace defines the space within each name - must be unique. An empty namespace is equivalent to the - \"default\" namespace, but \"default\" is the canonical - representation. Not all objects are required to be scoped - to a namespace - the value of this field for those objects - will be empty. \n Must be a DNS_LABEL. Cannot be updated. - More info: http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: List of objects depended by this object. If - ALL objects in the list have been deleted, this object - will be garbage collected. If this object is managed by - a controller, then an entry in this list will point to - this controller, with the controller field set to true. - There cannot be more than one managing controller. - items: + type: array + type: object + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + properties: + bootstrap: + description: Bootstrap is a reference to a local struct which + encapsulates fields to configure the Machine’s bootstrapping + mechanism. + properties: + configRef: + description: ConfigRef is a reference to a bootstrap provider-specific + resource that holds configuration details. The reference + is optional to allow users/operators to specify Bootstrap.Data + without the need of a controller. properties: - apiVersion: - description: API version of the referent. + apiGroup: + description: APIGroup is the group for the resource + being referenced. If APIGroup is not specified, + the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" - finalizer, then the owner cannot be deleted from - the key-value store until this reference is removed. - Defaults to false. To set this field, a user needs - "delete" permission of the owner, otherwise 422 - (Unprocessable Entity) will be returned. - type: boolean - controller: - description: If true, this reference points to the - managing controller. - type: boolean kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + description: Kind is the type of resource being referenced type: string name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + description: Name is the name of resource being referenced + type: string + required: + - apiGroup + - kind + - name + type: object + data: + description: Data contains the bootstrap data, such as + cloud-init details scripts. If nil, the Machine should + remain in the Pending state. + type: string + type: object + configSource: + description: ConfigSource is used to populate in the associated + Node for dynamic kubelet config. This field already exists + in Node, so any updates to it in the Machine spec will be + automatically copied to the linked NodeRef from the status. + The rest of dynamic kubelet config support should then work + as-is. + properties: + configMap: + description: ConfigMap is a reference to a Node's ConfigMap + properties: + kubeletConfigKey: + description: KubeletConfigKey declares which key of + the referenced ConfigMap corresponds to the KubeletConfiguration + structure This field is required in all cases. + type: string + name: + description: Name is the metadata.name of the referenced + ConfigMap. This field is required in all cases. + type: string + namespace: + description: Namespace is the metadata.namespace of + the referenced ConfigMap. This field is required + in all cases. + type: string + resourceVersion: + description: ResourceVersion is the metadata.ResourceVersion + of the referenced ConfigMap. This field is forbidden + in Node.Spec, and required in Node.Status. type: string uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + description: UID is the metadata.UID of the referenced + ConfigMap. This field is forbidden in Node.Spec, + and required in Node.Status. type: string required: - - apiVersion - - kind + - namespace - name - - uid + - kubeletConfigKey type: object - type: array - type: object - providerID: - description: ProviderID is the identification ID of the machine - provided by the provider. This field must match the provider - ID as seen on the node object corresponding to this machine. - This field is required by higher level consumers of cluster-api. - Example use case is cluster autoscaler with cluster-api as - provider. Clean-up logic in the autoscaler compares machines - to nodes to find out machines at provider which could not - get registered as Kubernetes nodes. With cluster-api as a - generic out-of-tree provider for autoscaler, this field is - required by autoscaler to be able to have a provider view - of the list of machines. Another list of nodes is queried - from the k8s apiserver and then a comparison is done to find - out unregistered machines and are marked for delete. This - field will be set by the actuators and consumed by higher - level entities like autoscaler that will be interfacing with - cluster-api as generic provider. - type: string - providerSpec: - description: ProviderSpec details Provider-specific configuration - to use during node creation. - properties: - value: - description: Value is an inlined, serialized representation - of the resource configuration. It is recommended that - providers maintain their own versioned API types that - should be serialized/deserialized from this field, akin - to component config. - type: object - valueFrom: - description: Source for the provider configuration. Cannot - be used if value is not empty. - properties: - machineClass: - description: The machine class from which the provider - config should be sourced. + type: object + infrastructureRef: + description: InfrastructureRef is a required reference to + a custom resource offered by an infrastructure provider. + properties: + apiGroup: + description: APIGroup is the group for the resource being + referenced. If APIGroup is not specified, the specified + Kind must be in the core API group. For any other third-party + types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + required: + - apiGroup + - kind + - name + type: object + metadata: + description: ObjectMeta will autopopulate the Node created. + Use this to indicate what labels, annotations, name prefix, + etc., should be used when creating the Node. + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value + map stored with a resource that may be set by external + tools to store and retrieve arbitrary metadata. They + are not queryable and should be preserved when modifying + objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + generateName: + description: "GenerateName is an optional prefix, used + by the server, to generate a unique name ONLY IF the + Name field has not been provided. If this field is used, + the name returned to the client will be different than + the name passed. This value will also be combined with + a unique suffix. The provided value has the same validation + rules as the Name field, and may be truncated by the + length of the suffix required to make the value unique + on the server. \n If this field is specified and the + generated name exists, the server will NOT return a + 409 - instead, it will either return 201 Created or + 500 with Reason ServerTimeout indicating a unique name + could not be found in the time allotted, and the client + should retry (optionally after the time indicated in + the Retry-After header). \n Applied only if Name is + not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be + used to organize and categorize (scope and select) objects. + May match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + name: + description: 'Name must be unique within a namespace. + Is required when creating resources, although some resources + may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be + updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each + name must be unique. An empty namespace is equivalent + to the \"default\" namespace, but \"default\" is the + canonical representation. Not all objects are required + to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. + Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. + If ALL objects in the list have been deleted, this object + will be garbage collected. If this object is managed + by a controller, then an entry in this list will point + to this controller, with the controller field set to + true. There cannot be more than one managing controller. + items: properties: apiVersion: description: API version of the referent. type: string - fieldPath: - description: 'If referring to a piece of an object - instead of an entire object, this string should - contain a valid JSON/Go field access statement, - such as desiredState.manifest.containers[2]. For - example, if the object reference is to a container - within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to - the name of the container that triggered the event) - or if no container name is specified "spec.containers[2]" - (container with index 2 in this pod). This syntax - is chosen only to have some well-defined way of - referencing a part of an object. TODO: this design - is not final and this field is subject to change - in the future.' - type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from + the key-value store until this reference is removed. + Defaults to false. To set this field, a user needs + "delete" permission of the owner, otherwise 422 + (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the + managing controller. + type: boolean kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - provider: - description: Provider is the name of the cloud-provider - which MachineClass is intended for. - type: string - resourceVersion: - description: 'Specific resourceVersion to which - this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' type: string uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' type: string + required: + - apiVersion + - kind + - name + - uid type: object - type: object - type: object - taints: - description: The list of the taints to be applied to the corresponding - Node in additive manner. This list will not overwrite any - other taints added to the Node on an ongoing basis by other - entities. These taints should be actively reconciled e.g. - if you ask the machine controller to apply a taint and then - manually remove the taint the machine controller will put - it back) but not have the machine controller remove any taints - items: - properties: - effect: - description: Required. The effect of the taint on pods - that do not tolerate the taint. Valid effects are NoSchedule, - PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to be applied to - a node. - type: string - timeAdded: - description: TimeAdded represents the time at which the - taint was added. It is only written for NoExecute taints. - format: date-time - type: string - value: - description: Required. The taint value corresponding to - the taint key. - type: string - required: - - key - - effect + type: array type: object - type: array - versions: - description: Versions of key software to use. This field is - optional at cluster creation time, and omitting the field - indicates that the cluster installation tool should select - defaults for the user. These defaults may differ based on - the cluster installer, but the tool should populate the values - it uses when persisting Machine objects. A Machine spec missing - this field at runtime is invalid. - properties: - controlPlane: - description: ControlPlane is the semantic version of the - Kubernetes control plane to run. This should only be populated - when the machine is a control plane. - type: string - kubelet: - description: Kubelet is the semantic version of kubelet - to run - type: string - required: - - kubelet - type: object - required: - - providerSpec - type: object - type: object - required: - - selector - - template - type: object - status: - properties: - availableReplicas: - description: Total number of available machines (ready for at least - minReadySeconds) targeted by this deployment. - format: int32 - type: integer - observedGeneration: - description: The generation observed by the deployment controller. - format: int64 - type: integer - readyReplicas: - description: Total number of ready machines targeted by this deployment. - format: int32 - type: integer - replicas: - description: Total number of non-terminated machines targeted by this - deployment (their labels match the selector). - format: int32 - type: integer - unavailableReplicas: - description: Total number of unavailable machines targeted by this deployment. - This is the total number of machines that are still required for the - deployment to have 100% available capacity. They may either be machines - that are running but not yet available or machines that still have - not been created. - format: int32 - type: integer - updatedReplicas: - description: Total number of non-terminated machines targeted by this - deployment that have the desired template spec. - format: int32 - type: integer - type: object - type: object - versions: - - name: v1alpha1 + providerID: + description: ProviderID is the identification ID of the machine + provided by the provider. This field must match the provider + ID as seen on the node object corresponding to this machine. + This field is required by higher level consumers of cluster-api. + Example use case is cluster autoscaler with cluster-api + as provider. Clean-up logic in the autoscaler compares machines + to nodes to find out machines at provider which could not + get registered as Kubernetes nodes. With cluster-api as + a generic out-of-tree provider for autoscaler, this field + is required by autoscaler to be able to have a provider + view of the list of machines. Another list of nodes is queried + from the k8s apiserver and then a comparison is done to + find out unregistered machines and are marked for delete. + This field will be set by the actuators and consumed by + higher level entities like autoscaler that will be interfacing + with cluster-api as generic provider. + type: string + taints: + description: The list of the taints to be applied to the corresponding + Node in additive manner. This list will not overwrite any + other taints added to the Node on an ongoing basis by other + entities. These taints should be actively reconciled e.g. + if you ask the machine controller to apply a taint and then + manually remove the taint the machine controller will put + it back) but not have the machine controller remove any + taints + items: + properties: + effect: + description: Required. The effect of the taint on pods + that do not tolerate the taint. Valid effects are + NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Required. The taint key to be applied to + a node. + type: string + timeAdded: + description: TimeAdded represents the time at which + the taint was added. It is only written for NoExecute + taints. + format: date-time + type: string + value: + description: Required. The taint value corresponding + to the taint key. + type: string + required: + - key + - effect + type: object + type: array + version: + description: Version defines the desired Kubernetes version. + This field is meant to be optionally used by bootstrap providers. + type: string + required: + - bootstrap + - infrastructureRef + type: object + type: object + required: + - selector + - template + type: object + status: + properties: + availableReplicas: + description: Total number of available machines (ready for at least + minReadySeconds) targeted by this deployment. + format: int32 + type: integer + observedGeneration: + description: The generation observed by the deployment controller. + format: int64 + type: integer + readyReplicas: + description: Total number of ready machines targeted by this deployment. + format: int32 + type: integer + replicas: + description: Total number of non-terminated machines targeted by this + deployment (their labels match the selector). + format: int32 + type: integer + unavailableReplicas: + description: Total number of unavailable machines targeted by this + deployment. This is the total number of machines that are still + required for the deployment to have 100% available capacity. They + may either be machines that are running but not yet available or + machines that still have not been created. + format: int32 + type: integer + updatedReplicas: + description: Total number of non-terminated machines targeted by this + deployment that have the desired template spec. + format: int32 + type: integer + type: object + type: object served: true storage: true + subresources: + scale: + labelSelectorPath: .status.labelSelector + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} status: acceptedNames: kind: "" diff --git a/config/crds/cluster.k8s.io_machines.yaml b/config/crds/cluster.k8s.io_machines.yaml index 2d1f103cf812..2ecaa41f1a8b 100644 --- a/config/crds/cluster.k8s.io_machines.yaml +++ b/config/crds/cluster.k8s.io_machines.yaml @@ -6,20 +6,6 @@ metadata: creationTimestamp: null name: machines.cluster.k8s.io spec: - additionalPrinterColumns: - - JSONPath: .spec.providerID - description: Provider ID - name: ProviderID - type: string - - JSONPath: .status.phase - description: Machine status such as Terminating/Pending/Running/Failed etc - name: Phase - type: string - - JSONPath: .status.nodeRef.name - description: Node name associated with this machine - name: NodeName - priority: 1 - type: string group: cluster.k8s.io names: kind: Machine @@ -27,826 +13,1631 @@ spec: shortNames: - ma scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - description: / [Machine] Machine is the Schema for the machines API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - properties: - annotations: - additionalProperties: - type: string - description: 'Annotations is an unstructured key value map stored with - a resource that may be set by external tools to store and retrieve - arbitrary metadata. They are not queryable and should be preserved - when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' - type: object - clusterName: - description: The name of the cluster which the object belongs to. This - is used to distinguish resources with same name and namespace in different - clusters. This field is not set anywhere right now and apiserver is - going to ignore it if set in create or update request. - type: string - creationTimestamp: - description: "CreationTimestamp is a timestamp representing the server - time when this object was created. It is not guaranteed to be set - in happens-before order across separate operations. Clients may not - set this value. It is represented in RFC3339 form and is in UTC. \n - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - deletionGracePeriodSeconds: - description: Number of seconds allowed for this object to gracefully - terminate before it will be removed from the system. Only set when - deletionTimestamp is also set. May only be shortened. Read-only. - format: int64 - type: integer - deletionTimestamp: - description: "DeletionTimestamp is RFC 3339 date and time at which this - resource will be deleted. This field is set by the server when a graceful - deletion is requested by the user, and is not directly settable by - a client. The resource is expected to be deleted (no longer visible - from resource lists, and not reachable by name) after the time in - this field, once the finalizers list is empty. As long as the finalizers - list contains items, deletion is blocked. Once the deletionTimestamp - is set, this value may not be unset or be set further into the future, - although it may be shortened or the resource may be deleted prior - to this time. For example, a user may request that a pod is deleted - in 30 seconds. The Kubelet will react by sending a graceful termination - signal to the containers in the pod. After that 30 seconds, the Kubelet - will send a hard termination signal (SIGKILL) to the container and - after cleanup, remove the pod from the API. In the presence of network - partitions, this object may still exist after this timestamp, until - an administrator or automated process can determine the resource is - fully terminated. If not set, graceful deletion of the object has - not been requested. \n Populated by the system when a graceful deletion - is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - finalizers: - description: Must be empty before the object is deleted from the registry. - Each entry is an identifier for the responsible component that will - remove the entry from the list. If the deletionTimestamp of the object - is non-nil, entries in this list can only be removed. - items: - type: string - type: array - generateName: - description: "GenerateName is an optional prefix, used by the server, - to generate a unique name ONLY IF the Name field has not been provided. - If this field is used, the name returned to the client will be different - than the name passed. This value will also be combined with a unique - suffix. The provided value has the same validation rules as the Name - field, and may be truncated by the length of the suffix required to - make the value unique on the server. \n If this field is specified - and the generated name exists, the server will NOT return a 409 - - instead, it will either return 201 Created or 500 with Reason ServerTimeout - indicating a unique name could not be found in the time allotted, - and the client should retry (optionally after the time indicated in - the Retry-After header). \n Applied only if Name is not specified. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - type: string - generation: - description: A sequence number representing a specific generation of - the desired state. Populated by the system. Read-only. - format: int64 - type: integer - initializers: - description: "An initializer is a controller which enforces some system - invariant at object creation time. This field is a list of initializers - that have not yet acted on this object. If nil or empty, this object - has been completely initialized. Otherwise, the object is considered - uninitialized and is hidden (in list/watch and get calls) from clients - that haven't explicitly asked to observe uninitialized objects. \n - When an object is created, the system will populate this list with - the current set of initializers. Only privileged users may set or - modify this list. Once it is empty, it may not be modified further - by any user. \n DEPRECATED - initializers are an alpha field and will - be removed in v1.15." - properties: - pending: - description: Pending is a list of initializers that must execute - in order before this object is visible. When the last pending - initializer is removed, and no failing result is set, the initializers - struct will be set to nil and the object is considered as initialized - and visible to all clients. - items: + versions: + - additionalPrinterColumns: + - JSONPath: .spec.providerID + description: Provider ID + name: ProviderID + type: string + - JSONPath: .status.phase + description: Machine status such as Terminating/Pending/Running/Failed etc + name: Phase + type: string + - JSONPath: .status.nodeRef.name + description: Node name associated with this machine + name: NodeName + priority: 1 + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: / [Machine] Machine is the Schema for the machines API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored + with a resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object belongs to. + This is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right now + and apiserver is going to ignore it if set in create or update request. + type: string + creationTimestamp: + description: "CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients may + not set this value. It is represented in RFC3339 form and is in + UTC. \n Populated by the system. Read-only. Null for lists. More + info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only set when + deletionTimestamp is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time at which + this resource will be deleted. This field is set by the server when + a graceful deletion is requested by the user, and is not directly + settable by a client. The resource is expected to be deleted (no + longer visible from resource lists, and not reachable by name) after + the time in this field, once the finalizers list is empty. As long + as the finalizers list contains items, deletion is blocked. Once + the deletionTimestamp is set, this value may not be unset or be + set further into the future, although it may be shortened or the + resource may be deleted prior to this time. For example, a user + may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + \n Populated by the system when a graceful deletion is requested. + Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + finalizers: + description: Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that will + remove the entry from the list. If the deletionTimestamp of the + object is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not been provided. + If this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a unique + suffix. The provided value has the same validation rules as the + Name field, and may be truncated by the length of the suffix required + to make the value unique on the server. \n If this field is specified + and the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the + time indicated in the Retry-After header). \n Applied only if Name + is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific generation + of the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces some system + invariant at object creation time. This field is a list of initializers + that have not yet acted on this object. If nil or empty, this object + has been completely initialized. Otherwise, the object is considered + uninitialized and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. + \n When an object is created, the system will populate this list + with the current set of initializers. Only privileged users may + set or modify this list. Once it is empty, it may not be modified + further by any user. \n DEPRECATED - initializers are an alpha field + and will be removed in v1.15." + properties: + pending: + description: Pending is a list of initializers that must execute + in order before this object is visible. When the last pending + initializer is removed, and no failing result is set, the initializers + struct will be set to nil and the object is considered as initialized + and visible to all clients. + items: + properties: + name: + description: name of the process that is responsible for + initializing this object. + type: string + required: + - name + type: object + type: array + result: + description: If result is set with the Failure field, the object + will be persisted to storage and then deleted, ensuring that + other clients can observe the deletion. properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this + representation of an object. Servers should convert recognized + schemas to the latest internal value, and may reject unrecognized + values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + code: + description: Suggested HTTP return code for this status, 0 + if not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This field is + optional and the data returned is not guaranteed to conform + to any schema except that defined by the reason type. + properties: + causes: + description: The Causes array includes more details associated + with the StatusReason failure. Not all StatusReasons + may provide detailed causes. + items: + properties: + field: + description: "The field of the resource that has + caused this error, as named by its JSON serialization. + May include dot and postfix notation for nested + attributes. Arrays are zero-indexed. Fields may + appear more than once in an array of causes due + to fields having multiple errors. Optional. \n + Examples: \"name\" - the field \"name\" on the + current resource \"items[0].name\" - the field + \"name\" on the first array entry in \"items\"" + type: string + message: + description: A human-readable description of the + cause of the error. This field may be presented + as-is to a reader. + type: string + reason: + description: A machine-readable description of the + cause of the error. If this value is empty there + is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource associated + with the status StatusReason. + type: string + kind: + description: 'The kind attribute of the resource associated + with the status StatusReason. On some operations may + differ from the requested resource Kind. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: The name attribute of the resource associated + with the status StatusReason (when there is a single + name which can be described). + type: string + retryAfterSeconds: + description: If specified, the time in seconds before + the operation should be retried. Some errors may indicate + the client must take an alternate action - for those + errors this field may indicate how long to wait before + taking the alternate action. + format: int32 + type: integer + uid: + description: 'UID of the resource. (when there is a single + resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + type: object + kind: + description: 'Kind is a string value representing the REST + resource this object represents. Servers may infer this + from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status of + this operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set a limit + on the number of items returned, and indicates that + the server has more data available. The value is opaque + and may be used to issue another request to the endpoint + that served this list to retrieve the next set of available + objects. Continuing a consistent list may not be possible + if the server configuration has changed or more than + a few minutes have passed. The resourceVersion field + returned when using this continue value will be identical + to the value in the first response, unless you have + received this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s internal + version of this object that can be used by clients to + determine when objects have changed. Value must be treated + as opaque by clients and passed unmodified back to the + server. Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why this operation + is in the "Failure" status. If this value is empty there + is no information available. A Reason clarifies an HTTP + status code but does not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" or + "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: string + type: object + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors of + replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + managedFields: + description: "ManagedFields maps workflow-id and version to the set + of fields that are managed by that workflow. This is mostly for + internal housekeeping, and users typically shouldn't need to set + or understand this field. A workflow can be the user's name, a controller's + name, or the name of a specific apply path like \"ci-cd\". The set + of fields is always in the version that the workflow used when modifying + the object. \n This field is alpha and can be changed or removed + without notice." + items: + properties: + apiVersion: + description: APIVersion defines the version of this resource + that this field set applies to. The format is "group/version" + just like the top-level APIVersion field. It is necessary + to track the version of a field set because it cannot be automatically + converted. + type: string + fields: + additionalProperties: true + description: Fields identifies a set of fields. + type: object + manager: + description: Manager is an identifier of the workflow managing + these fields. + type: string + operation: + description: Operation is the type of operation which lead to + this ManagedFieldsEntry being created. The only valid values + for this field are 'Apply' and 'Update'. + type: string + time: + description: Time is timestamp of when these fields were set. + It should always be empty if Operation is 'Apply' + format: date-time + type: string + type: object + type: array + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow a client + to request the generation of an appropriate name automatically. + Name is primarily intended for creation idempotence and configuration + definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must be + unique. An empty namespace is equivalent to the \"default\" namespace, + but \"default\" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. Cannot + be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field set + to true. There cannot be more than one managing controller. + items: + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. + To set this field, a user needs "delete" permission of the + owner, otherwise 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + resourceVersion: + description: "An opaque value that represents the internal version + of this object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. \n Populated by the system. Read-only. Value must + be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. \n Populated + by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + spec: + properties: + configSource: + description: ConfigSource is used to populate in the associated Node + for dynamic kubelet config. This field already exists in Node, so + any updates to it in the Machine spec will be automatically copied + to the linked NodeRef from the status. The rest of dynamic kubelet + config support should then work as-is. + properties: + configMap: + description: ConfigMap is a reference to a Node's ConfigMap + properties: + kubeletConfigKey: + description: KubeletConfigKey declares which key of the referenced + ConfigMap corresponds to the KubeletConfiguration structure + This field is required in all cases. + type: string name: - description: name of the process that is responsible for initializing - this object. + description: Name is the metadata.name of the referenced ConfigMap. + This field is required in all cases. + type: string + namespace: + description: Namespace is the metadata.namespace of the referenced + ConfigMap. This field is required in all cases. + type: string + resourceVersion: + description: ResourceVersion is the metadata.ResourceVersion + of the referenced ConfigMap. This field is forbidden in + Node.Spec, and required in Node.Status. + type: string + uid: + description: UID is the metadata.UID of the referenced ConfigMap. + This field is forbidden in Node.Spec, and required in Node.Status. type: string required: + - namespace - name + - kubeletConfigKey type: object - type: array - result: - description: If result is set with the Failure field, the object - will be persisted to storage and then deleted, ensuring that other - clients can observe the deletion. - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this - representation of an object. Servers should convert recognized - schemas to the latest internal value, and may reject unrecognized - values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - code: - description: Suggested HTTP return code for this status, 0 if - not set. - format: int32 - type: integer - details: - description: Extended data associated with the reason. Each - reason may define its own extended details. This field is - optional and the data returned is not guaranteed to conform - to any schema except that defined by the reason type. + type: object + metadata: + description: ObjectMeta will autopopulate the Node created. Use this + to indicate what labels, annotations, name prefix, etc., should + be used when creating the Node. + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored + with a resource that may be set by external tools to store and + retrieve arbitrary metadata. They are not queryable and should + be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + generateName: + description: "GenerateName is an optional prefix, used by the + server, to generate a unique name ONLY IF the Name field has + not been provided. If this field is used, the name returned + to the client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the value + unique on the server. \n If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated + in the Retry-After header). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to + organize and categorize (scope and select) objects. May match + selectors of replication controllers and services. More info: + http://kubernetes.io/docs/user-guide/labels' + type: object + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow a + client to request the generation of an appropriate name automatically. + Name is primarily intended for creation idempotence and configuration + definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must + be unique. An empty namespace is equivalent to the \"default\" + namespace, but \"default\" is the canonical representation. + Not all objects are required to be scoped to a namespace - the + value of this field for those objects will be empty. \n Must + be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing controller. + items: properties: - causes: - description: The Causes array includes more details associated - with the StatusReason failure. Not all StatusReasons may - provide detailed causes. - items: - properties: - field: - description: "The field of the resource that has caused - this error, as named by its JSON serialization. - May include dot and postfix notation for nested - attributes. Arrays are zero-indexed. Fields may - appear more than once in an array of causes due - to fields having multiple errors. Optional. \n Examples: - \ \"name\" - the field \"name\" on the current - resource \"items[0].name\" - the field \"name\" - on the first array entry in \"items\"" - type: string - message: - description: A human-readable description of the cause - of the error. This field may be presented as-is - to a reader. - type: string - reason: - description: A machine-readable description of the - cause of the error. If this value is empty there - is no information available. - type: string - type: object - type: array - group: - description: The group attribute of the resource associated - with the status StatusReason. + apiVersion: + description: API version of the referent. type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. + To set this field, a user needs "delete" permission of + the owner, otherwise 422 (Unprocessable Entity) will be + returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean kind: - description: 'The kind attribute of the resource associated - with the status StatusReason. On some operations may differ - from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string name: - description: The name attribute of the resource associated - with the status StatusReason (when there is a single name - which can be described). + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' type: string - retryAfterSeconds: - description: If specified, the time in seconds before the - operation should be retried. Some errors may indicate - the client must take an alternate action - for those errors - this field may indicate how long to wait before taking - the alternate action. - format: int32 - type: integer uid: - description: 'UID of the resource. (when there is a single - resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' type: string + required: + - apiVersion + - kind + - name + - uid type: object - kind: - description: 'Kind is a string value representing the REST resource - this object represents. Servers may infer this from the endpoint - the client submits requests to. Cannot be updated. In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: array + type: object + providerID: + description: ProviderID is the identification ID of the machine provided + by the provider. This field must match the provider ID as seen on + the node object corresponding to this machine. This field is required + by higher level consumers of cluster-api. Example use case is cluster + autoscaler with cluster-api as provider. Clean-up logic in the autoscaler + compares machines to nodes to find out machines at provider which + could not get registered as Kubernetes nodes. With cluster-api as + a generic out-of-tree provider for autoscaler, this field is required + by autoscaler to be able to have a provider view of the list of + machines. Another list of nodes is queried from the k8s apiserver + and then a comparison is done to find out unregistered machines + and are marked for delete. This field will be set by the actuators + and consumed by higher level entities like autoscaler that will + be interfacing with cluster-api as generic provider. + type: string + providerSpec: + description: ProviderSpec details Provider-specific configuration + to use during node creation. + properties: + value: + description: Value is an inlined, serialized representation of + the resource configuration. It is recommended that providers + maintain their own versioned API types that should be serialized/deserialized + from this field, akin to component config. + type: object + valueFrom: + description: Source for the provider configuration. Cannot be + used if value is not empty. + properties: + machineClass: + description: The machine class from which the provider config + should be sourced. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead + of an entire object, this string should contain a valid + JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this + pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object. TODO: this design + is not final and this field is subject to change in + the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + provider: + description: Provider is the name of the cloud-provider + which MachineClass is intended for. + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + type: object + type: object + taints: + description: The list of the taints to be applied to the corresponding + Node in additive manner. This list will not overwrite any other + taints added to the Node on an ongoing basis by other entities. + These taints should be actively reconciled e.g. if you ask the machine + controller to apply a taint and then manually remove the taint the + machine controller will put it back) but not have the machine controller + remove any taints + items: + properties: + effect: + description: Required. The effect of the taint on pods that + do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule + and NoExecute. + type: string + key: + description: Required. The taint key to be applied to a node. + type: string + timeAdded: + description: TimeAdded represents the time at which the taint + was added. It is only written for NoExecute taints. + format: date-time + type: string + value: + description: Required. The taint value corresponding to the + taint key. + type: string + required: + - key + - effect + type: object + type: array + versions: + description: Versions of key software to use. This field is optional + at cluster creation time, and omitting the field indicates that + the cluster installation tool should select defaults for the user. + These defaults may differ based on the cluster installer, but the + tool should populate the values it uses when persisting Machine + objects. A Machine spec missing this field at runtime is invalid. + properties: + controlPlane: + description: ControlPlane is the semantic version of the Kubernetes + control plane to run. This should only be populated when the + machine is a control plane. + type: string + kubelet: + description: Kubelet is the semantic version of kubelet to run + type: string + required: + - kubelet + type: object + required: + - providerSpec + type: object + status: + properties: + addresses: + description: Addresses is a list of addresses assigned to the machine. + Queried from cloud provider, if available. + items: + properties: + address: + description: The node address. + type: string + type: + description: Node address type, one of Hostname, ExternalIP + or InternalIP. + type: string + required: + - type + - address + type: object + type: array + conditions: + description: 'Conditions lists the conditions synced from the node + conditions of the corresponding node-object. Machine-controller + is responsible for keeping conditions up-to-date. MachineSet controller + will be taking these conditions as a signal to decide if machine + is healthy or needs to be replaced. Refer: https://kubernetes.io/docs/concepts/architecture/nodes/#condition' + items: + properties: + lastHeartbeatTime: + description: Last time we got an update on a given condition. + format: date-time + type: string + lastTransitionTime: + description: Last time the condition transit from one status + to another. + format: date-time type: string message: - description: A human-readable description of the status of this - operation. + description: Human readable message indicating details about + last transition. type: string - metadata: - description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - properties: - continue: - description: continue may be set if the user set a limit - on the number of items returned, and indicates that the - server has more data available. The value is opaque and - may be used to issue another request to the endpoint that - served this list to retrieve the next set of available - objects. Continuing a consistent list may not be possible - if the server configuration has changed or more than a - few minutes have passed. The resourceVersion field returned - when using this continue value will be identical to the - value in the first response, unless you have received - this token from an error message. - type: string - resourceVersion: - description: 'String that identifies the server''s internal - version of this object that can be used by clients to - determine when objects have changed. Value must be treated - as opaque by clients and passed unmodified back to the - server. Populated by the system. Read-only. More info: - https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' - type: string - selfLink: - description: selfLink is a URL representing this object. - Populated by the system. Read-only. - type: string - type: object reason: - description: A machine-readable description of why this operation - is in the "Failure" status. If this value is empty there is - no information available. A Reason clarifies an HTTP status - code but does not override it. + description: (brief) reason for the condition's last transition. type: string status: - description: 'Status of the operation. One of: "Success" or - "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of node condition. type: string + required: + - type + - status type: object - required: - - pending - type: object - labels: - additionalProperties: - type: string - description: 'Map of string keys and values that can be used to organize - and categorize (scope and select) objects. May match selectors of - replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' - type: object - managedFields: - description: "ManagedFields maps workflow-id and version to the set - of fields that are managed by that workflow. This is mostly for internal - housekeeping, and users typically shouldn't need to set or understand - this field. A workflow can be the user's name, a controller's name, - or the name of a specific apply path like \"ci-cd\". The set of fields - is always in the version that the workflow used when modifying the - object. \n This field is alpha and can be changed or removed without - notice." - items: + type: array + errorMessage: + description: "ErrorMessage will be set in the event that there is + a terminal problem reconciling the Machine and will contain a more + verbose string suitable for logging and human consumption. \n 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. \n Any transient errors that + occur during the reconciliation of Machines can be added as events + to the Machine object and/or logged in the controller's output." + type: string + errorReason: + description: "ErrorReason will be set in the event that there is a + terminal problem reconciling the Machine and will contain a succinct + value suitable for machine interpretation. \n 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. \n Any transient errors that occur + during the reconciliation of Machines can be added as events to + the Machine object and/or logged in the controller's output." + type: string + lastOperation: + description: LastOperation describes the last-operation performed + by the machine-controller. This API should be useful as a history + in terms of the latest operation performed on the specific machine. + It should also convey the state of the latest-operation for example + if it is still on-going, failed or completed successfully. properties: - apiVersion: - description: APIVersion defines the version of this resource that - this field set applies to. The format is "group/version" just - like the top-level APIVersion field. It is necessary to track - the version of a field set because it cannot be automatically - converted. - type: string - fields: - additionalProperties: true - description: Fields identifies a set of fields. - type: object - manager: - description: Manager is an identifier of the workflow managing - these fields. - type: string - operation: - description: Operation is the type of operation which lead to - this ManagedFieldsEntry being created. The only valid values - for this field are 'Apply' and 'Update'. - type: string - time: - description: Time is timestamp of when these fields were set. - It should always be empty if Operation is 'Apply' + description: + description: Description is the human-readable description of + the last operation. + type: string + lastUpdated: + description: LastUpdated is the timestamp at which LastOperation + API was last-updated. format: date-time type: string + state: + description: State is the current status of the last performed + operation. E.g. Processing, Failed, Successful etc + type: string + type: + description: Type is the type of operation which was last performed. + E.g. Create, Delete, Update etc + type: string type: object - type: array - name: - description: 'Name must be unique within a namespace. Is required when - creating resources, although some resources may allow a client to - request the generation of an appropriate name automatically. Name - is primarily intended for creation idempotence and configuration definition. - Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - namespace: - description: "Namespace defines the space within each name must be unique. - An empty namespace is equivalent to the \"default\" namespace, but - \"default\" is the canonical representation. Not all objects are required - to be scoped to a namespace - the value of this field for those objects - will be empty. \n Must be a DNS_LABEL. Cannot be updated. More info: - http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: List of objects depended by this object. If ALL objects - in the list have been deleted, this object will be garbage collected. - If this object is managed by a controller, then an entry in this list - will point to this controller, with the controller field set to true. - There cannot be more than one managing controller. - items: + lastUpdated: + description: LastUpdated identifies when this status was last observed. + format: date-time + type: string + nodeRef: + description: NodeRef will point to the corresponding Node if it exists. properties: apiVersion: description: API version of the referent. type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" - finalizer, then the owner cannot be deleted from the key-value - store until this reference is removed. Defaults to false. To - set this field, a user needs "delete" permission of the owner, - otherwise 422 (Unprocessable Entity) will be returned. - type: boolean - controller: - description: If true, this reference points to the managing controller. - type: boolean + fieldPath: + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' + type: string kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' type: string uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + phase: + description: Phase represents the current phase of machine actuation. + E.g. Pending, Running, Terminating, Failed etc. + type: string + providerStatus: + description: ProviderStatus details a Provider-specific status. It + is recommended that providers maintain their own versioned API types + that should be serialized/deserialized from this field. + type: object + versions: + description: "Versions specifies the current versions of software + on the corresponding Node (if it exists). This is provided for a + few reasons: \n 1) It is more convenient than checking the NodeRef, + traversing it to the Node, and finding the appropriate field + in Node.Status.NodeInfo (which uses different field names and + formatting). 2) It removes some of the dependency on the structure + of the Node, so that if the structure of Node.Status.NodeInfo + changes, only machine controllers need to be updated, rather + than every client of the Machines API. 3) There is no other simple + way to check the control plane version. A client would have to + connect directly to the apiserver running on the target node + in order to find out its version." + properties: + controlPlane: + description: ControlPlane is the semantic version of the Kubernetes + control plane to run. This should only be populated when the + machine is a control plane. + type: string + kubelet: + description: Kubelet is the semantic version of kubelet to run type: string required: - - apiVersion - - kind - - name - - uid + - kubelet + type: object + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - JSONPath: .spec.providerID + description: Provider ID + name: ProviderID + type: string + - JSONPath: .status.phase + description: Machine status such as Terminating/Pending/Running/Failed etc + name: Phase + type: string + - JSONPath: .status.nodeRef.name + description: Node name associated with this machine + name: NodeName + priority: 1 + type: string + name: v1alpha2 + schema: + openAPIV3Schema: + description: / [Machine] Machine is the Schema for the machines API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored + with a resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' type: object - type: array - resourceVersion: - description: "An opaque value that represents the internal version of - this object that can be used by clients to determine when objects - have changed. May be used for optimistic concurrency, change detection, - and the watch operation on a resource or set of resources. Clients - must treat these values as opaque and passed unmodified back to the - server. They may only be valid for a particular resource or set of - resources. \n Populated by the system. Read-only. Value must be treated - as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - type: string - selfLink: - description: SelfLink is a URL representing this object. Populated by - the system. Read-only. - type: string - uid: - description: "UID is the unique in time and space value for this object. - It is typically generated by the server on successful creation of - a resource and is not allowed to change on PUT operations. \n Populated - by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - type: string - type: object - spec: - properties: - configSource: - description: ConfigSource is used to populate in the associated Node - for dynamic kubelet config. This field already exists in Node, so - any updates to it in the Machine spec will be automatically copied - to the linked NodeRef from the status. The rest of dynamic kubelet - config support should then work as-is. - properties: - configMap: - description: ConfigMap is a reference to a Node's ConfigMap + clusterName: + description: The name of the cluster which the object belongs to. + This is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right now + and apiserver is going to ignore it if set in create or update request. + type: string + creationTimestamp: + description: "CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients may + not set this value. It is represented in RFC3339 form and is in + UTC. \n Populated by the system. Read-only. Null for lists. More + info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only set when + deletionTimestamp is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time at which + this resource will be deleted. This field is set by the server when + a graceful deletion is requested by the user, and is not directly + settable by a client. The resource is expected to be deleted (no + longer visible from resource lists, and not reachable by name) after + the time in this field, once the finalizers list is empty. As long + as the finalizers list contains items, deletion is blocked. Once + the deletionTimestamp is set, this value may not be unset or be + set further into the future, although it may be shortened or the + resource may be deleted prior to this time. For example, a user + may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + \n Populated by the system when a graceful deletion is requested. + Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + finalizers: + description: Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that will + remove the entry from the list. If the deletionTimestamp of the + object is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not been provided. + If this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a unique + suffix. The provided value has the same validation rules as the + Name field, and may be truncated by the length of the suffix required + to make the value unique on the server. \n If this field is specified + and the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the + time indicated in the Retry-After header). \n Applied only if Name + is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific generation + of the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces some system + invariant at object creation time. This field is a list of initializers + that have not yet acted on this object. If nil or empty, this object + has been completely initialized. Otherwise, the object is considered + uninitialized and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. + \n When an object is created, the system will populate this list + with the current set of initializers. Only privileged users may + set or modify this list. Once it is empty, it may not be modified + further by any user. \n DEPRECATED - initializers are an alpha field + and will be removed in v1.15." + properties: + pending: + description: Pending is a list of initializers that must execute + in order before this object is visible. When the last pending + initializer is removed, and no failing result is set, the initializers + struct will be set to nil and the object is considered as initialized + and visible to all clients. + items: + properties: + name: + description: name of the process that is responsible for + initializing this object. + type: string + required: + - name + type: object + type: array + result: + description: If result is set with the Failure field, the object + will be persisted to storage and then deleted, ensuring that + other clients can observe the deletion. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this + representation of an object. Servers should convert recognized + schemas to the latest internal value, and may reject unrecognized + values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + code: + description: Suggested HTTP return code for this status, 0 + if not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This field is + optional and the data returned is not guaranteed to conform + to any schema except that defined by the reason type. + properties: + causes: + description: The Causes array includes more details associated + with the StatusReason failure. Not all StatusReasons + may provide detailed causes. + items: + properties: + field: + description: "The field of the resource that has + caused this error, as named by its JSON serialization. + May include dot and postfix notation for nested + attributes. Arrays are zero-indexed. Fields may + appear more than once in an array of causes due + to fields having multiple errors. Optional. \n + Examples: \"name\" - the field \"name\" on the + current resource \"items[0].name\" - the field + \"name\" on the first array entry in \"items\"" + type: string + message: + description: A human-readable description of the + cause of the error. This field may be presented + as-is to a reader. + type: string + reason: + description: A machine-readable description of the + cause of the error. If this value is empty there + is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource associated + with the status StatusReason. + type: string + kind: + description: 'The kind attribute of the resource associated + with the status StatusReason. On some operations may + differ from the requested resource Kind. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: The name attribute of the resource associated + with the status StatusReason (when there is a single + name which can be described). + type: string + retryAfterSeconds: + description: If specified, the time in seconds before + the operation should be retried. Some errors may indicate + the client must take an alternate action - for those + errors this field may indicate how long to wait before + taking the alternate action. + format: int32 + type: integer + uid: + description: 'UID of the resource. (when there is a single + resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + type: object + kind: + description: 'Kind is a string value representing the REST + resource this object represents. Servers may infer this + from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status of + this operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set a limit + on the number of items returned, and indicates that + the server has more data available. The value is opaque + and may be used to issue another request to the endpoint + that served this list to retrieve the next set of available + objects. Continuing a consistent list may not be possible + if the server configuration has changed or more than + a few minutes have passed. The resourceVersion field + returned when using this continue value will be identical + to the value in the first response, unless you have + received this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s internal + version of this object that can be used by clients to + determine when objects have changed. Value must be treated + as opaque by clients and passed unmodified back to the + server. Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why this operation + is in the "Failure" status. If this value is empty there + is no information available. A Reason clarifies an HTTP + status code but does not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" or + "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: string + type: object + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors of + replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + managedFields: + description: "ManagedFields maps workflow-id and version to the set + of fields that are managed by that workflow. This is mostly for + internal housekeeping, and users typically shouldn't need to set + or understand this field. A workflow can be the user's name, a controller's + name, or the name of a specific apply path like \"ci-cd\". The set + of fields is always in the version that the workflow used when modifying + the object. \n This field is alpha and can be changed or removed + without notice." + items: properties: - kubeletConfigKey: - description: KubeletConfigKey declares which key of the referenced - ConfigMap corresponds to the KubeletConfiguration structure - This field is required in all cases. + apiVersion: + description: APIVersion defines the version of this resource + that this field set applies to. The format is "group/version" + just like the top-level APIVersion field. It is necessary + to track the version of a field set because it cannot be automatically + converted. type: string - name: - description: Name is the metadata.name of the referenced ConfigMap. - This field is required in all cases. + fields: + additionalProperties: true + description: Fields identifies a set of fields. + type: object + manager: + description: Manager is an identifier of the workflow managing + these fields. type: string - namespace: - description: Namespace is the metadata.namespace of the referenced - ConfigMap. This field is required in all cases. + operation: + description: Operation is the type of operation which lead to + this ManagedFieldsEntry being created. The only valid values + for this field are 'Apply' and 'Update'. type: string - resourceVersion: - description: ResourceVersion is the metadata.ResourceVersion - of the referenced ConfigMap. This field is forbidden in Node.Spec, - and required in Node.Status. + time: + description: Time is timestamp of when these fields were set. + It should always be empty if Operation is 'Apply' + format: date-time + type: string + type: object + type: array + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow a client + to request the generation of an appropriate name automatically. + Name is primarily intended for creation idempotence and configuration + definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must be + unique. An empty namespace is equivalent to the \"default\" namespace, + but \"default\" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. Cannot + be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field set + to true. There cannot be more than one managing controller. + items: + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. + To set this field, a user needs "delete" permission of the + owner, otherwise 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' type: string uid: - description: UID is the metadata.UID of the referenced ConfigMap. - This field is forbidden in Node.Spec, and required in Node.Status. + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' type: string required: - - namespace + - apiVersion + - kind - name - - kubeletConfigKey - type: object - type: object - metadata: - description: ObjectMeta will autopopulate the Node created. Use this - to indicate what labels, annotations, name prefix, etc., should be - used when creating the Node. - properties: - annotations: - additionalProperties: - type: string - description: 'Annotations is an unstructured key value map stored - with a resource that may be set by external tools to store and - retrieve arbitrary metadata. They are not queryable and should - be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' - type: object - generateName: - description: "GenerateName is an optional prefix, used by the server, - to generate a unique name ONLY IF the Name field has not been - provided. If this field is used, the name returned to the client - will be different than the name passed. This value will also be - combined with a unique suffix. The provided value has the same - validation rules as the Name field, and may be truncated by the - length of the suffix required to make the value unique on the - server. \n If this field is specified and the generated name exists, - the server will NOT return a 409 - instead, it will either return - 201 Created or 500 with Reason ServerTimeout indicating a unique - name could not be found in the time allotted, and the client should - retry (optionally after the time indicated in the Retry-After - header). \n Applied only if Name is not specified. More info: - https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - type: string - labels: - additionalProperties: - type: string - description: 'Map of string keys and values that can be used to - organize and categorize (scope and select) objects. May match - selectors of replication controllers and services. More info: - http://kubernetes.io/docs/user-guide/labels' + - uid type: object - name: - description: 'Name must be unique within a namespace. Is required - when creating resources, although some resources may allow a client - to request the generation of an appropriate name automatically. - Name is primarily intended for creation idempotence and configuration - definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - namespace: - description: "Namespace defines the space within each name must - be unique. An empty namespace is equivalent to the \"default\" - namespace, but \"default\" is the canonical representation. Not - all objects are required to be scoped to a namespace - the value - of this field for those objects will be empty. \n Must be a DNS_LABEL. - Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: List of objects depended by this object. If ALL objects - in the list have been deleted, this object will be garbage collected. - If this object is managed by a controller, then an entry in this - list will point to this controller, with the controller field - set to true. There cannot be more than one managing controller. - items: + type: array + resourceVersion: + description: "An opaque value that represents the internal version + of this object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. \n Populated by the system. Read-only. Value must + be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. \n Populated + by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + spec: + properties: + bootstrap: + description: Bootstrap is a reference to a local struct which encapsulates + fields to configure the Machine’s bootstrapping mechanism. + properties: + configRef: + description: ConfigRef is a reference to a bootstrap provider-specific + resource that holds configuration details. The reference is + optional to allow users/operators to specify Bootstrap.Data + without the need of a controller. properties: - apiVersion: - description: API version of the referent. + apiGroup: + description: APIGroup is the group for the resource being + referenced. If APIGroup is not specified, the specified + Kind must be in the core API group. For any other third-party + types, APIGroup is required. type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" - finalizer, then the owner cannot be deleted from the key-value - store until this reference is removed. Defaults to false. - To set this field, a user needs "delete" permission of the - owner, otherwise 422 (Unprocessable Entity) will be returned. - type: boolean - controller: - description: If true, this reference points to the managing - controller. - type: boolean kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + description: Kind is the type of resource being referenced type: string name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + description: Name is the name of resource being referenced + type: string + required: + - apiGroup + - kind + - name + type: object + data: + description: Data contains the bootstrap data, such as cloud-init + details scripts. If nil, the Machine should remain in the Pending + state. + type: string + type: object + configSource: + description: ConfigSource is used to populate in the associated Node + for dynamic kubelet config. This field already exists in Node, so + any updates to it in the Machine spec will be automatically copied + to the linked NodeRef from the status. The rest of dynamic kubelet + config support should then work as-is. + properties: + configMap: + description: ConfigMap is a reference to a Node's ConfigMap + properties: + kubeletConfigKey: + description: KubeletConfigKey declares which key of the referenced + ConfigMap corresponds to the KubeletConfiguration structure + This field is required in all cases. + type: string + name: + description: Name is the metadata.name of the referenced ConfigMap. + This field is required in all cases. + type: string + namespace: + description: Namespace is the metadata.namespace of the referenced + ConfigMap. This field is required in all cases. + type: string + resourceVersion: + description: ResourceVersion is the metadata.ResourceVersion + of the referenced ConfigMap. This field is forbidden in + Node.Spec, and required in Node.Status. type: string uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + description: UID is the metadata.UID of the referenced ConfigMap. + This field is forbidden in Node.Spec, and required in Node.Status. type: string required: - - apiVersion - - kind + - namespace - name - - uid + - kubeletConfigKey type: object - type: array - type: object - providerID: - description: ProviderID is the identification ID of the machine provided - by the provider. This field must match the provider ID as seen on - the node object corresponding to this machine. This field is required - by higher level consumers of cluster-api. Example use case is cluster - autoscaler with cluster-api as provider. Clean-up logic in the autoscaler - compares machines to nodes to find out machines at provider which - could not get registered as Kubernetes nodes. With cluster-api as - a generic out-of-tree provider for autoscaler, this field is required - by autoscaler to be able to have a provider view of the list of machines. - Another list of nodes is queried from the k8s apiserver and then a - comparison is done to find out unregistered machines and are marked - for delete. This field will be set by the actuators and consumed by - higher level entities like autoscaler that will be interfacing with - cluster-api as generic provider. - type: string - providerSpec: - description: ProviderSpec details Provider-specific configuration to - use during node creation. - properties: - value: - description: Value is an inlined, serialized representation of the - resource configuration. It is recommended that providers maintain - their own versioned API types that should be serialized/deserialized - from this field, akin to component config. - type: object - valueFrom: - description: Source for the provider configuration. Cannot be used - if value is not empty. - properties: - machineClass: - description: The machine class from which the provider config - should be sourced. + type: object + infrastructureRef: + description: InfrastructureRef is a required reference to a custom + resource offered by an infrastructure provider. + properties: + apiGroup: + description: APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in + the core API group. For any other third-party types, APIGroup + is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + required: + - apiGroup + - kind + - name + type: object + metadata: + description: ObjectMeta will autopopulate the Node created. Use this + to indicate what labels, annotations, name prefix, etc., should + be used when creating the Node. + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored + with a resource that may be set by external tools to store and + retrieve arbitrary metadata. They are not queryable and should + be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + generateName: + description: "GenerateName is an optional prefix, used by the + server, to generate a unique name ONLY IF the Name field has + not been provided. If this field is used, the name returned + to the client will be different than the name passed. This value + will also be combined with a unique suffix. The provided value + has the same validation rules as the Name field, and may be + truncated by the length of the suffix required to make the value + unique on the server. \n If this field is specified and the + generated name exists, the server will NOT return a 409 - instead, + it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated + in the Retry-After header). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to + organize and categorize (scope and select) objects. May match + selectors of replication controllers and services. More info: + http://kubernetes.io/docs/user-guide/labels' + type: object + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow a + client to request the generation of an appropriate name automatically. + Name is primarily intended for creation idempotence and configuration + definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must + be unique. An empty namespace is equivalent to the \"default\" + namespace, but \"default\" is the canonical representation. + Not all objects are required to be scoped to a namespace - the + value of this field for those objects will be empty. \n Must + be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in + this list will point to this controller, with the controller + field set to true. There cannot be more than one managing controller. + items: properties: apiVersion: description: API version of the referent. type: string - fieldPath: - description: 'If referring to a piece of an object instead - of an entire object, this string should contain a valid - JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container - within a pod, this would take on a value like: "spec.containers{name}" - (where "name" refers to the name of the container that - triggered the event) or if no container name is specified - "spec.containers[2]" (container with index 2 in this pod). - This syntax is chosen only to have some well-defined way - of referencing a part of an object. TODO: this design - is not final and this field is subject to change in the - future.' - type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. + To set this field, a user needs "delete" permission of + the owner, otherwise 422 (Unprocessable Entity) will be + returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - provider: - description: Provider is the name of the cloud-provider - which MachineClass is intended for. - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference - is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' type: string uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' type: string + required: + - apiVersion + - kind + - name + - uid type: object - type: object - type: object - taints: - description: The list of the taints to be applied to the corresponding - Node in additive manner. This list will not overwrite any other taints - added to the Node on an ongoing basis by other entities. These taints - should be actively reconciled e.g. if you ask the machine controller - to apply a taint and then manually remove the taint the machine controller - will put it back) but not have the machine controller remove any taints - items: - properties: - effect: - description: Required. The effect of the taint on pods that do - not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule - and NoExecute. - type: string - key: - description: Required. The taint key to be applied to a node. - type: string - timeAdded: - description: TimeAdded represents the time at which the taint - was added. It is only written for NoExecute taints. - format: date-time - type: string - value: - description: Required. The taint value corresponding to the taint - key. - type: string - required: - - key - - effect + type: array type: object - type: array - versions: - description: Versions of key software to use. This field is optional - at cluster creation time, and omitting the field indicates that the - cluster installation tool should select defaults for the user. These - defaults may differ based on the cluster installer, but the tool should - populate the values it uses when persisting Machine objects. A Machine - spec missing this field at runtime is invalid. - properties: - controlPlane: - description: ControlPlane is the semantic version of the Kubernetes - control plane to run. This should only be populated when the machine - is a control plane. - type: string - kubelet: - description: Kubelet is the semantic version of kubelet to run - type: string - required: - - kubelet - type: object - required: - - providerSpec - type: object - status: - properties: - addresses: - description: Addresses is a list of addresses assigned to the machine. - Queried from cloud provider, if available. - items: + providerID: + description: ProviderID is the identification ID of the machine provided + by the provider. This field must match the provider ID as seen on + the node object corresponding to this machine. This field is required + by higher level consumers of cluster-api. Example use case is cluster + autoscaler with cluster-api as provider. Clean-up logic in the autoscaler + compares machines to nodes to find out machines at provider which + could not get registered as Kubernetes nodes. With cluster-api as + a generic out-of-tree provider for autoscaler, this field is required + by autoscaler to be able to have a provider view of the list of + machines. Another list of nodes is queried from the k8s apiserver + and then a comparison is done to find out unregistered machines + and are marked for delete. This field will be set by the actuators + and consumed by higher level entities like autoscaler that will + be interfacing with cluster-api as generic provider. + type: string + taints: + description: The list of the taints to be applied to the corresponding + Node in additive manner. This list will not overwrite any other + taints added to the Node on an ongoing basis by other entities. + These taints should be actively reconciled e.g. if you ask the machine + controller to apply a taint and then manually remove the taint the + machine controller will put it back) but not have the machine controller + remove any taints + items: + properties: + effect: + description: Required. The effect of the taint on pods that + do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule + and NoExecute. + type: string + key: + description: Required. The taint key to be applied to a node. + type: string + timeAdded: + description: TimeAdded represents the time at which the taint + was added. It is only written for NoExecute taints. + format: date-time + type: string + value: + description: Required. The taint value corresponding to the + taint key. + type: string + required: + - key + - effect + type: object + type: array + version: + description: Version defines the desired Kubernetes version. This + field is meant to be optionally used by bootstrap providers. + type: string + required: + - bootstrap + - infrastructureRef + type: object + status: + properties: + addresses: + description: Addresses is a list of addresses assigned to the machine. + Queried from cloud provider, if available. + items: + properties: + address: + description: The node address. + type: string + type: + description: Node address type, one of Hostname, ExternalIP + or InternalIP. + type: string + required: + - type + - address + type: object + type: array + bootstrap: + description: Bootstrap is the state of the bootstrap provider. + type: string + conditions: + description: 'Conditions lists the conditions synced from the node + conditions of the corresponding node-object. Machine-controller + is responsible for keeping conditions up-to-date. MachineSet controller + will be taking these conditions as a signal to decide if machine + is healthy or needs to be replaced. Refer: https://kubernetes.io/docs/concepts/architecture/nodes/#condition' + items: + properties: + lastHeartbeatTime: + description: Last time we got an update on a given condition. + format: date-time + type: string + lastTransitionTime: + description: Last time the condition transit from one status + to another. + format: date-time + type: string + message: + description: Human readable message indicating details about + last transition. + type: string + reason: + description: (brief) reason for the condition's last transition. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of node condition. + type: string + required: + - type + - status + type: object + type: array + errorMessage: + description: "ErrorMessage will be set in the event that there is + a terminal problem reconciling the Machine and will contain a more + verbose string suitable for logging and human consumption. \n 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. \n Any transient errors that + occur during the reconciliation of Machines can be added as events + to the Machine object and/or logged in the controller's output." + type: string + errorReason: + description: "ErrorReason will be set in the event that there is a + terminal problem reconciling the Machine and will contain a succinct + value suitable for machine interpretation. \n 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. \n Any transient errors that occur + during the reconciliation of Machines can be added as events to + the Machine object and/or logged in the controller's output." + type: string + infrastructure: + description: Infrastructure is the state of the infrastructure provider. + type: string + lastUpdated: + description: LastUpdated identifies when this status was last observed. + format: date-time + type: string + nodeRef: + description: NodeRef will point to the corresponding Node if it exists. properties: - address: - description: The node address. - type: string - type: - description: Node address type, one of Hostname, ExternalIP or - InternalIP. + apiVersion: + description: API version of the referent. type: string - required: - - type - - address - type: object - type: array - conditions: - description: 'Conditions lists the conditions synced from the node conditions - of the corresponding node-object. Machine-controller is responsible - for keeping conditions up-to-date. MachineSet controller will be taking - these conditions as a signal to decide if machine is healthy or needs - to be replaced. Refer: https://kubernetes.io/docs/concepts/architecture/nodes/#condition' - items: - properties: - lastHeartbeatTime: - description: Last time we got an update on a given condition. - format: date-time + fieldPath: + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' type: string - lastTransitionTime: - description: Last time the condition transit from one status to - another. - format: date-time + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string - message: - description: Human readable message indicating details about last - transition. + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string - reason: - description: (brief) reason for the condition's last transition. + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' type: string - status: - description: Status of the condition, one of True, False, Unknown. + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' type: string - type: - description: Type of node condition. + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string - required: - - type - - status type: object - type: array - errorMessage: - description: "ErrorMessage will be set in the event that there is a - terminal problem reconciling the Machine and will contain a more verbose - string suitable for logging and human consumption. \n 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. \n Any transient errors that occur during the reconciliation - of Machines can be added as events to the Machine object and/or logged - in the controller's output." - type: string - errorReason: - description: "ErrorReason will be set in the event that there is a terminal - problem reconciling the Machine and will contain a succinct value - suitable for machine interpretation. \n 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. - \n Any transient errors that occur during the reconciliation of Machines - can be added as events to the Machine object and/or logged in the - controller's output." - type: string - lastOperation: - description: LastOperation describes the last-operation performed by - the machine-controller. This API should be useful as a history in - terms of the latest operation performed on the specific machine. It - should also convey the state of the latest-operation for example if - it is still on-going, failed or completed successfully. - properties: - description: - description: Description is the human-readable description of the - last operation. - type: string - lastUpdated: - description: LastUpdated is the timestamp at which LastOperation - API was last-updated. - format: date-time - type: string - state: - description: State is the current status of the last performed operation. - E.g. Processing, Failed, Successful etc - type: string - type: - description: Type is the type of operation which was last performed. - E.g. Create, Delete, Update etc - type: string - type: object - lastUpdated: - description: LastUpdated identifies when this status was last observed. - format: date-time - type: string - nodeRef: - description: NodeRef will point to the corresponding Node if it exists. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of an - entire object, this string should contain a valid JSON/Go field - access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within - a pod, this would take on a value like: "spec.containers{name}" - (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" - (container with index 2 in this pod). This syntax is chosen only - to have some well-defined way of referencing a part of an object. - TODO: this design is not final and this field is subject to change - in the future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference is - made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' - type: string - type: object - phase: - description: Phase represents the current phase of machine actuation. - E.g. Pending, Running, Terminating, Failed etc. - type: string - providerStatus: - description: ProviderStatus details a Provider-specific status. It is - recommended that providers maintain their own versioned API types - that should be serialized/deserialized from this field. - type: object - versions: - description: "Versions specifies the current versions of software on - the corresponding Node (if it exists). This is provided for a few - reasons: \n 1) It is more convenient than checking the NodeRef, traversing - it to the Node, and finding the appropriate field in Node.Status.NodeInfo - \ (which uses different field names and formatting). 2) It removes - some of the dependency on the structure of the Node, so that if - the structure of Node.Status.NodeInfo changes, only machine controllers - need to be updated, rather than every client of the Machines API. - 3) There is no other simple way to check the control plane version. - A client would have to connect directly to the apiserver running - on the target node in order to find out its version." - properties: - controlPlane: - description: ControlPlane is the semantic version of the Kubernetes - control plane to run. This should only be populated when the machine - is a control plane. - type: string - kubelet: - description: Kubelet is the semantic version of kubelet to run - type: string - required: - - kubelet - type: object - type: object - type: object - versions: - - name: v1alpha1 + phase: + description: Phase represents the current phase of machine actuation. + E.g. Pending, Running, Terminating, Failed etc. + type: string + providerStatus: + description: ProviderStatus details a Provider-specific status. It + is recommended that providers maintain their own versioned API types + that should be serialized/deserialized from this field. + type: object + version: + description: Version specifies the current version of Kubernetes running + on the corresponding Node. This is meant to be a means of bubbling + up status from the Node to the Machine. It is entirely optional, + but useful for end-user UX if it’s present. + type: string + type: object + type: object served: true storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/config/crds/cluster.k8s.io_machinesets.yaml b/config/crds/cluster.k8s.io_machinesets.yaml index 2bb56c35e784..d441fe15912f 100644 --- a/config/crds/cluster.k8s.io_machinesets.yaml +++ b/config/crds/cluster.k8s.io_machinesets.yaml @@ -13,884 +13,1765 @@ spec: shortNames: - ms scope: Namespaced - subresources: - scale: - labelSelectorPath: .status.labelSelector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} - validation: - openAPIV3Schema: - description: / [MachineSet] MachineSet ensures that a specified number of machines - replicas are running at any given time. - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - properties: - annotations: - additionalProperties: + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: / [MachineSet] MachineSet ensures that a specified number of + machines replicas are running at any given time. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored + with a resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object belongs to. + This is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right now + and apiserver is going to ignore it if set in create or update request. type: string - description: 'Annotations is an unstructured key value map stored with - a resource that may be set by external tools to store and retrieve - arbitrary metadata. They are not queryable and should be preserved - when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' - type: object - clusterName: - description: The name of the cluster which the object belongs to. This - is used to distinguish resources with same name and namespace in different - clusters. This field is not set anywhere right now and apiserver is - going to ignore it if set in create or update request. - type: string - creationTimestamp: - description: "CreationTimestamp is a timestamp representing the server - time when this object was created. It is not guaranteed to be set - in happens-before order across separate operations. Clients may not - set this value. It is represented in RFC3339 form and is in UTC. \n - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - deletionGracePeriodSeconds: - description: Number of seconds allowed for this object to gracefully - terminate before it will be removed from the system. Only set when - deletionTimestamp is also set. May only be shortened. Read-only. - format: int64 - type: integer - deletionTimestamp: - description: "DeletionTimestamp is RFC 3339 date and time at which this - resource will be deleted. This field is set by the server when a graceful - deletion is requested by the user, and is not directly settable by - a client. The resource is expected to be deleted (no longer visible - from resource lists, and not reachable by name) after the time in - this field, once the finalizers list is empty. As long as the finalizers - list contains items, deletion is blocked. Once the deletionTimestamp - is set, this value may not be unset or be set further into the future, - although it may be shortened or the resource may be deleted prior - to this time. For example, a user may request that a pod is deleted - in 30 seconds. The Kubelet will react by sending a graceful termination - signal to the containers in the pod. After that 30 seconds, the Kubelet - will send a hard termination signal (SIGKILL) to the container and - after cleanup, remove the pod from the API. In the presence of network - partitions, this object may still exist after this timestamp, until - an administrator or automated process can determine the resource is - fully terminated. If not set, graceful deletion of the object has - not been requested. \n Populated by the system when a graceful deletion - is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" - format: date-time - type: string - finalizers: - description: Must be empty before the object is deleted from the registry. - Each entry is an identifier for the responsible component that will - remove the entry from the list. If the deletionTimestamp of the object - is non-nil, entries in this list can only be removed. - items: + creationTimestamp: + description: "CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients may + not set this value. It is represented in RFC3339 form and is in + UTC. \n Populated by the system. Read-only. Null for lists. More + info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time type: string - type: array - generateName: - description: "GenerateName is an optional prefix, used by the server, - to generate a unique name ONLY IF the Name field has not been provided. - If this field is used, the name returned to the client will be different - than the name passed. This value will also be combined with a unique - suffix. The provided value has the same validation rules as the Name - field, and may be truncated by the length of the suffix required to - make the value unique on the server. \n If this field is specified - and the generated name exists, the server will NOT return a 409 - - instead, it will either return 201 Created or 500 with Reason ServerTimeout - indicating a unique name could not be found in the time allotted, - and the client should retry (optionally after the time indicated in - the Retry-After header). \n Applied only if Name is not specified. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - type: string - generation: - description: A sequence number representing a specific generation of - the desired state. Populated by the system. Read-only. - format: int64 - type: integer - initializers: - description: "An initializer is a controller which enforces some system - invariant at object creation time. This field is a list of initializers - that have not yet acted on this object. If nil or empty, this object - has been completely initialized. Otherwise, the object is considered - uninitialized and is hidden (in list/watch and get calls) from clients - that haven't explicitly asked to observe uninitialized objects. \n - When an object is created, the system will populate this list with - the current set of initializers. Only privileged users may set or - modify this list. Once it is empty, it may not be modified further - by any user. \n DEPRECATED - initializers are an alpha field and will - be removed in v1.15." - properties: - pending: - description: Pending is a list of initializers that must execute - in order before this object is visible. When the last pending - initializer is removed, and no failing result is set, the initializers - struct will be set to nil and the object is considered as initialized - and visible to all clients. - items: + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only set when + deletionTimestamp is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time at which + this resource will be deleted. This field is set by the server when + a graceful deletion is requested by the user, and is not directly + settable by a client. The resource is expected to be deleted (no + longer visible from resource lists, and not reachable by name) after + the time in this field, once the finalizers list is empty. As long + as the finalizers list contains items, deletion is blocked. Once + the deletionTimestamp is set, this value may not be unset or be + set further into the future, although it may be shortened or the + resource may be deleted prior to this time. For example, a user + may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + \n Populated by the system when a graceful deletion is requested. + Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + finalizers: + description: Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that will + remove the entry from the list. If the deletionTimestamp of the + object is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not been provided. + If this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a unique + suffix. The provided value has the same validation rules as the + Name field, and may be truncated by the length of the suffix required + to make the value unique on the server. \n If this field is specified + and the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the + time indicated in the Retry-After header). \n Applied only if Name + is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific generation + of the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces some system + invariant at object creation time. This field is a list of initializers + that have not yet acted on this object. If nil or empty, this object + has been completely initialized. Otherwise, the object is considered + uninitialized and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. + \n When an object is created, the system will populate this list + with the current set of initializers. Only privileged users may + set or modify this list. Once it is empty, it may not be modified + further by any user. \n DEPRECATED - initializers are an alpha field + and will be removed in v1.15." + properties: + pending: + description: Pending is a list of initializers that must execute + in order before this object is visible. When the last pending + initializer is removed, and no failing result is set, the initializers + struct will be set to nil and the object is considered as initialized + and visible to all clients. + items: + properties: + name: + description: name of the process that is responsible for + initializing this object. + type: string + required: + - name + type: object + type: array + result: + description: If result is set with the Failure field, the object + will be persisted to storage and then deleted, ensuring that + other clients can observe the deletion. properties: - name: - description: name of the process that is responsible for initializing - this object. + apiVersion: + description: 'APIVersion defines the versioned schema of this + representation of an object. Servers should convert recognized + schemas to the latest internal value, and may reject unrecognized + values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + code: + description: Suggested HTTP return code for this status, 0 + if not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This field is + optional and the data returned is not guaranteed to conform + to any schema except that defined by the reason type. + properties: + causes: + description: The Causes array includes more details associated + with the StatusReason failure. Not all StatusReasons + may provide detailed causes. + items: + properties: + field: + description: "The field of the resource that has + caused this error, as named by its JSON serialization. + May include dot and postfix notation for nested + attributes. Arrays are zero-indexed. Fields may + appear more than once in an array of causes due + to fields having multiple errors. Optional. \n + Examples: \"name\" - the field \"name\" on the + current resource \"items[0].name\" - the field + \"name\" on the first array entry in \"items\"" + type: string + message: + description: A human-readable description of the + cause of the error. This field may be presented + as-is to a reader. + type: string + reason: + description: A machine-readable description of the + cause of the error. If this value is empty there + is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource associated + with the status StatusReason. + type: string + kind: + description: 'The kind attribute of the resource associated + with the status StatusReason. On some operations may + differ from the requested resource Kind. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: The name attribute of the resource associated + with the status StatusReason (when there is a single + name which can be described). + type: string + retryAfterSeconds: + description: If specified, the time in seconds before + the operation should be retried. Some errors may indicate + the client must take an alternate action - for those + errors this field may indicate how long to wait before + taking the alternate action. + format: int32 + type: integer + uid: + description: 'UID of the resource. (when there is a single + resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + type: object + kind: + description: 'Kind is a string value representing the REST + resource this object represents. Servers may infer this + from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status of + this operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set a limit + on the number of items returned, and indicates that + the server has more data available. The value is opaque + and may be used to issue another request to the endpoint + that served this list to retrieve the next set of available + objects. Continuing a consistent list may not be possible + if the server configuration has changed or more than + a few minutes have passed. The resourceVersion field + returned when using this continue value will be identical + to the value in the first response, unless you have + received this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s internal + version of this object that can be used by clients to + determine when objects have changed. Value must be treated + as opaque by clients and passed unmodified back to the + server. Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why this operation + is in the "Failure" status. If this value is empty there + is no information available. A Reason clarifies an HTTP + status code but does not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" or + "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' type: string - required: - - name type: object - type: array - result: - description: If result is set with the Failure field, the object - will be persisted to storage and then deleted, ensuring that other - clients can observe the deletion. + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors of + replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + managedFields: + description: "ManagedFields maps workflow-id and version to the set + of fields that are managed by that workflow. This is mostly for + internal housekeeping, and users typically shouldn't need to set + or understand this field. A workflow can be the user's name, a controller's + name, or the name of a specific apply path like \"ci-cd\". The set + of fields is always in the version that the workflow used when modifying + the object. \n This field is alpha and can be changed or removed + without notice." + items: properties: apiVersion: - description: 'APIVersion defines the versioned schema of this - representation of an object. Servers should convert recognized - schemas to the latest internal value, and may reject unrecognized - values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + description: APIVersion defines the version of this resource + that this field set applies to. The format is "group/version" + just like the top-level APIVersion field. It is necessary + to track the version of a field set because it cannot be automatically + converted. type: string - code: - description: Suggested HTTP return code for this status, 0 if - not set. - format: int32 - type: integer - details: - description: Extended data associated with the reason. Each - reason may define its own extended details. This field is - optional and the data returned is not guaranteed to conform - to any schema except that defined by the reason type. - properties: - causes: - description: The Causes array includes more details associated - with the StatusReason failure. Not all StatusReasons may - provide detailed causes. - items: - properties: - field: - description: "The field of the resource that has caused - this error, as named by its JSON serialization. - May include dot and postfix notation for nested - attributes. Arrays are zero-indexed. Fields may - appear more than once in an array of causes due - to fields having multiple errors. Optional. \n Examples: - \ \"name\" - the field \"name\" on the current - resource \"items[0].name\" - the field \"name\" - on the first array entry in \"items\"" - type: string - message: - description: A human-readable description of the cause - of the error. This field may be presented as-is - to a reader. - type: string - reason: - description: A machine-readable description of the - cause of the error. If this value is empty there - is no information available. - type: string - type: object - type: array - group: - description: The group attribute of the resource associated - with the status StatusReason. - type: string - kind: - description: 'The kind attribute of the resource associated - with the status StatusReason. On some operations may differ - from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: The name attribute of the resource associated - with the status StatusReason (when there is a single name - which can be described). - type: string - retryAfterSeconds: - description: If specified, the time in seconds before the - operation should be retried. Some errors may indicate - the client must take an alternate action - for those errors - this field may indicate how long to wait before taking - the alternate action. - format: int32 - type: integer - uid: - description: 'UID of the resource. (when there is a single - resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string + fields: + additionalProperties: true + description: Fields identifies a set of fields. type: object + manager: + description: Manager is an identifier of the workflow managing + these fields. + type: string + operation: + description: Operation is the type of operation which lead to + this ManagedFieldsEntry being created. The only valid values + for this field are 'Apply' and 'Update'. + type: string + time: + description: Time is timestamp of when these fields were set. + It should always be empty if Operation is 'Apply' + format: date-time + type: string + type: object + type: array + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow a client + to request the generation of an appropriate name automatically. + Name is primarily intended for creation idempotence and configuration + definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must be + unique. An empty namespace is equivalent to the \"default\" namespace, + but \"default\" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. Cannot + be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field set + to true. There cannot be more than one managing controller. + items: + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. + To set this field, a user needs "delete" permission of the + owner, otherwise 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean kind: - description: 'Kind is a string value representing the REST resource - this object represents. Servers may infer this from the endpoint - the client submits requests to. Cannot be updated. In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string - message: - description: A human-readable description of the status of this - operation. + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' type: string - metadata: - description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + resourceVersion: + description: "An opaque value that represents the internal version + of this object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. \n Populated by the system. Read-only. Value must + be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. \n Populated + by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + spec: + properties: + deletePolicy: + description: DeletePolicy defines the policy used to identify nodes + to delete when downscaling. Defaults to "Random". Valid values + are "Random, "Newest", "Oldest" + enum: + - Random + - Newest + - Oldest + type: string + minReadySeconds: + description: MinReadySeconds is the minimum number of seconds for + which a newly created machine should be ready. Defaults to 0 (machine + will be considered available as soon as it is ready) + format: int32 + type: integer + replicas: + description: Replicas is the number of desired replicas. This is a + pointer to distinguish between explicit zero and unspecified. Defaults + to 1. + format: int32 + type: integer + selector: + description: 'Selector is a label query over machines that should + match the replica count. Label keys and values that must match in + order to be controlled by this MachineSet. It must match the machine + template''s labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors' + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: properties: - continue: - description: continue may be set if the user set a limit - on the number of items returned, and indicates that the - server has more data available. The value is opaque and - may be used to issue another request to the endpoint that - served this list to retrieve the next set of available - objects. Continuing a consistent list may not be possible - if the server configuration has changed or more than a - few minutes have passed. The resourceVersion field returned - when using this continue value will be identical to the - value in the first response, unless you have received - this token from an error message. + key: + description: key is the label key that the selector applies + to. type: string - resourceVersion: - description: 'String that identifies the server''s internal - version of this object that can be used by clients to - determine when objects have changed. Value must be treated - as opaque by clients and passed unmodified back to the - server. Populated by the system. Read-only. More info: - https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' - type: string - selfLink: - description: selfLink is a URL representing this object. - Populated by the system. Read-only. + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator type: object - reason: - description: A machine-readable description of why this operation - is in the "Failure" status. If this value is empty there is - no information available. A Reason clarifies an HTTP status - code but does not override it. + type: array + matchLabels: + additionalProperties: type: string - status: - description: 'Status of the operation. One of: "Success" or - "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' - type: string - type: object - required: - - pending - type: object - labels: - additionalProperties: - type: string - description: 'Map of string keys and values that can be used to organize - and categorize (scope and select) objects. May match selectors of - replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' - type: object - managedFields: - description: "ManagedFields maps workflow-id and version to the set - of fields that are managed by that workflow. This is mostly for internal - housekeeping, and users typically shouldn't need to set or understand - this field. A workflow can be the user's name, a controller's name, - or the name of a specific apply path like \"ci-cd\". The set of fields - is always in the version that the workflow used when modifying the - object. \n This field is alpha and can be changed or removed without - notice." - items: - properties: - apiVersion: - description: APIVersion defines the version of this resource that - this field set applies to. The format is "group/version" just - like the top-level APIVersion field. It is necessary to track - the version of a field set because it cannot be automatically - converted. - type: string - fields: - additionalProperties: true - description: Fields identifies a set of fields. + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. type: object - manager: - description: Manager is an identifier of the workflow managing - these fields. - type: string - operation: - description: Operation is the type of operation which lead to - this ManagedFieldsEntry being created. The only valid values - for this field are 'Apply' and 'Update'. - type: string - time: - description: Time is timestamp of when these fields were set. - It should always be empty if Operation is 'Apply' - format: date-time - type: string type: object - type: array - name: - description: 'Name must be unique within a namespace. Is required when - creating resources, although some resources may allow a client to - request the generation of an appropriate name automatically. Name - is primarily intended for creation idempotence and configuration definition. - Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - namespace: - description: "Namespace defines the space within each name must be unique. - An empty namespace is equivalent to the \"default\" namespace, but - \"default\" is the canonical representation. Not all objects are required - to be scoped to a namespace - the value of this field for those objects - will be empty. \n Must be a DNS_LABEL. Cannot be updated. More info: - http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: List of objects depended by this object. If ALL objects - in the list have been deleted, this object will be garbage collected. - If this object is managed by a controller, then an entry in this list - will point to this controller, with the controller field set to true. - There cannot be more than one managing controller. - items: + template: + description: Template is the object that describes the machine that + will be created if insufficient replicas are detected. properties: - apiVersion: - description: API version of the referent. - type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" - finalizer, then the owner cannot be deleted from the key-value - store until this reference is removed. Defaults to false. To - set this field, a user needs "delete" permission of the owner, - otherwise 422 (Unprocessable Entity) will be returned. - type: boolean - controller: - description: If true, this reference points to the managing controller. - type: boolean - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' - type: string - required: - - apiVersion - - kind - - name - - uid - type: object - type: array - resourceVersion: - description: "An opaque value that represents the internal version of - this object that can be used by clients to determine when objects - have changed. May be used for optimistic concurrency, change detection, - and the watch operation on a resource or set of resources. Clients - must treat these values as opaque and passed unmodified back to the - server. They may only be valid for a particular resource or set of - resources. \n Populated by the system. Read-only. Value must be treated - as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" - type: string - selfLink: - description: SelfLink is a URL representing this object. Populated by - the system. Read-only. - type: string - uid: - description: "UID is the unique in time and space value for this object. - It is typically generated by the server on successful creation of - a resource and is not allowed to change on PUT operations. \n Populated - by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" - type: string - type: object - spec: - properties: - deletePolicy: - description: DeletePolicy defines the policy used to identify nodes - to delete when downscaling. Defaults to "Random". Valid values are - "Random, "Newest", "Oldest" - enum: - - Random - - Newest - - Oldest - type: string - minReadySeconds: - description: MinReadySeconds is the minimum number of seconds for which - a newly created machine should be ready. Defaults to 0 (machine will - be considered available as soon as it is ready) - format: int32 - type: integer - replicas: - description: Replicas is the number of desired replicas. This is a pointer - to distinguish between explicit zero and unspecified. Defaults to - 1. - format: int32 - type: integer - selector: - description: 'Selector is a label query over machines that should match - the replica count. Label keys and values that must match in order - to be controlled by this MachineSet. It must match the machine template''s - labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors' - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. - items: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' properties: - key: - description: key is the label key that the selector applies - to. + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map + stored with a resource that may be set by external tools + to store and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. More info: + http://kubernetes.io/docs/user-guide/annotations' + type: object + generateName: + description: "GenerateName is an optional prefix, used by + the server, to generate a unique name ONLY IF the Name field + has not been provided. If this field is used, the name returned + to the client will be different than the name passed. This + value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and + may be truncated by the length of the suffix required to + make the value unique on the server. \n If this field is + specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created + or 500 with Reason ServerTimeout indicating a unique name + could not be found in the time allotted, and the client + should retry (optionally after the time indicated in the + Retry-After header). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used + to organize and categorize (scope and select) objects. May + match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow + a client to request the generation of an appropriate name + automatically. Name is primarily intended for creation idempotence + and configuration definition. Cannot be updated. More info: + http://kubernetes.io/docs/user-guide/identifiers#names' type: string - operator: - description: operator represents a key's relationship to a - set of values. Valid operators are In, NotIn, Exists and - DoesNotExist. + namespace: + description: "Namespace defines the space within each name + must be unique. An empty namespace is equivalent to the + \"default\" namespace, but \"default\" is the canonical + representation. Not all objects are required to be scoped + to a namespace - the value of this field for those objects + will be empty. \n Must be a DNS_LABEL. Cannot be updated. + More info: http://kubernetes.io/docs/user-guide/namespaces" type: string - values: - description: values is an array of string values. If the operator - is In or NotIn, the values array must be non-empty. If the - operator is Exists or DoesNotExist, the values array must - be empty. This array is replaced during a strategic merge - patch. + ownerReferences: + description: List of objects depended by this object. If ALL + objects in the list have been deleted, this object will + be garbage collected. If this object is managed by a controller, + then an entry in this list will point to this controller, + with the controller field set to true. There cannot be more + than one managing controller. items: - type: string + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the + key-value store until this reference is removed. Defaults + to false. To set this field, a user needs "delete" + permission of the owner, otherwise 422 (Unprocessable + Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object type: array - required: - - key - - operator type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. A single - {key,value} in the matchLabels map is equivalent to an element - of matchExpressions, whose key field is "key", the operator is - "In", and the values array contains only "value". The requirements - are ANDed. - type: object - type: object - template: - description: Template is the object that describes the machine that - will be created if insufficient replicas are detected. - properties: - metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' - properties: - annotations: - additionalProperties: + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + properties: + configSource: + description: ConfigSource is used to populate in the associated + Node for dynamic kubelet config. This field already exists + in Node, so any updates to it in the Machine spec will be + automatically copied to the linked NodeRef from the status. + The rest of dynamic kubelet config support should then work + as-is. + properties: + configMap: + description: ConfigMap is a reference to a Node's ConfigMap + properties: + kubeletConfigKey: + description: KubeletConfigKey declares which key of + the referenced ConfigMap corresponds to the KubeletConfiguration + structure This field is required in all cases. + type: string + name: + description: Name is the metadata.name of the referenced + ConfigMap. This field is required in all cases. + type: string + namespace: + description: Namespace is the metadata.namespace of + the referenced ConfigMap. This field is required + in all cases. + type: string + resourceVersion: + description: ResourceVersion is the metadata.ResourceVersion + of the referenced ConfigMap. This field is forbidden + in Node.Spec, and required in Node.Status. + type: string + uid: + description: UID is the metadata.UID of the referenced + ConfigMap. This field is forbidden in Node.Spec, + and required in Node.Status. + type: string + required: + - namespace + - name + - kubeletConfigKey + type: object + type: object + metadata: + description: ObjectMeta will autopopulate the Node created. + Use this to indicate what labels, annotations, name prefix, + etc., should be used when creating the Node. + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value + map stored with a resource that may be set by external + tools to store and retrieve arbitrary metadata. They + are not queryable and should be preserved when modifying + objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + generateName: + description: "GenerateName is an optional prefix, used + by the server, to generate a unique name ONLY IF the + Name field has not been provided. If this field is used, + the name returned to the client will be different than + the name passed. This value will also be combined with + a unique suffix. The provided value has the same validation + rules as the Name field, and may be truncated by the + length of the suffix required to make the value unique + on the server. \n If this field is specified and the + generated name exists, the server will NOT return a + 409 - instead, it will either return 201 Created or + 500 with Reason ServerTimeout indicating a unique name + could not be found in the time allotted, and the client + should retry (optionally after the time indicated in + the Retry-After header). \n Applied only if Name is + not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be + used to organize and categorize (scope and select) objects. + May match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + name: + description: 'Name must be unique within a namespace. + Is required when creating resources, although some resources + may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be + updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each + name must be unique. An empty namespace is equivalent + to the \"default\" namespace, but \"default\" is the + canonical representation. Not all objects are required + to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. + Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. + If ALL objects in the list have been deleted, this object + will be garbage collected. If this object is managed + by a controller, then an entry in this list will point + to this controller, with the controller field set to + true. There cannot be more than one managing controller. + items: + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from + the key-value store until this reference is removed. + Defaults to false. To set this field, a user needs + "delete" permission of the owner, otherwise 422 + (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the + managing controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + type: object + providerID: + description: ProviderID is the identification ID of the machine + provided by the provider. This field must match the provider + ID as seen on the node object corresponding to this machine. + This field is required by higher level consumers of cluster-api. + Example use case is cluster autoscaler with cluster-api + as provider. Clean-up logic in the autoscaler compares machines + to nodes to find out machines at provider which could not + get registered as Kubernetes nodes. With cluster-api as + a generic out-of-tree provider for autoscaler, this field + is required by autoscaler to be able to have a provider + view of the list of machines. Another list of nodes is queried + from the k8s apiserver and then a comparison is done to + find out unregistered machines and are marked for delete. + This field will be set by the actuators and consumed by + higher level entities like autoscaler that will be interfacing + with cluster-api as generic provider. type: string - description: 'Annotations is an unstructured key value map stored - with a resource that may be set by external tools to store - and retrieve arbitrary metadata. They are not queryable and - should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + providerSpec: + description: ProviderSpec details Provider-specific configuration + to use during node creation. + properties: + value: + description: Value is an inlined, serialized representation + of the resource configuration. It is recommended that + providers maintain their own versioned API types that + should be serialized/deserialized from this field, akin + to component config. + type: object + valueFrom: + description: Source for the provider configuration. Cannot + be used if value is not empty. + properties: + machineClass: + description: The machine class from which the provider + config should be sourced. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object + instead of an entire object, this string should + contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. + For example, if the object reference is to a + container within a pod, this would take on a + value like: "spec.containers{name}" (where "name" + refers to the name of the container that triggered + the event) or if no container name is specified + "spec.containers[2]" (container with index 2 + in this pod). This syntax is chosen only to + have some well-defined way of referencing a + part of an object. TODO: this design is not + final and this field is subject to change in + the future.' + type: string + kind: + description: 'Kind of the referent. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + provider: + description: Provider is the name of the cloud-provider + which MachineClass is intended for. + type: string + resourceVersion: + description: 'Specific resourceVersion to which + this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + type: object + type: object + taints: + description: The list of the taints to be applied to the corresponding + Node in additive manner. This list will not overwrite any + other taints added to the Node on an ongoing basis by other + entities. These taints should be actively reconciled e.g. + if you ask the machine controller to apply a taint and then + manually remove the taint the machine controller will put + it back) but not have the machine controller remove any + taints + items: + properties: + effect: + description: Required. The effect of the taint on pods + that do not tolerate the taint. Valid effects are + NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Required. The taint key to be applied to + a node. + type: string + timeAdded: + description: TimeAdded represents the time at which + the taint was added. It is only written for NoExecute + taints. + format: date-time + type: string + value: + description: Required. The taint value corresponding + to the taint key. + type: string + required: + - key + - effect + type: object + type: array + versions: + description: Versions of key software to use. This field is + optional at cluster creation time, and omitting the field + indicates that the cluster installation tool should select + defaults for the user. These defaults may differ based on + the cluster installer, but the tool should populate the + values it uses when persisting Machine objects. A Machine + spec missing this field at runtime is invalid. + properties: + controlPlane: + description: ControlPlane is the semantic version of the + Kubernetes control plane to run. This should only be + populated when the machine is a control plane. + type: string + kubelet: + description: Kubelet is the semantic version of kubelet + to run + type: string + required: + - kubelet + type: object + required: + - providerSpec + type: object + type: object + required: + - selector + type: object + status: + properties: + availableReplicas: + description: The number of available replicas (ready for at least + minReadySeconds) for this MachineSet. + format: int32 + type: integer + errorMessage: + type: string + errorReason: + description: "In the event that there is a terminal problem reconciling + the replicas, both ErrorReason and ErrorMessage will be set. ErrorReason + will be populated with a succinct value suitable for machine interpretation, + while ErrorMessage will contain a more verbose string suitable for + logging and human consumption. \n 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. \n Any transient + errors that occur during the reconciliation of Machines can be added + as events to the MachineSet object and/or logged in the controller's + output." + type: string + fullyLabeledReplicas: + description: The number of replicas that have labels matching the + labels of the machine template of the MachineSet. + format: int32 + type: integer + observedGeneration: + description: ObservedGeneration reflects the generation of the most + recently observed MachineSet. + format: int64 + type: integer + readyReplicas: + description: The number of ready replicas for this MachineSet. A machine + is considered ready when the node has been created and is "Ready". + format: int32 + type: integer + replicas: + description: Replicas is the most recently observed number of replicas. + format: int32 + type: integer + required: + - replicas + type: object + type: object + served: true + storage: false + subresources: + scale: + labelSelectorPath: .status.labelSelector + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} + - name: v1alpha2 + schema: + openAPIV3Schema: + description: / [MachineSet] MachineSet ensures that a specified number of + machines replicas are running at any given time. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored + with a resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object belongs to. + This is used to distinguish resources with same name and namespace + in different clusters. This field is not set anywhere right now + and apiserver is going to ignore it if set in create or update request. + type: string + creationTimestamp: + description: "CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients may + not set this value. It is represented in RFC3339 form and is in + UTC. \n Populated by the system. Read-only. Null for lists. More + info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only set when + deletionTimestamp is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time at which + this resource will be deleted. This field is set by the server when + a graceful deletion is requested by the user, and is not directly + settable by a client. The resource is expected to be deleted (no + longer visible from resource lists, and not reachable by name) after + the time in this field, once the finalizers list is empty. As long + as the finalizers list contains items, deletion is blocked. Once + the deletionTimestamp is set, this value may not be unset or be + set further into the future, although it may be shortened or the + resource may be deleted prior to this time. For example, a user + may request that a pod is deleted in 30 seconds. The Kubelet will + react by sending a graceful termination signal to the containers + in the pod. After that 30 seconds, the Kubelet will send a hard + termination signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of network partitions, + this object may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully terminated. + If not set, graceful deletion of the object has not been requested. + \n Populated by the system when a graceful deletion is requested. + Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + finalizers: + description: Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that will + remove the entry from the list. If the deletionTimestamp of the + object is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not been provided. + If this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a unique + suffix. The provided value has the same validation rules as the + Name field, and may be truncated by the length of the suffix required + to make the value unique on the server. \n If this field is specified + and the generated name exists, the server will NOT return a 409 + - instead, it will either return 201 Created or 500 with Reason + ServerTimeout indicating a unique name could not be found in the + time allotted, and the client should retry (optionally after the + time indicated in the Retry-After header). \n Applied only if Name + is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific generation + of the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces some system + invariant at object creation time. This field is a list of initializers + that have not yet acted on this object. If nil or empty, this object + has been completely initialized. Otherwise, the object is considered + uninitialized and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. + \n When an object is created, the system will populate this list + with the current set of initializers. Only privileged users may + set or modify this list. Once it is empty, it may not be modified + further by any user. \n DEPRECATED - initializers are an alpha field + and will be removed in v1.15." + properties: + pending: + description: Pending is a list of initializers that must execute + in order before this object is visible. When the last pending + initializer is removed, and no failing result is set, the initializers + struct will be set to nil and the object is considered as initialized + and visible to all clients. + items: + properties: + name: + description: name of the process that is responsible for + initializing this object. + type: string + required: + - name type: object - generateName: - description: "GenerateName is an optional prefix, used by the - server, to generate a unique name ONLY IF the Name field has - not been provided. If this field is used, the name returned - to the client will be different than the name passed. This - value will also be combined with a unique suffix. The provided - value has the same validation rules as the Name field, and - may be truncated by the length of the suffix required to make - the value unique on the server. \n If this field is specified - and the generated name exists, the server will NOT return - a 409 - instead, it will either return 201 Created or 500 - with Reason ServerTimeout indicating a unique name could not - be found in the time allotted, and the client should retry - (optionally after the time indicated in the Retry-After header). - \n Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - type: string - labels: - additionalProperties: + type: array + result: + description: If result is set with the Failure field, the object + will be persisted to storage and then deleted, ensuring that + other clients can observe the deletion. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this + representation of an object. Servers should convert recognized + schemas to the latest internal value, and may reject unrecognized + values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' type: string - description: 'Map of string keys and values that can be used - to organize and categorize (scope and select) objects. May - match selectors of replication controllers and services. More - info: http://kubernetes.io/docs/user-guide/labels' - type: object - name: - description: 'Name must be unique within a namespace. Is required - when creating resources, although some resources may allow - a client to request the generation of an appropriate name - automatically. Name is primarily intended for creation idempotence - and configuration definition. Cannot be updated. More info: - http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - namespace: - description: "Namespace defines the space within each name must - be unique. An empty namespace is equivalent to the \"default\" - namespace, but \"default\" is the canonical representation. - Not all objects are required to be scoped to a namespace - - the value of this field for those objects will be empty. \n - Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: List of objects depended by this object. If ALL - objects in the list have been deleted, this object will be - garbage collected. If this object is managed by a controller, - then an entry in this list will point to this controller, - with the controller field set to true. There cannot be more - than one managing controller. - items: + code: + description: Suggested HTTP return code for this status, 0 + if not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This field is + optional and the data returned is not guaranteed to conform + to any schema except that defined by the reason type. properties: - apiVersion: - description: API version of the referent. + causes: + description: The Causes array includes more details associated + with the StatusReason failure. Not all StatusReasons + may provide detailed causes. + items: + properties: + field: + description: "The field of the resource that has + caused this error, as named by its JSON serialization. + May include dot and postfix notation for nested + attributes. Arrays are zero-indexed. Fields may + appear more than once in an array of causes due + to fields having multiple errors. Optional. \n + Examples: \"name\" - the field \"name\" on the + current resource \"items[0].name\" - the field + \"name\" on the first array entry in \"items\"" + type: string + message: + description: A human-readable description of the + cause of the error. This field may be presented + as-is to a reader. + type: string + reason: + description: A machine-readable description of the + cause of the error. If this value is empty there + is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource associated + with the status StatusReason. type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" - finalizer, then the owner cannot be deleted from the - key-value store until this reference is removed. Defaults - to false. To set this field, a user needs "delete" permission - of the owner, otherwise 422 (Unprocessable Entity) will - be returned. - type: boolean - controller: - description: If true, this reference points to the managing - controller. - type: boolean kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + description: 'The kind attribute of the resource associated + with the status StatusReason. On some operations may + differ from the requested resource Kind. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + description: The name attribute of the resource associated + with the status StatusReason (when there is a single + name which can be described). type: string + retryAfterSeconds: + description: If specified, the time in seconds before + the operation should be retried. Some errors may indicate + the client must take an alternate action - for those + errors this field may indicate how long to wait before + taking the alternate action. + format: int32 + type: integer uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + description: 'UID of the resource. (when there is a single + resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' type: string - required: - - apiVersion - - kind - - name - - uid type: object - type: array + kind: + description: 'Kind is a string value representing the REST + resource this object represents. Servers may infer this + from the endpoint the client submits requests to. Cannot + be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status of + this operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set a limit + on the number of items returned, and indicates that + the server has more data available. The value is opaque + and may be used to issue another request to the endpoint + that served this list to retrieve the next set of available + objects. Continuing a consistent list may not be possible + if the server configuration has changed or more than + a few minutes have passed. The resourceVersion field + returned when using this continue value will be identical + to the value in the first response, unless you have + received this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s internal + version of this object that can be used by clients to + determine when objects have changed. Value must be treated + as opaque by clients and passed unmodified back to the + server. Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why this operation + is in the "Failure" status. If this value is empty there + is no information available. A Reason clarifies an HTTP + status code but does not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" or + "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: string + type: object + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors of + replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + managedFields: + description: "ManagedFields maps workflow-id and version to the set + of fields that are managed by that workflow. This is mostly for + internal housekeeping, and users typically shouldn't need to set + or understand this field. A workflow can be the user's name, a controller's + name, or the name of a specific apply path like \"ci-cd\". The set + of fields is always in the version that the workflow used when modifying + the object. \n This field is alpha and can be changed or removed + without notice." + items: + properties: + apiVersion: + description: APIVersion defines the version of this resource + that this field set applies to. The format is "group/version" + just like the top-level APIVersion field. It is necessary + to track the version of a field set because it cannot be automatically + converted. + type: string + fields: + additionalProperties: true + description: Fields identifies a set of fields. + type: object + manager: + description: Manager is an identifier of the workflow managing + these fields. + type: string + operation: + description: Operation is the type of operation which lead to + this ManagedFieldsEntry being created. The only valid values + for this field are 'Apply' and 'Update'. + type: string + time: + description: Time is timestamp of when these fields were set. + It should always be empty if Operation is 'Apply' + format: date-time + type: string type: object - spec: - description: 'Specification of the desired behavior of the machine. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: array + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow a client + to request the generation of an appropriate name automatically. + Name is primarily intended for creation idempotence and configuration + definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must be + unique. An empty namespace is equivalent to the \"default\" namespace, + but \"default\" is the canonical representation. Not all objects + are required to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. Cannot + be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this + list will point to this controller, with the controller field set + to true. There cannot be more than one managing controller. + items: properties: - configSource: - description: ConfigSource is used to populate in the associated - Node for dynamic kubelet config. This field already exists - in Node, so any updates to it in the Machine spec will be - automatically copied to the linked NodeRef from the status. - The rest of dynamic kubelet config support should then work - as-is. + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. + To set this field, a user needs "delete" permission of the + owner, otherwise 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + resourceVersion: + description: "An opaque value that represents the internal version + of this object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to + the server. They may only be valid for a particular resource or + set of resources. \n Populated by the system. Read-only. Value must + be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. \n Populated + by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + spec: + properties: + deletePolicy: + description: DeletePolicy defines the policy used to identify nodes + to delete when downscaling. Defaults to "Random". Valid values + are "Random, "Newest", "Oldest" + enum: + - Random + - Newest + - Oldest + type: string + minReadySeconds: + description: MinReadySeconds is the minimum number of seconds for + which a newly created machine should be ready. Defaults to 0 (machine + will be considered available as soon as it is ready) + format: int32 + type: integer + replicas: + description: Replicas is the number of desired replicas. This is a + pointer to distinguish between explicit zero and unspecified. Defaults + to 1. + format: int32 + type: integer + selector: + description: 'Selector is a label query over machines that should + match the replica count. Label keys and values that must match in + order to be controlled by this MachineSet. It must match the machine + template''s labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors' + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: properties: - configMap: - description: ConfigMap is a reference to a Node's ConfigMap + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + template: + description: Template is the object that describes the machine that + will be created if insufficient replicas are detected. Object references + to custom resources resources are treated as templates. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map + stored with a resource that may be set by external tools + to store and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. More info: + http://kubernetes.io/docs/user-guide/annotations' + type: object + generateName: + description: "GenerateName is an optional prefix, used by + the server, to generate a unique name ONLY IF the Name field + has not been provided. If this field is used, the name returned + to the client will be different than the name passed. This + value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and + may be truncated by the length of the suffix required to + make the value unique on the server. \n If this field is + specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created + or 500 with Reason ServerTimeout indicating a unique name + could not be found in the time allotted, and the client + should retry (optionally after the time indicated in the + Retry-After header). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used + to organize and categorize (scope and select) objects. May + match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow + a client to request the generation of an appropriate name + automatically. Name is primarily intended for creation idempotence + and configuration definition. Cannot be updated. More info: + http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name + must be unique. An empty namespace is equivalent to the + \"default\" namespace, but \"default\" is the canonical + representation. Not all objects are required to be scoped + to a namespace - the value of this field for those objects + will be empty. \n Must be a DNS_LABEL. Cannot be updated. + More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL + objects in the list have been deleted, this object will + be garbage collected. If this object is managed by a controller, + then an entry in this list will point to this controller, + with the controller field set to true. There cannot be more + than one managing controller. + items: properties: - kubeletConfigKey: - description: KubeletConfigKey declares which key of - the referenced ConfigMap corresponds to the KubeletConfiguration - structure This field is required in all cases. + apiVersion: + description: API version of the referent. type: string - name: - description: Name is the metadata.name of the referenced - ConfigMap. This field is required in all cases. + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the + key-value store until this reference is removed. Defaults + to false. To set this field, a user needs "delete" + permission of the owner, otherwise 422 (Unprocessable + Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string - namespace: - description: Namespace is the metadata.namespace of - the referenced ConfigMap. This field is required in - all cases. - type: string - resourceVersion: - description: ResourceVersion is the metadata.ResourceVersion - of the referenced ConfigMap. This field is forbidden - in Node.Spec, and required in Node.Status. + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' type: string uid: - description: UID is the metadata.UID of the referenced - ConfigMap. This field is forbidden in Node.Spec, and - required in Node.Status. + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' type: string required: - - namespace + - apiVersion + - kind - name - - kubeletConfigKey - type: object - type: object - metadata: - description: ObjectMeta will autopopulate the Node created. - Use this to indicate what labels, annotations, name prefix, - etc., should be used when creating the Node. - properties: - annotations: - additionalProperties: - type: string - description: 'Annotations is an unstructured key value map - stored with a resource that may be set by external tools - to store and retrieve arbitrary metadata. They are not - queryable and should be preserved when modifying objects. - More info: http://kubernetes.io/docs/user-guide/annotations' + - uid type: object - generateName: - description: "GenerateName is an optional prefix, used by - the server, to generate a unique name ONLY IF the Name - field has not been provided. If this field is used, the - name returned to the client will be different than the - name passed. This value will also be combined with a unique - suffix. The provided value has the same validation rules - as the Name field, and may be truncated by the length - of the suffix required to make the value unique on the - server. \n If this field is specified and the generated - name exists, the server will NOT return a 409 - instead, - it will either return 201 Created or 500 with Reason ServerTimeout - indicating a unique name could not be found in the time - allotted, and the client should retry (optionally after - the time indicated in the Retry-After header). \n Applied - only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" - type: string - labels: - additionalProperties: - type: string - description: 'Map of string keys and values that can be - used to organize and categorize (scope and select) objects. - May match selectors of replication controllers and services. - More info: http://kubernetes.io/docs/user-guide/labels' - type: object - name: - description: 'Name must be unique within a namespace. Is - required when creating resources, although some resources - may allow a client to request the generation of an appropriate - name automatically. Name is primarily intended for creation - idempotence and configuration definition. Cannot be updated. - More info: http://kubernetes.io/docs/user-guide/identifiers#names' - type: string - namespace: - description: "Namespace defines the space within each name - must be unique. An empty namespace is equivalent to the - \"default\" namespace, but \"default\" is the canonical - representation. Not all objects are required to be scoped - to a namespace - the value of this field for those objects - will be empty. \n Must be a DNS_LABEL. Cannot be updated. - More info: http://kubernetes.io/docs/user-guide/namespaces" - type: string - ownerReferences: - description: List of objects depended by this object. If - ALL objects in the list have been deleted, this object - will be garbage collected. If this object is managed by - a controller, then an entry in this list will point to - this controller, with the controller field set to true. - There cannot be more than one managing controller. - items: + type: array + type: object + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + properties: + bootstrap: + description: Bootstrap is a reference to a local struct which + encapsulates fields to configure the Machine’s bootstrapping + mechanism. + properties: + configRef: + description: ConfigRef is a reference to a bootstrap provider-specific + resource that holds configuration details. The reference + is optional to allow users/operators to specify Bootstrap.Data + without the need of a controller. properties: - apiVersion: - description: API version of the referent. + apiGroup: + description: APIGroup is the group for the resource + being referenced. If APIGroup is not specified, + the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string - blockOwnerDeletion: - description: If true, AND if the owner has the "foregroundDeletion" - finalizer, then the owner cannot be deleted from - the key-value store until this reference is removed. - Defaults to false. To set this field, a user needs - "delete" permission of the owner, otherwise 422 - (Unprocessable Entity) will be returned. - type: boolean - controller: - description: If true, this reference points to the - managing controller. - type: boolean kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + required: + - apiGroup + - kind + - name + type: object + data: + description: Data contains the bootstrap data, such as + cloud-init details scripts. If nil, the Machine should + remain in the Pending state. + type: string + type: object + configSource: + description: ConfigSource is used to populate in the associated + Node for dynamic kubelet config. This field already exists + in Node, so any updates to it in the Machine spec will be + automatically copied to the linked NodeRef from the status. + The rest of dynamic kubelet config support should then work + as-is. + properties: + configMap: + description: ConfigMap is a reference to a Node's ConfigMap + properties: + kubeletConfigKey: + description: KubeletConfigKey declares which key of + the referenced ConfigMap corresponds to the KubeletConfiguration + structure This field is required in all cases. type: string name: - description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + description: Name is the metadata.name of the referenced + ConfigMap. This field is required in all cases. + type: string + namespace: + description: Namespace is the metadata.namespace of + the referenced ConfigMap. This field is required + in all cases. + type: string + resourceVersion: + description: ResourceVersion is the metadata.ResourceVersion + of the referenced ConfigMap. This field is forbidden + in Node.Spec, and required in Node.Status. type: string uid: - description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + description: UID is the metadata.UID of the referenced + ConfigMap. This field is forbidden in Node.Spec, + and required in Node.Status. type: string required: - - apiVersion - - kind + - namespace - name - - uid + - kubeletConfigKey type: object - type: array - type: object - providerID: - description: ProviderID is the identification ID of the machine - provided by the provider. This field must match the provider - ID as seen on the node object corresponding to this machine. - This field is required by higher level consumers of cluster-api. - Example use case is cluster autoscaler with cluster-api as - provider. Clean-up logic in the autoscaler compares machines - to nodes to find out machines at provider which could not - get registered as Kubernetes nodes. With cluster-api as a - generic out-of-tree provider for autoscaler, this field is - required by autoscaler to be able to have a provider view - of the list of machines. Another list of nodes is queried - from the k8s apiserver and then a comparison is done to find - out unregistered machines and are marked for delete. This - field will be set by the actuators and consumed by higher - level entities like autoscaler that will be interfacing with - cluster-api as generic provider. - type: string - providerSpec: - description: ProviderSpec details Provider-specific configuration - to use during node creation. - properties: - value: - description: Value is an inlined, serialized representation - of the resource configuration. It is recommended that - providers maintain their own versioned API types that - should be serialized/deserialized from this field, akin - to component config. - type: object - valueFrom: - description: Source for the provider configuration. Cannot - be used if value is not empty. - properties: - machineClass: - description: The machine class from which the provider - config should be sourced. + type: object + infrastructureRef: + description: InfrastructureRef is a required reference to + a custom resource offered by an infrastructure provider. + properties: + apiGroup: + description: APIGroup is the group for the resource being + referenced. If APIGroup is not specified, the specified + Kind must be in the core API group. For any other third-party + types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + required: + - apiGroup + - kind + - name + type: object + metadata: + description: ObjectMeta will autopopulate the Node created. + Use this to indicate what labels, annotations, name prefix, + etc., should be used when creating the Node. + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value + map stored with a resource that may be set by external + tools to store and retrieve arbitrary metadata. They + are not queryable and should be preserved when modifying + objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + generateName: + description: "GenerateName is an optional prefix, used + by the server, to generate a unique name ONLY IF the + Name field has not been provided. If this field is used, + the name returned to the client will be different than + the name passed. This value will also be combined with + a unique suffix. The provided value has the same validation + rules as the Name field, and may be truncated by the + length of the suffix required to make the value unique + on the server. \n If this field is specified and the + generated name exists, the server will NOT return a + 409 - instead, it will either return 201 Created or + 500 with Reason ServerTimeout indicating a unique name + could not be found in the time allotted, and the client + should retry (optionally after the time indicated in + the Retry-After header). \n Applied only if Name is + not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be + used to organize and categorize (scope and select) objects. + May match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + name: + description: 'Name must be unique within a namespace. + Is required when creating resources, although some resources + may allow a client to request the generation of an appropriate + name automatically. Name is primarily intended for creation + idempotence and configuration definition. Cannot be + updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each + name must be unique. An empty namespace is equivalent + to the \"default\" namespace, but \"default\" is the + canonical representation. Not all objects are required + to be scoped to a namespace - the value of this field + for those objects will be empty. \n Must be a DNS_LABEL. + Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. + If ALL objects in the list have been deleted, this object + will be garbage collected. If this object is managed + by a controller, then an entry in this list will point + to this controller, with the controller field set to + true. There cannot be more than one managing controller. + items: properties: apiVersion: description: API version of the referent. type: string - fieldPath: - description: 'If referring to a piece of an object - instead of an entire object, this string should - contain a valid JSON/Go field access statement, - such as desiredState.manifest.containers[2]. For - example, if the object reference is to a container - within a pod, this would take on a value like: - "spec.containers{name}" (where "name" refers to - the name of the container that triggered the event) - or if no container name is specified "spec.containers[2]" - (container with index 2 in this pod). This syntax - is chosen only to have some well-defined way of - referencing a part of an object. TODO: this design - is not final and this field is subject to change - in the future.' - type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from + the key-value store until this reference is removed. + Defaults to false. To set this field, a user needs + "delete" permission of the owner, otherwise 422 + (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the + managing controller. + type: boolean kind: description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - provider: - description: Provider is the name of the cloud-provider - which MachineClass is intended for. - type: string - resourceVersion: - description: 'Specific resourceVersion to which - this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' type: string uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' type: string + required: + - apiVersion + - kind + - name + - uid type: object - type: object - type: object - taints: - description: The list of the taints to be applied to the corresponding - Node in additive manner. This list will not overwrite any - other taints added to the Node on an ongoing basis by other - entities. These taints should be actively reconciled e.g. - if you ask the machine controller to apply a taint and then - manually remove the taint the machine controller will put - it back) but not have the machine controller remove any taints - items: - properties: - effect: - description: Required. The effect of the taint on pods - that do not tolerate the taint. Valid effects are NoSchedule, - PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to be applied to - a node. - type: string - timeAdded: - description: TimeAdded represents the time at which the - taint was added. It is only written for NoExecute taints. - format: date-time - type: string - value: - description: Required. The taint value corresponding to - the taint key. - type: string - required: - - key - - effect + type: array type: object - type: array - versions: - description: Versions of key software to use. This field is - optional at cluster creation time, and omitting the field - indicates that the cluster installation tool should select - defaults for the user. These defaults may differ based on - the cluster installer, but the tool should populate the values - it uses when persisting Machine objects. A Machine spec missing - this field at runtime is invalid. - properties: - controlPlane: - description: ControlPlane is the semantic version of the - Kubernetes control plane to run. This should only be populated - when the machine is a control plane. - type: string - kubelet: - description: Kubelet is the semantic version of kubelet - to run - type: string - required: - - kubelet - type: object - required: - - providerSpec - type: object - type: object - required: - - selector - type: object - status: - properties: - availableReplicas: - description: The number of available replicas (ready for at least minReadySeconds) - for this MachineSet. - format: int32 - type: integer - errorMessage: - type: string - errorReason: - description: "In the event that there is a terminal problem reconciling - the replicas, both ErrorReason and ErrorMessage will be set. ErrorReason - will be populated with a succinct value suitable for machine interpretation, - while ErrorMessage will contain a more verbose string suitable for - logging and human consumption. \n 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. \n Any transient errors that occur - during the reconciliation of Machines can be added as events to the - MachineSet object and/or logged in the controller's output." - type: string - fullyLabeledReplicas: - description: The number of replicas that have labels matching the labels - of the machine template of the MachineSet. - format: int32 - type: integer - observedGeneration: - description: ObservedGeneration reflects the generation of the most - recently observed MachineSet. - format: int64 - type: integer - readyReplicas: - description: The number of ready replicas for this MachineSet. A machine - is considered ready when the node has been created and is "Ready". - format: int32 - type: integer - replicas: - description: Replicas is the most recently observed number of replicas. - format: int32 - type: integer - required: - - replicas - type: object - type: object - versions: - - name: v1alpha1 + providerID: + description: ProviderID is the identification ID of the machine + provided by the provider. This field must match the provider + ID as seen on the node object corresponding to this machine. + This field is required by higher level consumers of cluster-api. + Example use case is cluster autoscaler with cluster-api + as provider. Clean-up logic in the autoscaler compares machines + to nodes to find out machines at provider which could not + get registered as Kubernetes nodes. With cluster-api as + a generic out-of-tree provider for autoscaler, this field + is required by autoscaler to be able to have a provider + view of the list of machines. Another list of nodes is queried + from the k8s apiserver and then a comparison is done to + find out unregistered machines and are marked for delete. + This field will be set by the actuators and consumed by + higher level entities like autoscaler that will be interfacing + with cluster-api as generic provider. + type: string + taints: + description: The list of the taints to be applied to the corresponding + Node in additive manner. This list will not overwrite any + other taints added to the Node on an ongoing basis by other + entities. These taints should be actively reconciled e.g. + if you ask the machine controller to apply a taint and then + manually remove the taint the machine controller will put + it back) but not have the machine controller remove any + taints + items: + properties: + effect: + description: Required. The effect of the taint on pods + that do not tolerate the taint. Valid effects are + NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Required. The taint key to be applied to + a node. + type: string + timeAdded: + description: TimeAdded represents the time at which + the taint was added. It is only written for NoExecute + taints. + format: date-time + type: string + value: + description: Required. The taint value corresponding + to the taint key. + type: string + required: + - key + - effect + type: object + type: array + version: + description: Version defines the desired Kubernetes version. + This field is meant to be optionally used by bootstrap providers. + type: string + required: + - bootstrap + - infrastructureRef + type: object + type: object + required: + - selector + type: object + status: + properties: + availableReplicas: + description: The number of available replicas (ready for at least + minReadySeconds) for this MachineSet. + format: int32 + type: integer + errorMessage: + type: string + errorReason: + description: "In the event that there is a terminal problem reconciling + the replicas, both ErrorReason and ErrorMessage will be set. ErrorReason + will be populated with a succinct value suitable for machine interpretation, + while ErrorMessage will contain a more verbose string suitable for + logging and human consumption. \n 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. \n Any transient + errors that occur during the reconciliation of Machines can be added + as events to the MachineSet object and/or logged in the controller's + output." + type: string + fullyLabeledReplicas: + description: The number of replicas that have labels matching the + labels of the machine template of the MachineSet. + format: int32 + type: integer + observedGeneration: + description: ObservedGeneration reflects the generation of the most + recently observed MachineSet. + format: int64 + type: integer + readyReplicas: + description: The number of ready replicas for this MachineSet. A machine + is considered ready when the node has been created and is "Ready". + format: int32 + type: integer + replicas: + description: Replicas is the most recently observed number of replicas. + format: int32 + type: integer + required: + - replicas + type: object + type: object served: true storage: true + subresources: + scale: + labelSelectorPath: .status.labelSelector + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} status: acceptedNames: kind: "" diff --git a/config/crds/cluster_v1alpha2_machine.yaml b/config/crds/cluster_v1alpha2_machine.yaml deleted file mode 100644 index 2b4262b7fc8b..000000000000 --- a/config/crds/cluster_v1alpha2_machine.yaml +++ /dev/null @@ -1,185 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" - name: machines.cluster.k8s.io -spec: - additionalPrinterColumns: - - JSONPath: .spec.providerID - description: Provider ID - name: ProviderID - type: string - - JSONPath: .status.phase - description: Machine status such as Terminating/Pending/Running/Failed etc - name: Phase - type: string - - JSONPath: .status.nodeRef.name - description: Node name associated with this machine - name: NodeName - priority: 1 - type: string - group: cluster.k8s.io - names: - kind: Machine - plural: machines - shortNames: - - ma - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - bootstrap: - description: Bootstrap is a reference to a local struct which encapsulates - fields to configure the Machine’s bootstrapping mechanism. - type: object - configSource: - description: ConfigSource is used to populate in the associated Node - for dynamic kubelet config. This field already exists in Node, so - any updates to it in the Machine spec will be automatically copied - to the linked NodeRef from the status. The rest of dynamic kubelet - config support should then work as-is. - type: object - infrastructureRef: - description: InfrastructureRef is a required reference to a custom resource - offered by an infrastructure provider. - type: object - metadata: - description: ObjectMeta will autopopulate the Node created. Use this - to indicate what labels, annotations, name prefix, etc., should be - used when creating the Node. - type: object - providerID: - description: ProviderID is the identification ID of the machine provided - by the provider. This field must match the provider ID as seen on - the node object corresponding to this machine. This field is required - by higher level consumers of cluster-api. Example use case is cluster - autoscaler with cluster-api as provider. Clean-up logic in the autoscaler - compares machines to nodes to find out machines at provider which - could not get registered as Kubernetes nodes. With cluster-api as - a generic out-of-tree provider for autoscaler, this field is required - by autoscaler to be able to have a provider view of the list of machines. - Another list of nodes is queried from the k8s apiserver and then a - comparison is done to find out unregistered machines and are marked - for delete. This field will be set by the actuators and consumed by - higher level entities like autoscaler that will be interfacing with - cluster-api as generic provider. - type: string - taints: - description: The list of the taints to be applied to the corresponding - Node in additive manner. This list will not overwrite any other taints - added to the Node on an ongoing basis by other entities. These taints - should be actively reconciled e.g. if you ask the machine controller - to apply a taint and then manually remove the taint the machine controller - will put it back) but not have the machine controller remove any taints - items: - type: object - type: array - version: - description: Version defines the desired Kubernetes version. This field - is meant to be optionally used by bootstrap providers. - type: string - required: - - bootstrap - - infrastructureRef - type: object - status: - properties: - addresses: - description: Addresses is a list of addresses assigned to the machine. - Queried from cloud provider, if available. - items: - type: object - type: array - bootstrap: - description: Bootstrap is the state of the bootstrap provider. - type: string - conditions: - description: 'Conditions lists the conditions synced from the node conditions - of the corresponding node-object. Machine-controller is responsible - for keeping conditions up-to-date. MachineSet controller will be taking - these conditions as a signal to decide if machine is healthy or needs - to be replaced. Refer: https://kubernetes.io/docs/concepts/architecture/nodes/#condition' - items: - type: object - type: array - errorMessage: - description: ErrorMessage will be set in the event that there is a terminal - problem reconciling the Machine and will contain a more verbose string - suitable for logging and human consumption. This field should not - be set for transitive errors that a controller faces that are expected - to be fixed automatically over time (like service outages), but instead - indicate that something is fundamentally wrong with the Machine's - spec or the configuration of the controller, and that manual intervention - is required. Examples of terminal errors would be invalid combinations - of settings in the spec, values that are unsupported by the controller, - or the responsible controller itself being critically misconfigured. Any - transient errors that occur during the reconciliation of Machines - can be added as events to the Machine object and/or logged in the - controller's output. - type: string - errorReason: - description: ErrorReason will be set in the event that there is a terminal - problem reconciling the Machine and will contain a succinct value - suitable for machine interpretation. This field should not be set - for transitive errors that a controller faces that are expected to - be fixed automatically over time (like service outages), but instead - indicate that something is fundamentally wrong with the Machine's - spec or the configuration of the controller, and that manual intervention - is required. Examples of terminal errors would be invalid combinations - of settings in the spec, values that are unsupported by the controller, - or the responsible controller itself being critically misconfigured. Any - transient errors that occur during the reconciliation of Machines - can be added as events to the Machine object and/or logged in the - controller's output. - type: string - infrastructure: - description: Infrastructure is the state of the infrastructure provider. - type: string - lastUpdated: - description: LastUpdated identifies when this status was last observed. - format: date-time - type: string - nodeRef: - description: NodeRef will point to the corresponding Node if it exists. - type: object - phase: - description: Phase represents the current phase of machine actuation. - E.g. Pending, Running, Terminating, Failed etc. - type: string - providerStatus: - description: ProviderStatus details a Provider-specific status. It is - recommended that providers maintain their own versioned API types - that should be serialized/deserialized from this field. - type: object - version: - description: Version specifies the current version of Kubernetes running - on the corresponding Node. This is meant to be a means of bubbling - up status from the Node to the Machine. It is entirely optional, but - useful for end-user UX if it’s present. - type: string - type: object - version: v1alpha2 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/config/crds/cluster_v1alpha2_machinedeployment.yaml b/config/crds/cluster_v1alpha2_machinedeployment.yaml deleted file mode 100644 index 4df27b0a79d6..000000000000 --- a/config/crds/cluster_v1alpha2_machinedeployment.yaml +++ /dev/null @@ -1,232 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" - name: machinedeployments.cluster.k8s.io -spec: - group: cluster.k8s.io - names: - kind: MachineDeployment - plural: machinedeployments - shortNames: - - md - scope: Namespaced - subresources: - scale: - labelSelectorPath: .status.labelSelector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - minReadySeconds: - description: Minimum number of seconds for which a newly created machine - should be ready. Defaults to 0 (machine will be considered available - as soon as it is ready) - format: int32 - type: integer - paused: - description: Indicates that the deployment is paused. - type: boolean - progressDeadlineSeconds: - description: The maximum time in seconds for a deployment to make progress - before it is considered to be failed. The deployment controller will - continue to process failed deployments and a condition with a ProgressDeadlineExceeded - reason will be surfaced in the deployment status. Note that progress - will not be estimated during the time a deployment is paused. Defaults - to 600s. - format: int32 - type: integer - replicas: - description: Number of desired machines. Defaults to 1. This is a pointer - to distinguish between explicit zero and not specified. - format: int32 - type: integer - revisionHistoryLimit: - description: The number of old MachineSets to retain to allow rollback. - This is a pointer to distinguish between explicit zero and not specified. - Defaults to 1. - format: int32 - type: integer - selector: - description: Label selector for machines. Existing MachineSets whose - machines are selected by this will be the ones affected by this deployment. - It must match the machine template's labels. - type: object - strategy: - description: The deployment strategy to use to replace existing machines - with new ones. - properties: - rollingUpdate: - description: Rolling update config params. Present only if MachineDeploymentStrategyType - = RollingUpdate. - properties: - maxSurge: - anyOf: - - type: string - - type: integer - description: 'The maximum number of machines that can be scheduled - above the desired number of machines. Value can be an absolute - number (ex: 5) or a percentage of desired machines (ex: 10%). - This can not be 0 if MaxUnavailable is 0. Absolute number - is calculated from percentage by rounding up. Defaults to - 1. Example: when this is set to 30%, the new MachineSet can - be scaled up immediately when the rolling update starts, such - that the total number of old and new machines do not exceed - 130% of desired machines. Once old machines have been killed, - new MachineSet can be scaled up further, ensuring that total - number of machines running at any time during the update is - at most 130% of desired machines.' - maxUnavailable: - anyOf: - - type: string - - type: integer - description: 'The maximum number of machines that can be unavailable - during the update. Value can be an absolute number (ex: 5) - or a percentage of desired machines (ex: 10%). Absolute number - is calculated from percentage by rounding down. This can not - be 0 if MaxSurge is 0. Defaults to 0. Example: when this is - set to 30%, the old MachineSet can be scaled down to 70% of - desired machines immediately when the rolling update starts. - Once new machines are ready, old MachineSet can be scaled - down further, followed by scaling up the new MachineSet, ensuring - that the total number of machines available at all times during - the update is at least 70% of desired machines.' - type: object - type: - description: Type of deployment. Currently the only supported strategy - is "RollingUpdate". Default is RollingUpdate. - type: string - type: object - template: - description: Template describes the machines that will be created. - properties: - metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' - type: object - spec: - description: 'Specification of the desired behavior of the machine. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' - properties: - bootstrap: - description: Bootstrap is a reference to a local struct which - encapsulates fields to configure the Machine’s bootstrapping - mechanism. - type: object - configSource: - description: ConfigSource is used to populate in the associated - Node for dynamic kubelet config. This field already exists - in Node, so any updates to it in the Machine spec will be - automatically copied to the linked NodeRef from the status. - The rest of dynamic kubelet config support should then work - as-is. - type: object - infrastructureRef: - description: InfrastructureRef is a required reference to a - custom resource offered by an infrastructure provider. - type: object - metadata: - description: ObjectMeta will autopopulate the Node created. - Use this to indicate what labels, annotations, name prefix, - etc., should be used when creating the Node. - type: object - providerID: - description: ProviderID is the identification ID of the machine - provided by the provider. This field must match the provider - ID as seen on the node object corresponding to this machine. - This field is required by higher level consumers of cluster-api. - Example use case is cluster autoscaler with cluster-api as - provider. Clean-up logic in the autoscaler compares machines - to nodes to find out machines at provider which could not - get registered as Kubernetes nodes. With cluster-api as a - generic out-of-tree provider for autoscaler, this field is - required by autoscaler to be able to have a provider view - of the list of machines. Another list of nodes is queried - from the k8s apiserver and then a comparison is done to find - out unregistered machines and are marked for delete. This - field will be set by the actuators and consumed by higher - level entities like autoscaler that will be interfacing with - cluster-api as generic provider. - type: string - taints: - description: The list of the taints to be applied to the corresponding - Node in additive manner. This list will not overwrite any - other taints added to the Node on an ongoing basis by other - entities. These taints should be actively reconciled e.g. - if you ask the machine controller to apply a taint and then - manually remove the taint the machine controller will put - it back) but not have the machine controller remove any taints - items: - type: object - type: array - version: - description: Version defines the desired Kubernetes version. - This field is meant to be optionally used by bootstrap providers. - type: string - required: - - bootstrap - - infrastructureRef - type: object - type: object - required: - - selector - - template - type: object - status: - properties: - availableReplicas: - description: Total number of available machines (ready for at least - minReadySeconds) targeted by this deployment. - format: int32 - type: integer - observedGeneration: - description: The generation observed by the deployment controller. - format: int64 - type: integer - readyReplicas: - description: Total number of ready machines targeted by this deployment. - format: int32 - type: integer - replicas: - description: Total number of non-terminated machines targeted by this - deployment (their labels match the selector). - format: int32 - type: integer - unavailableReplicas: - description: Total number of unavailable machines targeted by this deployment. - This is the total number of machines that are still required for the - deployment to have 100% available capacity. They may either be machines - that are running but not yet available or machines that still have - not been created. - format: int32 - type: integer - updatedReplicas: - description: Total number of non-terminated machines targeted by this - deployment that have the desired template spec. - format: int32 - type: integer - type: object - version: v1alpha2 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/config/crds/cluster_v1alpha2_machineset.yaml b/config/crds/cluster_v1alpha2_machineset.yaml deleted file mode 100644 index 327b8f8c0d86..000000000000 --- a/config/crds/cluster_v1alpha2_machineset.yaml +++ /dev/null @@ -1,195 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" - name: machinesets.cluster.k8s.io -spec: - group: cluster.k8s.io - names: - kind: MachineSet - plural: machinesets - shortNames: - - ms - scope: Namespaced - subresources: - scale: - labelSelectorPath: .status.labelSelector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - deletePolicy: - description: DeletePolicy defines the policy used to identify nodes - to delete when downscaling. Defaults to "Random". Valid values are - "Random, "Newest", "Oldest" - enum: - - Random - - Newest - - Oldest - type: string - minReadySeconds: - description: MinReadySeconds is the minimum number of seconds for which - a newly created machine should be ready. Defaults to 0 (machine will - be considered available as soon as it is ready) - format: int32 - type: integer - replicas: - description: Replicas is the number of desired replicas. This is a pointer - to distinguish between explicit zero and unspecified. Defaults to - 1. - format: int32 - type: integer - selector: - description: 'Selector is a label query over machines that should match - the replica count. Label keys and values that must match in order - to be controlled by this MachineSet. It must match the machine template''s - labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors' - type: object - template: - description: Template is the object that describes the machine that - will be created if insufficient replicas are detected. Object references - to custom resources resources are treated as templates. - properties: - metadata: - description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' - type: object - spec: - description: 'Specification of the desired behavior of the machine. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' - properties: - bootstrap: - description: Bootstrap is a reference to a local struct which - encapsulates fields to configure the Machine’s bootstrapping - mechanism. - type: object - configSource: - description: ConfigSource is used to populate in the associated - Node for dynamic kubelet config. This field already exists - in Node, so any updates to it in the Machine spec will be - automatically copied to the linked NodeRef from the status. - The rest of dynamic kubelet config support should then work - as-is. - type: object - infrastructureRef: - description: InfrastructureRef is a required reference to a - custom resource offered by an infrastructure provider. - type: object - metadata: - description: ObjectMeta will autopopulate the Node created. - Use this to indicate what labels, annotations, name prefix, - etc., should be used when creating the Node. - type: object - providerID: - description: ProviderID is the identification ID of the machine - provided by the provider. This field must match the provider - ID as seen on the node object corresponding to this machine. - This field is required by higher level consumers of cluster-api. - Example use case is cluster autoscaler with cluster-api as - provider. Clean-up logic in the autoscaler compares machines - to nodes to find out machines at provider which could not - get registered as Kubernetes nodes. With cluster-api as a - generic out-of-tree provider for autoscaler, this field is - required by autoscaler to be able to have a provider view - of the list of machines. Another list of nodes is queried - from the k8s apiserver and then a comparison is done to find - out unregistered machines and are marked for delete. This - field will be set by the actuators and consumed by higher - level entities like autoscaler that will be interfacing with - cluster-api as generic provider. - type: string - taints: - description: The list of the taints to be applied to the corresponding - Node in additive manner. This list will not overwrite any - other taints added to the Node on an ongoing basis by other - entities. These taints should be actively reconciled e.g. - if you ask the machine controller to apply a taint and then - manually remove the taint the machine controller will put - it back) but not have the machine controller remove any taints - items: - type: object - type: array - version: - description: Version defines the desired Kubernetes version. - This field is meant to be optionally used by bootstrap providers. - type: string - required: - - bootstrap - - infrastructureRef - type: object - type: object - required: - - selector - type: object - status: - properties: - availableReplicas: - description: The number of available replicas (ready for at least minReadySeconds) - for this MachineSet. - format: int32 - type: integer - errorMessage: - type: string - errorReason: - description: In the event that there is a terminal problem reconciling - the replicas, both ErrorReason and ErrorMessage will be set. ErrorReason - will be populated with a succinct value suitable for machine interpretation, - while ErrorMessage will contain a more verbose string suitable for - logging and human consumption. These fields should not be set for - transitive errors that a controller faces that are expected to be - fixed automatically over time (like service outages), but instead - indicate that something is fundamentally wrong with the MachineTemplate's - spec or the configuration of the machine controller, and that manual - intervention is required. Examples of terminal errors would be invalid - combinations of settings in the spec, values that are unsupported - by the machine controller, or the responsible machine controller itself - being critically misconfigured. Any transient errors that occur during - the reconciliation of Machines can be added as events to the MachineSet - object and/or logged in the controller's output. - type: string - fullyLabeledReplicas: - description: The number of replicas that have labels matching the labels - of the machine template of the MachineSet. - format: int32 - type: integer - observedGeneration: - description: ObservedGeneration reflects the generation of the most - recently observed MachineSet. - format: int64 - type: integer - readyReplicas: - description: The number of ready replicas for this MachineSet. A machine - is considered ready when the node has been created and is "Ready". - format: int32 - type: integer - replicas: - description: Replicas is the most recently observed number of replicas. - format: int32 - type: integer - required: - - replicas - type: object - version: v1alpha2 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/config/samples/cluster_v1alpha1_cluster.yaml b/config/samples/cluster_v1alpha1_cluster.yaml index fc796aa6b5ff..a0bd6b52e55b 100644 --- a/config/samples/cluster_v1alpha1_cluster.yaml +++ b/config/samples/cluster_v1alpha1_cluster.yaml @@ -1,4 +1,4 @@ -apiVersion: cluster.k8s.io/v1alpha1 +apiVersion: cluster.k8s.io/v1alpha2 kind: Cluster metadata: labels: diff --git a/config/samples/cluster_v1alpha1_machine.yaml b/config/samples/cluster_v1alpha1_machine.yaml index 8d40d45a11e5..54aac83fd977 100644 --- a/config/samples/cluster_v1alpha1_machine.yaml +++ b/config/samples/cluster_v1alpha1_machine.yaml @@ -1,4 +1,4 @@ -apiVersion: cluster.k8s.io/v1alpha1 +apiVersion: cluster.k8s.io/v1alpha2 kind: Machine metadata: labels: diff --git a/config/samples/cluster_v1alpha1_machinedeployment.yaml b/config/samples/cluster_v1alpha1_machinedeployment.yaml index d2f072342d2c..ce1f911214d6 100644 --- a/config/samples/cluster_v1alpha1_machinedeployment.yaml +++ b/config/samples/cluster_v1alpha1_machinedeployment.yaml @@ -1,4 +1,4 @@ -apiVersion: cluster.k8s.io/v1alpha1 +apiVersion: cluster.k8s.io/v1alpha2 kind: MachineDeployment metadata: labels: @@ -13,4 +13,4 @@ spec: template: metadata: labels: - foo: bar \ No newline at end of file + foo: bar diff --git a/config/samples/cluster_v1alpha1_machineset.yaml b/config/samples/cluster_v1alpha1_machineset.yaml index 929af0869858..2b26deb23947 100644 --- a/config/samples/cluster_v1alpha1_machineset.yaml +++ b/config/samples/cluster_v1alpha1_machineset.yaml @@ -1,4 +1,4 @@ -apiVersion: cluster.k8s.io/v1alpha1 +apiVersion: cluster.k8s.io/v1alpha2 kind: MachineSet metadata: labels: diff --git a/docs/book/provider_implementations/create_actuators.md b/docs/book/provider_implementations/create_actuators.md index f2ee2babd935..e57b20e6ac70 100644 --- a/docs/book/provider_implementations/create_actuators.md +++ b/docs/book/provider_implementations/create_actuators.md @@ -31,7 +31,7 @@ import ( "fmt" "log" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" client "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" ) @@ -97,7 +97,7 @@ import ( "fmt" "log" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" client "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" ) diff --git a/docs/examples/cluster/cluster.yaml b/docs/examples/cluster/cluster.yaml index 9640cbfbe073..632c45842687 100644 --- a/docs/examples/cluster/cluster.yaml +++ b/docs/examples/cluster/cluster.yaml @@ -1,6 +1,6 @@ note: Cluster Example sample: | - apiVersion: cluster.k8s.io/v1alpha1 + apiVersion: cluster.k8s.io/v1alpha2 kind: Cluster metadata: name: cluster-example diff --git a/docs/examples/machine/machine.yaml b/docs/examples/machine/machine.yaml index 323c2c938314..ea201a8223fe 100644 --- a/docs/examples/machine/machine.yaml +++ b/docs/examples/machine/machine.yaml @@ -1,6 +1,6 @@ note: Machine Example sample: | - apiVersion: cluster.k8s.io/v1alpha1 + apiVersion: cluster.k8s.io/v1alpha2 kind: Machine metadata: name: machine-example diff --git a/docs/examples/machinedeployment/machinedeployment.yaml b/docs/examples/machinedeployment/machinedeployment.yaml index c092b6acbe01..da604ebb1681 100644 --- a/docs/examples/machinedeployment/machinedeployment.yaml +++ b/docs/examples/machinedeployment/machinedeployment.yaml @@ -1,6 +1,6 @@ note: MachineDeployment Example sample: | - apiVersion: cluster.k8s.io/v1alpha1 + apiVersion: cluster.k8s.io/v1alpha2 kind: MachineDeployment metadata: name: machinedeployment-example diff --git a/docs/examples/machineset/machineset.yaml b/docs/examples/machineset/machineset.yaml index 47353ebb144e..fa67250382e0 100644 --- a/docs/examples/machineset/machineset.yaml +++ b/docs/examples/machineset/machineset.yaml @@ -1,6 +1,6 @@ note: MachineSet Example sample: | - apiVersion: cluster.k8s.io/v1alpha1 + apiVersion: cluster.k8s.io/v1alpha2 kind: MachineSet metadata: name: machineset-example diff --git a/pkg/apis/cluster/v1alpha2/BUILD.bazel b/pkg/apis/cluster/v1alpha2/BUILD.bazel index d58da284cd85..4d19196b097d 100644 --- a/pkg/apis/cluster/v1alpha2/BUILD.bazel +++ b/pkg/apis/cluster/v1alpha2/BUILD.bazel @@ -4,6 +4,7 @@ go_library( name = "go_default_library", srcs = [ "cluster_types.go", + "common_type.go", "doc.go", "machine_types.go", "machinedeployment_types.go", @@ -23,7 +24,7 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - "//vendor/sigs.k8s.io/controller-runtime/pkg/runtime/scheme:go_default_library", + "//vendor/sigs.k8s.io/controller-runtime/pkg/scheme:go_default_library", ], ) diff --git a/pkg/apis/cluster/v1alpha2/cluster_types.go b/pkg/apis/cluster/v1alpha2/cluster_types.go index 988ff1298798..f5ba3841dfef 100644 --- a/pkg/apis/cluster/v1alpha2/cluster_types.go +++ b/pkg/apis/cluster/v1alpha2/cluster_types.go @@ -31,7 +31,8 @@ const ClusterFinalizer = "cluster.cluster.k8s.io" /// [Cluster] // Cluster is the Schema for the clusters API // +k8s:openapi-gen=true -// +kubebuilder:resource:shortName=cl +// +kubebuilder:resource:path=clusters,shortName=cl +// +kubebuilder:storageversion // +kubebuilder:subresource:status type Cluster struct { metav1.TypeMeta `json:",inline"` diff --git a/pkg/apis/cluster/v1alpha2/common_type.go b/pkg/apis/cluster/v1alpha2/common_type.go new file mode 100644 index 000000000000..1e222dcacaca --- /dev/null +++ b/pkg/apis/cluster/v1alpha2/common_type.go @@ -0,0 +1,105 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ObjectMeta is metadata that all persisted resources must have, which includes all objects +// users must create. This is a copy of customizable fields from metav1.ObjectMeta. +// +// ObjectMeta is embedded in `Machine.Spec`, `MachineDeployment.Template` and `MachineSet.Template`, +// which are not top-level Kubernetes objects. Given that metav1.ObjectMeta has lots of special cases +// and read-only fields which end up in the generated CRD validation, having it as a subset simplifies +// the API and some issues that can impact user experience. +// +// During the [upgrade to controller-tools@v2](https://github.com/kubernetes-sigs/cluster-api/pull/1054) +// for v1alpha2, we noticed a failure would occur running Cluster API test suite against the new CRDs, +// specifically `spec.metadata.creationTimestamp in body must be of type string: "null"`. +// The investigation showed that `controller-tools@v2` behaves differently than its previous version +// when handling types from [metav1](k8s.io/apimachinery/pkg/apis/meta/v1) package. +// +// In more details, we found that embedded (non-top level) types that embedded `metav1.ObjectMeta` +// had validation properties, including for `creationTimestamp` (metav1.Time). +// The `metav1.Time` type specifies a custom json marshaller that, when IsZero() is true, returns `null` +// which breaks validation because the field isn't marked as nullable. +// +// In future versions, controller-tools@v2 might allow overriding the type and validation for embedded +// types. When that happens, this hack should be revisited. +type ObjectMeta struct { + // Name must be unique within a namespace. Is required when creating resources, although + // some resources may allow a client to request the generation of an appropriate name + // automatically. Name is primarily intended for creation idempotence and configuration + // definition. + // Cannot be updated. + // More info: http://kubernetes.io/docs/user-guide/identifiers#names + // +optional + Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` + + // GenerateName is an optional prefix, used by the server, to generate a unique + // name ONLY IF the Name field has not been provided. + // If this field is used, the name returned to the client will be different + // than the name passed. This value will also be combined with a unique suffix. + // The provided value has the same validation rules as the Name field, + // and may be truncated by the length of the suffix required to make the value + // unique on the server. + // + // If this field is specified and the generated name exists, the server will + // NOT return a 409 - instead, it will either return 201 Created or 500 with Reason + // ServerTimeout indicating a unique name could not be found in the time allotted, and the client + // should retry (optionally after the time indicated in the Retry-After header). + // + // Applied only if Name is not specified. + // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency + // +optional + GenerateName string `json:"generateName,omitempty" protobuf:"bytes,2,opt,name=generateName"` + + // Namespace defines the space within each name must be unique. An empty namespace is + // equivalent to the "default" namespace, but "default" is the canonical representation. + // Not all objects are required to be scoped to a namespace - the value of this field for + // those objects will be empty. + // + // Must be a DNS_LABEL. + // Cannot be updated. + // More info: http://kubernetes.io/docs/user-guide/namespaces + // +optional + Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"` + + // Map of string keys and values that can be used to organize and categorize + // (scope and select) objects. May match selectors of replication controllers + // and services. + // More info: http://kubernetes.io/docs/user-guide/labels + // +optional + Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"` + + // Annotations is an unstructured key value map stored with a resource that may be + // set by external tools to store and retrieve arbitrary metadata. They are not + // queryable and should be preserved when modifying objects. + // More info: http://kubernetes.io/docs/user-guide/annotations + // +optional + Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"` + + // List of objects depended by this object. If ALL objects in the list have + // been deleted, this object will be garbage collected. If this object is managed by a controller, + // then an entry in this list will point to this controller, with the controller field set to true. + // There cannot be more than one managing controller. + // +optional + // +patchMergeKey=uid + // +patchStrategy=merge + OwnerReferences []metav1.OwnerReference `json:"ownerReferences,omitempty" patchStrategy:"merge" patchMergeKey:"uid" protobuf:"bytes,13,rep,name=ownerReferences"` +} diff --git a/pkg/apis/cluster/v1alpha2/defaults.go b/pkg/apis/cluster/v1alpha2/defaults.go new file mode 100644 index 000000000000..fa3e20238a28 --- /dev/null +++ b/pkg/apis/cluster/v1alpha2/defaults.go @@ -0,0 +1,74 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha2 + +import ( + 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 +// 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/pkg/apis/cluster/v1alpha2/machine_types.go b/pkg/apis/cluster/v1alpha2/machine_types.go index 260e944211ba..adba0db3ff16 100644 --- a/pkg/apis/cluster/v1alpha2/machine_types.go +++ b/pkg/apis/cluster/v1alpha2/machine_types.go @@ -29,6 +29,9 @@ const ( // MachineClusterLabelName is the label set on machines linked to a cluster. MachineClusterLabelName = "cluster.k8s.io/cluster-name" + + // MachineControlPlaneLabelName is the label set on machines part of a control plane. + MachineControlPlaneLabelName = "cluster.k8s.io/control-plane" ) // +genclient @@ -37,8 +40,9 @@ const ( /// [Machine] // Machine is the Schema for the machines API // +k8s:openapi-gen=true -// +kubebuilder:resource:shortName=ma +// +kubebuilder:resource:path=machines,shortName=ma // +kubebuilder:subresource:status +// +kubebuilder:storageversion // +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID" // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Machine status such as Terminating/Pending/Running/Failed etc" // +kubebuilder:printcolumn:name="NodeName",type="string",JSONPath=".status.nodeRef.name",description="Node name associated with this machine",priority=1 @@ -59,7 +63,7 @@ type MachineSpec struct { // indicate what labels, annotations, name prefix, etc., should be used // when creating the Node. // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` + ObjectMeta `json:"metadata,omitempty"` // Bootstrap is a reference to a local struct which encapsulates // fields to configure the Machine’s bootstrapping mechanism. diff --git a/pkg/apis/cluster/v1alpha2/machinedeployment_types.go b/pkg/apis/cluster/v1alpha2/machinedeployment_types.go index 6ceb03ddde95..36b737567783 100644 --- a/pkg/apis/cluster/v1alpha2/machinedeployment_types.go +++ b/pkg/apis/cluster/v1alpha2/machinedeployment_types.go @@ -167,7 +167,8 @@ type MachineDeploymentStatus struct { /// [MachineDeployment] // MachineDeployment is the Schema for the machinedeployments API // +k8s:openapi-gen=true -// +kubebuilder:resource:shortName=md +// +kubebuilder:resource:path=machinedeployments,shortName=md +// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector type MachineDeployment struct { diff --git a/pkg/apis/cluster/v1alpha2/machineset_types.go b/pkg/apis/cluster/v1alpha2/machineset_types.go index c0e973bd184e..d25467d01bc9 100644 --- a/pkg/apis/cluster/v1alpha2/machineset_types.go +++ b/pkg/apis/cluster/v1alpha2/machineset_types.go @@ -32,7 +32,8 @@ import ( /// [MachineSet] // MachineSet ensures that a specified number of machines replicas are running at any given time. // +k8s:openapi-gen=true -// +kubebuilder:resource:shortName=ms +// +kubebuilder:resource:path=machinesets,shortName=ms +// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector type MachineSet struct { @@ -61,7 +62,7 @@ type MachineSetSpec struct { // DeletePolicy defines the policy used to identify nodes to delete when downscaling. // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" - // +kubebuilder:validation:Enum=Random,Newest,Oldest + // +kubebuilder:validation:Enum=Random;Newest;Oldest DeletePolicy string `json:"deletePolicy,omitempty"` // Selector is a label query over machines that should match the replica count. @@ -109,7 +110,7 @@ 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"` + 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 diff --git a/pkg/apis/cluster/v1alpha2/register.go b/pkg/apis/cluster/v1alpha2/register.go index 24371afa7a88..e439272f978a 100644 --- a/pkg/apis/cluster/v1alpha2/register.go +++ b/pkg/apis/cluster/v1alpha2/register.go @@ -26,7 +26,7 @@ package v1alpha2 import ( "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/runtime/scheme" + "sigs.k8s.io/controller-runtime/pkg/scheme" ) var ( diff --git a/pkg/apis/cluster/v1alpha2/testutil/BUILD.bazel b/pkg/apis/cluster/v1alpha2/testutil/BUILD.bazel new file mode 100644 index 000000000000..cc35d8f73b81 --- /dev/null +++ b/pkg/apis/cluster/v1alpha2/testutil/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["testutil.go"], + importpath = "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2/testutil", + visibility = ["//visibility:public"], + deps = ["//pkg/apis/cluster/v1alpha2:go_default_library"], +) diff --git a/pkg/controller/add_node.go b/pkg/apis/cluster/v1alpha2/testutil/testutil.go similarity index 51% rename from pkg/controller/add_node.go rename to pkg/apis/cluster/v1alpha2/testutil/testutil.go index f6783fb53422..53d6dd8b6d4e 100644 --- a/pkg/controller/add_node.go +++ b/pkg/apis/cluster/v1alpha2/testutil/testutil.go @@ -14,13 +14,23 @@ See the License for the specific language governing permissions and limitations under the License. */ -package controller +package testutil -import ( - "sigs.k8s.io/cluster-api/pkg/controller/node" -) +import "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" -func init() { - // AddToManagerFuncs is a list of functions to create controllers and add them to a manager. - AddToManagerFuncs = append(AddToManagerFuncs, node.Add) +// GetVanillaCluster return a bare minimum functional cluster resource object +func GetVanillaCluster() v1alpha2.Cluster { + return v1alpha2.Cluster{ + Spec: v1alpha2.ClusterSpec{ + ClusterNetwork: v1alpha2.ClusterNetworkingConfig{ + Services: v1alpha2.NetworkRanges{ + CIDRBlocks: []string{"10.96.0.0/12"}, + }, + Pods: v1alpha2.NetworkRanges{ + CIDRBlocks: []string{"192.168.0.0/16"}, + }, + ServiceDomain: "cluster.local", + }, + }, + } } diff --git a/pkg/apis/cluster/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/cluster/v1alpha2/zz_generated.deepcopy.go index 497dbb4f0203..9bb603b3dde6 100644 --- a/pkg/apis/cluster/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/cluster/v1alpha2/zz_generated.deepcopy.go @@ -22,6 +22,7 @@ package v1alpha2 import ( v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" intstr "k8s.io/apimachinery/pkg/util/intstr" common "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" @@ -682,6 +683,43 @@ func (in *NetworkRanges) DeepCopy() *NetworkRanges { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.OwnerReferences != nil { + in, out := &in.OwnerReferences, &out.OwnerReferences + *out = make([]metav1.OwnerReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMeta. +func (in *ObjectMeta) DeepCopy() *ObjectMeta { + if in == nil { + return nil + } + out := new(ObjectMeta) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProviderSpec) DeepCopyInto(out *ProviderSpec) { *out = *in diff --git a/pkg/client/clientset_generated/clientset/BUILD.bazel b/pkg/client/clientset_generated/clientset/BUILD.bazel index 9665ba8d3dd3..13d0d9bf36d2 100644 --- a/pkg/client/clientset_generated/clientset/BUILD.bazel +++ b/pkg/client/clientset_generated/clientset/BUILD.bazel @@ -9,7 +9,7 @@ go_library( importpath = "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset", visibility = ["//visibility:public"], deps = [ - "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", + "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2:go_default_library", "//vendor/k8s.io/client-go/discovery:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/util/flowcontrol:go_default_library", diff --git a/pkg/client/clientset_generated/clientset/clientset.go b/pkg/client/clientset_generated/clientset/clientset.go index 7a837615c3af..f9248c86cb5e 100644 --- a/pkg/client/clientset_generated/clientset/clientset.go +++ b/pkg/client/clientset_generated/clientset/clientset.go @@ -22,24 +22,24 @@ import ( 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" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2" ) type Interface interface { Discovery() discovery.DiscoveryInterface - ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface + ClusterV1alpha2() clusterv1alpha2.ClusterV1alpha2Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - clusterV1alpha1 *clusterv1alpha1.ClusterV1alpha1Client + clusterV1alpha2 *clusterv1alpha2.ClusterV1alpha2Client } -// ClusterV1alpha1 retrieves the ClusterV1alpha1Client -func (c *Clientset) ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface { - return c.clusterV1alpha1 +// ClusterV1alpha2 retrieves the ClusterV1alpha2Client +func (c *Clientset) ClusterV1alpha2() clusterv1alpha2.ClusterV1alpha2Interface { + return c.clusterV1alpha2 } // Discovery retrieves the DiscoveryClient @@ -58,7 +58,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.clusterV1alpha1, err = clusterv1alpha1.NewForConfig(&configShallowCopy) + cs.clusterV1alpha2, err = clusterv1alpha2.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -74,7 +74,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset - cs.clusterV1alpha1 = clusterv1alpha1.NewForConfigOrDie(c) + cs.clusterV1alpha2 = clusterv1alpha2.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -83,7 +83,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.clusterV1alpha1 = clusterv1alpha1.New(c) + cs.clusterV1alpha2 = clusterv1alpha2.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset_generated/clientset/fake/BUILD.bazel b/pkg/client/clientset_generated/clientset/fake/BUILD.bazel index e3d124b8b13b..f4bd0d251677 100644 --- a/pkg/client/clientset_generated/clientset/fake/BUILD.bazel +++ b/pkg/client/clientset_generated/clientset/fake/BUILD.bazel @@ -10,10 +10,10 @@ go_library( importpath = "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/client/clientset_generated/clientset:go_default_library", - "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", - "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake:go_default_library", + "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2:go_default_library", + "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/pkg/client/clientset_generated/clientset/fake/clientset_generated.go b/pkg/client/clientset_generated/clientset/fake/clientset_generated.go index 59358a1d1f28..b557eed549db 100644 --- a/pkg/client/clientset_generated/clientset/fake/clientset_generated.go +++ b/pkg/client/clientset_generated/clientset/fake/clientset_generated.go @@ -25,8 +25,8 @@ import ( fakediscovery "k8s.io/client-go/discovery/fake" "k8s.io/client-go/testing" clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" - fakeclusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2" + fakeclusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. @@ -71,7 +71,7 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { var _ clientset.Interface = &Clientset{} -// ClusterV1alpha1 retrieves the ClusterV1alpha1Client -func (c *Clientset) ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface { - return &fakeclusterv1alpha1.FakeClusterV1alpha1{Fake: &c.Fake} +// ClusterV1alpha2 retrieves the ClusterV1alpha2Client +func (c *Clientset) ClusterV1alpha2() clusterv1alpha2.ClusterV1alpha2Interface { + return &fakeclusterv1alpha2.FakeClusterV1alpha2{Fake: &c.Fake} } diff --git a/pkg/client/clientset_generated/clientset/fake/register.go b/pkg/client/clientset_generated/clientset/fake/register.go index f1ab362c9d08..4bcde1930df0 100644 --- a/pkg/client/clientset_generated/clientset/fake/register.go +++ b/pkg/client/clientset_generated/clientset/fake/register.go @@ -24,14 +24,14 @@ import ( 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" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - clusterv1alpha1.AddToScheme, + clusterv1alpha2.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset_generated/clientset/scheme/BUILD.bazel b/pkg/client/clientset_generated/clientset/scheme/BUILD.bazel index 967e9635f263..3420664923f4 100644 --- a/pkg/client/clientset_generated/clientset/scheme/BUILD.bazel +++ b/pkg/client/clientset_generated/clientset/scheme/BUILD.bazel @@ -9,7 +9,7 @@ go_library( importpath = "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/pkg/client/clientset_generated/clientset/scheme/register.go b/pkg/client/clientset_generated/clientset/scheme/register.go index 4807900114b1..1d9b55fbc2d2 100644 --- a/pkg/client/clientset_generated/clientset/scheme/register.go +++ b/pkg/client/clientset_generated/clientset/scheme/register.go @@ -24,14 +24,14 @@ import ( 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" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - clusterv1alpha1.AddToScheme, + clusterv1alpha2.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineclass.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineclass.go deleted file mode 100644 index c86e5419af2e..000000000000 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineclass.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" -) - -// FakeMachineClasses implements MachineClassInterface -type FakeMachineClasses struct { - Fake *FakeClusterV1alpha1 - ns string -} - -var machineclassesResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1alpha1", Resource: "machineclasses"} - -var machineclassesKind = schema.GroupVersionKind{Group: "cluster.k8s.io", Version: "v1alpha1", Kind: "MachineClass"} - -// Get takes name of the machineClass, and returns the corresponding machineClass object, and an error if there is any. -func (c *FakeMachineClasses) Get(name string, options v1.GetOptions) (result *v1alpha1.MachineClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(machineclassesResource, c.ns, name), &v1alpha1.MachineClass{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MachineClass), err -} - -// List takes label and field selectors, and returns the list of MachineClasses that match those selectors. -func (c *FakeMachineClasses) List(opts v1.ListOptions) (result *v1alpha1.MachineClassList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(machineclassesResource, machineclassesKind, c.ns, opts), &v1alpha1.MachineClassList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.MachineClassList{ListMeta: obj.(*v1alpha1.MachineClassList).ListMeta} - for _, item := range obj.(*v1alpha1.MachineClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested machineClasses. -func (c *FakeMachineClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(machineclassesResource, c.ns, opts)) - -} - -// Create takes the representation of a machineClass and creates it. Returns the server's representation of the machineClass, and an error, if there is any. -func (c *FakeMachineClasses) Create(machineClass *v1alpha1.MachineClass) (result *v1alpha1.MachineClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(machineclassesResource, c.ns, machineClass), &v1alpha1.MachineClass{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MachineClass), err -} - -// Update takes the representation of a machineClass and updates it. Returns the server's representation of the machineClass, and an error, if there is any. -func (c *FakeMachineClasses) Update(machineClass *v1alpha1.MachineClass) (result *v1alpha1.MachineClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(machineclassesResource, c.ns, machineClass), &v1alpha1.MachineClass{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MachineClass), err -} - -// Delete takes name of the machineClass and deletes it. Returns an error if one occurs. -func (c *FakeMachineClasses) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(machineclassesResource, c.ns, name), &v1alpha1.MachineClass{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeMachineClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(machineclassesResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha1.MachineClassList{}) - return err -} - -// Patch applies the patch and returns the patched machineClass. -func (c *FakeMachineClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(machineclassesResource, c.ns, name, pt, data, subresources...), &v1alpha1.MachineClass{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MachineClass), err -} diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go deleted file mode 100644 index f2f830f33059..000000000000 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v1alpha1 - -import ( - "time" - - 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. -// 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(*v1alpha1.MachineClass) (*v1alpha1.MachineClass, error) - Update(*v1alpha1.MachineClass) (*v1alpha1.MachineClass, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.MachineClass, error) - List(opts v1.ListOptions) (*v1alpha1.MachineClassList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineClass, err error) - MachineClassExpansion -} - -// machineClasses implements MachineClassInterface -type machineClasses struct { - client rest.Interface - ns string -} - -// newMachineClasses returns a MachineClasses -func newMachineClasses(c *ClusterV1alpha1Client, 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 *v1alpha1.MachineClass, err error) { - result = &v1alpha1.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 *v1alpha1.MachineClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.MachineClassList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("machineclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested machineClasses. -func (c *machineClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("machineclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - 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 *v1alpha1.MachineClass) (result *v1alpha1.MachineClass, err error) { - result = &v1alpha1.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 *v1alpha1.MachineClass) (result *v1alpha1.MachineClass, err error) { - result = &v1alpha1.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 { - var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("machineclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Timeout(timeout). - 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 *v1alpha1.MachineClass, err error) { - result = &v1alpha1.MachineClass{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("machineclasses"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/BUILD.bazel b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/BUILD.bazel similarity index 87% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/BUILD.bazel rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/BUILD.bazel index d7034eae03dd..1e32e851df78 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/BUILD.bazel +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/BUILD.bazel @@ -8,14 +8,13 @@ go_library( "doc.go", "generated_expansion.go", "machine.go", - "machineclass.go", "machinedeployment.go", "machineset.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1", + importpath = "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/client/clientset_generated/clientset/scheme:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/cluster.go similarity index 81% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/cluster.go index b365aa10ba3d..620e7a20cf0b 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster.go +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/cluster.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( "time" @@ -25,7 +25,7 @@ import ( 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" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) @@ -37,15 +37,15 @@ type ClustersGetter interface { // ClusterInterface has methods to work with Cluster resources. type ClusterInterface interface { - Create(*v1alpha1.Cluster) (*v1alpha1.Cluster, error) - Update(*v1alpha1.Cluster) (*v1alpha1.Cluster, error) - UpdateStatus(*v1alpha1.Cluster) (*v1alpha1.Cluster, error) + Create(*v1alpha2.Cluster) (*v1alpha2.Cluster, error) + Update(*v1alpha2.Cluster) (*v1alpha2.Cluster, error) + UpdateStatus(*v1alpha2.Cluster) (*v1alpha2.Cluster, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.Cluster, error) - List(opts v1.ListOptions) (*v1alpha1.ClusterList, error) + Get(name string, options v1.GetOptions) (*v1alpha2.Cluster, error) + List(opts v1.ListOptions) (*v1alpha2.ClusterList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Cluster, err error) ClusterExpansion } @@ -56,7 +56,7 @@ type clusters struct { } // newClusters returns a Clusters -func newClusters(c *ClusterV1alpha1Client, namespace string) *clusters { +func newClusters(c *ClusterV1alpha2Client, namespace string) *clusters { return &clusters{ client: c.RESTClient(), ns: namespace, @@ -64,8 +64,8 @@ func newClusters(c *ClusterV1alpha1Client, namespace string) *clusters { } // 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 *v1alpha1.Cluster, err error) { - result = &v1alpha1.Cluster{} +func (c *clusters) Get(name string, options v1.GetOptions) (result *v1alpha2.Cluster, err error) { + result = &v1alpha2.Cluster{} err = c.client.Get(). Namespace(c.ns). Resource("clusters"). @@ -77,12 +77,12 @@ func (c *clusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Clu } // List takes label and field selectors, and returns the list of Clusters that match those selectors. -func (c *clusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) { +func (c *clusters) List(opts v1.ListOptions) (result *v1alpha2.ClusterList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.ClusterList{} + result = &v1alpha2.ClusterList{} err = c.client.Get(). Namespace(c.ns). Resource("clusters"). @@ -109,8 +109,8 @@ func (c *clusters) Watch(opts v1.ListOptions) (watch.Interface, error) { } // 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 *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { - result = &v1alpha1.Cluster{} +func (c *clusters) Create(cluster *v1alpha2.Cluster) (result *v1alpha2.Cluster, err error) { + result = &v1alpha2.Cluster{} err = c.client.Post(). Namespace(c.ns). Resource("clusters"). @@ -121,8 +121,8 @@ func (c *clusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, } // 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 *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { - result = &v1alpha1.Cluster{} +func (c *clusters) Update(cluster *v1alpha2.Cluster) (result *v1alpha2.Cluster, err error) { + result = &v1alpha2.Cluster{} err = c.client.Put(). Namespace(c.ns). Resource("clusters"). @@ -136,8 +136,8 @@ func (c *clusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, // 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 *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { - result = &v1alpha1.Cluster{} +func (c *clusters) UpdateStatus(cluster *v1alpha2.Cluster) (result *v1alpha2.Cluster, err error) { + result = &v1alpha2.Cluster{} err = c.client.Put(). Namespace(c.ns). Resource("clusters"). @@ -177,8 +177,8 @@ func (c *clusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.Li } // Patch applies the patch and returns the patched cluster. -func (c *clusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) { - result = &v1alpha1.Cluster{} +func (c *clusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Cluster, err error) { + result = &v1alpha2.Cluster{} err = c.client.Patch(pt). Namespace(c.ns). Resource("clusters"). diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/cluster_client.go similarity index 62% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/cluster_client.go index 36ebc273b3c2..4a169c2d9b0c 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/cluster_client.go @@ -16,51 +16,46 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( serializer "k8s.io/apimachinery/pkg/runtime/serializer" rest "k8s.io/client-go/rest" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) -type ClusterV1alpha1Interface interface { +type ClusterV1alpha2Interface interface { RESTClient() rest.Interface ClustersGetter MachinesGetter - MachineClassesGetter MachineDeploymentsGetter MachineSetsGetter } -// ClusterV1alpha1Client is used to interact with features provided by the cluster.k8s.io group. -type ClusterV1alpha1Client struct { +// ClusterV1alpha2Client is used to interact with features provided by the cluster.k8s.io group. +type ClusterV1alpha2Client struct { restClient rest.Interface } -func (c *ClusterV1alpha1Client) Clusters(namespace string) ClusterInterface { +func (c *ClusterV1alpha2Client) Clusters(namespace string) ClusterInterface { return newClusters(c, namespace) } -func (c *ClusterV1alpha1Client) Machines(namespace string) MachineInterface { +func (c *ClusterV1alpha2Client) Machines(namespace string) MachineInterface { return newMachines(c, namespace) } -func (c *ClusterV1alpha1Client) MachineClasses(namespace string) MachineClassInterface { - return newMachineClasses(c, namespace) -} - -func (c *ClusterV1alpha1Client) MachineDeployments(namespace string) MachineDeploymentInterface { +func (c *ClusterV1alpha2Client) MachineDeployments(namespace string) MachineDeploymentInterface { return newMachineDeployments(c, namespace) } -func (c *ClusterV1alpha1Client) MachineSets(namespace string) MachineSetInterface { +func (c *ClusterV1alpha2Client) MachineSets(namespace string) MachineSetInterface { return newMachineSets(c, namespace) } -// NewForConfig creates a new ClusterV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*ClusterV1alpha1Client, error) { +// NewForConfig creates a new ClusterV1alpha2Client for the given config. +func NewForConfig(c *rest.Config) (*ClusterV1alpha2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -69,12 +64,12 @@ func NewForConfig(c *rest.Config) (*ClusterV1alpha1Client, error) { if err != nil { return nil, err } - return &ClusterV1alpha1Client{client}, nil + return &ClusterV1alpha2Client{client}, nil } -// NewForConfigOrDie creates a new ClusterV1alpha1Client for the given config and +// NewForConfigOrDie creates a new ClusterV1alpha2Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ClusterV1alpha1Client { +func NewForConfigOrDie(c *rest.Config) *ClusterV1alpha2Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -82,13 +77,13 @@ func NewForConfigOrDie(c *rest.Config) *ClusterV1alpha1Client { return client } -// New creates a new ClusterV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *ClusterV1alpha1Client { - return &ClusterV1alpha1Client{c} +// New creates a new ClusterV1alpha2Client for the given RESTClient. +func New(c rest.Interface) *ClusterV1alpha2Client { + return &ClusterV1alpha2Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion + gv := v1alpha2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} @@ -102,7 +97,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *ClusterV1alpha1Client) RESTClient() rest.Interface { +func (c *ClusterV1alpha2Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/doc.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/doc.go similarity index 97% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/doc.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/doc.go index 68d97b9b322f..c543a8ee50bc 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/doc.go +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Code generated by main. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1alpha1 +package v1alpha2 diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/BUILD.bazel b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/BUILD.bazel similarity index 85% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/BUILD.bazel rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/BUILD.bazel index 76a6933b28a9..5b41c30f6f63 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/BUILD.bazel +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/BUILD.bazel @@ -7,15 +7,14 @@ go_library( "fake_cluster.go", "fake_cluster_client.go", "fake_machine.go", - "fake_machineclass.go", "fake_machinedeployment.go", "fake_machineset.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake", + importpath = "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", - "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", + "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/doc.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/doc.go similarity index 100% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/doc.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/doc.go diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_cluster.go similarity index 75% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_cluster.go index 14a73632207e..036a9b2b40f7 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster.go +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_cluster.go @@ -25,34 +25,34 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) // FakeClusters implements ClusterInterface type FakeClusters struct { - Fake *FakeClusterV1alpha1 + Fake *FakeClusterV1alpha2 ns string } -var clustersResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1alpha1", Resource: "clusters"} +var clustersResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1alpha2", Resource: "clusters"} -var clustersKind = schema.GroupVersionKind{Group: "cluster.k8s.io", Version: "v1alpha1", Kind: "Cluster"} +var clustersKind = schema.GroupVersionKind{Group: "cluster.k8s.io", Version: "v1alpha2", Kind: "Cluster"} // Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. -func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) { +func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1alpha2.Cluster, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(clustersResource, c.ns, name), &v1alpha1.Cluster{}) + Invokes(testing.NewGetAction(clustersResource, c.ns, name), &v1alpha2.Cluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Cluster), err + return obj.(*v1alpha2.Cluster), err } // List takes label and field selectors, and returns the list of Clusters that match those selectors. -func (c *FakeClusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) { +func (c *FakeClusters) List(opts v1.ListOptions) (result *v1alpha2.ClusterList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(clustersResource, clustersKind, c.ns, opts), &v1alpha1.ClusterList{}) + Invokes(testing.NewListAction(clustersResource, clustersKind, c.ns, opts), &v1alpha2.ClusterList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeClusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, if label == nil { label = labels.Everything() } - list := &v1alpha1.ClusterList{ListMeta: obj.(*v1alpha1.ClusterList).ListMeta} - for _, item := range obj.(*v1alpha1.ClusterList).Items { + list := &v1alpha2.ClusterList{ListMeta: obj.(*v1alpha2.ClusterList).ListMeta} + for _, item := range obj.(*v1alpha2.ClusterList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakeClusters) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *FakeClusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { +func (c *FakeClusters) Create(cluster *v1alpha2.Cluster) (result *v1alpha2.Cluster, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{}) + Invokes(testing.NewCreateAction(clustersResource, c.ns, cluster), &v1alpha2.Cluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Cluster), err + return obj.(*v1alpha2.Cluster), err } // Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *FakeClusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { +func (c *FakeClusters) Update(cluster *v1alpha2.Cluster) (result *v1alpha2.Cluster, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{}) + Invokes(testing.NewUpdateAction(clustersResource, c.ns, cluster), &v1alpha2.Cluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Cluster), err + return obj.(*v1alpha2.Cluster), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusters) UpdateStatus(cluster *v1alpha1.Cluster) (*v1alpha1.Cluster, error) { +func (c *FakeClusters) UpdateStatus(cluster *v1alpha2.Cluster) (*v1alpha2.Cluster, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(clustersResource, "status", c.ns, cluster), &v1alpha1.Cluster{}) + Invokes(testing.NewUpdateSubresourceAction(clustersResource, "status", c.ns, cluster), &v1alpha2.Cluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Cluster), err + return obj.(*v1alpha2.Cluster), err } // Delete takes name of the cluster and deletes it. Returns an error if one occurs. func (c *FakeClusters) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(clustersResource, c.ns, name), &v1alpha1.Cluster{}) + Invokes(testing.NewDeleteAction(clustersResource, c.ns, name), &v1alpha2.Cluster{}) return err } @@ -124,17 +124,17 @@ func (c *FakeClusters) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(clustersResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1alpha1.ClusterList{}) + _, err := c.Fake.Invokes(action, &v1alpha2.ClusterList{}) return err } // Patch applies the patch and returns the patched cluster. -func (c *FakeClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) { +func (c *FakeClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Cluster, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, pt, data, subresources...), &v1alpha1.Cluster{}) + Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, pt, data, subresources...), &v1alpha2.Cluster{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Cluster), err + return obj.(*v1alpha2.Cluster), err } diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster_client.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_cluster_client.go similarity index 59% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster_client.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_cluster_client.go index 9ab6c3822904..d73d5f2a97e2 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_cluster_client.go +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_cluster_client.go @@ -21,36 +21,32 @@ package fake import ( rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2" ) -type FakeClusterV1alpha1 struct { +type FakeClusterV1alpha2 struct { *testing.Fake } -func (c *FakeClusterV1alpha1) Clusters(namespace string) v1alpha1.ClusterInterface { +func (c *FakeClusterV1alpha2) Clusters(namespace string) v1alpha2.ClusterInterface { return &FakeClusters{c, namespace} } -func (c *FakeClusterV1alpha1) Machines(namespace string) v1alpha1.MachineInterface { +func (c *FakeClusterV1alpha2) Machines(namespace string) v1alpha2.MachineInterface { return &FakeMachines{c, namespace} } -func (c *FakeClusterV1alpha1) MachineClasses(namespace string) v1alpha1.MachineClassInterface { - return &FakeMachineClasses{c, namespace} -} - -func (c *FakeClusterV1alpha1) MachineDeployments(namespace string) v1alpha1.MachineDeploymentInterface { +func (c *FakeClusterV1alpha2) MachineDeployments(namespace string) v1alpha2.MachineDeploymentInterface { return &FakeMachineDeployments{c, namespace} } -func (c *FakeClusterV1alpha1) MachineSets(namespace string) v1alpha1.MachineSetInterface { +func (c *FakeClusterV1alpha2) MachineSets(namespace string) v1alpha2.MachineSetInterface { return &FakeMachineSets{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeClusterV1alpha1) RESTClient() rest.Interface { +func (c *FakeClusterV1alpha2) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machine.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_machine.go similarity index 75% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machine.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_machine.go index 6b549e3309e2..5454575a8d3f 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machine.go +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_machine.go @@ -25,34 +25,34 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) // FakeMachines implements MachineInterface type FakeMachines struct { - Fake *FakeClusterV1alpha1 + Fake *FakeClusterV1alpha2 ns string } -var machinesResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1alpha1", Resource: "machines"} +var machinesResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1alpha2", Resource: "machines"} -var machinesKind = schema.GroupVersionKind{Group: "cluster.k8s.io", Version: "v1alpha1", Kind: "Machine"} +var machinesKind = schema.GroupVersionKind{Group: "cluster.k8s.io", Version: "v1alpha2", Kind: "Machine"} // Get takes name of the machine, and returns the corresponding machine object, and an error if there is any. -func (c *FakeMachines) Get(name string, options v1.GetOptions) (result *v1alpha1.Machine, err error) { +func (c *FakeMachines) Get(name string, options v1.GetOptions) (result *v1alpha2.Machine, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(machinesResource, c.ns, name), &v1alpha1.Machine{}) + Invokes(testing.NewGetAction(machinesResource, c.ns, name), &v1alpha2.Machine{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Machine), err + return obj.(*v1alpha2.Machine), err } // List takes label and field selectors, and returns the list of Machines that match those selectors. -func (c *FakeMachines) List(opts v1.ListOptions) (result *v1alpha1.MachineList, err error) { +func (c *FakeMachines) List(opts v1.ListOptions) (result *v1alpha2.MachineList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(machinesResource, machinesKind, c.ns, opts), &v1alpha1.MachineList{}) + Invokes(testing.NewListAction(machinesResource, machinesKind, c.ns, opts), &v1alpha2.MachineList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeMachines) List(opts v1.ListOptions) (result *v1alpha1.MachineList, if label == nil { label = labels.Everything() } - list := &v1alpha1.MachineList{ListMeta: obj.(*v1alpha1.MachineList).ListMeta} - for _, item := range obj.(*v1alpha1.MachineList).Items { + list := &v1alpha2.MachineList{ListMeta: obj.(*v1alpha2.MachineList).ListMeta} + for _, item := range obj.(*v1alpha2.MachineList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakeMachines) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any. -func (c *FakeMachines) Create(machine *v1alpha1.Machine) (result *v1alpha1.Machine, err error) { +func (c *FakeMachines) Create(machine *v1alpha2.Machine) (result *v1alpha2.Machine, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(machinesResource, c.ns, machine), &v1alpha1.Machine{}) + Invokes(testing.NewCreateAction(machinesResource, c.ns, machine), &v1alpha2.Machine{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Machine), err + return obj.(*v1alpha2.Machine), err } // Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any. -func (c *FakeMachines) Update(machine *v1alpha1.Machine) (result *v1alpha1.Machine, err error) { +func (c *FakeMachines) Update(machine *v1alpha2.Machine) (result *v1alpha2.Machine, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(machinesResource, c.ns, machine), &v1alpha1.Machine{}) + Invokes(testing.NewUpdateAction(machinesResource, c.ns, machine), &v1alpha2.Machine{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Machine), err + return obj.(*v1alpha2.Machine), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeMachines) UpdateStatus(machine *v1alpha1.Machine) (*v1alpha1.Machine, error) { +func (c *FakeMachines) UpdateStatus(machine *v1alpha2.Machine) (*v1alpha2.Machine, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(machinesResource, "status", c.ns, machine), &v1alpha1.Machine{}) + Invokes(testing.NewUpdateSubresourceAction(machinesResource, "status", c.ns, machine), &v1alpha2.Machine{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Machine), err + return obj.(*v1alpha2.Machine), err } // Delete takes name of the machine and deletes it. Returns an error if one occurs. func (c *FakeMachines) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(machinesResource, c.ns, name), &v1alpha1.Machine{}) + Invokes(testing.NewDeleteAction(machinesResource, c.ns, name), &v1alpha2.Machine{}) return err } @@ -124,17 +124,17 @@ func (c *FakeMachines) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeMachines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(machinesResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1alpha1.MachineList{}) + _, err := c.Fake.Invokes(action, &v1alpha2.MachineList{}) return err } // Patch applies the patch and returns the patched machine. -func (c *FakeMachines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Machine, err error) { +func (c *FakeMachines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Machine, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(machinesResource, c.ns, name, pt, data, subresources...), &v1alpha1.Machine{}) + Invokes(testing.NewPatchSubresourceAction(machinesResource, c.ns, name, pt, data, subresources...), &v1alpha2.Machine{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Machine), err + return obj.(*v1alpha2.Machine), err } diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machinedeployment.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_machinedeployment.go similarity index 74% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machinedeployment.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_machinedeployment.go index 60246dd32149..5dbcb13dae21 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machinedeployment.go +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_machinedeployment.go @@ -25,34 +25,34 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) // FakeMachineDeployments implements MachineDeploymentInterface type FakeMachineDeployments struct { - Fake *FakeClusterV1alpha1 + Fake *FakeClusterV1alpha2 ns string } -var machinedeploymentsResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1alpha1", Resource: "machinedeployments"} +var machinedeploymentsResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1alpha2", Resource: "machinedeployments"} -var machinedeploymentsKind = schema.GroupVersionKind{Group: "cluster.k8s.io", Version: "v1alpha1", Kind: "MachineDeployment"} +var machinedeploymentsKind = schema.GroupVersionKind{Group: "cluster.k8s.io", Version: "v1alpha2", Kind: "MachineDeployment"} // Get takes name of the machineDeployment, and returns the corresponding machineDeployment object, and an error if there is any. -func (c *FakeMachineDeployments) Get(name string, options v1.GetOptions) (result *v1alpha1.MachineDeployment, err error) { +func (c *FakeMachineDeployments) Get(name string, options v1.GetOptions) (result *v1alpha2.MachineDeployment, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(machinedeploymentsResource, c.ns, name), &v1alpha1.MachineDeployment{}) + Invokes(testing.NewGetAction(machinedeploymentsResource, c.ns, name), &v1alpha2.MachineDeployment{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.MachineDeployment), err + return obj.(*v1alpha2.MachineDeployment), err } // List takes label and field selectors, and returns the list of MachineDeployments that match those selectors. -func (c *FakeMachineDeployments) List(opts v1.ListOptions) (result *v1alpha1.MachineDeploymentList, err error) { +func (c *FakeMachineDeployments) List(opts v1.ListOptions) (result *v1alpha2.MachineDeploymentList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(machinedeploymentsResource, machinedeploymentsKind, c.ns, opts), &v1alpha1.MachineDeploymentList{}) + Invokes(testing.NewListAction(machinedeploymentsResource, machinedeploymentsKind, c.ns, opts), &v1alpha2.MachineDeploymentList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeMachineDeployments) List(opts v1.ListOptions) (result *v1alpha1.Mac if label == nil { label = labels.Everything() } - list := &v1alpha1.MachineDeploymentList{ListMeta: obj.(*v1alpha1.MachineDeploymentList).ListMeta} - for _, item := range obj.(*v1alpha1.MachineDeploymentList).Items { + list := &v1alpha2.MachineDeploymentList{ListMeta: obj.(*v1alpha2.MachineDeploymentList).ListMeta} + for _, item := range obj.(*v1alpha2.MachineDeploymentList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakeMachineDeployments) Watch(opts v1.ListOptions) (watch.Interface, er } // Create takes the representation of a machineDeployment and creates it. Returns the server's representation of the machineDeployment, and an error, if there is any. -func (c *FakeMachineDeployments) Create(machineDeployment *v1alpha1.MachineDeployment) (result *v1alpha1.MachineDeployment, err error) { +func (c *FakeMachineDeployments) Create(machineDeployment *v1alpha2.MachineDeployment) (result *v1alpha2.MachineDeployment, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(machinedeploymentsResource, c.ns, machineDeployment), &v1alpha1.MachineDeployment{}) + Invokes(testing.NewCreateAction(machinedeploymentsResource, c.ns, machineDeployment), &v1alpha2.MachineDeployment{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.MachineDeployment), err + return obj.(*v1alpha2.MachineDeployment), err } // Update takes the representation of a machineDeployment and updates it. Returns the server's representation of the machineDeployment, and an error, if there is any. -func (c *FakeMachineDeployments) Update(machineDeployment *v1alpha1.MachineDeployment) (result *v1alpha1.MachineDeployment, err error) { +func (c *FakeMachineDeployments) Update(machineDeployment *v1alpha2.MachineDeployment) (result *v1alpha2.MachineDeployment, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(machinedeploymentsResource, c.ns, machineDeployment), &v1alpha1.MachineDeployment{}) + Invokes(testing.NewUpdateAction(machinedeploymentsResource, c.ns, machineDeployment), &v1alpha2.MachineDeployment{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.MachineDeployment), err + return obj.(*v1alpha2.MachineDeployment), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeMachineDeployments) UpdateStatus(machineDeployment *v1alpha1.MachineDeployment) (*v1alpha1.MachineDeployment, error) { +func (c *FakeMachineDeployments) UpdateStatus(machineDeployment *v1alpha2.MachineDeployment) (*v1alpha2.MachineDeployment, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(machinedeploymentsResource, "status", c.ns, machineDeployment), &v1alpha1.MachineDeployment{}) + Invokes(testing.NewUpdateSubresourceAction(machinedeploymentsResource, "status", c.ns, machineDeployment), &v1alpha2.MachineDeployment{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.MachineDeployment), err + return obj.(*v1alpha2.MachineDeployment), err } // Delete takes name of the machineDeployment and deletes it. Returns an error if one occurs. func (c *FakeMachineDeployments) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(machinedeploymentsResource, c.ns, name), &v1alpha1.MachineDeployment{}) + Invokes(testing.NewDeleteAction(machinedeploymentsResource, c.ns, name), &v1alpha2.MachineDeployment{}) return err } @@ -124,17 +124,17 @@ func (c *FakeMachineDeployments) Delete(name string, options *v1.DeleteOptions) func (c *FakeMachineDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(machinedeploymentsResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1alpha1.MachineDeploymentList{}) + _, err := c.Fake.Invokes(action, &v1alpha2.MachineDeploymentList{}) return err } // Patch applies the patch and returns the patched machineDeployment. -func (c *FakeMachineDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineDeployment, err error) { +func (c *FakeMachineDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.MachineDeployment, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(machinedeploymentsResource, c.ns, name, pt, data, subresources...), &v1alpha1.MachineDeployment{}) + Invokes(testing.NewPatchSubresourceAction(machinedeploymentsResource, c.ns, name, pt, data, subresources...), &v1alpha2.MachineDeployment{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.MachineDeployment), err + return obj.(*v1alpha2.MachineDeployment), err } diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineset.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_machineset.go similarity index 74% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineset.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_machineset.go index 5c1613e81201..fe6797e3f4c1 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/fake/fake_machineset.go +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/fake/fake_machineset.go @@ -25,34 +25,34 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) // FakeMachineSets implements MachineSetInterface type FakeMachineSets struct { - Fake *FakeClusterV1alpha1 + Fake *FakeClusterV1alpha2 ns string } -var machinesetsResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1alpha1", Resource: "machinesets"} +var machinesetsResource = schema.GroupVersionResource{Group: "cluster.k8s.io", Version: "v1alpha2", Resource: "machinesets"} -var machinesetsKind = schema.GroupVersionKind{Group: "cluster.k8s.io", Version: "v1alpha1", Kind: "MachineSet"} +var machinesetsKind = schema.GroupVersionKind{Group: "cluster.k8s.io", Version: "v1alpha2", Kind: "MachineSet"} // Get takes name of the machineSet, and returns the corresponding machineSet object, and an error if there is any. -func (c *FakeMachineSets) Get(name string, options v1.GetOptions) (result *v1alpha1.MachineSet, err error) { +func (c *FakeMachineSets) Get(name string, options v1.GetOptions) (result *v1alpha2.MachineSet, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(machinesetsResource, c.ns, name), &v1alpha1.MachineSet{}) + Invokes(testing.NewGetAction(machinesetsResource, c.ns, name), &v1alpha2.MachineSet{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.MachineSet), err + return obj.(*v1alpha2.MachineSet), err } // List takes label and field selectors, and returns the list of MachineSets that match those selectors. -func (c *FakeMachineSets) List(opts v1.ListOptions) (result *v1alpha1.MachineSetList, err error) { +func (c *FakeMachineSets) List(opts v1.ListOptions) (result *v1alpha2.MachineSetList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(machinesetsResource, machinesetsKind, c.ns, opts), &v1alpha1.MachineSetList{}) + Invokes(testing.NewListAction(machinesetsResource, machinesetsKind, c.ns, opts), &v1alpha2.MachineSetList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeMachineSets) List(opts v1.ListOptions) (result *v1alpha1.MachineSet if label == nil { label = labels.Everything() } - list := &v1alpha1.MachineSetList{ListMeta: obj.(*v1alpha1.MachineSetList).ListMeta} - for _, item := range obj.(*v1alpha1.MachineSetList).Items { + list := &v1alpha2.MachineSetList{ListMeta: obj.(*v1alpha2.MachineSetList).ListMeta} + for _, item := range obj.(*v1alpha2.MachineSetList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakeMachineSets) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a machineSet and creates it. Returns the server's representation of the machineSet, and an error, if there is any. -func (c *FakeMachineSets) Create(machineSet *v1alpha1.MachineSet) (result *v1alpha1.MachineSet, err error) { +func (c *FakeMachineSets) Create(machineSet *v1alpha2.MachineSet) (result *v1alpha2.MachineSet, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(machinesetsResource, c.ns, machineSet), &v1alpha1.MachineSet{}) + Invokes(testing.NewCreateAction(machinesetsResource, c.ns, machineSet), &v1alpha2.MachineSet{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.MachineSet), err + return obj.(*v1alpha2.MachineSet), err } // Update takes the representation of a machineSet and updates it. Returns the server's representation of the machineSet, and an error, if there is any. -func (c *FakeMachineSets) Update(machineSet *v1alpha1.MachineSet) (result *v1alpha1.MachineSet, err error) { +func (c *FakeMachineSets) Update(machineSet *v1alpha2.MachineSet) (result *v1alpha2.MachineSet, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(machinesetsResource, c.ns, machineSet), &v1alpha1.MachineSet{}) + Invokes(testing.NewUpdateAction(machinesetsResource, c.ns, machineSet), &v1alpha2.MachineSet{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.MachineSet), err + return obj.(*v1alpha2.MachineSet), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeMachineSets) UpdateStatus(machineSet *v1alpha1.MachineSet) (*v1alpha1.MachineSet, error) { +func (c *FakeMachineSets) UpdateStatus(machineSet *v1alpha2.MachineSet) (*v1alpha2.MachineSet, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(machinesetsResource, "status", c.ns, machineSet), &v1alpha1.MachineSet{}) + Invokes(testing.NewUpdateSubresourceAction(machinesetsResource, "status", c.ns, machineSet), &v1alpha2.MachineSet{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.MachineSet), err + return obj.(*v1alpha2.MachineSet), err } // Delete takes name of the machineSet and deletes it. Returns an error if one occurs. func (c *FakeMachineSets) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(machinesetsResource, c.ns, name), &v1alpha1.MachineSet{}) + Invokes(testing.NewDeleteAction(machinesetsResource, c.ns, name), &v1alpha2.MachineSet{}) return err } @@ -124,17 +124,17 @@ func (c *FakeMachineSets) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeMachineSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(machinesetsResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1alpha1.MachineSetList{}) + _, err := c.Fake.Invokes(action, &v1alpha2.MachineSetList{}) return err } // Patch applies the patch and returns the patched machineSet. -func (c *FakeMachineSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineSet, err error) { +func (c *FakeMachineSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.MachineSet, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(machinesetsResource, c.ns, name, pt, data, subresources...), &v1alpha1.MachineSet{}) + Invokes(testing.NewPatchSubresourceAction(machinesetsResource, c.ns, name, pt, data, subresources...), &v1alpha2.MachineSet{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.MachineSet), err + return obj.(*v1alpha2.MachineSet), err } diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/generated_expansion.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/generated_expansion.go similarity index 93% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/generated_expansion.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/generated_expansion.go index 874cfce99bcb..ee795c400bee 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/generated_expansion.go @@ -16,14 +16,12 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 type ClusterExpansion interface{} type MachineExpansion interface{} -type MachineClassExpansion interface{} - type MachineDeploymentExpansion interface{} type MachineSetExpansion interface{} diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machine.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/machine.go similarity index 81% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machine.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/machine.go index 70646de5c427..93748d23d5b3 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machine.go +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/machine.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( "time" @@ -25,7 +25,7 @@ import ( 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" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) @@ -37,15 +37,15 @@ type MachinesGetter interface { // MachineInterface has methods to work with Machine resources. type MachineInterface interface { - Create(*v1alpha1.Machine) (*v1alpha1.Machine, error) - Update(*v1alpha1.Machine) (*v1alpha1.Machine, error) - UpdateStatus(*v1alpha1.Machine) (*v1alpha1.Machine, error) + Create(*v1alpha2.Machine) (*v1alpha2.Machine, error) + Update(*v1alpha2.Machine) (*v1alpha2.Machine, error) + UpdateStatus(*v1alpha2.Machine) (*v1alpha2.Machine, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.Machine, error) - List(opts v1.ListOptions) (*v1alpha1.MachineList, error) + Get(name string, options v1.GetOptions) (*v1alpha2.Machine, error) + List(opts v1.ListOptions) (*v1alpha2.MachineList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Machine, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Machine, err error) MachineExpansion } @@ -56,7 +56,7 @@ type machines struct { } // newMachines returns a Machines -func newMachines(c *ClusterV1alpha1Client, namespace string) *machines { +func newMachines(c *ClusterV1alpha2Client, namespace string) *machines { return &machines{ client: c.RESTClient(), ns: namespace, @@ -64,8 +64,8 @@ func newMachines(c *ClusterV1alpha1Client, namespace string) *machines { } // 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 *v1alpha1.Machine, err error) { - result = &v1alpha1.Machine{} +func (c *machines) Get(name string, options v1.GetOptions) (result *v1alpha2.Machine, err error) { + result = &v1alpha2.Machine{} err = c.client.Get(). Namespace(c.ns). Resource("machines"). @@ -77,12 +77,12 @@ func (c *machines) Get(name string, options v1.GetOptions) (result *v1alpha1.Mac } // List takes label and field selectors, and returns the list of Machines that match those selectors. -func (c *machines) List(opts v1.ListOptions) (result *v1alpha1.MachineList, err error) { +func (c *machines) List(opts v1.ListOptions) (result *v1alpha2.MachineList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.MachineList{} + result = &v1alpha2.MachineList{} err = c.client.Get(). Namespace(c.ns). Resource("machines"). @@ -109,8 +109,8 @@ func (c *machines) Watch(opts v1.ListOptions) (watch.Interface, error) { } // 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 *v1alpha1.Machine) (result *v1alpha1.Machine, err error) { - result = &v1alpha1.Machine{} +func (c *machines) Create(machine *v1alpha2.Machine) (result *v1alpha2.Machine, err error) { + result = &v1alpha2.Machine{} err = c.client.Post(). Namespace(c.ns). Resource("machines"). @@ -121,8 +121,8 @@ func (c *machines) Create(machine *v1alpha1.Machine) (result *v1alpha1.Machine, } // 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 *v1alpha1.Machine) (result *v1alpha1.Machine, err error) { - result = &v1alpha1.Machine{} +func (c *machines) Update(machine *v1alpha2.Machine) (result *v1alpha2.Machine, err error) { + result = &v1alpha2.Machine{} err = c.client.Put(). Namespace(c.ns). Resource("machines"). @@ -136,8 +136,8 @@ func (c *machines) Update(machine *v1alpha1.Machine) (result *v1alpha1.Machine, // 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 *v1alpha1.Machine) (result *v1alpha1.Machine, err error) { - result = &v1alpha1.Machine{} +func (c *machines) UpdateStatus(machine *v1alpha2.Machine) (result *v1alpha2.Machine, err error) { + result = &v1alpha2.Machine{} err = c.client.Put(). Namespace(c.ns). Resource("machines"). @@ -177,8 +177,8 @@ func (c *machines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.Li } // Patch applies the patch and returns the patched machine. -func (c *machines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Machine, err error) { - result = &v1alpha1.Machine{} +func (c *machines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.Machine, err error) { + result = &v1alpha2.Machine{} err = c.client.Patch(pt). Namespace(c.ns). Resource("machines"). diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machinedeployment.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/machinedeployment.go similarity index 81% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machinedeployment.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/machinedeployment.go index 8bddaf9dfefd..d12d786b0210 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machinedeployment.go +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/machinedeployment.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( "time" @@ -25,7 +25,7 @@ import ( 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" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) @@ -37,15 +37,15 @@ type MachineDeploymentsGetter interface { // MachineDeploymentInterface has methods to work with MachineDeployment resources. type MachineDeploymentInterface interface { - Create(*v1alpha1.MachineDeployment) (*v1alpha1.MachineDeployment, error) - Update(*v1alpha1.MachineDeployment) (*v1alpha1.MachineDeployment, error) - UpdateStatus(*v1alpha1.MachineDeployment) (*v1alpha1.MachineDeployment, error) + Create(*v1alpha2.MachineDeployment) (*v1alpha2.MachineDeployment, error) + Update(*v1alpha2.MachineDeployment) (*v1alpha2.MachineDeployment, error) + UpdateStatus(*v1alpha2.MachineDeployment) (*v1alpha2.MachineDeployment, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.MachineDeployment, error) - List(opts v1.ListOptions) (*v1alpha1.MachineDeploymentList, error) + Get(name string, options v1.GetOptions) (*v1alpha2.MachineDeployment, error) + List(opts v1.ListOptions) (*v1alpha2.MachineDeploymentList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineDeployment, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.MachineDeployment, err error) MachineDeploymentExpansion } @@ -56,7 +56,7 @@ type machineDeployments struct { } // newMachineDeployments returns a MachineDeployments -func newMachineDeployments(c *ClusterV1alpha1Client, namespace string) *machineDeployments { +func newMachineDeployments(c *ClusterV1alpha2Client, namespace string) *machineDeployments { return &machineDeployments{ client: c.RESTClient(), ns: namespace, @@ -64,8 +64,8 @@ func newMachineDeployments(c *ClusterV1alpha1Client, namespace string) *machineD } // 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 *v1alpha1.MachineDeployment, err error) { - result = &v1alpha1.MachineDeployment{} +func (c *machineDeployments) Get(name string, options v1.GetOptions) (result *v1alpha2.MachineDeployment, err error) { + result = &v1alpha2.MachineDeployment{} err = c.client.Get(). Namespace(c.ns). Resource("machinedeployments"). @@ -77,12 +77,12 @@ func (c *machineDeployments) Get(name string, options v1.GetOptions) (result *v1 } // List takes label and field selectors, and returns the list of MachineDeployments that match those selectors. -func (c *machineDeployments) List(opts v1.ListOptions) (result *v1alpha1.MachineDeploymentList, err error) { +func (c *machineDeployments) List(opts v1.ListOptions) (result *v1alpha2.MachineDeploymentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.MachineDeploymentList{} + result = &v1alpha2.MachineDeploymentList{} err = c.client.Get(). Namespace(c.ns). Resource("machinedeployments"). @@ -109,8 +109,8 @@ func (c *machineDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) } // 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 *v1alpha1.MachineDeployment) (result *v1alpha1.MachineDeployment, err error) { - result = &v1alpha1.MachineDeployment{} +func (c *machineDeployments) Create(machineDeployment *v1alpha2.MachineDeployment) (result *v1alpha2.MachineDeployment, err error) { + result = &v1alpha2.MachineDeployment{} err = c.client.Post(). Namespace(c.ns). Resource("machinedeployments"). @@ -121,8 +121,8 @@ func (c *machineDeployments) Create(machineDeployment *v1alpha1.MachineDeploymen } // 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 *v1alpha1.MachineDeployment) (result *v1alpha1.MachineDeployment, err error) { - result = &v1alpha1.MachineDeployment{} +func (c *machineDeployments) Update(machineDeployment *v1alpha2.MachineDeployment) (result *v1alpha2.MachineDeployment, err error) { + result = &v1alpha2.MachineDeployment{} err = c.client.Put(). Namespace(c.ns). Resource("machinedeployments"). @@ -136,8 +136,8 @@ func (c *machineDeployments) Update(machineDeployment *v1alpha1.MachineDeploymen // 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 *v1alpha1.MachineDeployment) (result *v1alpha1.MachineDeployment, err error) { - result = &v1alpha1.MachineDeployment{} +func (c *machineDeployments) UpdateStatus(machineDeployment *v1alpha2.MachineDeployment) (result *v1alpha2.MachineDeployment, err error) { + result = &v1alpha2.MachineDeployment{} err = c.client.Put(). Namespace(c.ns). Resource("machinedeployments"). @@ -177,8 +177,8 @@ func (c *machineDeployments) DeleteCollection(options *v1.DeleteOptions, listOpt } // Patch applies the patch and returns the patched machineDeployment. -func (c *machineDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineDeployment, err error) { - result = &v1alpha1.MachineDeployment{} +func (c *machineDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.MachineDeployment, err error) { + result = &v1alpha2.MachineDeployment{} err = c.client.Patch(pt). Namespace(c.ns). Resource("machinedeployments"). diff --git a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineset.go b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/machineset.go similarity index 80% rename from pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineset.go rename to pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/machineset.go index 122bb1073050..f9cc431885a3 100644 --- a/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineset.go +++ b/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2/machineset.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( "time" @@ -25,7 +25,7 @@ import ( 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" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" ) @@ -37,15 +37,15 @@ type MachineSetsGetter interface { // MachineSetInterface has methods to work with MachineSet resources. type MachineSetInterface interface { - Create(*v1alpha1.MachineSet) (*v1alpha1.MachineSet, error) - Update(*v1alpha1.MachineSet) (*v1alpha1.MachineSet, error) - UpdateStatus(*v1alpha1.MachineSet) (*v1alpha1.MachineSet, error) + Create(*v1alpha2.MachineSet) (*v1alpha2.MachineSet, error) + Update(*v1alpha2.MachineSet) (*v1alpha2.MachineSet, error) + UpdateStatus(*v1alpha2.MachineSet) (*v1alpha2.MachineSet, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.MachineSet, error) - List(opts v1.ListOptions) (*v1alpha1.MachineSetList, error) + Get(name string, options v1.GetOptions) (*v1alpha2.MachineSet, error) + List(opts v1.ListOptions) (*v1alpha2.MachineSetList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineSet, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.MachineSet, err error) MachineSetExpansion } @@ -56,7 +56,7 @@ type machineSets struct { } // newMachineSets returns a MachineSets -func newMachineSets(c *ClusterV1alpha1Client, namespace string) *machineSets { +func newMachineSets(c *ClusterV1alpha2Client, namespace string) *machineSets { return &machineSets{ client: c.RESTClient(), ns: namespace, @@ -64,8 +64,8 @@ func newMachineSets(c *ClusterV1alpha1Client, namespace string) *machineSets { } // 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 *v1alpha1.MachineSet, err error) { - result = &v1alpha1.MachineSet{} +func (c *machineSets) Get(name string, options v1.GetOptions) (result *v1alpha2.MachineSet, err error) { + result = &v1alpha2.MachineSet{} err = c.client.Get(). Namespace(c.ns). Resource("machinesets"). @@ -77,12 +77,12 @@ func (c *machineSets) Get(name string, options v1.GetOptions) (result *v1alpha1. } // List takes label and field selectors, and returns the list of MachineSets that match those selectors. -func (c *machineSets) List(opts v1.ListOptions) (result *v1alpha1.MachineSetList, err error) { +func (c *machineSets) List(opts v1.ListOptions) (result *v1alpha2.MachineSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.MachineSetList{} + result = &v1alpha2.MachineSetList{} err = c.client.Get(). Namespace(c.ns). Resource("machinesets"). @@ -109,8 +109,8 @@ func (c *machineSets) Watch(opts v1.ListOptions) (watch.Interface, error) { } // 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 *v1alpha1.MachineSet) (result *v1alpha1.MachineSet, err error) { - result = &v1alpha1.MachineSet{} +func (c *machineSets) Create(machineSet *v1alpha2.MachineSet) (result *v1alpha2.MachineSet, err error) { + result = &v1alpha2.MachineSet{} err = c.client.Post(). Namespace(c.ns). Resource("machinesets"). @@ -121,8 +121,8 @@ func (c *machineSets) Create(machineSet *v1alpha1.MachineSet) (result *v1alpha1. } // 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 *v1alpha1.MachineSet) (result *v1alpha1.MachineSet, err error) { - result = &v1alpha1.MachineSet{} +func (c *machineSets) Update(machineSet *v1alpha2.MachineSet) (result *v1alpha2.MachineSet, err error) { + result = &v1alpha2.MachineSet{} err = c.client.Put(). Namespace(c.ns). Resource("machinesets"). @@ -136,8 +136,8 @@ func (c *machineSets) Update(machineSet *v1alpha1.MachineSet) (result *v1alpha1. // 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 *v1alpha1.MachineSet) (result *v1alpha1.MachineSet, err error) { - result = &v1alpha1.MachineSet{} +func (c *machineSets) UpdateStatus(machineSet *v1alpha2.MachineSet) (result *v1alpha2.MachineSet, err error) { + result = &v1alpha2.MachineSet{} err = c.client.Put(). Namespace(c.ns). Resource("machinesets"). @@ -177,8 +177,8 @@ func (c *machineSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1 } // Patch applies the patch and returns the patched machineSet. -func (c *machineSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineSet, err error) { - result = &v1alpha1.MachineSet{} +func (c *machineSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.MachineSet, err error) { + result = &v1alpha2.MachineSet{} err = c.client.Patch(pt). Namespace(c.ns). Resource("machinesets"). diff --git a/pkg/client/informers_generated/externalversions/BUILD.bazel b/pkg/client/informers_generated/externalversions/BUILD.bazel index 039490a15196..c0cf12d897dc 100644 --- a/pkg/client/informers_generated/externalversions/BUILD.bazel +++ b/pkg/client/informers_generated/externalversions/BUILD.bazel @@ -9,7 +9,7 @@ go_library( importpath = "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/client/clientset_generated/clientset:go_default_library", "//pkg/client/informers_generated/externalversions/cluster:go_default_library", "//pkg/client/informers_generated/externalversions/internalinterfaces:go_default_library", diff --git a/pkg/client/informers_generated/externalversions/cluster/BUILD.bazel b/pkg/client/informers_generated/externalversions/cluster/BUILD.bazel index b8cbc69a99fc..d6884e96ca44 100644 --- a/pkg/client/informers_generated/externalversions/cluster/BUILD.bazel +++ b/pkg/client/informers_generated/externalversions/cluster/BUILD.bazel @@ -6,7 +6,7 @@ go_library( importpath = "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster", visibility = ["//visibility:public"], deps = [ - "//pkg/client/informers_generated/externalversions/cluster/v1alpha1:go_default_library", + "//pkg/client/informers_generated/externalversions/cluster/v1alpha2:go_default_library", "//pkg/client/informers_generated/externalversions/internalinterfaces:go_default_library", ], ) diff --git a/pkg/client/informers_generated/externalversions/cluster/interface.go b/pkg/client/informers_generated/externalversions/cluster/interface.go index a41f50d6f501..86d7540ba37f 100644 --- a/pkg/client/informers_generated/externalversions/cluster/interface.go +++ b/pkg/client/informers_generated/externalversions/cluster/interface.go @@ -19,14 +19,14 @@ limitations under the License. package cluster import ( - v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha2" internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { - // V1alpha1 provides access to shared informers for resources in V1alpha1. - V1alpha1() v1alpha1.Interface + // V1alpha2 provides access to shared informers for resources in V1alpha2. + V1alpha2() v1alpha2.Interface } type group struct { @@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// V1alpha1 returns a new v1alpha1.Interface. -func (g *group) V1alpha1() v1alpha1.Interface { - return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +// V1alpha2 returns a new v1alpha2.Interface. +func (g *group) V1alpha2() v1alpha2.Interface { + return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) } diff --git a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go b/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go deleted file mode 100644 index 89fd6a4b0b77..000000000000 --- a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v1alpha1 - -import ( - time "time" - - 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 -// MachineClasses. -type MachineClassInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.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.ClusterV1alpha1().MachineClasses(namespace).List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ClusterV1alpha1().MachineClasses(namespace).Watch(options) - }, - }, - &clusterv1alpha1.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(&clusterv1alpha1.MachineClass{}, f.defaultInformer) -} - -func (f *machineClassInformer) Lister() v1alpha1.MachineClassLister { - return v1alpha1.NewMachineClassLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/BUILD.bazel b/pkg/client/informers_generated/externalversions/cluster/v1alpha2/BUILD.bazel similarity index 81% rename from pkg/client/informers_generated/externalversions/cluster/v1alpha1/BUILD.bazel rename to pkg/client/informers_generated/externalversions/cluster/v1alpha2/BUILD.bazel index ffabb236fea2..09481cc21522 100644 --- a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/BUILD.bazel +++ b/pkg/client/informers_generated/externalversions/cluster/v1alpha2/BUILD.bazel @@ -6,17 +6,16 @@ go_library( "cluster.go", "interface.go", "machine.go", - "machineclass.go", "machinedeployment.go", "machineset.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1", + importpath = "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha2", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/client/clientset_generated/clientset:go_default_library", "//pkg/client/informers_generated/externalversions/internalinterfaces:go_default_library", - "//pkg/client/listers_generated/cluster/v1alpha1:go_default_library", + "//pkg/client/listers_generated/cluster/v1alpha2:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", diff --git a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go b/pkg/client/informers_generated/externalversions/cluster/v1alpha2/cluster.go similarity index 84% rename from pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go rename to pkg/client/informers_generated/externalversions/cluster/v1alpha2/cluster.go index be02f42415f4..bbcc6fcd334a 100644 --- a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go +++ b/pkg/client/informers_generated/externalversions/cluster/v1alpha2/cluster.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( time "time" @@ -25,17 +25,17 @@ import ( 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" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" 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" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha2" ) // ClusterInformer provides access to a shared informer and lister for // Clusters. type ClusterInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.ClusterLister + Lister() v1alpha2.ClusterLister } type clusterInformer struct { @@ -61,16 +61,16 @@ func NewFilteredClusterInformer(client clientset.Interface, namespace string, re if tweakListOptions != nil { tweakListOptions(&options) } - return client.ClusterV1alpha1().Clusters(namespace).List(options) + return client.ClusterV1alpha2().Clusters(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ClusterV1alpha1().Clusters(namespace).Watch(options) + return client.ClusterV1alpha2().Clusters(namespace).Watch(options) }, }, - &clusterv1alpha1.Cluster{}, + &clusterv1alpha2.Cluster{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *clusterInformer) defaultInformer(client clientset.Interface, resyncPeri } func (f *clusterInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&clusterv1alpha1.Cluster{}, f.defaultInformer) + return f.factory.InformerFor(&clusterv1alpha2.Cluster{}, f.defaultInformer) } -func (f *clusterInformer) Lister() v1alpha1.ClusterLister { - return v1alpha1.NewClusterLister(f.Informer().GetIndexer()) +func (f *clusterInformer) Lister() v1alpha2.ClusterLister { + return v1alpha2.NewClusterLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go b/pkg/client/informers_generated/externalversions/cluster/v1alpha2/interface.go similarity index 88% rename from pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go rename to pkg/client/informers_generated/externalversions/cluster/v1alpha2/interface.go index 7d6251617a7a..7a7186d2470f 100644 --- a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go +++ b/pkg/client/informers_generated/externalversions/cluster/v1alpha2/interface.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" @@ -28,8 +28,6 @@ type Interface interface { Clusters() ClusterInformer // Machines returns a MachineInformer. Machines() MachineInformer - // MachineClasses returns a MachineClassInformer. - MachineClasses() MachineClassInformer // MachineDeployments returns a MachineDeploymentInformer. MachineDeployments() MachineDeploymentInformer // MachineSets returns a MachineSetInformer. @@ -57,11 +55,6 @@ 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} diff --git a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go b/pkg/client/informers_generated/externalversions/cluster/v1alpha2/machine.go similarity index 84% rename from pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go rename to pkg/client/informers_generated/externalversions/cluster/v1alpha2/machine.go index 9a5b69f936fc..4c5c59538af3 100644 --- a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go +++ b/pkg/client/informers_generated/externalversions/cluster/v1alpha2/machine.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( time "time" @@ -25,17 +25,17 @@ import ( 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" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" 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" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha2" ) // MachineInformer provides access to a shared informer and lister for // Machines. type MachineInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.MachineLister + Lister() v1alpha2.MachineLister } type machineInformer struct { @@ -61,16 +61,16 @@ func NewFilteredMachineInformer(client clientset.Interface, namespace string, re if tweakListOptions != nil { tweakListOptions(&options) } - return client.ClusterV1alpha1().Machines(namespace).List(options) + return client.ClusterV1alpha2().Machines(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ClusterV1alpha1().Machines(namespace).Watch(options) + return client.ClusterV1alpha2().Machines(namespace).Watch(options) }, }, - &clusterv1alpha1.Machine{}, + &clusterv1alpha2.Machine{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *machineInformer) defaultInformer(client clientset.Interface, resyncPeri } func (f *machineInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&clusterv1alpha1.Machine{}, f.defaultInformer) + return f.factory.InformerFor(&clusterv1alpha2.Machine{}, f.defaultInformer) } -func (f *machineInformer) Lister() v1alpha1.MachineLister { - return v1alpha1.NewMachineLister(f.Informer().GetIndexer()) +func (f *machineInformer) Lister() v1alpha2.MachineLister { + return v1alpha2.NewMachineLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go b/pkg/client/informers_generated/externalversions/cluster/v1alpha2/machinedeployment.go similarity index 85% rename from pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go rename to pkg/client/informers_generated/externalversions/cluster/v1alpha2/machinedeployment.go index 1a9c2a9ee32f..862295475b9a 100644 --- a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go +++ b/pkg/client/informers_generated/externalversions/cluster/v1alpha2/machinedeployment.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( time "time" @@ -25,17 +25,17 @@ import ( 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" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" 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" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha2" ) // MachineDeploymentInformer provides access to a shared informer and lister for // MachineDeployments. type MachineDeploymentInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.MachineDeploymentLister + Lister() v1alpha2.MachineDeploymentLister } type machineDeploymentInformer struct { @@ -61,16 +61,16 @@ func NewFilteredMachineDeploymentInformer(client clientset.Interface, namespace if tweakListOptions != nil { tweakListOptions(&options) } - return client.ClusterV1alpha1().MachineDeployments(namespace).List(options) + return client.ClusterV1alpha2().MachineDeployments(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ClusterV1alpha1().MachineDeployments(namespace).Watch(options) + return client.ClusterV1alpha2().MachineDeployments(namespace).Watch(options) }, }, - &clusterv1alpha1.MachineDeployment{}, + &clusterv1alpha2.MachineDeployment{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *machineDeploymentInformer) defaultInformer(client clientset.Interface, } func (f *machineDeploymentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&clusterv1alpha1.MachineDeployment{}, f.defaultInformer) + return f.factory.InformerFor(&clusterv1alpha2.MachineDeployment{}, f.defaultInformer) } -func (f *machineDeploymentInformer) Lister() v1alpha1.MachineDeploymentLister { - return v1alpha1.NewMachineDeploymentLister(f.Informer().GetIndexer()) +func (f *machineDeploymentInformer) Lister() v1alpha2.MachineDeploymentLister { + return v1alpha2.NewMachineDeploymentLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go b/pkg/client/informers_generated/externalversions/cluster/v1alpha2/machineset.go similarity index 84% rename from pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go rename to pkg/client/informers_generated/externalversions/cluster/v1alpha2/machineset.go index e3da0547b454..f69f1b07b393 100644 --- a/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go +++ b/pkg/client/informers_generated/externalversions/cluster/v1alpha2/machineset.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( time "time" @@ -25,17 +25,17 @@ import ( 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" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" 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" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha2" ) // MachineSetInformer provides access to a shared informer and lister for // MachineSets. type MachineSetInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.MachineSetLister + Lister() v1alpha2.MachineSetLister } type machineSetInformer struct { @@ -61,16 +61,16 @@ func NewFilteredMachineSetInformer(client clientset.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.ClusterV1alpha1().MachineSets(namespace).List(options) + return client.ClusterV1alpha2().MachineSets(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ClusterV1alpha1().MachineSets(namespace).Watch(options) + return client.ClusterV1alpha2().MachineSets(namespace).Watch(options) }, }, - &clusterv1alpha1.MachineSet{}, + &clusterv1alpha2.MachineSet{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *machineSetInformer) defaultInformer(client clientset.Interface, resyncP } func (f *machineSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&clusterv1alpha1.MachineSet{}, f.defaultInformer) + return f.factory.InformerFor(&clusterv1alpha2.MachineSet{}, f.defaultInformer) } -func (f *machineSetInformer) Lister() v1alpha1.MachineSetLister { - return v1alpha1.NewMachineSetLister(f.Informer().GetIndexer()) +func (f *machineSetInformer) Lister() v1alpha2.MachineSetLister { + return v1alpha2.NewMachineSetLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers_generated/externalversions/generic.go b/pkg/client/informers_generated/externalversions/generic.go index b0cfdc0aee51..cef9096cf0a7 100644 --- a/pkg/client/informers_generated/externalversions/generic.go +++ b/pkg/client/informers_generated/externalversions/generic.go @@ -23,7 +23,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" - v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other @@ -52,17 +52,15 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=cluster.k8s.io, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("clusters"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha1().Clusters().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("machines"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha1().Machines().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("machineclasses"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha1().MachineClasses().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("machinedeployments"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha1().MachineDeployments().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("machinesets"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha1().MachineSets().Informer()}, nil + // Group=cluster.k8s.io, Version=v1alpha2 + case v1alpha2.SchemeGroupVersion.WithResource("clusters"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha2().Clusters().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("machines"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha2().Machines().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("machinedeployments"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha2().MachineDeployments().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("machinesets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha2().MachineSets().Informer()}, nil } diff --git a/pkg/client/listers_generated/cluster/v1alpha1/machineclass.go b/pkg/client/listers_generated/cluster/v1alpha1/machineclass.go deleted file mode 100644 index 0f9dbc156a75..000000000000 --- a/pkg/client/listers_generated/cluster/v1alpha1/machineclass.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v1alpha1 - -import ( - "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. -type MachineClassLister interface { - // List lists all MachineClasses in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.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 []*v1alpha1.MachineClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.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 []*v1alpha1.MachineClass, err error) - // Get retrieves the MachineClass from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.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 []*v1alpha1.MachineClass, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MachineClass)) - }) - return ret, err -} - -// Get retrieves the MachineClass from the indexer for a given namespace and name. -func (s machineClassNamespaceLister) Get(name string) (*v1alpha1.MachineClass, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("machineclass"), name) - } - return obj.(*v1alpha1.MachineClass), nil -} diff --git a/pkg/client/listers_generated/cluster/v1alpha1/BUILD.bazel b/pkg/client/listers_generated/cluster/v1alpha2/BUILD.bazel similarity index 84% rename from pkg/client/listers_generated/cluster/v1alpha1/BUILD.bazel rename to pkg/client/listers_generated/cluster/v1alpha2/BUILD.bazel index 40ed528680d8..d0b6877766a8 100644 --- a/pkg/client/listers_generated/cluster/v1alpha1/BUILD.bazel +++ b/pkg/client/listers_generated/cluster/v1alpha2/BUILD.bazel @@ -6,14 +6,13 @@ go_library( "cluster.go", "expansion_generated.go", "machine.go", - "machineclass.go", "machinedeployment.go", "machineset.go", ], - importpath = "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1", + importpath = "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha2", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", diff --git a/pkg/client/listers_generated/cluster/v1alpha1/cluster.go b/pkg/client/listers_generated/cluster/v1alpha2/cluster.go similarity index 81% rename from pkg/client/listers_generated/cluster/v1alpha1/cluster.go rename to pkg/client/listers_generated/cluster/v1alpha2/cluster.go index 0ee493b55ffd..80d11b745cde 100644 --- a/pkg/client/listers_generated/cluster/v1alpha1/cluster.go +++ b/pkg/client/listers_generated/cluster/v1alpha2/cluster.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( "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" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) // ClusterLister helps list Clusters. type ClusterLister interface { // List lists all Clusters in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error) + List(selector labels.Selector) (ret []*v1alpha2.Cluster, err error) // Clusters returns an object that can list and get Clusters. Clusters(namespace string) ClusterNamespaceLister ClusterListerExpansion @@ -45,9 +45,9 @@ func NewClusterLister(indexer cache.Indexer) ClusterLister { } // List lists all Clusters in the indexer. -func (s *clusterLister) List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error) { +func (s *clusterLister) List(selector labels.Selector) (ret []*v1alpha2.Cluster, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Cluster)) + ret = append(ret, m.(*v1alpha2.Cluster)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *clusterLister) Clusters(namespace string) ClusterNamespaceLister { // 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 []*v1alpha1.Cluster, err error) + List(selector labels.Selector) (ret []*v1alpha2.Cluster, err error) // Get retrieves the Cluster from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.Cluster, error) + Get(name string) (*v1alpha2.Cluster, error) ClusterNamespaceListerExpansion } @@ -74,21 +74,21 @@ type clusterNamespaceLister struct { } // List lists all Clusters in the indexer for a given namespace. -func (s clusterNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error) { +func (s clusterNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.Cluster, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Cluster)) + ret = append(ret, m.(*v1alpha2.Cluster)) }) return ret, err } // Get retrieves the Cluster from the indexer for a given namespace and name. -func (s clusterNamespaceLister) Get(name string) (*v1alpha1.Cluster, error) { +func (s clusterNamespaceLister) Get(name string) (*v1alpha2.Cluster, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("cluster"), name) + return nil, errors.NewNotFound(v1alpha2.Resource("cluster"), name) } - return obj.(*v1alpha1.Cluster), nil + return obj.(*v1alpha2.Cluster), nil } diff --git a/pkg/client/listers_generated/cluster/v1alpha1/expansion_generated.go b/pkg/client/listers_generated/cluster/v1alpha2/expansion_generated.go similarity index 84% rename from pkg/client/listers_generated/cluster/v1alpha1/expansion_generated.go rename to pkg/client/listers_generated/cluster/v1alpha2/expansion_generated.go index a8a1ea160dde..2625591a75d2 100644 --- a/pkg/client/listers_generated/cluster/v1alpha1/expansion_generated.go +++ b/pkg/client/listers_generated/cluster/v1alpha2/expansion_generated.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // ClusterListerExpansion allows custom methods to be added to // ClusterLister. @@ -34,14 +34,6 @@ type MachineListerExpansion interface{} // 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{} diff --git a/pkg/client/listers_generated/cluster/v1alpha1/machine.go b/pkg/client/listers_generated/cluster/v1alpha2/machine.go similarity index 81% rename from pkg/client/listers_generated/cluster/v1alpha1/machine.go rename to pkg/client/listers_generated/cluster/v1alpha2/machine.go index 1495d5db0f46..11f5593b3f2d 100644 --- a/pkg/client/listers_generated/cluster/v1alpha1/machine.go +++ b/pkg/client/listers_generated/cluster/v1alpha2/machine.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( "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" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) // MachineLister helps list Machines. type MachineLister interface { // List lists all Machines in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.Machine, err error) + List(selector labels.Selector) (ret []*v1alpha2.Machine, err error) // Machines returns an object that can list and get Machines. Machines(namespace string) MachineNamespaceLister MachineListerExpansion @@ -45,9 +45,9 @@ func NewMachineLister(indexer cache.Indexer) MachineLister { } // List lists all Machines in the indexer. -func (s *machineLister) List(selector labels.Selector) (ret []*v1alpha1.Machine, err error) { +func (s *machineLister) List(selector labels.Selector) (ret []*v1alpha2.Machine, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Machine)) + ret = append(ret, m.(*v1alpha2.Machine)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *machineLister) Machines(namespace string) MachineNamespaceLister { // 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 []*v1alpha1.Machine, err error) + List(selector labels.Selector) (ret []*v1alpha2.Machine, err error) // Get retrieves the Machine from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.Machine, error) + Get(name string) (*v1alpha2.Machine, error) MachineNamespaceListerExpansion } @@ -74,21 +74,21 @@ type machineNamespaceLister struct { } // List lists all Machines in the indexer for a given namespace. -func (s machineNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Machine, err error) { +func (s machineNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.Machine, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Machine)) + ret = append(ret, m.(*v1alpha2.Machine)) }) return ret, err } // Get retrieves the Machine from the indexer for a given namespace and name. -func (s machineNamespaceLister) Get(name string) (*v1alpha1.Machine, error) { +func (s machineNamespaceLister) Get(name string) (*v1alpha2.Machine, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("machine"), name) + return nil, errors.NewNotFound(v1alpha2.Resource("machine"), name) } - return obj.(*v1alpha1.Machine), nil + return obj.(*v1alpha2.Machine), nil } diff --git a/pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go b/pkg/client/listers_generated/cluster/v1alpha2/machinedeployment.go similarity index 82% rename from pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go rename to pkg/client/listers_generated/cluster/v1alpha2/machinedeployment.go index cbfd877e9360..31b0a0ae1126 100644 --- a/pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go +++ b/pkg/client/listers_generated/cluster/v1alpha2/machinedeployment.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( "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" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) // MachineDeploymentLister helps list MachineDeployments. type MachineDeploymentLister interface { // List lists all MachineDeployments in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.MachineDeployment, err error) + List(selector labels.Selector) (ret []*v1alpha2.MachineDeployment, err error) // MachineDeployments returns an object that can list and get MachineDeployments. MachineDeployments(namespace string) MachineDeploymentNamespaceLister MachineDeploymentListerExpansion @@ -45,9 +45,9 @@ func NewMachineDeploymentLister(indexer cache.Indexer) MachineDeploymentLister { } // List lists all MachineDeployments in the indexer. -func (s *machineDeploymentLister) List(selector labels.Selector) (ret []*v1alpha1.MachineDeployment, err error) { +func (s *machineDeploymentLister) List(selector labels.Selector) (ret []*v1alpha2.MachineDeployment, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MachineDeployment)) + ret = append(ret, m.(*v1alpha2.MachineDeployment)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *machineDeploymentLister) MachineDeployments(namespace string) MachineDe // 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 []*v1alpha1.MachineDeployment, err error) + List(selector labels.Selector) (ret []*v1alpha2.MachineDeployment, err error) // Get retrieves the MachineDeployment from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.MachineDeployment, error) + Get(name string) (*v1alpha2.MachineDeployment, error) MachineDeploymentNamespaceListerExpansion } @@ -74,21 +74,21 @@ type machineDeploymentNamespaceLister struct { } // List lists all MachineDeployments in the indexer for a given namespace. -func (s machineDeploymentNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.MachineDeployment, err error) { +func (s machineDeploymentNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.MachineDeployment, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MachineDeployment)) + ret = append(ret, m.(*v1alpha2.MachineDeployment)) }) return ret, err } // Get retrieves the MachineDeployment from the indexer for a given namespace and name. -func (s machineDeploymentNamespaceLister) Get(name string) (*v1alpha1.MachineDeployment, error) { +func (s machineDeploymentNamespaceLister) Get(name string) (*v1alpha2.MachineDeployment, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("machinedeployment"), name) + return nil, errors.NewNotFound(v1alpha2.Resource("machinedeployment"), name) } - return obj.(*v1alpha1.MachineDeployment), nil + return obj.(*v1alpha2.MachineDeployment), nil } diff --git a/pkg/client/listers_generated/cluster/v1alpha1/machineset.go b/pkg/client/listers_generated/cluster/v1alpha2/machineset.go similarity index 81% rename from pkg/client/listers_generated/cluster/v1alpha1/machineset.go rename to pkg/client/listers_generated/cluster/v1alpha2/machineset.go index 67ebc7accdec..d3e03a54148e 100644 --- a/pkg/client/listers_generated/cluster/v1alpha1/machineset.go +++ b/pkg/client/listers_generated/cluster/v1alpha2/machineset.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by main. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( "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" + v1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) // MachineSetLister helps list MachineSets. type MachineSetLister interface { // List lists all MachineSets in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.MachineSet, err error) + List(selector labels.Selector) (ret []*v1alpha2.MachineSet, err error) // MachineSets returns an object that can list and get MachineSets. MachineSets(namespace string) MachineSetNamespaceLister MachineSetListerExpansion @@ -45,9 +45,9 @@ func NewMachineSetLister(indexer cache.Indexer) MachineSetLister { } // List lists all MachineSets in the indexer. -func (s *machineSetLister) List(selector labels.Selector) (ret []*v1alpha1.MachineSet, err error) { +func (s *machineSetLister) List(selector labels.Selector) (ret []*v1alpha2.MachineSet, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MachineSet)) + ret = append(ret, m.(*v1alpha2.MachineSet)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *machineSetLister) MachineSets(namespace string) MachineSetNamespaceList // 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 []*v1alpha1.MachineSet, err error) + List(selector labels.Selector) (ret []*v1alpha2.MachineSet, err error) // Get retrieves the MachineSet from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.MachineSet, error) + Get(name string) (*v1alpha2.MachineSet, error) MachineSetNamespaceListerExpansion } @@ -74,21 +74,21 @@ type machineSetNamespaceLister struct { } // List lists all MachineSets in the indexer for a given namespace. -func (s machineSetNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.MachineSet, err error) { +func (s machineSetNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.MachineSet, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MachineSet)) + ret = append(ret, m.(*v1alpha2.MachineSet)) }) return ret, err } // Get retrieves the MachineSet from the indexer for a given namespace and name. -func (s machineSetNamespaceLister) Get(name string) (*v1alpha1.MachineSet, error) { +func (s machineSetNamespaceLister) Get(name string) (*v1alpha2.MachineSet, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("machineset"), name) + return nil, errors.NewNotFound(v1alpha2.Resource("machineset"), name) } - return obj.(*v1alpha1.MachineSet), nil + return obj.(*v1alpha2.MachineSet), nil } diff --git a/pkg/controller/cluster/BUILD.bazel b/pkg/controller/cluster/BUILD.bazel index 60c81d49b42f..47e2f1e0c5c8 100644 --- a/pkg/controller/cluster/BUILD.bazel +++ b/pkg/controller/cluster/BUILD.bazel @@ -10,7 +10,7 @@ go_library( importpath = "sigs.k8s.io/cluster-api/pkg/controller/cluster", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/controller/error:go_default_library", "//pkg/util:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", @@ -36,7 +36,7 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/apis:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", diff --git a/pkg/controller/cluster/actuator.go b/pkg/controller/cluster/actuator.go index d41a6cbb4b59..5863f989f7fc 100644 --- a/pkg/controller/cluster/actuator.go +++ b/pkg/controller/cluster/actuator.go @@ -17,7 +17,7 @@ limitations under the License. package cluster import ( - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) /// [Actuator] diff --git a/pkg/controller/cluster/cluster_controller.go b/pkg/controller/cluster/cluster_controller.go index 176b2677cfa6..919326de9123 100644 --- a/pkg/controller/cluster/cluster_controller.go +++ b/pkg/controller/cluster/cluster_controller.go @@ -24,8 +24,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/klog" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" + clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" controllerError "sigs.k8s.io/cluster-api/pkg/controller/error" "sigs.k8s.io/cluster-api/pkg/util" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/pkg/controller/cluster/cluster_reconciler_test.go b/pkg/controller/cluster/cluster_reconciler_test.go index c6268a634f50..28421c2b0f76 100644 --- a/pkg/controller/cluster/cluster_reconciler_test.go +++ b/pkg/controller/cluster/cluster_reconciler_test.go @@ -23,7 +23,7 @@ import ( "golang.org/x/net/context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -36,12 +36,12 @@ var expectedRequest = reconcile.Request{NamespacedName: types.NamespacedName{Nam const timeout = time.Second * 5 func TestReconcile(t *testing.T) { - instance := &clusterv1alpha1.Cluster{ + instance := &clusterv1alpha2.Cluster{ ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "default"}, - Spec: clusterv1alpha1.ClusterSpec{ - ClusterNetwork: clusterv1alpha1.ClusterNetworkingConfig{ - Services: clusterv1alpha1.NetworkRanges{CIDRBlocks: []string{"10.96.0.0/12"}}, - Pods: clusterv1alpha1.NetworkRanges{CIDRBlocks: []string{"192.168.0.0/16"}}, + Spec: clusterv1alpha2.ClusterSpec{ + ClusterNetwork: clusterv1alpha2.ClusterNetworkingConfig{ + Services: clusterv1alpha2.NetworkRanges{CIDRBlocks: []string{"10.96.0.0/12"}}, + Pods: clusterv1alpha2.NetworkRanges{CIDRBlocks: []string{"192.168.0.0/16"}}, }, }, } diff --git a/pkg/controller/cluster/testactuator.go b/pkg/controller/cluster/testactuator.go index 5de8a13b98cc..319d6ffd8487 100644 --- a/pkg/controller/cluster/testactuator.go +++ b/pkg/controller/cluster/testactuator.go @@ -19,7 +19,7 @@ package cluster import ( "sync" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) type TestActuator struct { @@ -31,7 +31,7 @@ type TestActuator struct { Lock sync.Mutex } -func (a *TestActuator) Reconcile(*v1alpha1.Cluster) error { +func (a *TestActuator) Reconcile(*v1alpha2.Cluster) error { defer func() { if a.BlockOnReconcile { <-a.unblock @@ -44,7 +44,7 @@ func (a *TestActuator) Reconcile(*v1alpha1.Cluster) error { return nil } -func (a *TestActuator) Delete(*v1alpha1.Cluster) error { +func (a *TestActuator) Delete(*v1alpha2.Cluster) error { defer func() { if a.BlockOnDelete { <-a.unblock diff --git a/pkg/controller/machine/BUILD.bazel b/pkg/controller/machine/BUILD.bazel index 2e84bb00a6de..bb87af26237e 100644 --- a/pkg/controller/machine/BUILD.bazel +++ b/pkg/controller/machine/BUILD.bazel @@ -2,18 +2,12 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", - srcs = [ - "actuator.go", - "machine_controller.go", - "testactuator.go", - ], + srcs = ["machine_controller.go"], importpath = "sigs.k8s.io/cluster-api/pkg/controller/machine", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", - "//pkg/controller/error:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/util:go_default_library", - "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", @@ -38,7 +32,7 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/apis:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", diff --git a/pkg/controller/machine/actuator.go b/pkg/controller/machine/actuator.go deleted file mode 100644 index fb07683b3981..000000000000 --- a/pkg/controller/machine/actuator.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package machine - -import ( - "context" - - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" -) - -/// [Actuator] -// Actuator controls machines on a specific infrastructure. All -// methods should be idempotent unless otherwise specified. -type Actuator interface { - // Create the machine. - Create(context.Context, *clusterv1.Cluster, *clusterv1.Machine) error - // Delete the machine. If no error is returned, it is assumed that all dependent resources have been cleaned up. - Delete(context.Context, *clusterv1.Cluster, *clusterv1.Machine) error - // Update the machine to the provided definition. - Update(context.Context, *clusterv1.Cluster, *clusterv1.Machine) error - // Checks if the machine currently exists. - Exists(context.Context, *clusterv1.Cluster, *clusterv1.Machine) (bool, error) -} - -/// [Actuator] diff --git a/pkg/controller/machine/machine_controller.go b/pkg/controller/machine/machine_controller.go index eea4d5a84fac..e75abd88c080 100644 --- a/pkg/controller/machine/machine_controller.go +++ b/pkg/controller/machine/machine_controller.go @@ -20,14 +20,12 @@ import ( "context" "os" - "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/klog" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - controllerError "sigs.k8s.io/cluster-api/pkg/controller/error" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/cluster-api/pkg/util" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" @@ -41,19 +39,12 @@ const ( NodeNameEnvVar = "NODE_NAME" ) -var DefaultActuator Actuator - -func AddWithActuator(mgr manager.Manager, actuator Actuator) error { - return add(mgr, newReconciler(mgr, actuator)) -} - // newReconciler returns a new reconcile.Reconciler -func newReconciler(mgr manager.Manager, actuator Actuator) reconcile.Reconciler { +func newReconciler(mgr manager.Manager) reconcile.Reconciler { r := &ReconcileMachine{ Client: mgr.GetClient(), scheme: mgr.GetScheme(), nodeName: os.Getenv(NodeNameEnvVar), - actuator: actuator, } if r.nodeName == "" { @@ -83,8 +74,6 @@ type ReconcileMachine struct { client.Client scheme *runtime.Scheme - actuator Actuator - // nodeName is the name of the node on which the machine controller is running, if not present, it is loaded from NODE_NAME. nodeName string } @@ -155,80 +144,80 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul } } - if !m.ObjectMeta.DeletionTimestamp.IsZero() { - // no-op if finalizer has been removed. - if !util.Contains(m.ObjectMeta.Finalizers, clusterv1.MachineFinalizer) { - klog.Infof("Reconciling machine %q causes a no-op as there is no finalizer", name) - return reconcile.Result{}, nil - } - - if !r.isDeleteAllowed(m) { - klog.Infof("Deleting machine hosting this controller is not allowed. Skipping reconciliation of machine %q", name) - return reconcile.Result{}, nil - } - - klog.Infof("Reconciling machine %q triggers delete", name) - if err := r.actuator.Delete(ctx, cluster, m); err != nil { - if requeueErr, ok := errors.Cause(err).(controllerError.HasRequeueAfterError); ok { - klog.Infof("Actuator returned requeue-after error: %v", requeueErr) - return reconcile.Result{Requeue: true, RequeueAfter: requeueErr.GetRequeueAfter()}, nil - } - - klog.Errorf("Failed to delete machine %q: %v", name, err) - return reconcile.Result{}, err - } - - if m.Status.NodeRef != nil { - klog.Infof("Deleting node %q for machine %q", m.Status.NodeRef.Name, m.Name) - if err := r.deleteNode(ctx, m.Status.NodeRef.Name); err != nil { - klog.Errorf("Error deleting node %q for machine %q", name, err) - return reconcile.Result{}, err - } - } - - // Remove finalizer on successful deletion. - m.ObjectMeta.Finalizers = util.Filter(m.ObjectMeta.Finalizers, clusterv1.MachineFinalizer) - if err := r.Client.Update(context.Background(), m); err != nil { - klog.Errorf("Failed to remove finalizer from machine %q: %v", name, err) - return reconcile.Result{}, err - } - - klog.Infof("Machine %q deletion successful", name) - return reconcile.Result{}, nil - } - - exist, err := r.actuator.Exists(ctx, cluster, m) - if err != nil { - klog.Errorf("Failed to check if machine %q exists: %v", name, err) - return reconcile.Result{}, err - } - - if exist { - klog.Infof("Reconciling machine %q triggers idempotent update", name) - if err := r.actuator.Update(ctx, cluster, m); err != nil { - if requeueErr, ok := errors.Cause(err).(controllerError.HasRequeueAfterError); ok { - klog.Infof("Actuator returned requeue-after error: %v", requeueErr) - return reconcile.Result{Requeue: true, RequeueAfter: requeueErr.GetRequeueAfter()}, nil - } - - klog.Errorf(`Error updating machine "%s/%s": %v`, m.Namespace, name, err) - return reconcile.Result{}, err - } - - return reconcile.Result{}, nil - } - - // Machine resource created. Machine does not yet exist. - klog.Infof("Reconciling machine object %v triggers idempotent create.", m.ObjectMeta.Name) - if err := r.actuator.Create(ctx, cluster, m); err != nil { - if requeueErr, ok := errors.Cause(err).(controllerError.HasRequeueAfterError); ok { - klog.Infof("Actuator returned requeue-after error: %v", requeueErr) - return reconcile.Result{Requeue: true, RequeueAfter: requeueErr.GetRequeueAfter()}, nil - } - - klog.Warningf("Failed to create machine %q: %v", name, err) - return reconcile.Result{}, err - } + // if !m.ObjectMeta.DeletionTimestamp.IsZero() { + // // no-op if finalizer has been removed. + // if !util.Contains(m.ObjectMeta.Finalizers, clusterv1.MachineFinalizer) { + // klog.Infof("Reconciling machine %q causes a no-op as there is no finalizer", name) + // return reconcile.Result{}, nil + // } + + // if !r.isDeleteAllowed(m) { + // klog.Infof("Deleting machine hosting this controller is not allowed. Skipping reconciliation of machine %q", name) + // return reconcile.Result{}, nil + // } + + // klog.Infof("Reconciling machine %q triggers delete", name) + // if err := r.actuator.Delete(ctx, cluster, m); err != nil { + // if requeueErr, ok := errors.Cause(err).(controllerError.HasRequeueAfterError); ok { + // klog.Infof("Actuator returned requeue-after error: %v", requeueErr) + // return reconcile.Result{Requeue: true, RequeueAfter: requeueErr.GetRequeueAfter()}, nil + // } + + // klog.Errorf("Failed to delete machine %q: %v", name, err) + // return reconcile.Result{}, err + // } + + // if m.Status.NodeRef != nil { + // klog.Infof("Deleting node %q for machine %q", m.Status.NodeRef.Name, m.Name) + // if err := r.deleteNode(ctx, m.Status.NodeRef.Name); err != nil { + // klog.Errorf("Error deleting node %q for machine %q", name, err) + // return reconcile.Result{}, err + // } + // } + + // // Remove finalizer on successful deletion. + // m.ObjectMeta.Finalizers = util.Filter(m.ObjectMeta.Finalizers, clusterv1.MachineFinalizer) + // if err := r.Client.Update(context.Background(), m); err != nil { + // klog.Errorf("Failed to remove finalizer from machine %q: %v", name, err) + // return reconcile.Result{}, err + // } + + // klog.Infof("Machine %q deletion successful", name) + // return reconcile.Result{}, nil + // } + + // exist, err := r.actuator.Exists(ctx, cluster, m) + // if err != nil { + // klog.Errorf("Failed to check if machine %q exists: %v", name, err) + // return reconcile.Result{}, err + // } + + // if exist { + // klog.Infof("Reconciling machine %q triggers idempotent update", name) + // if err := r.actuator.Update(ctx, cluster, m); err != nil { + // if requeueErr, ok := errors.Cause(err).(controllerError.HasRequeueAfterError); ok { + // klog.Infof("Actuator returned requeue-after error: %v", requeueErr) + // return reconcile.Result{Requeue: true, RequeueAfter: requeueErr.GetRequeueAfter()}, nil + // } + + // klog.Errorf(`Error updating machine "%s/%s": %v`, m.Namespace, name, err) + // return reconcile.Result{}, err + // } + + // return reconcile.Result{}, nil + // } + + // // Machine resource created. Machine does not yet exist. + // klog.Infof("Reconciling machine object %v triggers idempotent create.", m.ObjectMeta.Name) + // if err := r.actuator.Create(ctx, cluster, m); err != nil { + // if requeueErr, ok := errors.Cause(err).(controllerError.HasRequeueAfterError); ok { + // klog.Infof("Actuator returned requeue-after error: %v", requeueErr) + // return reconcile.Result{Requeue: true, RequeueAfter: requeueErr.GetRequeueAfter()}, nil + // } + + // klog.Warningf("Failed to create machine %q: %v", name, err) + // return reconcile.Result{}, err + // } return reconcile.Result{}, nil } diff --git a/pkg/controller/machine/machine_controller_test.go b/pkg/controller/machine/machine_controller_test.go index 49cf6128ff3c..a0b38d4ed4cd 100644 --- a/pkg/controller/machine/machine_controller_test.go +++ b/pkg/controller/machine/machine_controller_test.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" ) @@ -33,52 +33,52 @@ var ( ) func TestReconcileRequest(t *testing.T) { - machine1 := v1alpha1.Machine{ + machine1 := v1alpha2.Machine{ TypeMeta: metav1.TypeMeta{ Kind: "Machine", }, ObjectMeta: metav1.ObjectMeta{ Name: "create", Namespace: "default", - Finalizers: []string{v1alpha1.MachineFinalizer, metav1.FinalizerDeleteDependents}, + Finalizers: []string{v1alpha2.MachineFinalizer, metav1.FinalizerDeleteDependents}, Labels: map[string]string{ - v1alpha1.MachineClusterLabelName: "testcluster", + v1alpha2.MachineClusterLabelName: "testcluster", }, }, } - machine2 := v1alpha1.Machine{ + machine2 := v1alpha2.Machine{ TypeMeta: metav1.TypeMeta{ Kind: "Machine", }, ObjectMeta: metav1.ObjectMeta{ Name: "update", Namespace: "default", - Finalizers: []string{v1alpha1.MachineFinalizer, metav1.FinalizerDeleteDependents}, + Finalizers: []string{v1alpha2.MachineFinalizer, metav1.FinalizerDeleteDependents}, Labels: map[string]string{ - v1alpha1.MachineClusterLabelName: "testcluster", + v1alpha2.MachineClusterLabelName: "testcluster", }, }, } time := metav1.Now() - machine3 := v1alpha1.Machine{ + machine3 := v1alpha2.Machine{ TypeMeta: metav1.TypeMeta{ Kind: "Machine", }, ObjectMeta: metav1.ObjectMeta{ Name: "delete", Namespace: "default", - Finalizers: []string{v1alpha1.MachineFinalizer, metav1.FinalizerDeleteDependents}, + Finalizers: []string{v1alpha2.MachineFinalizer, metav1.FinalizerDeleteDependents}, DeletionTimestamp: &time, Labels: map[string]string{ - v1alpha1.MachineClusterLabelName: "testcluster", + v1alpha2.MachineClusterLabelName: "testcluster", }, }, } - clusterList := v1alpha1.ClusterList{ + clusterList := v1alpha2.ClusterList{ TypeMeta: metav1.TypeMeta{ Kind: "ClusterList", }, - Items: []v1alpha1.Cluster{ + Items: []v1alpha2.Cluster{ { TypeMeta: metav1.TypeMeta{ Kind: "Cluster", @@ -151,13 +151,11 @@ func TestReconcileRequest(t *testing.T) { } for _, tc := range testCases { - act := newTestActuator() - act.ExistsValue = tc.existsValue - v1alpha1.AddToScheme(scheme.Scheme) + // act.ExistsValue = tc.existsValue + v1alpha2.AddToScheme(scheme.Scheme) r := &ReconcileMachine{ - Client: fake.NewFakeClient(&clusterList, &machine1, &machine2, &machine3), - scheme: scheme.Scheme, - actuator: act, + Client: fake.NewFakeClient(&clusterList, &machine1, &machine2, &machine3), + scheme: scheme.Scheme, } result, err := r.Reconcile(tc.request) @@ -174,20 +172,20 @@ func TestReconcileRequest(t *testing.T) { t.Errorf("Case %s. Got: %v, expected %v", tc.request.Name, result, tc.expected.result) } - if act.CreateCallCount != tc.expected.createCallCount { - t.Errorf("Case %s. Got: %d createCallCount, expected %d", tc.request.Name, act.CreateCallCount, tc.expected.createCallCount) - } + // if act.CreateCallCount != tc.expected.createCallCount { + // t.Errorf("Case %s. Got: %d createCallCount, expected %d", tc.request.Name, act.CreateCallCount, tc.expected.createCallCount) + // } - if act.UpdateCallCount != tc.expected.updateCallCount { - t.Errorf("Case %s. Got: %d updateCallCount, expected %d", tc.request.Name, act.UpdateCallCount, tc.expected.updateCallCount) - } + // if act.UpdateCallCount != tc.expected.updateCallCount { + // t.Errorf("Case %s. Got: %d updateCallCount, expected %d", tc.request.Name, act.UpdateCallCount, tc.expected.updateCallCount) + // } - if act.ExistsCallCount != tc.expected.existCallCount { - t.Errorf("Case %s. Got: %d existCallCount, expected %d", tc.request.Name, act.ExistsCallCount, tc.expected.existCallCount) - } + // if act.ExistsCallCount != tc.expected.existCallCount { + // t.Errorf("Case %s. Got: %d existCallCount, expected %d", tc.request.Name, act.ExistsCallCount, tc.expected.existCallCount) + // } - if act.DeleteCallCount != tc.expected.deleteCallCount { - t.Errorf("Case %s. Got: %d deleteCallCount, expected %d", tc.request.Name, act.DeleteCallCount, tc.expected.deleteCallCount) - } + // if act.DeleteCallCount != tc.expected.deleteCallCount { + // t.Errorf("Case %s. Got: %d deleteCallCount, expected %d", tc.request.Name, act.DeleteCallCount, tc.expected.deleteCallCount) + // } } } diff --git a/pkg/controller/machine/machine_reconciler_test.go b/pkg/controller/machine/machine_reconciler_test.go index 8d8b2f88e004..f34bf3d34115 100644 --- a/pkg/controller/machine/machine_reconciler_test.go +++ b/pkg/controller/machine/machine_reconciler_test.go @@ -23,7 +23,7 @@ import ( "golang.org/x/net/context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -38,9 +38,7 @@ const timeout = time.Second * 5 func TestReconcile(t *testing.T) { instance := &clusterv1alpha1.Machine{ ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "default"}, - Spec: clusterv1alpha1.MachineSpec{ - Versions: clusterv1alpha1.MachineVersionInfo{Kubelet: "1.10.3"}, - }, + Spec: clusterv1alpha1.MachineSpec{}, } // Setup the Manager and Controller. Wrap the Controller Reconcile function so it writes each request to a @@ -51,8 +49,7 @@ func TestReconcile(t *testing.T) { } c = mgr.GetClient() - a := newTestActuator() - recFn, requests := SetupTestReconcile(newReconciler(mgr, a)) + recFn, requests := SetupTestReconcile(newReconciler(mgr)) if err := add(mgr, recFn); err != nil { t.Fatalf("error adding controller to manager: %v", err) } diff --git a/pkg/controller/machine/testactuator.go b/pkg/controller/machine/testactuator.go deleted file mode 100644 index 5e5b165b61f4..000000000000 --- a/pkg/controller/machine/testactuator.go +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package machine - -import ( - "context" - "sync" - - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" -) - -var _ Actuator = &TestActuator{} - -type TestActuator struct { - unblock chan string - BlockOnCreate bool - BlockOnDelete bool - BlockOnUpdate bool - BlockOnExists bool - CreateCallCount int64 - DeleteCallCount int64 - UpdateCallCount int64 - ExistsCallCount int64 - ExistsValue bool - Lock sync.Mutex -} - -func (a *TestActuator) Create(context.Context, *v1alpha1.Cluster, *v1alpha1.Machine) error { - defer func() { - if a.BlockOnCreate { - <-a.unblock - } - }() - - a.Lock.Lock() - defer a.Lock.Unlock() - a.CreateCallCount++ - return nil -} - -func (a *TestActuator) Delete(context.Context, *v1alpha1.Cluster, *v1alpha1.Machine) error { - defer func() { - if a.BlockOnDelete { - <-a.unblock - } - }() - - a.Lock.Lock() - defer a.Lock.Unlock() - a.DeleteCallCount++ - return nil -} - -func (a *TestActuator) Update(ctx context.Context, c *v1alpha1.Cluster, machine *v1alpha1.Machine) error { - defer func() { - if a.BlockOnUpdate { - <-a.unblock - } - }() - a.Lock.Lock() - defer a.Lock.Unlock() - a.UpdateCallCount++ - return nil -} - -func (a *TestActuator) Exists(context.Context, *v1alpha1.Cluster, *v1alpha1.Machine) (bool, error) { - defer func() { - if a.BlockOnExists { - <-a.unblock - } - }() - - a.Lock.Lock() - defer a.Lock.Unlock() - a.ExistsCallCount++ - return a.ExistsValue, nil -} - -func newTestActuator() *TestActuator { - ta := new(TestActuator) - ta.unblock = make(chan string) - return ta -} - -func (a *TestActuator) Unblock() { - close(a.unblock) -} diff --git a/pkg/controller/machinedeployment/BUILD.bazel b/pkg/controller/machinedeployment/BUILD.bazel index 5dc2b03bf577..f2406d8986a3 100644 --- a/pkg/controller/machinedeployment/BUILD.bazel +++ b/pkg/controller/machinedeployment/BUILD.bazel @@ -11,7 +11,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/common:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/controller/machinedeployment/util:go_default_library", "//pkg/util:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", @@ -48,7 +48,7 @@ go_test( deps = [ "//pkg/apis:go_default_library", "//pkg/apis/cluster/common:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/pkg/controller/machinedeployment/machinedeployment_controller.go b/pkg/controller/machinedeployment/machinedeployment_controller.go index 11b7cbb635c8..a46d404a38f1 100644 --- a/pkg/controller/machinedeployment/machinedeployment_controller.go +++ b/pkg/controller/machinedeployment/machinedeployment_controller.go @@ -30,7 +30,7 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/klog" "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/cluster-api/pkg/util" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" @@ -45,7 +45,7 @@ const controllerName = "machinedeployment_controller" var ( // controllerKind contains the schema.GroupVersionKind for this controller type. - controllerKind = v1alpha1.SchemeGroupVersion.WithKind("MachineDeployment") + controllerKind = v1alpha2.SchemeGroupVersion.WithKind("MachineDeployment") ) // ReconcileMachineDeployment reconciles a MachineDeployment object. @@ -80,7 +80,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler, mapFn handler.ToRequestsFu // Watch for changes to MachineDeployment. err = c.Watch(&source.Kind{ - Type: &v1alpha1.MachineDeployment{}}, + Type: &v1alpha2.MachineDeployment{}}, &handler.EnqueueRequestForObject{}, ) if err != nil { @@ -89,8 +89,8 @@ func add(mgr manager.Manager, r reconcile.Reconciler, mapFn handler.ToRequestsFu // Watch for changes to MachineSet and reconcile the owner MachineDeployment. err = c.Watch( - &source.Kind{Type: &v1alpha1.MachineSet{}}, - &handler.EnqueueRequestForOwner{OwnerType: &v1alpha1.MachineDeployment{}, IsController: true}, + &source.Kind{Type: &v1alpha2.MachineSet{}}, + &handler.EnqueueRequestForOwner{OwnerType: &v1alpha2.MachineDeployment{}, IsController: true}, ) if err != nil { return err @@ -100,7 +100,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler, mapFn handler.ToRequestsFu // This watcher is required for use cases like adoption. In case a MachineSet doesn't have // a controller reference, it'll look for potential matching MachineDeployments to reconcile. err = c.Watch( - &source.Kind{Type: &v1alpha1.MachineSet{}}, + &source.Kind{Type: &v1alpha2.MachineSet{}}, &handler.EnqueueRequestsFromMapFunc{ToRequests: mapFn}, ) if err != nil { @@ -114,7 +114,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler, mapFn handler.ToRequestsFu // and what is in the MachineDeployment.Spec. func (r *ReconcileMachineDeployment) Reconcile(request reconcile.Request) (reconcile.Result, error) { // Fetch the MachineDeployment instance - d := &v1alpha1.MachineDeployment{} + d := &v1alpha2.MachineDeployment{} ctx := context.TODO() if err := r.Get(context.TODO(), request.NamespacedName, d); err != nil { if apierrors.IsNotFound(err) { @@ -141,8 +141,8 @@ func (r *ReconcileMachineDeployment) Reconcile(request reconcile.Request) (recon return result, err } -func (r *ReconcileMachineDeployment) reconcile(ctx context.Context, d *v1alpha1.MachineDeployment) (reconcile.Result, error) { - v1alpha1.PopulateDefaultsMachineDeployment(d) +func (r *ReconcileMachineDeployment) reconcile(ctx context.Context, d *v1alpha2.MachineDeployment) (reconcile.Result, error) { + v1alpha2.PopulateDefaultsMachineDeployment(d) everything := metav1.LabelSelector{} if reflect.DeepEqual(d.Spec.Selector, &everything) { @@ -225,16 +225,16 @@ func (r *ReconcileMachineDeployment) reconcile(ctx context.Context, d *v1alpha1. } // getCluster reuturns the Cluster associated with the MachineDeployment, if any. -func (r *ReconcileMachineDeployment) getCluster(d *v1alpha1.MachineDeployment) (*v1alpha1.Cluster, error) { - if d.Spec.Template.Labels[v1alpha1.MachineClusterLabelName] == "" { - klog.Infof("Deployment %q in namespace %q doesn't specify %q label, assuming nil cluster", d.Name, d.Namespace, v1alpha1.MachineClusterLabelName) +func (r *ReconcileMachineDeployment) getCluster(d *v1alpha2.MachineDeployment) (*v1alpha2.Cluster, error) { + if d.Spec.Template.Labels[v1alpha2.MachineClusterLabelName] == "" { + klog.Infof("Deployment %q in namespace %q doesn't specify %q label, assuming nil cluster", d.Name, d.Namespace, v1alpha2.MachineClusterLabelName) return nil, nil } - cluster := &v1alpha1.Cluster{} + cluster := &v1alpha2.Cluster{} key := client.ObjectKey{ Namespace: d.Namespace, - Name: d.Spec.Template.Labels[v1alpha1.MachineClusterLabelName], + Name: d.Spec.Template.Labels[v1alpha2.MachineClusterLabelName], } if err := r.Client.Get(context.Background(), key, cluster); err != nil { @@ -245,15 +245,15 @@ func (r *ReconcileMachineDeployment) getCluster(d *v1alpha1.MachineDeployment) ( } // getMachineSetsForDeployment returns a list of MachineSets associated with a MachineDeployment. -func (r *ReconcileMachineDeployment) getMachineSetsForDeployment(d *v1alpha1.MachineDeployment) ([]*v1alpha1.MachineSet, error) { +func (r *ReconcileMachineDeployment) getMachineSetsForDeployment(d *v1alpha2.MachineDeployment) ([]*v1alpha2.MachineSet, error) { // List all MachineSets to find those we own but that no longer match our selector. - machineSets := &v1alpha1.MachineSetList{} + machineSets := &v1alpha2.MachineSetList{} if err := r.Client.List(context.Background(), machineSets, client.InNamespace(d.Namespace)); err != nil { return nil, err } - filtered := make([]*v1alpha1.MachineSet, 0, len(machineSets.Items)) + filtered := make([]*v1alpha2.MachineSet, 0, len(machineSets.Items)) for idx := range machineSets.Items { ms := &machineSets.Items[idx] @@ -295,7 +295,7 @@ func (r *ReconcileMachineDeployment) getMachineSetsForDeployment(d *v1alpha1.Mac } // adoptOrphan sets the MachineDeployment as a controller OwnerReference to the MachineSet. -func (r *ReconcileMachineDeployment) adoptOrphan(deployment *v1alpha1.MachineDeployment, machineSet *v1alpha1.MachineSet) error { +func (r *ReconcileMachineDeployment) adoptOrphan(deployment *v1alpha2.MachineDeployment, machineSet *v1alpha2.MachineSet) error { newRef := *metav1.NewControllerRef(deployment, controllerKind) machineSet.OwnerReferences = append(machineSet.OwnerReferences, newRef) return r.Client.Update(context.Background(), machineSet) @@ -305,7 +305,7 @@ func (r *ReconcileMachineDeployment) adoptOrphan(deployment *v1alpha1.MachineDep // // It returns a map from MachineSet UID to a list of Machines controlled by that MachineSet, // according to the Machine's ControllerRef. -func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1alpha1.MachineDeployment, msList []*v1alpha1.MachineSet) (map[types.UID]*v1alpha1.MachineList, error) { +func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1alpha2.MachineDeployment, msList []*v1alpha2.MachineSet) (map[types.UID]*v1alpha2.MachineList, error) { // TODO(droot): double check if previous selector maps correctly to new one. // _, err := metav1.LabelSelectorAsSelector(&d.Spec.Selector) @@ -315,15 +315,15 @@ func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1alpha1.Mach return nil, err } - machines := &v1alpha1.MachineList{} + machines := &v1alpha2.MachineList{} if err = r.Client.List(context.Background(), machines, client.InNamespace(d.Namespace), client.MatchingLabels(selector)); err != nil { return nil, err } // Group Machines by their controller (if it's in msList). - machineMap := make(map[types.UID]*v1alpha1.MachineList, len(msList)) + machineMap := make(map[types.UID]*v1alpha2.MachineList, len(msList)) for _, ms := range msList { - machineMap[ms.UID] = &v1alpha1.MachineList{} + machineMap[ms.UID] = &v1alpha2.MachineList{} } for idx := range machines.Items { @@ -346,19 +346,19 @@ func (r *ReconcileMachineDeployment) getMachineMapForDeployment(d *v1alpha1.Mach } // getMachineDeploymentsForMachineSet returns a list of MachineDeployments that could potentially match a MachineSet. -func (r *ReconcileMachineDeployment) getMachineDeploymentsForMachineSet(ms *v1alpha1.MachineSet) []*v1alpha1.MachineDeployment { +func (r *ReconcileMachineDeployment) getMachineDeploymentsForMachineSet(ms *v1alpha2.MachineSet) []*v1alpha2.MachineDeployment { if len(ms.Labels) == 0 { klog.Warningf("No machine deployments found for MachineSet %q because it has no labels", ms.Name) return nil } - dList := &v1alpha1.MachineDeploymentList{} + dList := &v1alpha2.MachineDeploymentList{} if err := r.Client.List(context.Background(), dList, client.InNamespace(ms.Namespace)); err != nil { klog.Warningf("Failed to list machine deployments: %v", err) return nil } - deployments := make([]*v1alpha1.MachineDeployment, 0, len(dList.Items)) + deployments := make([]*v1alpha2.MachineDeployment, 0, len(dList.Items)) for idx, d := range dList.Items { selector, err := metav1.LabelSelectorAsSelector(&d.Spec.Selector) if err != nil { @@ -381,7 +381,7 @@ func (r *ReconcileMachineDeployment) getMachineDeploymentsForMachineSet(ms *v1al func (r *ReconcileMachineDeployment) MachineSetToDeployments(o handler.MapObject) []reconcile.Request { result := []reconcile.Request{} - ms := &v1alpha1.MachineSet{} + ms := &v1alpha2.MachineSet{} key := client.ObjectKey{Namespace: o.Meta.GetNamespace(), Name: o.Meta.GetName()} if err := r.Client.Get(context.Background(), key, ms); err != nil { if !apierrors.IsNotFound(err) { diff --git a/pkg/controller/machinedeployment/machinedeployment_controller_test.go b/pkg/controller/machinedeployment/machinedeployment_controller_test.go index 03063bdc4734..78442c30e90d 100644 --- a/pkg/controller/machinedeployment/machinedeployment_controller_test.go +++ b/pkg/controller/machinedeployment/machinedeployment_controller_test.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/handler" @@ -35,29 +35,29 @@ var ( ) func TestMachineSetToDeployments(t *testing.T) { - machineDeployment := v1alpha1.MachineDeployment{ + machineDeployment := v1alpha2.MachineDeployment{ ObjectMeta: metav1.ObjectMeta{ Name: "withMatchingLabels", Namespace: "test", }, - Spec: v1alpha1.MachineDeploymentSpec{ + Spec: v1alpha2.MachineDeploymentSpec{ Selector: metav1.LabelSelector{ MatchLabels: map[string]string{ "foo": "bar", - v1alpha1.MachineClusterLabelName: "test-cluster", + v1alpha2.MachineClusterLabelName: "test-cluster", }, }, }, } - machineDeplopymentList := &v1alpha1.MachineDeploymentList{ + machineDeplopymentList := &v1alpha2.MachineDeploymentList{ TypeMeta: metav1.TypeMeta{ Kind: "MachineDeploymentList", }, - Items: []v1alpha1.MachineDeployment{machineDeployment}, + Items: []v1alpha2.MachineDeployment{machineDeployment}, } - ms1 := v1alpha1.MachineSet{ + ms1 := v1alpha2.MachineSet{ TypeMeta: metav1.TypeMeta{ Kind: "MachineSet", }, @@ -68,11 +68,11 @@ func TestMachineSetToDeployments(t *testing.T) { *metav1.NewControllerRef(&machineDeployment, controllerKind), }, Labels: map[string]string{ - v1alpha1.MachineClusterLabelName: "test-cluster", + v1alpha2.MachineClusterLabelName: "test-cluster", }, }, } - ms2 := v1alpha1.MachineSet{ + ms2 := v1alpha2.MachineSet{ TypeMeta: metav1.TypeMeta{ Kind: "MachineSet", }, @@ -80,11 +80,11 @@ func TestMachineSetToDeployments(t *testing.T) { Name: "noOwnerRefNoLabels", Namespace: "test", Labels: map[string]string{ - v1alpha1.MachineClusterLabelName: "test-cluster", + v1alpha2.MachineClusterLabelName: "test-cluster", }, }, } - ms3 := v1alpha1.MachineSet{ + ms3 := v1alpha2.MachineSet{ TypeMeta: metav1.TypeMeta{ Kind: "MachineSet", }, @@ -93,13 +93,13 @@ func TestMachineSetToDeployments(t *testing.T) { Namespace: "test", Labels: map[string]string{ "foo": "bar", - v1alpha1.MachineClusterLabelName: "test-cluster", + v1alpha2.MachineClusterLabelName: "test-cluster", }, }, } testsCases := []struct { - machineSet v1alpha1.MachineSet + machineSet v1alpha2.MachineSet mapObject handler.MapObject expected []reconcile.Request }{ @@ -131,7 +131,7 @@ func TestMachineSetToDeployments(t *testing.T) { }, } - v1alpha1.AddToScheme(scheme.Scheme) + v1alpha2.AddToScheme(scheme.Scheme) r := &ReconcileMachineDeployment{ Client: fake.NewFakeClient(&ms1, &ms2, &ms3, machineDeplopymentList), scheme: scheme.Scheme, @@ -147,12 +147,12 @@ func TestMachineSetToDeployments(t *testing.T) { } func TestGetMachineDeploymentsForMachineSet(t *testing.T) { - machineDeployment := v1alpha1.MachineDeployment{ + machineDeployment := v1alpha2.MachineDeployment{ ObjectMeta: metav1.ObjectMeta{ Name: "withLabels", Namespace: "test", }, - Spec: v1alpha1.MachineDeploymentSpec{ + Spec: v1alpha2.MachineDeploymentSpec{ Selector: metav1.LabelSelector{ MatchLabels: map[string]string{ "foo": "bar", @@ -160,15 +160,15 @@ func TestGetMachineDeploymentsForMachineSet(t *testing.T) { }, }, } - machineDeplopymentList := &v1alpha1.MachineDeploymentList{ + machineDeplopymentList := &v1alpha2.MachineDeploymentList{ TypeMeta: metav1.TypeMeta{ Kind: "MachineDeploymentList", }, - Items: []v1alpha1.MachineDeployment{ + Items: []v1alpha2.MachineDeployment{ machineDeployment, }, } - ms1 := v1alpha1.MachineSet{ + ms1 := v1alpha2.MachineSet{ TypeMeta: metav1.TypeMeta{ Kind: "MachineSet", }, @@ -177,7 +177,7 @@ func TestGetMachineDeploymentsForMachineSet(t *testing.T) { Namespace: "test", }, } - ms2 := v1alpha1.MachineSet{ + ms2 := v1alpha2.MachineSet{ TypeMeta: metav1.TypeMeta{ Kind: "MachineSet", }, @@ -191,9 +191,9 @@ func TestGetMachineDeploymentsForMachineSet(t *testing.T) { } testCases := []struct { - machineDeploymentList v1alpha1.MachineDeploymentList - machineSet v1alpha1.MachineSet - expected []*v1alpha1.MachineDeployment + machineDeploymentList v1alpha2.MachineDeploymentList + machineSet v1alpha2.MachineSet + expected []*v1alpha2.MachineDeployment }{ { machineDeploymentList: *machineDeplopymentList, @@ -203,10 +203,10 @@ func TestGetMachineDeploymentsForMachineSet(t *testing.T) { { machineDeploymentList: *machineDeplopymentList, machineSet: ms2, - expected: []*v1alpha1.MachineDeployment{&machineDeployment}, + expected: []*v1alpha2.MachineDeployment{&machineDeployment}, }, } - v1alpha1.AddToScheme(scheme.Scheme) + v1alpha2.AddToScheme(scheme.Scheme) r := &ReconcileMachineDeployment{ Client: fake.NewFakeClient(&ms1, &ms2, machineDeplopymentList), scheme: scheme.Scheme, @@ -222,13 +222,13 @@ func TestGetMachineDeploymentsForMachineSet(t *testing.T) { } func TestGetMachineSetsForDeployment(t *testing.T) { - machineDeployment1 := v1alpha1.MachineDeployment{ + machineDeployment1 := v1alpha2.MachineDeployment{ ObjectMeta: metav1.ObjectMeta{ Name: "withMatchingOwnerRefAndLabels", Namespace: "test", UID: "UID", }, - Spec: v1alpha1.MachineDeploymentSpec{ + Spec: v1alpha2.MachineDeploymentSpec{ Selector: metav1.LabelSelector{ MatchLabels: map[string]string{ "foo": "bar", @@ -236,13 +236,13 @@ func TestGetMachineSetsForDeployment(t *testing.T) { }, }, } - machineDeployment2 := v1alpha1.MachineDeployment{ + machineDeployment2 := v1alpha2.MachineDeployment{ ObjectMeta: metav1.ObjectMeta{ Name: "withNoMatchingOwnerRef", Namespace: "test", UID: "unMatchingUID", }, - Spec: v1alpha1.MachineDeploymentSpec{ + Spec: v1alpha2.MachineDeploymentSpec{ Selector: metav1.LabelSelector{ MatchLabels: map[string]string{ "foo": "bar2", @@ -251,7 +251,7 @@ func TestGetMachineSetsForDeployment(t *testing.T) { }, } - ms1 := v1alpha1.MachineSet{ + ms1 := v1alpha2.MachineSet{ TypeMeta: metav1.TypeMeta{ Kind: "MachineSet", }, @@ -263,7 +263,7 @@ func TestGetMachineSetsForDeployment(t *testing.T) { }, }, } - ms2 := v1alpha1.MachineSet{ + ms2 := v1alpha2.MachineSet{ TypeMeta: metav1.TypeMeta{ Kind: "MachineSet", }, @@ -278,7 +278,7 @@ func TestGetMachineSetsForDeployment(t *testing.T) { }, }, } - ms3 := v1alpha1.MachineSet{ + ms3 := v1alpha2.MachineSet{ TypeMeta: metav1.TypeMeta{ Kind: "MachineSet", }, @@ -290,7 +290,7 @@ func TestGetMachineSetsForDeployment(t *testing.T) { }, }, } - ms4 := v1alpha1.MachineSet{ + ms4 := v1alpha2.MachineSet{ TypeMeta: metav1.TypeMeta{ Kind: "MachineSet", }, @@ -302,11 +302,11 @@ func TestGetMachineSetsForDeployment(t *testing.T) { }, }, } - machineSetList := &v1alpha1.MachineSetList{ + machineSetList := &v1alpha2.MachineSetList{ TypeMeta: metav1.TypeMeta{ Kind: "MachineSetList", }, - Items: []v1alpha1.MachineSet{ + Items: []v1alpha2.MachineSet{ ms1, ms2, ms3, @@ -315,20 +315,20 @@ func TestGetMachineSetsForDeployment(t *testing.T) { } testCases := []struct { - machineDeployment v1alpha1.MachineDeployment - expected []*v1alpha1.MachineSet + machineDeployment v1alpha2.MachineDeployment + expected []*v1alpha2.MachineSet }{ { machineDeployment: machineDeployment1, - expected: []*v1alpha1.MachineSet{&ms2, &ms3}, + expected: []*v1alpha2.MachineSet{&ms2, &ms3}, }, { machineDeployment: machineDeployment2, - expected: []*v1alpha1.MachineSet{&ms1}, + expected: []*v1alpha2.MachineSet{&ms1}, }, } - v1alpha1.AddToScheme(scheme.Scheme) + v1alpha2.AddToScheme(scheme.Scheme) r := &ReconcileMachineDeployment{ Client: fake.NewFakeClient(machineSetList), scheme: scheme.Scheme, diff --git a/pkg/controller/machinedeployment/machinedeployment_reconciler_test.go b/pkg/controller/machinedeployment/machinedeployment_reconciler_test.go index b3de7c2b470e..7879e820f58f 100644 --- a/pkg/controller/machinedeployment/machinedeployment_reconciler_test.go +++ b/pkg/controller/machinedeployment/machinedeployment_reconciler_test.go @@ -27,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -45,6 +45,7 @@ var ( func TestReconcile(t *testing.T) { labels := map[string]string{"foo": "bar"} + version := "1.10.3" deployment := &clusterv1alpha1.MachineDeployment{ ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "default"}, Spec: clusterv1alpha1.MachineDeploymentSpec{ @@ -64,7 +65,7 @@ func TestReconcile(t *testing.T) { Labels: labels, }, Spec: clusterv1alpha1.MachineSpec{ - Versions: clusterv1alpha1.MachineVersionInfo{Kubelet: "1.10.3"}, + Version: &version, }, }, }, @@ -105,8 +106,8 @@ func TestReconcile(t *testing.T) { if r := *ms.Spec.Replicas; r != 2 { t.Errorf("replicas was %d not 2", r) } - if k := ms.Spec.Template.Spec.Versions.Kubelet; k != "1.10.3" { - t.Errorf("kubelet was %q not '1.10.3'", k) + if k := ms.Spec.Template.Spec.Version; k == nil || *k != "1.10.3" { + t.Errorf("kubelet was %v not '1.10.3'", k) } // Delete a MachineSet and expect Reconcile to be called to replace it. diff --git a/pkg/controller/machinedeployment/rolling.go b/pkg/controller/machinedeployment/rolling.go index 179ee833a9a2..3556b65854cc 100644 --- a/pkg/controller/machinedeployment/rolling.go +++ b/pkg/controller/machinedeployment/rolling.go @@ -23,12 +23,12 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/klog" "k8s.io/utils/integer" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" dutil "sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/util" ) // rolloutRolling implements the logic for rolling a new machine set. -func (r *ReconcileMachineDeployment) rolloutRolling(d *v1alpha1.MachineDeployment, msList []*v1alpha1.MachineSet, machineMap map[types.UID]*v1alpha1.MachineList) error { +func (r *ReconcileMachineDeployment) rolloutRolling(d *v1alpha2.MachineDeployment, msList []*v1alpha2.MachineSet, machineMap map[types.UID]*v1alpha2.MachineList) error { newMS, oldMSs, err := r.getAllMachineSetsAndSyncRevision(d, msList, machineMap, true) if err != nil { return err @@ -70,7 +70,7 @@ func (r *ReconcileMachineDeployment) rolloutRolling(d *v1alpha1.MachineDeploymen return nil } -func (r *ReconcileMachineDeployment) reconcileNewMachineSet(allMSs []*v1alpha1.MachineSet, newMS *v1alpha1.MachineSet, deployment *v1alpha1.MachineDeployment) error { +func (r *ReconcileMachineDeployment) reconcileNewMachineSet(allMSs []*v1alpha2.MachineSet, newMS *v1alpha2.MachineSet, deployment *v1alpha2.MachineDeployment) error { if deployment.Spec.Replicas == nil { return errors.Errorf("spec replicas for deployment set %v is nil, this is unexpected", deployment.Name) } @@ -98,7 +98,7 @@ func (r *ReconcileMachineDeployment) reconcileNewMachineSet(allMSs []*v1alpha1.M return err } -func (r *ReconcileMachineDeployment) reconcileOldMachineSets(allMSs []*v1alpha1.MachineSet, oldMSs []*v1alpha1.MachineSet, newMS *v1alpha1.MachineSet, deployment *v1alpha1.MachineDeployment) error { +func (r *ReconcileMachineDeployment) reconcileOldMachineSets(allMSs []*v1alpha2.MachineSet, oldMSs []*v1alpha2.MachineSet, newMS *v1alpha2.MachineSet, deployment *v1alpha2.MachineDeployment) error { if deployment.Spec.Replicas == nil { return errors.Errorf("spec replicas for deployment set %v is nil, this is unexpected", deployment.Name) } @@ -175,7 +175,7 @@ func (r *ReconcileMachineDeployment) reconcileOldMachineSets(allMSs []*v1alpha1. } // cleanupUnhealthyReplicas will scale down old machine sets with unhealthy replicas, so that all unhealthy replicas will be deleted. -func (r *ReconcileMachineDeployment) cleanupUnhealthyReplicas(oldMSs []*v1alpha1.MachineSet, deployment *v1alpha1.MachineDeployment, maxCleanupCount int32) ([]*v1alpha1.MachineSet, int32, error) { +func (r *ReconcileMachineDeployment) cleanupUnhealthyReplicas(oldMSs []*v1alpha2.MachineSet, deployment *v1alpha2.MachineDeployment, maxCleanupCount int32) ([]*v1alpha2.MachineSet, int32, error) { sort.Sort(dutil.MachineSetsByCreationTimestamp(oldMSs)) // Safely scale down all old machine sets with unhealthy replicas. Replica set will sort the machines in the order @@ -226,7 +226,7 @@ func (r *ReconcileMachineDeployment) cleanupUnhealthyReplicas(oldMSs []*v1alpha1 // scaleDownOldMachineSetsForRollingUpdate scales down old machine sets when deployment strategy is "RollingUpdate". // Need check maxUnavailable to ensure availability -func (r *ReconcileMachineDeployment) scaleDownOldMachineSetsForRollingUpdate(allMSs []*v1alpha1.MachineSet, oldMSs []*v1alpha1.MachineSet, deployment *v1alpha1.MachineDeployment) (int32, error) { +func (r *ReconcileMachineDeployment) scaleDownOldMachineSetsForRollingUpdate(allMSs []*v1alpha2.MachineSet, oldMSs []*v1alpha2.MachineSet, deployment *v1alpha2.MachineDeployment) (int32, error) { if deployment.Spec.Replicas == nil { return 0, errors.Errorf("spec replicas for deployment %v is nil, this is unexpected", deployment.Name) } diff --git a/pkg/controller/machinedeployment/sync.go b/pkg/controller/machinedeployment/sync.go index 6fe0be776028..b48d61f8e957 100644 --- a/pkg/controller/machinedeployment/sync.go +++ b/pkg/controller/machinedeployment/sync.go @@ -33,7 +33,7 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/util/retry" "k8s.io/klog" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" dutil "sigs.k8s.io/cluster-api/pkg/controller/machinedeployment/util" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/controller/machinedeployment/util/BUILD.bazel b/pkg/controller/machinedeployment/util/BUILD.bazel index e64db5ca01cf..dfc9501063f4 100644 --- a/pkg/controller/machinedeployment/util/BUILD.bazel +++ b/pkg/controller/machinedeployment/util/BUILD.bazel @@ -7,7 +7,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/apis/cluster/common:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/github.com/davecgh/go-spew/spew:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", @@ -26,7 +26,7 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/apis/cluster/common:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/client/clientset_generated/clientset/fake:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/pkg/controller/machinedeployment/util/util.go b/pkg/controller/machinedeployment/util/util.go index 45d69204a7c5..e22573ee0e40 100644 --- a/pkg/controller/machinedeployment/util/util.go +++ b/pkg/controller/machinedeployment/util/util.go @@ -34,7 +34,7 @@ import ( "k8s.io/klog" "k8s.io/utils/integer" "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) const ( @@ -72,7 +72,7 @@ const ( ) // MachineSetsByCreationTimestamp sorts a list of MachineSet by creation timestamp, using their names as a tie breaker. -type MachineSetsByCreationTimestamp []*v1alpha1.MachineSet +type MachineSetsByCreationTimestamp []*v1alpha2.MachineSet func (o MachineSetsByCreationTimestamp) Len() int { return len(o) } func (o MachineSetsByCreationTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] } @@ -85,7 +85,7 @@ func (o MachineSetsByCreationTimestamp) Less(i, j int) bool { // MachineSetsBySizeOlder sorts a list of MachineSet by size in descending order, using their creation timestamp or name as a tie breaker. // By using the creation timestamp, this sorts from old to new machine sets. -type MachineSetsBySizeOlder []*v1alpha1.MachineSet +type MachineSetsBySizeOlder []*v1alpha2.MachineSet func (o MachineSetsBySizeOlder) Len() int { return len(o) } func (o MachineSetsBySizeOlder) Swap(i, j int) { o[i], o[j] = o[j], o[i] } @@ -98,7 +98,7 @@ func (o MachineSetsBySizeOlder) Less(i, j int) bool { // MachineSetsBySizeNewer sorts a list of MachineSet by size in descending order, using their creation timestamp or name as a tie breaker. // By using the creation timestamp, this sorts from new to old machine sets. -type MachineSetsBySizeNewer []*v1alpha1.MachineSet +type MachineSetsBySizeNewer []*v1alpha2.MachineSet func (o MachineSetsBySizeNewer) Len() int { return len(o) } func (o MachineSetsBySizeNewer) Swap(i, j int) { o[i], o[j] = o[j], o[i] } @@ -110,7 +110,7 @@ func (o MachineSetsBySizeNewer) Less(i, j int) bool { } // SetDeploymentRevision updates the revision for a deployment. -func SetDeploymentRevision(deployment *v1alpha1.MachineDeployment, revision string) bool { +func SetDeploymentRevision(deployment *v1alpha2.MachineDeployment, revision string) bool { updated := false if deployment.Annotations == nil { @@ -125,7 +125,7 @@ func SetDeploymentRevision(deployment *v1alpha1.MachineDeployment, revision stri } // MaxRevision finds the highest revision in the machine sets -func MaxRevision(allMSs []*v1alpha1.MachineSet) int64 { +func MaxRevision(allMSs []*v1alpha2.MachineSet) int64 { max := int64(0) for _, ms := range allMSs { if v, err := Revision(ms); err != nil { @@ -169,7 +169,7 @@ func skipCopyAnnotation(key string) bool { // copyDeploymentAnnotationsToMachineSet copies deployment's annotations to machine set's annotations, // and returns true if machine set's annotation is changed. // Note that apply and revision annotations are not copied. -func copyDeploymentAnnotationsToMachineSet(deployment *v1alpha1.MachineDeployment, ms *v1alpha1.MachineSet) bool { +func copyDeploymentAnnotationsToMachineSet(deployment *v1alpha2.MachineDeployment, ms *v1alpha2.MachineSet) bool { msAnnotationsChanged := false if ms.Annotations == nil { ms.Annotations = make(map[string]string) @@ -188,15 +188,15 @@ func copyDeploymentAnnotationsToMachineSet(deployment *v1alpha1.MachineDeploymen } // GetDesiredReplicasAnnotation returns the number of desired replicas -func GetDesiredReplicasAnnotation(ms *v1alpha1.MachineSet) (int32, bool) { +func GetDesiredReplicasAnnotation(ms *v1alpha2.MachineSet) (int32, bool) { return getIntFromAnnotation(ms, DesiredReplicasAnnotation) } -func getMaxReplicasAnnotation(ms *v1alpha1.MachineSet) (int32, bool) { +func getMaxReplicasAnnotation(ms *v1alpha2.MachineSet) (int32, bool) { return getIntFromAnnotation(ms, MaxReplicasAnnotation) } -func getIntFromAnnotation(ms *v1alpha1.MachineSet, annotationKey string) (int32, bool) { +func getIntFromAnnotation(ms *v1alpha2.MachineSet, annotationKey string) (int32, bool) { annotationValue, ok := ms.Annotations[annotationKey] if !ok { return int32(0), false @@ -211,7 +211,7 @@ func getIntFromAnnotation(ms *v1alpha1.MachineSet, annotationKey string) (int32, // SetNewMachineSetAnnotations sets new machine set's annotations appropriately by updating its revision and // copying required deployment annotations to it; it returns true if machine set's annotation is changed. -func SetNewMachineSetAnnotations(deployment *v1alpha1.MachineDeployment, newMS *v1alpha1.MachineSet, newRevision string, exists bool) bool { +func SetNewMachineSetAnnotations(deployment *v1alpha2.MachineDeployment, newMS *v1alpha2.MachineSet, newRevision string, exists bool) bool { // First, copy deployment's annotations (except for apply and revision annotations) annotationChanged := copyDeploymentAnnotationsToMachineSet(deployment, newMS) // Then, update machine set's revision annotation @@ -265,7 +265,7 @@ func SetNewMachineSetAnnotations(deployment *v1alpha1.MachineDeployment, newMS * // FindOneActiveOrLatest returns the only active or the latest machine set in case there is at most one active // machine set. If there are more than one active machine sets, return nil so machine sets can be scaled down // to the point where there is only one active machine set. -func FindOneActiveOrLatest(newMS *v1alpha1.MachineSet, oldMSs []*v1alpha1.MachineSet) *v1alpha1.MachineSet { +func FindOneActiveOrLatest(newMS *v1alpha2.MachineSet, oldMSs []*v1alpha2.MachineSet) *v1alpha2.MachineSet { if newMS == nil && len(oldMSs) == 0 { return nil } @@ -288,7 +288,7 @@ func FindOneActiveOrLatest(newMS *v1alpha1.MachineSet, oldMSs []*v1alpha1.Machin } // SetReplicasAnnotations sets the desiredReplicas and maxReplicas into the annotations -func SetReplicasAnnotations(ms *v1alpha1.MachineSet, desiredReplicas, maxReplicas int32) bool { +func SetReplicasAnnotations(ms *v1alpha2.MachineSet, desiredReplicas, maxReplicas int32) bool { updated := false if ms.Annotations == nil { ms.Annotations = make(map[string]string) @@ -307,7 +307,7 @@ func SetReplicasAnnotations(ms *v1alpha1.MachineSet, desiredReplicas, maxReplica } // AnnotationsNeedUpdate return true if ReplicasAnnotations need to be updated -func ReplicasAnnotationsNeedUpdate(ms *v1alpha1.MachineSet, desiredReplicas, maxReplicas int32) bool { +func ReplicasAnnotationsNeedUpdate(ms *v1alpha2.MachineSet, desiredReplicas, maxReplicas int32) bool { if ms.Annotations == nil { return true } @@ -323,7 +323,7 @@ func ReplicasAnnotationsNeedUpdate(ms *v1alpha1.MachineSet, desiredReplicas, max } // MaxUnavailable returns the maximum unavailable machines a rolling deployment can take. -func MaxUnavailable(deployment v1alpha1.MachineDeployment) int32 { +func MaxUnavailable(deployment v1alpha2.MachineDeployment) int32 { if !IsRollingUpdate(&deployment) || *(deployment.Spec.Replicas) == 0 { return int32(0) } @@ -336,7 +336,7 @@ func MaxUnavailable(deployment v1alpha1.MachineDeployment) int32 { } // MaxSurge returns the maximum surge machines a rolling deployment can take. -func MaxSurge(deployment v1alpha1.MachineDeployment) int32 { +func MaxSurge(deployment v1alpha2.MachineDeployment) int32 { if !IsRollingUpdate(&deployment) { return int32(0) } @@ -348,7 +348,7 @@ func MaxSurge(deployment v1alpha1.MachineDeployment) int32 { // GetProportion will estimate the proportion for the provided machine set using 1. the current size // of the parent deployment, 2. the replica count that needs be added on the machine sets of the // deployment, and 3. the total replicas added in the machine sets of the deployment so far. -func GetProportion(ms *v1alpha1.MachineSet, d v1alpha1.MachineDeployment, deploymentReplicasToAdd, deploymentReplicasAdded int32) int32 { +func GetProportion(ms *v1alpha2.MachineSet, d v1alpha2.MachineDeployment, deploymentReplicasToAdd, deploymentReplicasAdded int32) int32 { if ms == nil || *(ms.Spec.Replicas) == 0 || deploymentReplicasToAdd == 0 || deploymentReplicasToAdd == deploymentReplicasAdded { return int32(0) } @@ -370,7 +370,7 @@ func GetProportion(ms *v1alpha1.MachineSet, d v1alpha1.MachineDeployment, deploy // getMachineSetFraction estimates the fraction of replicas a machine set can have in // 1. a scaling event during a rollout or 2. when scaling a paused deployment. -func getMachineSetFraction(ms v1alpha1.MachineSet, d v1alpha1.MachineDeployment) int32 { +func getMachineSetFraction(ms v1alpha2.MachineSet, d v1alpha2.MachineDeployment) int32 { // If we are scaling down to zero then the fraction of this machine set is its whole size (negative) if *(d.Spec.Replicas) == int32(0) { return -*(ms.Spec.Replicas) @@ -397,7 +397,7 @@ func getMachineSetFraction(ms v1alpha1.MachineSet, d v1alpha1.MachineDeployment) // 1. The hash result would be different upon machineTemplateSpec API changes // (e.g. the addition of a new field will cause the hash code to change) // 2. The deployment template won't have hash labels -func EqualIgnoreHash(template1, template2 *v1alpha1.MachineTemplateSpec) bool { +func EqualIgnoreHash(template1, template2 *v1alpha2.MachineTemplateSpec) bool { t1Copy := template1.DeepCopy() t2Copy := template2.DeepCopy() // Remove hash labels from template.Labels before comparing @@ -407,7 +407,7 @@ func EqualIgnoreHash(template1, template2 *v1alpha1.MachineTemplateSpec) bool { } // FindNewMachineSet returns the new MS this given deployment targets (the one with the same machine template). -func FindNewMachineSet(deployment *v1alpha1.MachineDeployment, msList []*v1alpha1.MachineSet) *v1alpha1.MachineSet { +func FindNewMachineSet(deployment *v1alpha2.MachineDeployment, msList []*v1alpha2.MachineSet) *v1alpha2.MachineSet { sort.Sort(MachineSetsByCreationTimestamp(msList)) for i := range msList { if EqualIgnoreHash(&msList[i].Spec.Template, &deployment.Spec.Template) { @@ -426,9 +426,9 @@ func FindNewMachineSet(deployment *v1alpha1.MachineDeployment, msList []*v1alpha // Returns two list of machine sets // - the first contains all old machine sets with all non-zero replicas // - the second contains all old machine sets -func FindOldMachineSets(deployment *v1alpha1.MachineDeployment, msList []*v1alpha1.MachineSet) ([]*v1alpha1.MachineSet, []*v1alpha1.MachineSet) { - var requiredMSs []*v1alpha1.MachineSet - allMSs := make([]*v1alpha1.MachineSet, 0, len(msList)) +func FindOldMachineSets(deployment *v1alpha2.MachineDeployment, msList []*v1alpha2.MachineSet) ([]*v1alpha2.MachineSet, []*v1alpha2.MachineSet) { + var requiredMSs []*v1alpha2.MachineSet + allMSs := make([]*v1alpha2.MachineSet, 0, len(msList)) newMS := FindNewMachineSet(deployment, msList) for _, ms := range msList { // Filter out new machine set @@ -444,7 +444,7 @@ func FindOldMachineSets(deployment *v1alpha1.MachineDeployment, msList []*v1alph } // GetReplicaCountForMachineSets returns the sum of Replicas of the given machine sets. -func GetReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int32 { +func GetReplicaCountForMachineSets(machineSets []*v1alpha2.MachineSet) int32 { totalReplicas := int32(0) for _, ms := range machineSets { if ms != nil { @@ -455,7 +455,7 @@ func GetReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int32 { } // GetActualReplicaCountForMachineSets returns the sum of actual replicas of the given machine sets. -func GetActualReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int32 { +func GetActualReplicaCountForMachineSets(machineSets []*v1alpha2.MachineSet) int32 { totalActualReplicas := int32(0) for _, ms := range machineSets { if ms != nil { @@ -466,7 +466,7 @@ func GetActualReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int } // GetReadyReplicaCountForMachineSets returns the number of ready machines corresponding to the given machine sets. -func GetReadyReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int32 { +func GetReadyReplicaCountForMachineSets(machineSets []*v1alpha2.MachineSet) int32 { totalReadyReplicas := int32(0) for _, ms := range machineSets { if ms != nil { @@ -477,7 +477,7 @@ func GetReadyReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int3 } // GetAvailableReplicaCountForMachineSets returns the number of available machines corresponding to the given machine sets. -func GetAvailableReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) int32 { +func GetAvailableReplicaCountForMachineSets(machineSets []*v1alpha2.MachineSet) int32 { totalAvailableReplicas := int32(0) for _, ms := range machineSets { if ms != nil { @@ -488,13 +488,13 @@ func GetAvailableReplicaCountForMachineSets(machineSets []*v1alpha1.MachineSet) } // IsRollingUpdate returns true if the strategy type is a rolling update. -func IsRollingUpdate(deployment *v1alpha1.MachineDeployment) bool { +func IsRollingUpdate(deployment *v1alpha2.MachineDeployment) bool { return deployment.Spec.Strategy.Type == common.RollingUpdateMachineDeploymentStrategyType } // DeploymentComplete considers a deployment to be complete once all of its desired replicas // are updated and available, and no old machines are running. -func DeploymentComplete(deployment *v1alpha1.MachineDeployment, newStatus *v1alpha1.MachineDeploymentStatus) bool { +func DeploymentComplete(deployment *v1alpha2.MachineDeployment, newStatus *v1alpha2.MachineDeploymentStatus) bool { return newStatus.UpdatedReplicas == *(deployment.Spec.Replicas) && newStatus.Replicas == *(deployment.Spec.Replicas) && newStatus.AvailableReplicas == *(deployment.Spec.Replicas) && @@ -505,7 +505,7 @@ func DeploymentComplete(deployment *v1alpha1.MachineDeployment, newStatus *v1alp // When one of the following is true, we're rolling out the deployment; otherwise, we're scaling it. // 1) The new MS is saturated: newMS's replicas == deployment's replicas // 2) Max number of machines allowed is reached: deployment's replicas + maxSurge == all MSs' replicas -func NewMSNewReplicas(deployment *v1alpha1.MachineDeployment, allMSs []*v1alpha1.MachineSet, newMS *v1alpha1.MachineSet) (int32, error) { +func NewMSNewReplicas(deployment *v1alpha2.MachineDeployment, allMSs []*v1alpha2.MachineSet, newMS *v1alpha2.MachineSet) (int32, error) { switch deployment.Spec.Strategy.Type { case common.RollingUpdateMachineDeploymentStrategyType: // Check if we can scale up. @@ -551,7 +551,7 @@ func NewMSNewReplicas(deployment *v1alpha1.MachineDeployment, allMSs []*v1alpha1 // Both the deployment and the machine set have to believe this machine set can own all of the desired // replicas in the deployment and the annotation helps in achieving that. All machines of the MachineSet // need to be available. -func IsSaturated(deployment *v1alpha1.MachineDeployment, ms *v1alpha1.MachineSet) bool { +func IsSaturated(deployment *v1alpha2.MachineDeployment, ms *v1alpha2.MachineSet) bool { if ms == nil { return false } @@ -596,18 +596,18 @@ func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired } // FilterActiveMachineSets returns machine sets that have (or at least ought to have) machines. -func FilterActiveMachineSets(machineSets []*v1alpha1.MachineSet) []*v1alpha1.MachineSet { - activeFilter := func(ms *v1alpha1.MachineSet) bool { +func FilterActiveMachineSets(machineSets []*v1alpha2.MachineSet) []*v1alpha2.MachineSet { + activeFilter := func(ms *v1alpha2.MachineSet) bool { return ms != nil && ms.Spec.Replicas != nil && *(ms.Spec.Replicas) > 0 } return FilterMachineSets(machineSets, activeFilter) } -type filterMS func(ms *v1alpha1.MachineSet) bool +type filterMS func(ms *v1alpha2.MachineSet) bool // FilterMachineSets returns machine sets that are filtered by filterFn (all returned ones should match filterFn). -func FilterMachineSets(MSes []*v1alpha1.MachineSet, filterFn filterMS) []*v1alpha1.MachineSet { - var filtered []*v1alpha1.MachineSet +func FilterMachineSets(MSes []*v1alpha2.MachineSet, filterFn filterMS) []*v1alpha2.MachineSet { + var filtered []*v1alpha2.MachineSet for i := range MSes { if filterFn(MSes[i]) { filtered = append(filtered, MSes[i]) @@ -686,7 +686,7 @@ func DeepHashObject(hasher hash.Hash, objectToWrite interface{}) { printer.Fprintf(hasher, "%#v", objectToWrite) } -func ComputeHash(template *v1alpha1.MachineTemplateSpec) uint32 { +func ComputeHash(template *v1alpha2.MachineTemplateSpec) uint32 { machineTemplateSpecHasher := fnv.New32a() DeepHashObject(machineTemplateSpecHasher, *template) diff --git a/pkg/controller/machinedeployment/util/util_test.go b/pkg/controller/machinedeployment/util/util_test.go index 189687ff823b..e9420dde787b 100644 --- a/pkg/controller/machinedeployment/util/util_test.go +++ b/pkg/controller/machinedeployment/util/util_test.go @@ -33,7 +33,7 @@ import ( "k8s.io/apiserver/pkg/storage/names" core "k8s.io/client-go/testing" "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/fake" ) @@ -52,7 +52,7 @@ func addListMachinesReactor(fakeClient *fake.Clientset, obj runtime.Object) *fak } func addGetMSReactor(fakeClient *fake.Clientset, obj runtime.Object) *fake.Clientset { - msList, ok := obj.(*v1alpha1.MachineSetList) + msList, ok := obj.(*v1alpha2.MachineSetList) fakeClient.AddReactor("get", "machinesets", func(action core.Action) (handled bool, ret runtime.Object, err error) { name := action.(core.GetAction).GetName() if ok { @@ -70,7 +70,7 @@ func addGetMSReactor(fakeClient *fake.Clientset, obj runtime.Object) *fake.Clien func addUpdateMSReactor(fakeClient *fake.Clientset) *fake.Clientset { fakeClient.AddReactor("update", "machinesets", func(action core.Action) (handled bool, ret runtime.Object, err error) { - obj := action.(core.UpdateAction).GetObject().(*v1alpha1.MachineSet) + obj := action.(core.UpdateAction).GetObject().(*v1alpha2.MachineSet) return true, obj, nil }) return fakeClient @@ -78,32 +78,32 @@ func addUpdateMSReactor(fakeClient *fake.Clientset) *fake.Clientset { func addUpdateMachinesReactor(fakeClient *fake.Clientset) *fake.Clientset { fakeClient.AddReactor("update", "machines", func(action core.Action) (handled bool, ret runtime.Object, err error) { - obj := action.(core.UpdateAction).GetObject().(*v1alpha1.Machine) + obj := action.(core.UpdateAction).GetObject().(*v1alpha2.Machine) return true, obj, nil }) return fakeClient } -func generateMSWithLabel(labels map[string]string, image string) v1alpha1.MachineSet { - return v1alpha1.MachineSet{ +func generateMSWithLabel(labels map[string]string, image string) v1alpha2.MachineSet { + return v1alpha2.MachineSet{ ObjectMeta: metav1.ObjectMeta{ Name: names.SimpleNameGenerator.GenerateName("machineset"), Labels: labels, }, - Spec: v1alpha1.MachineSetSpec{ + Spec: v1alpha2.MachineSetSpec{ Replicas: func(i int32) *int32 { return &i }(1), Selector: metav1.LabelSelector{MatchLabels: labels}, - Template: v1alpha1.MachineTemplateSpec{ - ObjectMeta: v1alpha1.ObjectMeta{ + Template: v1alpha2.MachineTemplateSpec{ + ObjectMeta: v1alpha2.ObjectMeta{ Labels: labels, }, - Spec: v1alpha1.MachineSpec{}, + Spec: v1alpha2.MachineSpec{}, }, }, } } -func newDControllerRef(d *v1alpha1.MachineDeployment) *metav1.OwnerReference { +func newDControllerRef(d *v1alpha2.MachineDeployment) *metav1.OwnerReference { isController := true return &metav1.OwnerReference{ APIVersion: "clusters/v1alpha", @@ -115,16 +115,16 @@ func newDControllerRef(d *v1alpha1.MachineDeployment) *metav1.OwnerReference { } // generateMS creates a machine set, with the input deployment's template as its template -func generateMS(deployment v1alpha1.MachineDeployment) v1alpha1.MachineSet { +func generateMS(deployment v1alpha2.MachineDeployment) v1alpha2.MachineSet { template := deployment.Spec.Template.DeepCopy() - return v1alpha1.MachineSet{ + return v1alpha2.MachineSet{ ObjectMeta: metav1.ObjectMeta{ UID: randomUID(), Name: names.SimpleNameGenerator.GenerateName("machineset"), Labels: template.Labels, OwnerReferences: []metav1.OwnerReference{*newDControllerRef(&deployment)}, }, - Spec: v1alpha1.MachineSetSpec{ + Spec: v1alpha2.MachineSetSpec{ Replicas: new(int32), Template: *template, Selector: metav1.LabelSelector{MatchLabels: template.Labels}, @@ -137,41 +137,41 @@ func randomUID() types.UID { } // generateDeployment creates a deployment, with the input image as its template -func generateDeployment(image string) v1alpha1.MachineDeployment { +func generateDeployment(image string) v1alpha2.MachineDeployment { machineLabels := map[string]string{"name": image} - return v1alpha1.MachineDeployment{ + return v1alpha2.MachineDeployment{ ObjectMeta: metav1.ObjectMeta{ Name: image, Annotations: make(map[string]string), }, - Spec: v1alpha1.MachineDeploymentSpec{ + Spec: v1alpha2.MachineDeploymentSpec{ Replicas: func(i int32) *int32 { return &i }(1), Selector: metav1.LabelSelector{MatchLabels: machineLabels}, - Template: v1alpha1.MachineTemplateSpec{ - ObjectMeta: v1alpha1.ObjectMeta{ + Template: v1alpha2.MachineTemplateSpec{ + ObjectMeta: v1alpha2.ObjectMeta{ Labels: machineLabels, }, - Spec: v1alpha1.MachineSpec{}, + Spec: v1alpha2.MachineSpec{}, }, }, } } -func generateMachineTemplateSpec(name, nodeName string, annotations, labels map[string]string) v1alpha1.MachineTemplateSpec { - return v1alpha1.MachineTemplateSpec{ - ObjectMeta: v1alpha1.ObjectMeta{ +func generateMachineTemplateSpec(name, nodeName string, annotations, labels map[string]string) v1alpha2.MachineTemplateSpec { + return v1alpha2.MachineTemplateSpec{ + ObjectMeta: v1alpha2.ObjectMeta{ Name: name, Annotations: annotations, Labels: labels, }, - Spec: v1alpha1.MachineSpec{}, + Spec: v1alpha2.MachineSpec{}, } } func TestEqualIgnoreHash(t *testing.T) { tests := []struct { Name string - former, latter v1alpha1.MachineTemplateSpec + former, latter v1alpha2.MachineTemplateSpec expected bool }{ { @@ -238,7 +238,7 @@ func TestEqualIgnoreHash(t *testing.T) { for _, test := range tests { t.Run(test.Name, func(t *testing.T) { - runTest := func(t1, t2 *v1alpha1.MachineTemplateSpec, reversed bool) { + runTest := func(t1, t2 *v1alpha2.MachineTemplateSpec, reversed bool) { reverseString := "" if reversed { reverseString = " (reverse order)" @@ -281,26 +281,26 @@ func TestFindNewMachineSet(t *testing.T) { tests := []struct { Name string - deployment v1alpha1.MachineDeployment - msList []*v1alpha1.MachineSet - expected *v1alpha1.MachineSet + deployment v1alpha2.MachineDeployment + msList []*v1alpha2.MachineSet + expected *v1alpha2.MachineSet }{ { Name: "Get new MachineSet with the same template as Deployment spec but different machine-template-hash value", deployment: deployment, - msList: []*v1alpha1.MachineSet{&newMS, &oldMS}, + msList: []*v1alpha2.MachineSet{&newMS, &oldMS}, expected: &newMS, }, { Name: "Get the oldest new MachineSet when there are more than one MachineSet with the same template", deployment: deployment, - msList: []*v1alpha1.MachineSet{&newMS, &oldMS, &newMSDup}, + msList: []*v1alpha2.MachineSet{&newMS, &oldMS, &newMSDup}, expected: &newMSDup, }, { Name: "Get nil new MachineSet", deployment: deployment, - msList: []*v1alpha1.MachineSet{&oldMS}, + msList: []*v1alpha2.MachineSet{&oldMS}, expected: nil, }, } @@ -337,38 +337,38 @@ func TestFindOldMachineSets(t *testing.T) { tests := []struct { Name string - deployment v1alpha1.MachineDeployment - msList []*v1alpha1.MachineSet - machineList *v1alpha1.MachineList - expected []*v1alpha1.MachineSet - expectedRequire []*v1alpha1.MachineSet + deployment v1alpha2.MachineDeployment + msList []*v1alpha2.MachineSet + machineList *v1alpha2.MachineList + expected []*v1alpha2.MachineSet + expectedRequire []*v1alpha2.MachineSet }{ { Name: "Get old MachineSets", deployment: deployment, - msList: []*v1alpha1.MachineSet{&newMS, &oldMS}, - expected: []*v1alpha1.MachineSet{&oldMS}, + msList: []*v1alpha2.MachineSet{&newMS, &oldMS}, + expected: []*v1alpha2.MachineSet{&oldMS}, expectedRequire: nil, }, { Name: "Get old MachineSets with no new MachineSet", deployment: deployment, - msList: []*v1alpha1.MachineSet{&oldMS}, - expected: []*v1alpha1.MachineSet{&oldMS}, + msList: []*v1alpha2.MachineSet{&oldMS}, + expected: []*v1alpha2.MachineSet{&oldMS}, expectedRequire: nil, }, { Name: "Get old MachineSets with two new MachineSets, only the oldest new MachineSet is seen as new MachineSet", deployment: deployment, - msList: []*v1alpha1.MachineSet{&oldMS, &newMS, &newMSDup}, - expected: []*v1alpha1.MachineSet{&oldMS, &newMS}, - expectedRequire: []*v1alpha1.MachineSet{&newMS}, + msList: []*v1alpha2.MachineSet{&oldMS, &newMS, &newMSDup}, + expected: []*v1alpha2.MachineSet{&oldMS, &newMS}, + expectedRequire: []*v1alpha2.MachineSet{&newMS}, }, { Name: "Get empty old MachineSets", deployment: deployment, - msList: []*v1alpha1.MachineSet{&newMS}, - expected: []*v1alpha1.MachineSet{}, + msList: []*v1alpha2.MachineSet{&newMS}, + expected: []*v1alpha2.MachineSet{}, expectedRequire: nil, }, } @@ -390,7 +390,7 @@ func TestFindOldMachineSets(t *testing.T) { } // equal compares the equality of two MachineSet slices regardless of their ordering -func equal(mss1, mss2 []*v1alpha1.MachineSet) bool { +func equal(mss1, mss2 []*v1alpha2.MachineSet) bool { if reflect.DeepEqual(mss1, mss2) { return true } @@ -419,19 +419,19 @@ func TestGetReplicaCountForMachineSets(t *testing.T) { tests := []struct { Name string - sets []*v1alpha1.MachineSet + sets []*v1alpha2.MachineSet expectedCount int32 expectedActual int32 }{ { "1:2 Replicas", - []*v1alpha1.MachineSet{&ms1}, + []*v1alpha2.MachineSet{&ms1}, 1, 2, }, { "3:5 Replicas", - []*v1alpha1.MachineSet{&ms1, &ms2}, + []*v1alpha2.MachineSet{&ms1, &ms2}, 3, 5, }, @@ -540,8 +540,8 @@ func TestNewMSNewReplicas(t *testing.T) { for _, test := range tests { t.Run(test.Name, func(t *testing.T) { *(newDeployment.Spec.Replicas) = test.depReplicas - newDeployment.Spec.Strategy = &v1alpha1.MachineDeploymentStrategy{Type: test.strategyType} - newDeployment.Spec.Strategy.RollingUpdate = &v1alpha1.MachineRollingUpdateDeployment{ + newDeployment.Spec.Strategy = &v1alpha2.MachineDeploymentStrategy{Type: test.strategyType} + newDeployment.Spec.Strategy.RollingUpdate = &v1alpha2.MachineRollingUpdateDeployment{ MaxUnavailable: func(i int) *intstr.IntOrString { x := intstr.FromInt(i) return &x @@ -552,7 +552,7 @@ func TestNewMSNewReplicas(t *testing.T) { }(test.maxSurge), } *(newRC.Spec.Replicas) = test.newMSReplicas - ms, err := NewMSNewReplicas(&newDeployment, []*v1alpha1.MachineSet{&rs5}, &newRC) + ms, err := NewMSNewReplicas(&newDeployment, []*v1alpha2.MachineSet{&rs5}, &newRC) if err != nil { t.Errorf("In test case %s, got unexpected error %v", test.Name, err) } @@ -564,19 +564,19 @@ func TestNewMSNewReplicas(t *testing.T) { } func TestDeploymentComplete(t *testing.T) { - deployment := func(desired, current, updated, available, maxUnavailable, maxSurge int32) *v1alpha1.MachineDeployment { - return &v1alpha1.MachineDeployment{ - Spec: v1alpha1.MachineDeploymentSpec{ + deployment := func(desired, current, updated, available, maxUnavailable, maxSurge int32) *v1alpha2.MachineDeployment { + return &v1alpha2.MachineDeployment{ + Spec: v1alpha2.MachineDeploymentSpec{ Replicas: &desired, - Strategy: &v1alpha1.MachineDeploymentStrategy{ - RollingUpdate: &v1alpha1.MachineRollingUpdateDeployment{ + Strategy: &v1alpha2.MachineDeploymentStrategy{ + RollingUpdate: &v1alpha2.MachineRollingUpdateDeployment{ MaxUnavailable: func(i int) *intstr.IntOrString { x := intstr.FromInt(i); return &x }(int(maxUnavailable)), MaxSurge: func(i int) *intstr.IntOrString { x := intstr.FromInt(i); return &x }(int(maxSurge)), }, Type: common.RollingUpdateMachineDeploymentStrategyType, }, }, - Status: v1alpha1.MachineDeploymentStatus{ + Status: v1alpha2.MachineDeploymentStatus{ Replicas: current, UpdatedReplicas: updated, AvailableReplicas: available, @@ -587,7 +587,7 @@ func TestDeploymentComplete(t *testing.T) { tests := []struct { name string - d *v1alpha1.MachineDeployment + d *v1alpha2.MachineDeployment expected bool }{ @@ -641,12 +641,12 @@ func TestDeploymentComplete(t *testing.T) { } func TestMaxUnavailable(t *testing.T) { - deployment := func(replicas int32, maxUnavailable intstr.IntOrString) v1alpha1.MachineDeployment { - return v1alpha1.MachineDeployment{ - Spec: v1alpha1.MachineDeploymentSpec{ + deployment := func(replicas int32, maxUnavailable intstr.IntOrString) v1alpha2.MachineDeployment { + return v1alpha2.MachineDeployment{ + Spec: v1alpha2.MachineDeploymentSpec{ Replicas: func(i int32) *int32 { return &i }(replicas), - Strategy: &v1alpha1.MachineDeploymentStrategy{ - RollingUpdate: &v1alpha1.MachineRollingUpdateDeployment{ + Strategy: &v1alpha2.MachineDeploymentStrategy{ + RollingUpdate: &v1alpha2.MachineRollingUpdateDeployment{ MaxSurge: func(i int) *intstr.IntOrString { x := intstr.FromInt(i); return &x }(int(1)), MaxUnavailable: &maxUnavailable, }, @@ -657,7 +657,7 @@ func TestMaxUnavailable(t *testing.T) { } tests := []struct { name string - deployment v1alpha1.MachineDeployment + deployment v1alpha2.MachineDeployment expected int32 }{ { @@ -773,14 +773,14 @@ func TestReplicasAnnotationsNeedUpdate(t *testing.T) { tests := []struct { name string - machineSet *v1alpha1.MachineSet + machineSet *v1alpha2.MachineSet expected bool }{ { name: "test Annotations nil", - machineSet: &v1alpha1.MachineSet{ + machineSet: &v1alpha2.MachineSet{ ObjectMeta: metav1.ObjectMeta{Name: "hello", Namespace: "test"}, - Spec: v1alpha1.MachineSetSpec{ + Spec: v1alpha2.MachineSetSpec{ Selector: metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, @@ -788,13 +788,13 @@ func TestReplicasAnnotationsNeedUpdate(t *testing.T) { }, { name: "test desiredReplicas update", - machineSet: &v1alpha1.MachineSet{ + machineSet: &v1alpha2.MachineSet{ ObjectMeta: metav1.ObjectMeta{ Name: "hello", Namespace: "test", Annotations: map[string]string{DesiredReplicasAnnotation: "8", MaxReplicasAnnotation: maxReplicas}, }, - Spec: v1alpha1.MachineSetSpec{ + Spec: v1alpha2.MachineSetSpec{ Selector: metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, @@ -802,13 +802,13 @@ func TestReplicasAnnotationsNeedUpdate(t *testing.T) { }, { name: "test maxReplicas update", - machineSet: &v1alpha1.MachineSet{ + machineSet: &v1alpha2.MachineSet{ ObjectMeta: metav1.ObjectMeta{ Name: "hello", Namespace: "test", Annotations: map[string]string{DesiredReplicasAnnotation: desiredReplicas, MaxReplicasAnnotation: "16"}, }, - Spec: v1alpha1.MachineSetSpec{ + Spec: v1alpha2.MachineSetSpec{ Selector: metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, @@ -816,13 +816,13 @@ func TestReplicasAnnotationsNeedUpdate(t *testing.T) { }, { name: "test needn't update", - machineSet: &v1alpha1.MachineSet{ + machineSet: &v1alpha2.MachineSet{ ObjectMeta: metav1.ObjectMeta{ Name: "hello", Namespace: "test", Annotations: map[string]string{DesiredReplicasAnnotation: desiredReplicas, MaxReplicasAnnotation: maxReplicas}, }, - Spec: v1alpha1.MachineSetSpec{ + Spec: v1alpha2.MachineSetSpec{ Selector: metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, }, }, diff --git a/pkg/controller/machineset/BUILD.bazel b/pkg/controller/machineset/BUILD.bazel index 3488d679f8e2..ca430854e24a 100644 --- a/pkg/controller/machineset/BUILD.bazel +++ b/pkg/controller/machineset/BUILD.bazel @@ -11,7 +11,7 @@ go_library( importpath = "sigs.k8s.io/cluster-api/pkg/controller/machineset", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/controller/noderefutil:go_default_library", "//pkg/util:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", @@ -44,7 +44,7 @@ go_test( deps = [ "//pkg/apis:go_default_library", "//pkg/apis/cluster/common:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", diff --git a/pkg/controller/machineset/delete_policy.go b/pkg/controller/machineset/delete_policy.go index 7515be688073..08028aa9ef54 100644 --- a/pkg/controller/machineset/delete_policy.go +++ b/pkg/controller/machineset/delete_policy.go @@ -22,12 +22,12 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) type ( deletePriority float64 - deletePriorityFunc func(machine *v1alpha1.Machine) deletePriority + deletePriorityFunc func(machine *v1alpha2.Machine) deletePriority ) const ( @@ -45,7 +45,7 @@ const ( ) // maps the creation timestamp onto the 0-100 priority range -func oldestDeletePriority(machine *v1alpha1.Machine) deletePriority { +func oldestDeletePriority(machine *v1alpha2.Machine) deletePriority { if machine.DeletionTimestamp != nil && !machine.DeletionTimestamp.IsZero() { return mustDelete } @@ -65,7 +65,7 @@ func oldestDeletePriority(machine *v1alpha1.Machine) deletePriority { return deletePriority(float64(mustDelete) * (1.0 - math.Exp(-d.Seconds()/secondsPerTenDays))) } -func newestDeletePriority(machine *v1alpha1.Machine) deletePriority { +func newestDeletePriority(machine *v1alpha2.Machine) deletePriority { if machine.DeletionTimestamp != nil && !machine.DeletionTimestamp.IsZero() { return mustDelete } @@ -78,7 +78,7 @@ func newestDeletePriority(machine *v1alpha1.Machine) deletePriority { return mustDelete - oldestDeletePriority(machine) } -func randomDeletePolicy(machine *v1alpha1.Machine) deletePriority { +func randomDeletePolicy(machine *v1alpha2.Machine) deletePriority { if machine.DeletionTimestamp != nil && !machine.DeletionTimestamp.IsZero() { return mustDelete } @@ -92,7 +92,7 @@ func randomDeletePolicy(machine *v1alpha1.Machine) deletePriority { } type sortableMachines struct { - machines []*v1alpha1.Machine + machines []*v1alpha2.Machine priority deletePriorityFunc } @@ -102,11 +102,11 @@ func (m sortableMachines) Less(i, j int) bool { return m.priority(m.machines[j]) < m.priority(m.machines[i]) // high to low } -func getMachinesToDeletePrioritized(filteredMachines []*v1alpha1.Machine, diff int, fun deletePriorityFunc) []*v1alpha1.Machine { +func getMachinesToDeletePrioritized(filteredMachines []*v1alpha2.Machine, diff int, fun deletePriorityFunc) []*v1alpha2.Machine { if diff >= len(filteredMachines) { return filteredMachines } else if diff <= 0 { - return []*v1alpha1.Machine{} + return []*v1alpha2.Machine{} } sortable := sortableMachines{ @@ -118,14 +118,14 @@ func getMachinesToDeletePrioritized(filteredMachines []*v1alpha1.Machine, diff i return sortable.machines[:diff] } -func getDeletePriorityFunc(ms *v1alpha1.MachineSet) (deletePriorityFunc, error) { +func getDeletePriorityFunc(ms *v1alpha2.MachineSet) (deletePriorityFunc, error) { // Map the Spec.DeletePolicy value to the appropriate delete priority function - switch msdp := v1alpha1.MachineSetDeletePolicy(ms.Spec.DeletePolicy); msdp { - case v1alpha1.RandomMachineSetDeletePolicy: + switch msdp := v1alpha2.MachineSetDeletePolicy(ms.Spec.DeletePolicy); msdp { + case v1alpha2.RandomMachineSetDeletePolicy: return randomDeletePolicy, nil - case v1alpha1.NewestMachineSetDeletePolicy: + case v1alpha2.NewestMachineSetDeletePolicy: return newestDeletePriority, nil - case v1alpha1.OldestMachineSetDeletePolicy: + case v1alpha2.OldestMachineSetDeletePolicy: return oldestDeletePriority, nil case "": return randomDeletePolicy, nil diff --git a/pkg/controller/machineset/delete_policy_test.go b/pkg/controller/machineset/delete_policy_test.go index 28149e4680cd..e91025445af5 100644 --- a/pkg/controller/machineset/delete_policy_test.go +++ b/pkg/controller/machineset/delete_policy_test.go @@ -22,49 +22,49 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) func TestMachineToDelete(t *testing.T) { msg := "something wrong with the machine" now := metav1.Now() - mustDeleteMachine := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{DeletionTimestamp: &now}} - betterDeleteMachine := &v1alpha1.Machine{Status: v1alpha1.MachineStatus{ErrorMessage: &msg}} - deleteMeMachine := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{DeleteNodeAnnotation: "yes"}}} + mustDeleteMachine := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{DeletionTimestamp: &now}} + betterDeleteMachine := &v1alpha2.Machine{Status: v1alpha2.MachineStatus{ErrorMessage: &msg}} + deleteMeMachine := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{DeleteNodeAnnotation: "yes"}}} tests := []struct { desc string - machines []*v1alpha1.Machine + machines []*v1alpha2.Machine diff int - expect []*v1alpha1.Machine + expect []*v1alpha2.Machine }{ { desc: "func=randomDeletePolicy, diff=0", diff: 0, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ {}, }, - expect: []*v1alpha1.Machine{}, + expect: []*v1alpha2.Machine{}, }, { desc: "func=randomDeletePolicy, diff>len(machines)", diff: 2, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ {}, }, - expect: []*v1alpha1.Machine{ + expect: []*v1alpha2.Machine{ {}, }, }, { desc: "func=randomDeletePolicy, diff>betterDelete", diff: 2, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ {}, betterDeleteMachine, {}, }, - expect: []*v1alpha1.Machine{ + expect: []*v1alpha2.Machine{ betterDeleteMachine, {}, }, @@ -72,13 +72,13 @@ func TestMachineToDelete(t *testing.T) { { desc: "func=randomDeletePolicy, diffbetterDelete", diff: 2, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ {}, betterDeleteMachine, {}, }, - expect: []*v1alpha1.Machine{ + expect: []*v1alpha2.Machine{ betterDeleteMachine, {}, }, @@ -140,12 +140,12 @@ func TestMachineToDelete(t *testing.T) { { desc: "func=randomDeletePolicy, annotated, diff=1", diff: 1, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ {}, deleteMeMachine, {}, }, - expect: []*v1alpha1.Machine{ + expect: []*v1alpha2.Machine{ deleteMeMachine, }, }} @@ -162,59 +162,59 @@ func TestMachineNewestDelete(t *testing.T) { currentTime := metav1.Now() statusError := common.MachineStatusError("I'm unhealthy!") - mustDeleteMachine := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{DeletionTimestamp: ¤tTime}} - newest := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -1))}} - new := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -5))}} - old := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}} - oldest := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}} - annotatedMachine := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{DeleteNodeAnnotation: "yes"}, CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}} - unhealthyMachine := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}, Status: v1alpha1.MachineStatus{ErrorReason: &statusError}} + mustDeleteMachine := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{DeletionTimestamp: ¤tTime}} + newest := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -1))}} + new := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -5))}} + old := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}} + oldest := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}} + annotatedMachine := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{DeleteNodeAnnotation: "yes"}, CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}} + unhealthyMachine := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}, Status: v1alpha2.MachineStatus{ErrorReason: &statusError}} tests := []struct { desc string - machines []*v1alpha1.Machine + machines []*v1alpha2.Machine diff int - expect []*v1alpha1.Machine + expect []*v1alpha2.Machine }{ { desc: "func=newestDeletePriority, diff=1", diff: 1, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ new, oldest, old, mustDeleteMachine, newest, }, - expect: []*v1alpha1.Machine{mustDeleteMachine}, + expect: []*v1alpha2.Machine{mustDeleteMachine}, }, { desc: "func=newestDeletePriority, diff=2", diff: 2, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ new, oldest, mustDeleteMachine, old, newest, }, - expect: []*v1alpha1.Machine{mustDeleteMachine, newest}, + expect: []*v1alpha2.Machine{mustDeleteMachine, newest}, }, { desc: "func=newestDeletePriority, diff=3", diff: 3, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ new, mustDeleteMachine, oldest, old, newest, }, - expect: []*v1alpha1.Machine{mustDeleteMachine, newest, new}, + expect: []*v1alpha2.Machine{mustDeleteMachine, newest, new}, }, { desc: "func=newestDeletePriority, diff=1 (annotated)", diff: 1, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ new, oldest, old, newest, annotatedMachine, }, - expect: []*v1alpha1.Machine{annotatedMachine}, + expect: []*v1alpha2.Machine{annotatedMachine}, }, { desc: "func=newestDeletePriority, diff=1 (unhealthy)", diff: 1, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ new, oldest, old, newest, unhealthyMachine, }, - expect: []*v1alpha1.Machine{unhealthyMachine}, + expect: []*v1alpha2.Machine{unhealthyMachine}, }, } @@ -230,67 +230,67 @@ func TestMachineOldestDelete(t *testing.T) { currentTime := metav1.Now() statusError := common.MachineStatusError("I'm unhealthy!") - empty := &v1alpha1.Machine{} - newest := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -1))}} - new := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -5))}} - old := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}} - oldest := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}} - annotatedMachine := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{DeleteNodeAnnotation: "yes"}, CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}} - unhealthyMachine := &v1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}, Status: v1alpha1.MachineStatus{ErrorReason: &statusError}} + empty := &v1alpha2.Machine{} + newest := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -1))}} + new := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -5))}} + old := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}} + oldest := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}} + annotatedMachine := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{Annotations: map[string]string{DeleteNodeAnnotation: "yes"}, CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}} + unhealthyMachine := &v1alpha2.Machine{ObjectMeta: metav1.ObjectMeta{CreationTimestamp: metav1.NewTime(currentTime.Time.AddDate(0, 0, -10))}, Status: v1alpha2.MachineStatus{ErrorReason: &statusError}} tests := []struct { desc string - machines []*v1alpha1.Machine + machines []*v1alpha2.Machine diff int - expect []*v1alpha1.Machine + expect []*v1alpha2.Machine }{ { desc: "func=oldestDeletePriority, diff=1", diff: 1, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ empty, new, oldest, old, newest, }, - expect: []*v1alpha1.Machine{oldest}, + expect: []*v1alpha2.Machine{oldest}, }, { desc: "func=oldestDeletePriority, diff=2", diff: 2, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ new, oldest, old, newest, empty, }, - expect: []*v1alpha1.Machine{oldest, old}, + expect: []*v1alpha2.Machine{oldest, old}, }, { desc: "func=oldestDeletePriority, diff=3", diff: 3, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ new, oldest, old, newest, empty, }, - expect: []*v1alpha1.Machine{oldest, old, new}, + expect: []*v1alpha2.Machine{oldest, old, new}, }, { desc: "func=oldestDeletePriority, diff=4", diff: 4, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ new, oldest, old, newest, empty, }, - expect: []*v1alpha1.Machine{oldest, old, new, newest}, + expect: []*v1alpha2.Machine{oldest, old, new, newest}, }, { desc: "func=oldestDeletePriority, diff=1 (annotated)", diff: 1, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ empty, new, oldest, old, newest, annotatedMachine, }, - expect: []*v1alpha1.Machine{annotatedMachine}, + expect: []*v1alpha2.Machine{annotatedMachine}, }, { desc: "func=oldestDeletePriority, diff=1 (unhealthy)", diff: 1, - machines: []*v1alpha1.Machine{ + machines: []*v1alpha2.Machine{ empty, new, oldest, old, newest, unhealthyMachine, }, - expect: []*v1alpha1.Machine{unhealthyMachine}, + expect: []*v1alpha2.Machine{unhealthyMachine}, }, } diff --git a/pkg/controller/machineset/machine.go b/pkg/controller/machineset/machine.go index 53abd9407adf..0312fcf43352 100644 --- a/pkg/controller/machineset/machine.go +++ b/pkg/controller/machineset/machine.go @@ -22,24 +22,24 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/klog" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/controller-runtime/pkg/client" ) -func (c *ReconcileMachineSet) getMachineSetsForMachine(m *v1alpha1.Machine) []*v1alpha1.MachineSet { +func (c *ReconcileMachineSet) getMachineSetsForMachine(m *v1alpha2.Machine) []*v1alpha2.MachineSet { if len(m.Labels) == 0 { klog.Warningf("No machine sets found for Machine %v because it has no labels", m.Name) return nil } - msList := &v1alpha1.MachineSetList{} + msList := &v1alpha2.MachineSetList{} err := c.Client.List(context.Background(), msList, client.InNamespace(m.Namespace)) if err != nil { klog.Errorf("Failed to list machine sets, %v", err) return nil } - var mss []*v1alpha1.MachineSet + var mss []*v1alpha2.MachineSet for idx := range msList.Items { ms := &msList.Items[idx] if hasMatchingLabels(ms, m) { @@ -50,7 +50,7 @@ func (c *ReconcileMachineSet) getMachineSetsForMachine(m *v1alpha1.Machine) []*v return mss } -func hasMatchingLabels(machineSet *v1alpha1.MachineSet, machine *v1alpha1.Machine) bool { +func hasMatchingLabels(machineSet *v1alpha2.MachineSet, machine *v1alpha2.Machine) bool { selector, err := metav1.LabelSelectorAsSelector(&machineSet.Spec.Selector) if err != nil { klog.Warningf("unable to convert selector: %v", err) diff --git a/pkg/controller/machineset/machine_test.go b/pkg/controller/machineset/machine_test.go index 7e2f9190da9e..a05c22c87d30 100644 --- a/pkg/controller/machineset/machine_test.go +++ b/pkg/controller/machineset/machine_test.go @@ -20,18 +20,18 @@ import ( "testing" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" ) func TestHasMatchingLabels(t *testing.T) { testCases := []struct { - machineSet v1alpha1.MachineSet - machine v1alpha1.Machine + machineSet v1alpha2.MachineSet + machine v1alpha2.Machine expected bool }{ { - machineSet: v1alpha1.MachineSet{ - Spec: v1alpha1.MachineSetSpec{ + machineSet: v1alpha2.MachineSet{ + Spec: v1alpha2.MachineSetSpec{ Selector: metav1.LabelSelector{ MatchLabels: map[string]string{ "foo": "bar", @@ -39,7 +39,7 @@ func TestHasMatchingLabels(t *testing.T) { }, }, }, - machine: v1alpha1.Machine{ + machine: v1alpha2.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: "matchSelector", Labels: map[string]string{ @@ -50,8 +50,8 @@ func TestHasMatchingLabels(t *testing.T) { expected: true, }, { - machineSet: v1alpha1.MachineSet{ - Spec: v1alpha1.MachineSetSpec{ + machineSet: v1alpha2.MachineSet{ + Spec: v1alpha2.MachineSetSpec{ Selector: metav1.LabelSelector{ MatchLabels: map[string]string{ "foo": "bar", @@ -59,7 +59,7 @@ func TestHasMatchingLabels(t *testing.T) { }, }, }, - machine: v1alpha1.Machine{ + machine: v1alpha2.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: "doesNotMatchSelector", Labels: map[string]string{ diff --git a/pkg/controller/machineset/machineset_controller.go b/pkg/controller/machineset/machineset_controller.go index e580ab76c442..8dda46bef723 100644 --- a/pkg/controller/machineset/machineset_controller.go +++ b/pkg/controller/machineset/machineset_controller.go @@ -31,7 +31,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/record" "k8s.io/klog" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/cluster-api/pkg/util" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" diff --git a/pkg/controller/machineset/machineset_controller_test.go b/pkg/controller/machineset/machineset_controller_test.go index 7247de1df2e0..23f9c8be4ee5 100644 --- a/pkg/controller/machineset/machineset_controller_test.go +++ b/pkg/controller/machineset/machineset_controller_test.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/handler" @@ -33,21 +33,21 @@ import ( var _ reconcile.Reconciler = &ReconcileMachineSet{} func TestMachineSetToMachines(t *testing.T) { - machineSetList := &v1alpha1.MachineSetList{ + machineSetList := &v1alpha2.MachineSetList{ TypeMeta: metav1.TypeMeta{ Kind: "MachineSetList", }, - Items: []v1alpha1.MachineSet{ + Items: []v1alpha2.MachineSet{ { ObjectMeta: metav1.ObjectMeta{ Name: "withMatchingLabels", Namespace: "test", }, - Spec: v1alpha1.MachineSetSpec{ + Spec: v1alpha2.MachineSetSpec{ Selector: metav1.LabelSelector{ MatchLabels: map[string]string{ "foo": "bar", - v1alpha1.MachineClusterLabelName: "test-cluster", + v1alpha2.MachineClusterLabelName: "test-cluster", }, }, }, @@ -55,7 +55,7 @@ func TestMachineSetToMachines(t *testing.T) { }, } controller := true - m := v1alpha1.Machine{ + m := v1alpha2.Machine{ TypeMeta: metav1.TypeMeta{ Kind: "Machine", }, @@ -63,7 +63,7 @@ func TestMachineSetToMachines(t *testing.T) { Name: "withOwnerRef", Namespace: "test", Labels: map[string]string{ - v1alpha1.MachineClusterLabelName: "test-cluster", + v1alpha2.MachineClusterLabelName: "test-cluster", }, OwnerReferences: []metav1.OwnerReference{ { @@ -74,7 +74,7 @@ func TestMachineSetToMachines(t *testing.T) { }, }, } - m2 := v1alpha1.Machine{ + m2 := v1alpha2.Machine{ TypeMeta: metav1.TypeMeta{ Kind: "Machine", }, @@ -82,11 +82,11 @@ func TestMachineSetToMachines(t *testing.T) { Name: "noOwnerRefNoLabels", Namespace: "test", Labels: map[string]string{ - v1alpha1.MachineClusterLabelName: "test-cluster", + v1alpha2.MachineClusterLabelName: "test-cluster", }, }, } - m3 := v1alpha1.Machine{ + m3 := v1alpha2.Machine{ TypeMeta: metav1.TypeMeta{ Kind: "Machine", }, @@ -95,12 +95,12 @@ func TestMachineSetToMachines(t *testing.T) { Namespace: "test", Labels: map[string]string{ "foo": "bar", - v1alpha1.MachineClusterLabelName: "test-cluster", + v1alpha2.MachineClusterLabelName: "test-cluster", }, }, } testsCases := []struct { - machine v1alpha1.Machine + machine v1alpha2.Machine mapObject handler.MapObject expected []reconcile.Request }{ @@ -132,7 +132,7 @@ func TestMachineSetToMachines(t *testing.T) { }, } - v1alpha1.AddToScheme(scheme.Scheme) + v1alpha2.AddToScheme(scheme.Scheme) r := &ReconcileMachineSet{ Client: fake.NewFakeClient(&m, &m2, &m3, machineSetList), scheme: scheme.Scheme, @@ -149,13 +149,13 @@ func TestMachineSetToMachines(t *testing.T) { func TestShouldExcludeMachine(t *testing.T) { controller := true testCases := []struct { - machineSet v1alpha1.MachineSet - machine v1alpha1.Machine + machineSet v1alpha2.MachineSet + machine v1alpha2.Machine expected bool }{ { - machineSet: v1alpha1.MachineSet{}, - machine: v1alpha1.Machine{ + machineSet: v1alpha2.MachineSet{}, + machine: v1alpha2.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: "withNoMatchingOwnerRef", Namespace: "test", @@ -171,8 +171,8 @@ func TestShouldExcludeMachine(t *testing.T) { expected: true, }, { - machineSet: v1alpha1.MachineSet{ - Spec: v1alpha1.MachineSetSpec{ + machineSet: v1alpha2.MachineSet{ + Spec: v1alpha2.MachineSetSpec{ Selector: metav1.LabelSelector{ MatchLabels: map[string]string{ "foo": "bar", @@ -180,7 +180,7 @@ func TestShouldExcludeMachine(t *testing.T) { }, }, }, - machine: v1alpha1.Machine{ + machine: v1alpha2.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: "withMatchingLabels", Namespace: "test", @@ -192,8 +192,8 @@ func TestShouldExcludeMachine(t *testing.T) { expected: false, }, { - machineSet: v1alpha1.MachineSet{}, - machine: v1alpha1.Machine{ + machineSet: v1alpha2.MachineSet{}, + machine: v1alpha2.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: "withDeletionTimestamp", Namespace: "test", @@ -216,12 +216,12 @@ func TestShouldExcludeMachine(t *testing.T) { } func TestAdoptOrphan(t *testing.T) { - m := v1alpha1.Machine{ + m := v1alpha2.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: "orphanMachine", }, } - ms := v1alpha1.MachineSet{ + ms := v1alpha2.MachineSet{ ObjectMeta: metav1.ObjectMeta{ Name: "adoptOrphanMachine", }, @@ -229,8 +229,8 @@ func TestAdoptOrphan(t *testing.T) { controller := true blockOwnerDeletion := true testCases := []struct { - machineSet v1alpha1.MachineSet - machine v1alpha1.Machine + machineSet v1alpha2.MachineSet + machine v1alpha2.Machine expected []metav1.OwnerReference }{ { @@ -238,7 +238,7 @@ func TestAdoptOrphan(t *testing.T) { machineSet: ms, expected: []metav1.OwnerReference{ { - APIVersion: v1alpha1.SchemeGroupVersion.String(), + APIVersion: v1alpha2.SchemeGroupVersion.String(), Kind: "MachineSet", Name: "adoptOrphanMachine", UID: "", @@ -249,7 +249,7 @@ func TestAdoptOrphan(t *testing.T) { }, } - v1alpha1.AddToScheme(scheme.Scheme) + v1alpha2.AddToScheme(scheme.Scheme) r := &ReconcileMachineSet{ Client: fake.NewFakeClient(&m), scheme: scheme.Scheme, diff --git a/pkg/controller/machineset/machineset_reconciler_test.go b/pkg/controller/machineset/machineset_reconciler_test.go index d927518640f9..781fddc16481 100644 --- a/pkg/controller/machineset/machineset_reconciler_test.go +++ b/pkg/controller/machineset/machineset_reconciler_test.go @@ -23,7 +23,7 @@ import ( "golang.org/x/net/context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -37,13 +37,14 @@ const timeout = time.Second * 5 func TestReconcile(t *testing.T) { replicas := int32(2) - instance := &clusterv1alpha1.MachineSet{ + version := "1.14.2" + instance := &clusterv1alpha2.MachineSet{ ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "default"}, - Spec: clusterv1alpha1.MachineSetSpec{ + Spec: clusterv1alpha2.MachineSetSpec{ Replicas: &replicas, - Template: clusterv1alpha1.MachineTemplateSpec{ - Spec: clusterv1alpha1.MachineSpec{ - Versions: clusterv1alpha1.MachineVersionInfo{Kubelet: "1.10.3"}, + Template: clusterv1alpha2.MachineTemplateSpec{ + Spec: clusterv1alpha2.MachineSpec{ + Version: &version, }, }, }, @@ -78,7 +79,7 @@ func TestReconcile(t *testing.T) { t.Error("timed out waiting for request") } - machines := &clusterv1alpha1.MachineList{} + machines := &clusterv1alpha2.MachineList{} // TODO(joshuarubin) there seems to be a race here. If expectInt sleeps // briefly, even 10ms, the number of replicas is 4 and not 2 as expected @@ -91,8 +92,8 @@ func TestReconcile(t *testing.T) { // Verify that each machine has the desired kubelet version. for _, m := range machines.Items { - if k := m.Spec.Versions.Kubelet; k != "1.10.3" { - t.Errorf("kubelet was %q not '1.10.3'", k) + if k := m.Spec.Version; k == nil || *k != "1.14.2" { + t.Errorf("kubelet was %v not '1.14.2'", k) } } diff --git a/pkg/controller/machineset/status.go b/pkg/controller/machineset/status.go index 645d0dbb8c4f..6936cc84a092 100644 --- a/pkg/controller/machineset/status.go +++ b/pkg/controller/machineset/status.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/klog" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/cluster-api/pkg/controller/noderefutil" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -35,7 +35,7 @@ const ( statusUpdateRetries = 1 ) -func (c *ReconcileMachineSet) calculateStatus(ms *v1alpha1.MachineSet, filteredMachines []*v1alpha1.Machine) v1alpha1.MachineSetStatus { +func (c *ReconcileMachineSet) calculateStatus(ms *v1alpha2.MachineSet, filteredMachines []*v1alpha2.Machine) v1alpha2.MachineSetStatus { newStatus := ms.Status // Count the number of machines that have labels matching the labels of the machine // template of the replica set, the matching machines may have more @@ -71,7 +71,7 @@ func (c *ReconcileMachineSet) calculateStatus(ms *v1alpha1.MachineSet, filteredM } // updateMachineSetStatus attempts to update the Status.Replicas of the given MachineSet, with a single GET/PUT retry. -func updateMachineSetStatus(c client.Client, ms *v1alpha1.MachineSet, newStatus v1alpha1.MachineSetStatus) (*v1alpha1.MachineSet, error) { +func updateMachineSetStatus(c client.Client, ms *v1alpha2.MachineSet, newStatus v1alpha2.MachineSetStatus) (*v1alpha2.MachineSet, error) { // This is the steady state. It happens when the MachineSet doesn't have any expectations, since // we do a periodic relist every 30s. If the generations differ but the replicas are // the same, a caller might've resized to the same replica count. @@ -122,7 +122,7 @@ func updateMachineSetStatus(c client.Client, ms *v1alpha1.MachineSet, newStatus return nil, updateErr } -func (c *ReconcileMachineSet) getMachineNode(machine *v1alpha1.Machine) (*corev1.Node, error) { +func (c *ReconcileMachineSet) getMachineNode(machine *v1alpha2.Machine) (*corev1.Node, error) { nodeRef := machine.Status.NodeRef if nodeRef == nil { return nil, errors.New("machine has no node ref") diff --git a/pkg/controller/node/BUILD.bazel b/pkg/controller/node/BUILD.bazel deleted file mode 100644 index 5a855c4171ce..000000000000 --- a/pkg/controller/node/BUILD.bazel +++ /dev/null @@ -1,51 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = [ - "node.go", - "node_controller.go", - ], - importpath = "sigs.k8s.io/cluster-api/pkg/controller/node", - visibility = ["//visibility:public"], - deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", - "//pkg/controller/noderefutil:go_default_library", - "//pkg/util:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/k8s.io/klog:go_default_library", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client:go_default_library", - "//vendor/sigs.k8s.io/controller-runtime/pkg/controller:go_default_library", - "//vendor/sigs.k8s.io/controller-runtime/pkg/handler:go_default_library", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager:go_default_library", - "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile:go_default_library", - "//vendor/sigs.k8s.io/controller-runtime/pkg/source:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = [ - "node_reconciler_suite_test.go", - "node_reconciler_test.go", - ], - embed = [":go_default_library"], - deps = [ - "//pkg/apis:go_default_library", - "//vendor/golang.org/x/net/context:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/sigs.k8s.io/controller-runtime/pkg/client:go_default_library", - "//vendor/sigs.k8s.io/controller-runtime/pkg/envtest:go_default_library", - "//vendor/sigs.k8s.io/controller-runtime/pkg/manager:go_default_library", - "//vendor/sigs.k8s.io/controller-runtime/pkg/reconcile:go_default_library", - ], -) diff --git a/pkg/controller/node/node.go b/pkg/controller/node/node.go deleted file mode 100644 index b2c7230086db..000000000000 --- a/pkg/controller/node/node.go +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright 2017 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 node - -import ( - "context" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/tools/cache" - "k8s.io/klog" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/controller/noderefutil" - "sigs.k8s.io/cluster-api/pkg/util" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -const ( - // MachineAnnotationKey annotation used to link node and machine resource - MachineAnnotationKey = "cluster.k8s.io/machine" -) - -// We are using "cluster.k8s.io/machine" annotation to link node and machine resource. The "cluster.k8s.io/machine" -// annotation is an implementation detail of how the two objects can get linked together, but it is -// not required behavior. However, in the event that a Machine.Spec update requires replacing the -// Node, this can allow for faster turn-around time by allowing a new Node to be created with a new -// name while the old node is being deleted. -// -// Currently, these annotations are added by the node itself as part of its -// bootup script after "kubeadm join" succeeds. -func (c *ReconcileNode) link(node *corev1.Node) error { - nodeReady := noderefutil.IsNodeReady(node) - - // skip update if cached and no change in readiness. - if c.linkedNodes[node.ObjectMeta.Name] { - if cachedReady, ok := c.cachedReadiness[node.ObjectMeta.Name]; ok && cachedReady == nodeReady { - return nil - } - } - - val, ok := node.ObjectMeta.Annotations[MachineAnnotationKey] - if !ok { - return nil - } - - namespace, mach, err := cache.SplitMetaNamespaceKey(val) - if err != nil { - klog.Errorf("Machine annotation format is incorrect %v: %v\n", val, err) - return err - } - namespace = util.GetNamespaceOrDefault(namespace) - key := client.ObjectKey{Namespace: namespace, Name: mach} - - machine := &v1alpha1.Machine{} - if err = c.Client.Get(context.Background(), key, machine); err != nil { - klog.Errorf("Error getting machine %v: %v\n", mach, err) - return err - } - - t := metav1.Now() - machine.Status.LastUpdated = &t - machine.Status.NodeRef = objectRef(node) - if err = c.Client.Status().Update(context.Background(), machine); err != nil { - klog.Errorf("Error updating machine to link to node: %v\n", err) - } else { - klog.Infof("Successfully linked machine %s to node %s\n", - machine.ObjectMeta.Name, node.ObjectMeta.Name) - c.linkedNodes[node.ObjectMeta.Name] = true - c.cachedReadiness[node.ObjectMeta.Name] = nodeReady - } - return err -} - -func (c *ReconcileNode) unlink(node *corev1.Node) error { - val, ok := node.ObjectMeta.Annotations[MachineAnnotationKey] - if !ok { - return nil - } - - namespace, mach, err := cache.SplitMetaNamespaceKey(val) - if err != nil { - klog.Errorf("Machine annotation format is incorrect %v: %v\n", val, err) - return err - } - namespace = util.GetNamespaceOrDefault(namespace) - key := client.ObjectKey{Namespace: namespace, Name: mach} - - machine := &v1alpha1.Machine{} - if err = c.Client.Get(context.Background(), key, machine); err != nil { - klog.Errorf("Error getting machine %v: %v\n", mach, err) - return err - } - - // This machine has no link to remove - if machine.Status.NodeRef == nil { - return nil - } - - // This machine was linked to a different node, don't unlink them - if machine.Status.NodeRef.Name != node.ObjectMeta.Name { - klog.Warningf("Node (%v) is tring to unlink machine (%v) which is linked with node (%v).", - node.ObjectMeta.Name, machine.ObjectMeta.Name, machine.Status.NodeRef.Name) - return nil - } - - t := metav1.Now() - machine.Status.LastUpdated = &t - machine.Status.NodeRef = nil - if err = c.Client.Status().Update(context.Background(), machine); err != nil { - klog.Errorf("Error updating machine %s to unlink node %s: %v\n", - machine.ObjectMeta.Name, node.ObjectMeta.Name, err) - } else { - klog.Infof("Successfully unlinked node %s from machine %s\n", - node.ObjectMeta.Name, machine.ObjectMeta.Name) - delete(c.cachedReadiness, node.ObjectMeta.Name) - delete(c.linkedNodes, node.ObjectMeta.Name) - } - return err -} - -func objectRef(node *corev1.Node) *corev1.ObjectReference { - return &corev1.ObjectReference{ - Kind: "Node", - Name: node.ObjectMeta.Name, - UID: node.UID, - } -} diff --git a/pkg/controller/node/node_controller.go b/pkg/controller/node/node_controller.go deleted file mode 100644 index b403b8592dd7..000000000000 --- a/pkg/controller/node/node_controller.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package node - -import ( - "context" - - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/klog" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" -) - -// Add creates a new Node Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller -// and Start it when the Manager is Started. -func Add(mgr manager.Manager) error { - return add(mgr, newReconciler(mgr)) -} - -// newReconciler returns a new reconcile.Reconciler -func newReconciler(mgr manager.Manager) reconcile.Reconciler { - return &ReconcileNode{ - Client: mgr.GetClient(), - scheme: mgr.GetScheme(), - linkedNodes: map[string]bool{}, - cachedReadiness: map[string]bool{}, - } -} - -// add adds a new Controller to mgr with r as the reconcile.Reconciler -func add(mgr manager.Manager, r reconcile.Reconciler) error { - // Create a new controller - c, err := controller.New("node_controller", mgr, controller.Options{Reconciler: r}) - if err != nil { - return err - } - - // Watch for changes to Node - err = c.Watch(&source.Kind{Type: &corev1.Node{}}, &handler.EnqueueRequestForObject{}) - if err != nil { - return err - } - - return nil -} - -var _ reconcile.Reconciler = &ReconcileNode{} - -// ReconcileNode reconciles a Node object -type ReconcileNode struct { - client.Client - scheme *runtime.Scheme - - linkedNodes map[string]bool - cachedReadiness map[string]bool -} - -// Reconcile reads that state of the cluster for a Node object and makes changes based on the state read -// and what is in the Node.Spec -func (r *ReconcileNode) Reconcile(request reconcile.Request) (reconcile.Result, error) { - // Fetch the Node instance - instance := &corev1.Node{} - err := r.Get(context.Background(), request.NamespacedName, instance) - if err != nil { - if errors.IsNotFound(err) { - // Object not found, return. Created objects are automatically garbage collected. - // For additional cleanup logic use finalizers. - klog.Errorf("Unable to retrieve Node %v from store: %v", request, err) - return reconcile.Result{}, nil - } - // Error reading the object - requeue the request. - return reconcile.Result{}, err - } - - if instance.DeletionTimestamp.IsZero() { - return reconcile.Result{}, r.link(instance) - } - return reconcile.Result{}, r.unlink(instance) -} diff --git a/pkg/controller/node/node_reconciler_suite_test.go b/pkg/controller/node/node_reconciler_suite_test.go deleted file mode 100644 index f93d36915f64..000000000000 --- a/pkg/controller/node/node_reconciler_suite_test.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package node - -import ( - "log" - "os" - "path/filepath" - "testing" - - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/cluster-api/pkg/apis" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" -) - -var cfg *rest.Config - -func TestMain(m *testing.M) { - t := &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crds")}, - } - apis.AddToScheme(scheme.Scheme) - - var err error - if cfg, err = t.Start(); err != nil { - log.Fatal(err) - } - - code := m.Run() - t.Stop() - os.Exit(code) -} - -// SetupTestReconcile returns a reconcile.Reconcile implementation that delegates to inner and -// writes the request to requests after Reconcile is finished. -func SetupTestReconcile(inner reconcile.Reconciler) (reconcile.Reconciler, chan reconcile.Request) { - requests := make(chan reconcile.Request) - fn := reconcile.Func(func(req reconcile.Request) (reconcile.Result, error) { - result, err := inner.Reconcile(req) - requests <- req - return result, err - }) - return fn, requests -} - -// StartTestManager adds recFn -func StartTestManager(mgr manager.Manager, t *testing.T) chan struct{} { - t.Helper() - - stop := make(chan struct{}) - go func() { - if err := mgr.Start(stop); err != nil { - t.Fatalf("error starting test manager: %v", err) - } - }() - return stop -} diff --git a/pkg/controller/node/node_reconciler_test.go b/pkg/controller/node/node_reconciler_test.go deleted file mode 100644 index 304b1caa12e5..000000000000 --- a/pkg/controller/node/node_reconciler_test.go +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package node - -import ( - "testing" - "time" - - "golang.org/x/net/context" - corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" -) - -var c client.Client - -var expectedRequest = reconcile.Request{NamespacedName: types.NamespacedName{Name: "foo"}} - -const timeout = time.Second * 5 - -func TestReconcile(t *testing.T) { - instance := &corev1.Node{ObjectMeta: metav1.ObjectMeta{Name: "foo"}} - - // Setup the Manager and Controller. Wrap the Controller Reconcile function so it writes each request to a - // channel when it is finished. - mgr, err := manager.New(cfg, manager.Options{}) - if err != nil { - t.Errorf("error creating new manager: %v", err) - } - c = mgr.GetClient() - - recFn, requests := SetupTestReconcile(newReconciler(mgr)) - if err := add(mgr, recFn); err != nil { - t.Errorf("error adding controller to manager: %v", err) - } - defer close(StartTestManager(mgr, t)) - - // Create the Node object and expect the Reconcile - err = c.Create(context.TODO(), instance) - // The instance object may not be a valid object because it might be missing some required fields. - // Please modify the instance object by adding required fields and then remove the following if statement. - if apierrors.IsInvalid(err) { - t.Logf("failed to create object, got an invalid object error: %v", err) - return - } - if err != nil { - t.Errorf("error creating instance: %v", err) - } - defer c.Delete(context.TODO(), instance) - select { - case recv := <-requests: - if recv != expectedRequest { - t.Error("received request does not match expected request") - } - case <-time.After(timeout): - t.Error("timed out waiting for request") - } - -} diff --git a/pkg/controller/noderef/BUILD.bazel b/pkg/controller/noderef/BUILD.bazel index 88ac19a74c38..a5a5c75dde52 100644 --- a/pkg/controller/noderef/BUILD.bazel +++ b/pkg/controller/noderef/BUILD.bazel @@ -6,7 +6,7 @@ go_library( importpath = "sigs.k8s.io/cluster-api/pkg/controller/noderef", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/controller/noderefutil:go_default_library", "//pkg/controller/remote:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", @@ -35,7 +35,7 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/apis:go_default_library", - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/controller/noderefutil:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", diff --git a/pkg/controller/noderef/noderef_controller.go b/pkg/controller/noderef/noderef_controller.go index c32822c3631d..82b7959889a6 100644 --- a/pkg/controller/noderef/noderef_controller.go +++ b/pkg/controller/noderef/noderef_controller.go @@ -28,7 +28,7 @@ import ( corev1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/tools/record" "k8s.io/klog" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/cluster-api/pkg/controller/noderefutil" "sigs.k8s.io/cluster-api/pkg/controller/remote" "sigs.k8s.io/controller-runtime/pkg/client" @@ -70,7 +70,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error { } // Watch for changes to Machines. - return c.Watch(&source.Kind{Type: &v1alpha1.Machine{}}, &handler.EnqueueRequestForObject{}) + return c.Watch(&source.Kind{Type: &v1alpha2.Machine{}}, &handler.EnqueueRequestForObject{}) } var _ reconcile.Reconciler = &ReconcileNodeRef{} @@ -88,7 +88,7 @@ func (r *ReconcileNodeRef) Reconcile(request reconcile.Request) (reconcile.Resul ctx := context.Background() // Fetch the Machine instance. - machine := &v1alpha1.Machine{} + machine := &v1alpha2.Machine{} err := r.Get(ctx, request.NamespacedName, machine) if err != nil { if apierrors.IsNotFound(err) { @@ -111,9 +111,9 @@ func (r *ReconcileNodeRef) Reconcile(request reconcile.Request) (reconcile.Resul } // Check that the Machine has a cluster label. - if machine.Labels[v1alpha1.MachineClusterLabelName] == "" { + if machine.Labels[v1alpha2.MachineClusterLabelName] == "" { klog.V(2).Infof("Machine %q in namespace %q doesn't specify %q label, won't reconcile", machine.Name, machine.Namespace, - v1alpha1.MachineClusterLabelName) + v1alpha2.MachineClusterLabelName) return reconcile.Result{}, nil } @@ -145,7 +145,7 @@ func (r *ReconcileNodeRef) Reconcile(request reconcile.Request) (reconcile.Resul return result, nil } -func (r *ReconcileNodeRef) reconcile(ctx context.Context, cluster *v1alpha1.Cluster, machine *v1alpha1.Machine) (reconcile.Result, error) { +func (r *ReconcileNodeRef) reconcile(ctx context.Context, cluster *v1alpha2.Cluster, machine *v1alpha2.Machine) (reconcile.Result, error) { providerID, err := noderefutil.NewProviderID(*machine.Spec.ProviderID) if err != nil { return reconcile.Result{}, err @@ -180,11 +180,11 @@ func (r *ReconcileNodeRef) reconcile(ctx context.Context, cluster *v1alpha1.Clus return reconcile.Result{}, nil } -func (r *ReconcileNodeRef) getCluster(ctx context.Context, machine *v1alpha1.Machine) (*v1alpha1.Cluster, error) { - cluster := &v1alpha1.Cluster{} +func (r *ReconcileNodeRef) getCluster(ctx context.Context, machine *v1alpha2.Machine) (*v1alpha2.Cluster, error) { + cluster := &v1alpha2.Cluster{} key := client.ObjectKey{ Namespace: machine.Namespace, - Name: machine.Labels[v1alpha1.MachineClusterLabelName], + Name: machine.Labels[v1alpha2.MachineClusterLabelName], } if err := r.Client.Get(ctx, key, cluster); err != nil { diff --git a/pkg/controller/noderef/noderef_controller_test.go b/pkg/controller/noderef/noderef_controller_test.go index 5bb3a49016f0..7e52f8a4ec85 100644 --- a/pkg/controller/noderef/noderef_controller_test.go +++ b/pkg/controller/noderef/noderef_controller_test.go @@ -31,7 +31,7 @@ import ( fakeclient "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/cluster-api/pkg/controller/noderefutil" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -47,7 +47,7 @@ const timeout = time.Second * 5 func TestReconcile(t *testing.T) { g := gomega.NewGomegaWithT(t) - instance := &v1alpha1.Machine{ + instance := &v1alpha2.Machine{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Namespace: "default", @@ -84,7 +84,7 @@ func TestReconcile(t *testing.T) { } func TestGetNodeReference(t *testing.T) { - v1alpha1.AddToScheme(scheme.Scheme) + v1alpha2.AddToScheme(scheme.Scheme) r := &ReconcileNodeRef{ Client: fake.NewFakeClient(), scheme: scheme.Scheme, diff --git a/pkg/controller/remote/BUILD.bazel b/pkg/controller/remote/BUILD.bazel index d4ce571ab12f..61a35366cfd9 100644 --- a/pkg/controller/remote/BUILD.bazel +++ b/pkg/controller/remote/BUILD.bazel @@ -9,7 +9,7 @@ go_library( importpath = "sigs.k8s.io/cluster-api/pkg/controller/remote", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", @@ -28,7 +28,7 @@ go_test( ], embed = [":go_default_library"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/pkg/controller/remote/cluster.go b/pkg/controller/remote/cluster.go index b47389b444cc..85148db1f46f 100644 --- a/pkg/controller/remote/cluster.go +++ b/pkg/controller/remote/cluster.go @@ -21,7 +21,7 @@ import ( corev1 "k8s.io/client-go/kubernetes/typed/core/v1" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -35,11 +35,11 @@ type ClusterClient interface { // clusterClient is a helper struct to connect to remote workload clusters. type clusterClient struct { restConfig *restclient.Config - cluster *v1alpha1.Cluster + cluster *v1alpha2.Cluster } // NewClusterClient creates a new ClusterClient. -func NewClusterClient(c client.Client, cluster *v1alpha1.Cluster) (ClusterClient, error) { +func NewClusterClient(c client.Client, cluster *v1alpha2.Cluster) (ClusterClient, error) { secret, err := GetKubeConfigSecret(c, cluster.Name, cluster.Namespace) if err != nil { return nil, errors.Wrapf(err, "failed to retrieve kubeconfig secret for Cluster %q in namespace %q", diff --git a/pkg/controller/remote/cluster_test.go b/pkg/controller/remote/cluster_test.go index 8412ee62ca90..63240c3ae043 100644 --- a/pkg/controller/remote/cluster_test.go +++ b/pkg/controller/remote/cluster_test.go @@ -22,26 +22,26 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) var ( - clusterWithValidKubeConfig = &v1alpha1.Cluster{ + clusterWithValidKubeConfig = &v1alpha2.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: "test1", Namespace: "test", }, } - clusterWithInvalidKubeConfig = &v1alpha1.Cluster{ + clusterWithInvalidKubeConfig = &v1alpha2.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: "test2", Namespace: "test", }, } - clusterWithNoKubeConfig = &v1alpha1.Cluster{ + clusterWithNoKubeConfig = &v1alpha2.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: "test3", Namespace: "test", diff --git a/pkg/provider/example/actuators/cluster/BUILD.bazel b/pkg/provider/example/actuators/cluster/BUILD.bazel index 92a54a8726aa..6bc257b2b89a 100644 --- a/pkg/provider/example/actuators/cluster/BUILD.bazel +++ b/pkg/provider/example/actuators/cluster/BUILD.bazel @@ -6,8 +6,8 @@ go_library( importpath = "sigs.k8s.io/cluster-api/pkg/provider/example/actuators/cluster", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", - "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", + "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", ], diff --git a/pkg/provider/example/actuators/cluster/clusteractuator.go b/pkg/provider/example/actuators/cluster/clusteractuator.go index 249c5f070259..3c2394e65035 100644 --- a/pkg/provider/example/actuators/cluster/clusteractuator.go +++ b/pkg/provider/example/actuators/cluster/clusteractuator.go @@ -19,18 +19,18 @@ package cluster import ( corev1 "k8s.io/api/core/v1" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2" ) // Actuator is responsible for performing cluster reconciliation type Actuator struct { - clusterV1alpha1 clusterv1alpha1.ClusterV1alpha1Interface + clusterV1alpha1 clusterv1alpha2.ClusterV1alpha2Interface recorder record.EventRecorder } // NewClusterActuator creates a new cluster actuator -func NewClusterActuator(clusterV1alpha1 clusterv1alpha1.ClusterV1alpha1Interface, recorder record.EventRecorder) (*Actuator, error) { +func NewClusterActuator(clusterV1alpha1 clusterv1alpha2.ClusterV1alpha2Interface, recorder record.EventRecorder) (*Actuator, error) { return &Actuator{ clusterV1alpha1: clusterV1alpha1, recorder: recorder, diff --git a/pkg/provider/example/actuators/machine/BUILD.bazel b/pkg/provider/example/actuators/machine/BUILD.bazel index 3246479ed0bf..3f67d543edec 100644 --- a/pkg/provider/example/actuators/machine/BUILD.bazel +++ b/pkg/provider/example/actuators/machine/BUILD.bazel @@ -6,8 +6,8 @@ go_library( importpath = "sigs.k8s.io/cluster-api/pkg/provider/example/actuators/machine", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", - "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", + "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", ], diff --git a/pkg/provider/example/actuators/machine/machineactuator.go b/pkg/provider/example/actuators/machine/machineactuator.go index 0c1585736db5..5822c1811665 100644 --- a/pkg/provider/example/actuators/machine/machineactuator.go +++ b/pkg/provider/example/actuators/machine/machineactuator.go @@ -21,18 +21,18 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" + clusterv1alpha2 "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha2" ) // Actuator is responsible for performing machine reconciliation. type Actuator struct { - client clusterv1alpha1.ClusterV1alpha1Interface + client clusterv1alpha2.ClusterV1alpha2Interface recorder record.EventRecorder } // NewMachineActuator return a machine actuator -func NewMachineActuator(clusterV1alpha1 clusterv1alpha1.ClusterV1alpha1Interface, recorder record.EventRecorder) (*Actuator, error) { +func NewMachineActuator(clusterV1alpha1 clusterv1alpha2.ClusterV1alpha2Interface, recorder record.EventRecorder) (*Actuator, error) { return &Actuator{ client: clusterV1alpha1, recorder: recorder, diff --git a/pkg/util/BUILD.bazel b/pkg/util/BUILD.bazel index eb29fb108589..40c23c0e23eb 100644 --- a/pkg/util/BUILD.bazel +++ b/pkg/util/BUILD.bazel @@ -9,7 +9,7 @@ go_library( importpath = "sigs.k8s.io/cluster-api/pkg/util", visibility = ["//visibility:public"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library", diff --git a/pkg/util/util.go b/pkg/util/util.go index 76af756efc23..d0cefe0c765e 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -34,7 +34,7 @@ import ( "k8s.io/apimachinery/pkg/util/json" "k8s.io/apimachinery/pkg/util/yaml" "k8s.io/klog" - clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -133,7 +133,7 @@ func GetMachineIfExists(c client.Client, namespace, name string) (*clusterv1.Mac // IsControlPlaneMachine checks machine is a control plane node. func IsControlPlaneMachine(machine *clusterv1.Machine) bool { - return machine.Spec.Versions.ControlPlane != "" + return machine.ObjectMeta.Labels[clusterv1.MachineControlPlaneLabelName] != "" } // IsNodeReady returns true if a node is ready. diff --git a/pkg/util/util_test.go b/pkg/util/util_test.go index e662e1d185ee..678963180ee2 100644 --- a/pkg/util/util_test.go +++ b/pkg/util/util_test.go @@ -23,7 +23,7 @@ import ( ) const validCluster = ` -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: Cluster metadata: name: cluster1 @@ -31,42 +31,42 @@ spec:` const validMachines1 = ` --- -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: Machine metadata: name: machine1 --- -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: Machine metadata: name: machine2` const validUnified1 = ` -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: Cluster metadata: name: cluster1 --- -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: MachineList items: -- apiVersion: "cluster.k8s.io/v1alpha1" +- apiVersion: "cluster.k8s.io/v1alpha2" kind: Machine metadata: name: machine1` const validUnified2 = ` -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: Cluster metadata: name: cluster1 --- -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: Machine metadata: name: machine1 --- -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: Machine metadata: name: machine2` @@ -83,24 +83,24 @@ metadata: name: cluster-api-shared-configuration namespace: cluster-api-test --- -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: Cluster metadata: name: cluster1 --- -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: Machine metadata: name: machine1 --- -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: Machine metadata: name: machine2` const invalidMachines1 = ` items: -- apiVersion: "cluster.k8s.io/v1alpha1" +- apiVersion: "cluster.k8s.io/v1alpha2" kind: Machine metadata: name: machine1 @@ -127,12 +127,12 @@ metadata: name: cluster-api-shared-configuration namespace: cluster-api-test --- -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: Cluster metadata: name: cluster1 --- -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: MachineList items: - metadata: @@ -154,7 +154,7 @@ metadata: name: cluster-api-shared-configuration namespace: cluster-api-test --- -apiVersion: "cluster.k8s.io/v1alpha1" +apiVersion: "cluster.k8s.io/v1alpha2" kind: Cluster metadata: name: cluster1 diff --git a/test/integration/cluster/BUILD.bazel b/test/integration/cluster/BUILD.bazel index 8cc7fbe9431d..a7a54ce15601 100644 --- a/test/integration/cluster/BUILD.bazel +++ b/test/integration/cluster/BUILD.bazel @@ -4,9 +4,8 @@ go_test( name = "go_default_test", srcs = ["cluster_test.go"], deps = [ - "//pkg/apis/cluster/v1alpha1:go_default_library", + "//pkg/apis/cluster/v1alpha2:go_default_library", "//pkg/client/clientset_generated/clientset:go_default_library", - "//pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", @@ -15,5 +14,6 @@ go_test( "//vendor/k8s.io/client-go/kubernetes:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", + "//vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1:go_default_library", ], ) diff --git a/test/integration/cluster/cluster_test.go b/test/integration/cluster/cluster_test.go index 9873425c155f..bd8e1c99b2c5 100644 --- a/test/integration/cluster/cluster_test.go +++ b/test/integration/cluster/cluster_test.go @@ -28,7 +28,7 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/clientcmd" - clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha2" clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" client "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1" )