From e2a31b8f4531236a720852281056e346322f63d2 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Tue, 21 May 2019 11:52:30 +0200 Subject: [PATCH] Sync with rebased upstream 0.1.0 --- Gopkg.lock | 11 +- Gopkg.toml | 2 +- .../openshift/cluster-api/CONTRIBUTING.md | 4 + .../openshift/cluster-api/Dockerfile | 2 +- .../github.com/openshift/cluster-api/Makefile | 2 +- .../cluster-api/cmd/clusterctl/README.md | 18 ++- .../config/crds/cluster_v1alpha1_machine.yaml | 17 ++- .../cluster_v1alpha1_machinedeployment.yaml | 10 +- .../crds/cluster_v1alpha1_machineset.yaml | 19 ++- .../config/crds/machine_v1beta1_machine.yaml | 23 ++-- .../machine_v1beta1_machinedeployment.yaml | 20 ++-- .../crds/machine_v1beta1_machineset.yaml | 29 +++-- .../config/default/manager_image_patch.yaml | 4 +- .../cluster-api/config/rbac/rbac_role.yaml | 2 +- .../cluster-api/docs/book/SUMMARY.md | 1 + .../book/common_code/cluster_controller.md | 19 +-- .../activity_cluster_reconciliation.drawio | 1 + .../activity_cluster_reconciliation.svg | 2 + ...y_machine_controller_reconciliation.drawio | 1 + ...vity_machine_controller_reconciliation.svg | 2 + .../activity_machine_deletion_block.drawio | 1 + .../activity_machine_deletion_block.svg | 2 + ...ty_machinedeployment_reconciliation.drawio | 1 + ...ivity_machinedeployment_reconciliation.svg | 2 + .../activity_machineset_reconciliation.drawio | 1 + .../activity_machineset_reconciliation.svg | 2 + .../activity_node_reconciliation.drawio | 1 + .../images/activity_node_reconciliation.svg | 2 + .../images/sequence_cluster_creation.drawio | 1 + .../images/sequence_cluster_creation.svg | 2 + .../images/sequence_cluster_deletion.drawio | 1 + .../images/sequence_cluster_deletion.svg | 2 + .../images/sequence_machine_creation.drawio | 1 + .../images/sequence_machine_creation.svg | 2 + .../images/sequence_machine_deletion.drawio | 1 + .../images/sequence_machine_deletion.svg | 2 + .../book/common_code/machine_controller.md | 19 ++- .../machinedeployment_controller.md | 20 ++++ .../book/common_code/machineset_controller.md | 21 ++++ .../docs/book/common_code/node_controller.md | 22 ++++ .../register_schemes.md | 3 + .../apis/cluster/v1alpha1/machine_types.go | 19 +-- .../apis/cluster/v1alpha1/machineset_types.go | 35 ++++++ .../pkg/apis/machine/v1beta1/machine_types.go | 17 +-- .../apis/machine/v1beta1/machineset_types.go | 35 ++++++ .../pkg/controller/machine/controller.go | 2 +- .../machinedeployment/controller.go | 9 +- .../pkg/controller/machineset/BUILD.bazel | 1 + .../pkg/controller/machineset/controller.go | 16 ++- .../controller/machineset/delete_policy.go | 110 +++++++++++++----- .../pkg/controller/machineset/status.go | 2 +- 51 files changed, 421 insertions(+), 123 deletions(-) create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_cluster_reconciliation.drawio create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_cluster_reconciliation.svg create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_controller_reconciliation.drawio create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_controller_reconciliation.svg create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_deletion_block.drawio create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_deletion_block.svg create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machinedeployment_reconciliation.drawio create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machinedeployment_reconciliation.svg create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machineset_reconciliation.drawio create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machineset_reconciliation.svg create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_node_reconciliation.drawio create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_node_reconciliation.svg create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_creation.drawio create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_creation.svg create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_deletion.drawio create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_deletion.svg create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_creation.drawio create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_creation.svg create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_deletion.drawio create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_deletion.svg create mode 100644 vendor/github.com/openshift/cluster-api/docs/book/common_code/node_controller.md diff --git a/Gopkg.lock b/Gopkg.lock index babacb754d..4197385d88 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -485,8 +485,8 @@ revision = "81d064c11ff2d62705dbb09ed9ac200ef9557716" [[projects]] - branch = "openshift-4.2-cluster-api-0.0.0-alpha.4" - digest = "1:d67ab3b4d46616ef4c7d482dd8a88dbe4634f3a35dd354720cb7a4d6b2f59fa1" + branch = "openshift-4.2-cluster-api-0.1.0" + digest = "1:b991b56ba36f19ad2a1712d06d24bd5e050ed1dc43c290c45cd92302d8ab54e9" name = "github.com/openshift/cluster-api" packages = [ "pkg/apis", @@ -506,7 +506,8 @@ "pkg/util", ] pruneopts = "T" - revision = "9941763fab7237205d6eb162cae1bfb1d0096058" + revision = "b5b707e02e5c199ec352fff2ecffe46c7ae55968" + source = "github.com/gofed/cluster-api" [[projects]] branch = "master" @@ -1259,7 +1260,6 @@ "github.com/openshift/cluster-api-actuator-pkg/pkg/types", "github.com/openshift/cluster-api/pkg/apis", "github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1", - "github.com/openshift/cluster-api/pkg/apis/machine/common", "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1", "github.com/openshift/cluster-api/pkg/controller/error", "github.com/openshift/cluster-api/pkg/controller/machine", @@ -1275,16 +1275,13 @@ "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1", "k8s.io/apimachinery/pkg/api/equality", "k8s.io/apimachinery/pkg/apis/meta/v1", - "k8s.io/apimachinery/pkg/apis/meta/v1/validation", "k8s.io/apimachinery/pkg/labels", "k8s.io/apimachinery/pkg/runtime", "k8s.io/apimachinery/pkg/runtime/schema", "k8s.io/apimachinery/pkg/runtime/serializer", "k8s.io/apimachinery/pkg/types", "k8s.io/apimachinery/pkg/util/errors", - "k8s.io/apimachinery/pkg/util/intstr", "k8s.io/apimachinery/pkg/util/uuid", - "k8s.io/apimachinery/pkg/util/validation/field", "k8s.io/apimachinery/pkg/util/wait", "k8s.io/client-go/kubernetes", "k8s.io/client-go/kubernetes/scheme", diff --git a/Gopkg.toml b/Gopkg.toml index 75b5dc9d69..7a928b4712 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -30,7 +30,7 @@ required = [ [[override]] name = "github.com/openshift/cluster-api" - branch = "openshift-4.2-cluster-api-0.0.0-alpha.4" + branch = "openshift-4.2-cluster-api-0.1.0" [[override]] name = "github.com/openshift/cluster-api-actuator-pkg" diff --git a/vendor/github.com/openshift/cluster-api/CONTRIBUTING.md b/vendor/github.com/openshift/cluster-api/CONTRIBUTING.md index cc52280e07..b0be9a45fb 100644 --- a/vendor/github.com/openshift/cluster-api/CONTRIBUTING.md +++ b/vendor/github.com/openshift/cluster-api/CONTRIBUTING.md @@ -26,6 +26,10 @@ All changes must be code reviewed. Coding conventions and standards are explaine Cluster API maintainers may add "LGTM" (Looks Good To Me) or an equivalent comment to indicate that a PR is acceptable. Any change requires at least one LGTM. No pull requests can be merged until at least one Cluster API maintainer signs off with an LGTM. +### Google Doc Viewing Permissions + +To gain viewing permissions to google docs in this project, please join either the [kubernetes-dev](https://groups.google.com/forum/#!forum/kubernetes-dev) or [kubernetes-sig-cluster-lifecycle](https://groups.google.com/forum/#!forum/kubernetes-sig-cluster-lifecycle) google group. + ## Cloud Provider Developer Guide ### Overview diff --git a/vendor/github.com/openshift/cluster-api/Dockerfile b/vendor/github.com/openshift/cluster-api/Dockerfile index 8c49ba98f4..e4e89a9d1c 100644 --- a/vendor/github.com/openshift/cluster-api/Dockerfile +++ b/vendor/github.com/openshift/cluster-api/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # Build the manager binary -FROM golang:1.11.5 as builder +FROM golang:1.11.6 as builder # Copy in the go src WORKDIR $GOPATH/src/github.com/openshift/cluster-api diff --git a/vendor/github.com/openshift/cluster-api/Makefile b/vendor/github.com/openshift/cluster-api/Makefile index d72c81957d..73eb4450ec 100644 --- a/vendor/github.com/openshift/cluster-api/Makefile +++ b/vendor/github.com/openshift/cluster-api/Makefile @@ -22,7 +22,7 @@ export KUBEBUILDER_CONTROLPLANE_START_TIMEOUT ?=60s export KUBEBUILDER_CONTROLPLANE_STOP_TIMEOUT ?=60s # Image URL to use all building/pushing image targets -export CONTROLLER_IMG ?= gcr.io/k8s-cluster-api/cluster-api-controller:latest +export CONTROLLER_IMG ?= gcr.io/k8s-cluster-api/cluster-api-controller:0.1.0 export EXAMPLE_PROVIDER_IMG ?= gcr.io/k8s-cluster-api/example-provider-controller:latest all: test manager clusterctl diff --git a/vendor/github.com/openshift/cluster-api/cmd/clusterctl/README.md b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/README.md index 9499ef26bb..33f2baba3e 100644 --- a/vendor/github.com/openshift/cluster-api/cmd/clusterctl/README.md +++ b/vendor/github.com/openshift/cluster-api/cmd/clusterctl/README.md @@ -2,7 +2,7 @@ `clusterctl` is the SIG-cluster-lifecycle sponsored tool that implements the Cluster API. -Read the [experience doc here](https://docs.google.com/document/d/1-sYb3EdkRga49nULH1kSwuQFf1o6GvAw_POrsNo5d8c/edit#). +Read the [experience doc here](https://docs.google.com/document/d/1-sYb3EdkRga49nULH1kSwuQFf1o6GvAw_POrsNo5d8c/edit#). To gain viewing permissions, please join either the [kubernetes-dev](https://groups.google.com/forum/#!forum/kubernetes-dev) or [kubernetes-sig-cluster-lifecycle](https://groups.google.com/forum/#!forum/kubernetes-sig-cluster-lifecycle) google group. ## Getting Started @@ -13,8 +13,8 @@ this repository.** ### Prerequisites -1. Install [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) -2. Install a [driver](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md) for minikube. For Linux, we recommend kvm2. For MacOS, we recommend VirtualBox. +1. Install [kind](https://github.com/kubernetes-sigs/kind#installation-and-usage) or [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/). [kind](https://github.com/kubernetes-sigs/kind#installation-and-usage) is preferred. +2. If you are using kind, go to step 3; If you are using minikube, install a [driver](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md) for minikube. For Linux, we recommend kvm2. For MacOS, we recommend VirtualBox. 2. Build the `clusterctl` tool ```bash @@ -41,10 +41,12 @@ https://github.com/kubernetes-sigs/cluster-api/issues/158 and https://github.com 1. Create a cluster: ```shell - ./clusterctl create cluster --provider -c cluster.yaml -m machines.yaml -p provider-components.yaml -a addons.yaml + ./clusterctl create cluster --provider --bootstrap-type -c cluster.yaml -m machines.yaml -p provider-components.yaml -a addons.yaml ``` -To choose a specific minikube driver, please use the `--vm-driver` command line parameter. For example to use the kvm2 driver with clusterctl you would add `--vm-driver kvm2` +Currently two `bootstrap-type` options are supported - `kind` and `minikube`. + +If you are using minikube, to choose a specific minikube driver, please use the `--bootstrap-flags vm-driver=xxx` command line parameter. For example to use the kvm2 driver with clusterctl you woud add `--bootstrap-flags vm-driver=kvm2`. Additional advanced flags can be found via help. @@ -54,6 +56,12 @@ Additional advanced flags can be found via help. ### Interacting with your cluster +If you are using kind, set the `KUBECONFIG` environment variable first before using kubectl: + +``` +export KUBECONFIG="$(kind get kubeconfig-path --name="clusterapi")" +``` + Once you have created a cluster, you can interact with the cluster and machine resources using kubectl: diff --git a/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machine.yaml b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machine.yaml index d513c9c1a0..8b77b8ffd8 100644 --- a/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machine.yaml +++ b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machine.yaml @@ -6,6 +6,15 @@ metadata: 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 group: cluster.k8s.io names: kind: Machine @@ -47,15 +56,15 @@ spec: 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 login in the autoscaler - compares machines v/s nodes to find out machines at provider which + 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 queries from the k8s apiserver and then comparison + Another list of nodes is queried from the k8s apiserver and then 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 who will be interfacing with cluster-api + entities like autoscaler that will be interfacing with cluster-api as generic provider. type: string providerSpec: diff --git a/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml index f0d5bf7309..488d76a3d3 100644 --- a/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml +++ b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machinedeployment.yaml @@ -142,16 +142,16 @@ spec: 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 login in the autoscaler compares machines - v/s nodes to find out machines at provider which could not + 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 queries - from the k8s apiserver and then comparison is done to find + 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 who will be interfacing with + level entities like autoscaler that will be interfacing with cluster-api as generic provider. type: string providerSpec: diff --git a/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml index dcc20f00de..fb69e27543 100644 --- a/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml +++ b/vendor/github.com/openshift/cluster-api/config/crds/cluster_v1alpha1_machineset.yaml @@ -34,6 +34,15 @@ spec: 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 @@ -82,16 +91,16 @@ spec: 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 login in the autoscaler compares machines - v/s nodes to find out machines at provider which could not + 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 queries - from the k8s apiserver and then comparison is done to find + 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 who will be interfacing with + level entities like autoscaler that will be interfacing with cluster-api as generic provider. type: string providerSpec: diff --git a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machine.yaml b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machine.yaml index e4944fbe7f..35dd1f4af4 100644 --- a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machine.yaml +++ b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machine.yaml @@ -40,16 +40,16 @@ spec: 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 login in the autoscaler - compares machines v/s nodes to find out machines at provider which + 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 queries from the k8s apiserver and then 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 who will be interfacing with cluster-api - as generic provider. + 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 @@ -63,9 +63,12 @@ spec: type: object type: object taints: - description: Taints is the full, authoritative list of taints to apply - to the corresponding Node. This list will overwrite any modifications - made to the Node on an ongoing basis. + 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 diff --git a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machinedeployment.yaml b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machinedeployment.yaml index 00cd0bdf9b..c0a788421f 100644 --- a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machinedeployment.yaml +++ b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machinedeployment.yaml @@ -134,16 +134,16 @@ spec: 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 login in the autoscaler compares machines - v/s nodes to find out machines at provider which could not + 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 queries - from the k8s apiserver and then comparison is done to find + 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 who will be interfacing with + level entities like autoscaler that will be interfacing with cluster-api as generic provider. type: string providerSpec: @@ -159,9 +159,13 @@ spec: type: object type: object taints: - description: Taints is the full, authoritative list of taints - to apply to the corresponding Node. This list will overwrite - any modifications made to the Node on an ongoing basis. + 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 diff --git a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineset.yaml b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineset.yaml index 6898963059..4e88e2b694 100644 --- a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineset.yaml +++ b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineset.yaml @@ -34,6 +34,15 @@ spec: 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 @@ -74,16 +83,16 @@ spec: 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 login in the autoscaler compares machines - v/s nodes to find out machines at provider which could not + 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 queries - from the k8s apiserver and then comparison is done to find + 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 who will be interfacing with + level entities like autoscaler that will be interfacing with cluster-api as generic provider. type: string providerSpec: @@ -99,9 +108,13 @@ spec: type: object type: object taints: - description: Taints is the full, authoritative list of taints - to apply to the corresponding Node. This list will overwrite - any modifications made to the Node on an ongoing basis. + 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 diff --git a/vendor/github.com/openshift/cluster-api/config/default/manager_image_patch.yaml b/vendor/github.com/openshift/cluster-api/config/default/manager_image_patch.yaml index 31f6484644..194878cf40 100644 --- a/vendor/github.com/openshift/cluster-api/config/default/manager_image_patch.yaml +++ b/vendor/github.com/openshift/cluster-api/config/default/manager_image_patch.yaml @@ -7,5 +7,5 @@ spec: template: spec: containers: - - image: gcr.io/k8s-cluster-api/cluster-api-controller:latest - name: manager \ No newline at end of file + - image: gcr.io/k8s-cluster-api/cluster-api-controller:0.1.0 + name: manager diff --git a/vendor/github.com/openshift/cluster-api/config/rbac/rbac_role.yaml b/vendor/github.com/openshift/cluster-api/config/rbac/rbac_role.yaml index 19fa4a3fe7..63684bf85f 100644 --- a/vendor/github.com/openshift/cluster-api/config/rbac/rbac_role.yaml +++ b/vendor/github.com/openshift/cluster-api/config/rbac/rbac_role.yaml @@ -29,6 +29,7 @@ rules: - machine.openshift.io resources: - machines + - machines/status verbs: - get - list @@ -89,7 +90,6 @@ rules: - machine.openshift.io resources: - machines - - machines/status verbs: - get - list diff --git a/vendor/github.com/openshift/cluster-api/docs/book/SUMMARY.md b/vendor/github.com/openshift/cluster-api/docs/book/SUMMARY.md index dfdf2b3a2a..30ada6bdf0 100644 --- a/vendor/github.com/openshift/cluster-api/docs/book/SUMMARY.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/SUMMARY.md @@ -14,6 +14,7 @@ * [Machine Controller](common_code/machine_controller.md) * [MachineSet Controller](common_code/machineset_controller.md) * [MachineDeployment Controller](common_code/machinedeployment_controller.md) +* [Node Controller](common_code/node_controller.md) ## Creating a New Provider diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/cluster_controller.md b/vendor/github.com/openshift/cluster-api/docs/book/common_code/cluster_controller.md index e24bfd82e9..32a248f4d6 100644 --- a/vendor/github.com/openshift/cluster-api/docs/book/common_code/cluster_controller.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/cluster_controller.md @@ -87,13 +87,6 @@ If a `Cluster` resource is deleted, the controller will call the actuator's ## Cluster Controller Semantics -{% panel style="info", title="Logic sequence" %} -We need a diagram tracing the logic from resource creation through updates -and finally deletion. This was done using the sequences GitBook plugin. -Unfortunately there are (possibly personal) problems with phantomjs which -are making this difficult. -{% endpanel %} - 0. If the `Cluster` hasn't been deleted and doesn't have a finalizer, add one. - If the `Cluster` is being deleted, and there is no finalizer, we're done. - Call the provider specific `Delete()` method. @@ -101,3 +94,15 @@ are making this difficult. - If the `Cluster` has not been deleted, call the `Reconcile()` method. [cluster_source]: https://github.com/kubernetes-sigs/cluster-api/blob/master/pkg/apis/cluster/v1alpha1/cluster_types.go + +#### cluster object reconciliation logic + +![cluster object reconciliation logic](images/activity_cluster_reconciliation.svg) + +#### cluster object creation sequence + +![Cluster object creation](images/sequence_cluster_creation.svg) + +#### cluster object deletion sequence + +![Cluster object deletion](images/sequence_cluster_deletion.svg) diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_cluster_reconciliation.drawio b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_cluster_reconciliation.drawio new file mode 100644 index 0000000000..6d4d90f07e --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_cluster_reconciliation.drawio @@ -0,0 +1 @@ +7VvLcqM4FP0aL9OFkQBnmc5rNj011anqxxKDMMwAcssitvvrW4olAxK2SQzC9jibwJV43XuOdHTAI3CfrZ6JP4+/4BClI9sKVyPwMLLt8fh2wv7xyFpErAncRGYkCUWsDLwkv5HsKKJFEqJFrSPFOKXJvB4McJ6jgNZiPiF4We8W4bR+1bk/Q1rgJfBTPfo9CWm8iU4cq4z/hZJZLK88tkRL5svOIrCI/RAvKyHwOAL3BGO62cpW9yjl2ZN52Rz3tKN1e2ME5bTNAbk1Bd9u7p7S5Muvr+sfxe+/89nN2Nmc5tVPC/HE4m7pWqaAnYZlm+18jmmWstiYbbKnmfP2BfUJfaE+5e1Rkqb3OMXk7UBgvf3xzpTg/1ClJYpEi/4Q4rleEaFoVQmJh3pGOEOUrFkX2WqJZxAQgyLfy7JcQITiSqVkzBcAmW1PXOaQbYg0vielbouUhgxkYhcTGuMZzv30sYxWU81TkTBE3qXJLGexKaYUZ6wB5eEdhzg/yRzlm4ig0ORjaV/gggSoBWD4E+ytDkGpT5PXOo2aki0O/Qcn7F7KqkrayIHDVerFcDdDVByllGx7G0dU0dOq+Iz4/QVpsaCIsC08/ZePOGptCS7yEIWieMs4oehl7r8ldckGyXptfRKIgkFelwjntIlACrEi9hf0TixXqYCtE2sbqzIL9sasyekzi6WbrH+woPXJkbs/+a7ceVjV9tZi7whGCqRuCLGv4+0w1NUA0Td1bzWYMFmCaILzke2mLEWfp4y/7oxv0SRDbA7L5vz+8lDvECUMP6zyRG/SqR/jbFosDtN+ED57SlmsBj5bDXz2+uKzxEmlUDk+jtG+YHKKIto3wWv0LtnePcFvWxJcDocHCS4AcSPu4Ei+b/ktgQUco3zfMqGE0ZotGfrEEcXzc5slWoOorcBTQKSo747nENByDtFOdFNfHGzHHHkeHEUL1A8sbQ2WfhjyNWg5o1yqdNSGBLlsGEw72uCMtOPY1NQik3BwVHCgGe0ILIX343a8Zxn315Vuc95hsfs6nqpRxZy1axhR+3terT/b2NxBtyOIbs6UQtbiypUK6aoqU7RKWJM+vpyTPgVN602z+lR3cq76dDdMDw4i0nIzrU+BAizHsD7VraSrPv0wiGDbmahbEKmCFBr2I23d+/IDWvgUk08PfFJAl6smFSPScRsmBrNiUneYTldMmqPwpC2FPTNiUuWsa3jgB7q/teXsVxTgPEjSC6atuggEYOhFINCdohPmrSn9JmF6WL8ZeoGgLgKh+q62b97qw/uiCALESfmk8/WkF1VwfGqrKqiPitdV1W4QHp5N7Zas7FYQO+py3fDkCq+uf4cgau3vNbv+0mU/ElNQUfpQdevbuv5O49317/lLLlZASdCvAhUXLPPUgcB1h5Z58Or178HmyXj9LlBlXrsZ5L1ev3odI969tKkqGIzZDVff/p2dllSIDhu+tGyUkqpV1h3R9Rck5yQlTakAicXeVEDHH5BAde3Rt5TU3/NcpeSHQSRtwIENesfwV4dQf8tztqaBquicwT0D/e3HOQ30xiRe20+BB/IMbNWQn/Sj+BzQfJ2dy8X9/XtSiLrLeD6zzskh2hl/DNHdGhgqwL2JIQPjvQxRZ0sjayJHt+wIyjDL9v/yo0jPGdoocXS76rjx5yJmUQnTkzFK1PdhnuFvTxzdy9Bhsu9HorzWQ/5EFEKnOYHd/0aU7ZY/6d0UoPxlNHj8Aw== \ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_cluster_reconciliation.svg b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_cluster_reconciliation.svg new file mode 100644 index 0000000000..2e41c5df0a --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_cluster_reconciliation.svg @@ -0,0 +1,2 @@ + +
Get cluster object
Get cluster object
deletion
timestamp and
finalizer
[Not supported by viewer]
no
no
yes
yes
add finalizer
add finalizer
deletion timetstamp
exitst
deletion timetstamp<br>exitst
no
no
yes
yes
actuator.Delete
actuator.Delete
actuator.Reconcile
actuator.Reconcile
succeed?
succeed?
no
no
yes
yes
requeue
requeue
has finalizer?
has finalizer?
no
no
yes
yes
succeed?
succeed?
no
no
yes
yes
remove finalizer
remove finalizer
\ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_controller_reconciliation.drawio b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_controller_reconciliation.drawio new file mode 100644 index 0000000000..c9cebce8c2 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_controller_reconciliation.drawio @@ -0,0 +1 @@ +7V1bk5s2GP01+7gd7pfHxMluJ0mbTreZNo8sCJsWIy+WY3t/fSUjGZDAlm0Q2Nk8JCCEwJ/O+e5M7szJfPOYB4vZbzAC6Z2hRZs788OdYei67+F/yMiWjmieVYxM8ySiY+XAU/IK2EQ6ukoisKxNRBCmKFnUB0OYZSBEtbEgz+G6Pi2Gaf2pi2AKhIGnMEjF0b+TCM2KUc/WyvFfQTKdsSfrGr0yD9hkOrCcBRFcV4bMj3fmJIcQFUfzzQSkRHpMLsV9Dy1X9y+WgwzJ3LD9PXyJ/5rEz+uXl+UncP85C5/u6So/gnRFfzB9WbRlEsCrYGHjk/czNE/xmI4P8Y9ZkOtLFOToCQWIXI+TNJ3AFOa7G01t94dMRjn8D1SuxDG9Iv4G9kIgR2BTGaK/6RHAOUD5Fk9hVzW7uIUizHJ/oQPrcr9MugezylaxsYAiZLpfuhQiPqByPEGmhoRMIwwyegpzNINTmAXpx3K0KmsiiwQj8l2aTDM89gwRgnN8AWTROwJxssgCZMUIpZB3UO5Y3Pn2HzyoYWHR0+/klJ182NTOtvSsdb+WcJWH4DjQMFymAB2YZxbziIAO7n4O0gAlP+osbdpKeusfMMGvXKKGsZLpJWcPG7ZI8ar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51dYVxT2ycDEK0ChDMf/m2iEjv2c0mOPgktmMOnYDyPGE3LtMQN/H1AsNoVSvEX16/xuHjt+jpAbx7/fbJeE3hva4ow8Hz3jX7iWYE/eJz3wdy8x0+yqrP7yeaYfa8SYNMcnDTGkRwKgbPkfoyn4P+dBqEYXQ0GsSxzvMcTtUgwnNGqUHEfMhlmB2pX6y2haylpCtBAuOgzuvJleaAZzmeFCE6cKWFJUyONLbOrXFyH1vXXrvf9Veub4ypVO5775bohjIO5x1afApMIWUsvnOD/1iro9ZPiytQMbXRmt/n30tXYc/EjGEOXlZgdcOeMB9Le02VQ7We8DU0lTO9qKtK0/qyH4Gq6hbgGe3x3w72FEsrqfT5YkPRchWGgDD+2loD+G5i12hguNLKzP5p11WaoT4N82IqjG/1aQaImGW7iphCUVzOMf2u1Ua7b8Nn+zw536YrJaJrYk5n9KWjMxz3EYP83K6ZbtujXQ7z5zcxnNwcfeknWr52mp/Oza9b56N3e5IB+xkMbU+Y1PhZ7eoOIuLhj6AxQ7D1DayRNv9KGzMapS5mDa/A+F/UlyGk8o4ovUNgPV5it1TYcT5u7LEto1EaYiJt9Kb1IjPZHYQUZ7t4He9I1lyH6bVoFJtY3F/RDovqV0AjzhBdZkDMlg1UkSFq3A8xOL+M+KMrlQpkP8psr1UpHA8E/ebtvzTQa0s7KDIQuphjqKZwrtyrs/nYVmVSp1neV/2B+Fl53E5sMsOpZMKmb7/O5bS9a/f2eXizOMSY7GocuysAUbG7il1Ak+sR8NUVPE/uu+Ff9bJqAz4t/5eBYnr5nzWYH/8H \ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_controller_reconciliation.svg b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_controller_reconciliation.svg new file mode 100644 index 0000000000..4b58fed45c --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_controller_reconciliation.svg @@ -0,0 +1,2 @@ + +
Get machine object
Get machine object
deletion
timestamp
[Not supported by viewer]
no
no
yes
yes
cluster exist && ownerRef > 0
[Not supported by viewer]
no
no
yes
yes
add cluster to ownerRef
add cluster to ownerRef
add machine finalizer if not present
add machine finalizer if not present
cluster exist?
cluster exist?
no
no
yes
yes
add delete dependents finalizer if not present
add delete dependents finalizer if not present
machine/node deletion BLOCK
machine/node deletion BLOCK
machine needs deletion?
machine needs deletion?
no
no
yes
yes
machine exist?
machine exist?<br>
no
no
yes
yes
actuator.Update
actuator.Update
actuator.Create
actuator.Create
requeue
requeue
succeed?
succeed?
no
no
yes
yes
finalizer added
finalizer added<br>
no
no
yes
yes
update finalizer
update finalizer
succeed?
succeed?<br>
no
no
yes
yes
\ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_deletion_block.drawio b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_deletion_block.drawio new file mode 100644 index 0000000000..8461762e6e --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_deletion_block.drawio @@ -0,0 +1 @@ +7VxLc6M4EP41PiYFAhs4ZvKsqZ2a2aR2MzkqIBvNAvKAnNjz61cKEhiEbWLzTCWXSI2QRPfXD3UrmRiX4fo2hkv/G/FQMAGat54YVxMAdN2x2S9O2QiKZpspZRFjT9BywgP+g+RAQV1hDyWFgZSQgOJlkeiSKEIuLdBgHJPX4rA5CYqrLuECKYQHFwYq9RF71E+p9lTL6XcIL3y5sq6JJyGUgwUh8aFHXrdIxvXEuIwJoWkrXF+igHNP8iV972bH02xjMYponRdmf99dBNfW7ebfv+bm958/fv15QGdilhcYrMQHMwkiiknEGY1DlFAYLidgFrA1vjzHrLXgLbTGCft9Iz6NbiS/Yp+EzyvG9C+vPqboYQld/uSVwYPRfBoGrKez5hwHwSUJSPz2njFnP67G6AmNyX+o8ERjP+yJ+sFy9yimaL1FEgy4RSRENN6wIeKpI2Qh0Ti1zqcp5TUXbiZCf0uwlqBBgadFNnfOctYQXH+HBIAig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Wg5h1lbX3UwWfmm/sLPtX044iCz87K6hKAh3XSOc5VNxx8zuSGu1JQNf859HivAzAMMmyztLo3o4YUuKkJ3xj9XqEVz6xj/scgEXMGVe7go4Rv5arxTOs7ejPUhOVwo7d3pinQGtPsNdbeeov18pd4pwHv4tQ0KF1Vms1SzsDS6pXTTs1lzMAAE/OGmstQcb6v6M3B2mfJ27SKJW+n8lJ1W1XvfbcPq8z5gA24wvIKweyUgnL1Eag3D1oz4JVCACOy30dF+iUzWbTE+3B5zK3J1Ew0boqVvwbWQFNXZlk3/48B6fD8Hy8Y1/8D \ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_deletion_block.svg b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_deletion_block.svg new file mode 100644 index 0000000000..3af105cb41 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machine_deletion_block.svg @@ -0,0 +1,2 @@ + +
deletion timestamp
exist?
deletion timestamp<br>exist?
no
no
nodeRef exist?
nodeRef exist?
no
no
yes
yes
yes
yes
delete node
delete node
succeed?
succeed?
no
no
yes
yes
Remove machine finalizer
Remove machine finalizer
has machine finalizer?
has machine finalizer?
no
no
yes
yes
can delete?
can delete?
no
no
yes
yes
actuator.Delete
actuator.Delete
succeed
succeed
no
no
yes
yes
requeue if needed
requeue if needed
requeue
requeue
\ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machinedeployment_reconciliation.drawio b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machinedeployment_reconciliation.drawio new file mode 100644 index 0000000000..ef43b9448f --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machinedeployment_reconciliation.drawio @@ -0,0 +1 @@ +7Vxbc6M2GP01eUwGJDD4MZvbbmfSbjfT2fSpg42waTDyCnlt+usrgTAXQUwwBsw6D4klJMCfznfOkVC4gner3ROx1stnbCPvCij27greXwGgql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Zh6ev/3Bu92zGS11sT9eoypxzACcqiqvE16s6h7g7VFKT6Tx0aVtqBSu88Glbb2LpW1Vnv22YJy5aVNsTkKIjzzXJt5kZI5ZT2bL/flleXJ88cvVID9IQUBr5mpaNsz6VO/aMMvz57Ea5i5gpDSD0WnN8aRIQ8M3x0BeD7BsO6stNmKosVEkxIrjMjQy7HDtcp1Ih/jXWBMUIP/XWbWdmP17YSDPwI9jk1EIUTIEh5/K1mWQljnCMOtxxNHbPBSoFzB2AnObyHkGhNmHOOK5Tnb7RtGgxg54BE+DJYvRu3cF8gP5c/KuXZmOBMPtUUa73lVTJe9ai0Fay/HLpoIWQQTVZiBq17mCadHQwFqYGpBzhbL/EdLzzPRASE9RUw4o0SiFqMKsdipFEJyhFDVngwSb5yIphlpvgba13JXX8S+S0hhEsOGa2mklxVTqLrENSVTk+QxBls2DR3GZnPBFEnuMqmEqoG/NOO/pS1crHrCu89SGoTVmuguqK7W5TGDahNFkiGozBWenNUkkMrB0g2j0NsE4NEVK/d41RZMnjRdNGYxU6GbfUqHJ89SLVFSh40ykQpucv1TI82UGCIuiRSiLxJuPt/4Y5EOig/7lQ54eDl8+jkj02v/i2o9eGHrveiHPUS960RhGmjkEvZjA89cLecaLdmi+iTb0BKE/l5VgLDt1ICiOXslj+E436mjyBuDjCGIcU4xJ29pyZNrD4vtYlGK+trVrXbpQFzt1NHkjc0oJuferpM5yrByhG4PjCHl38OA44ohcNweW60WJP1muyxfqIteTMDZ+oRqHRJ+vUzO0qvHp4IVqof5N/2f1bNqb3e8K/esVfNrdlryijqAfG8QKQ2ZJKeIl41L7iSBI0rgLliwdBHlxbnAkedzsqsB7eWp9D5cl2VaTbNv3UYV/yoPayfaWlEZEnvoMf4mmqf3mW9ZexV3yz5lerJR24oUDSGvpTUrVID31YhAoLAZpTbc0qsb0Bpi6oWriN3j/vHGYGuCZFdMXr8bN0/fXwof/AQ== \ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machinedeployment_reconciliation.svg b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machinedeployment_reconciliation.svg new file mode 100644 index 0000000000..16f73843cd --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machinedeployment_reconciliation.svg @@ -0,0 +1,2 @@ + +
Get machinedeployment object
Get machinedeployment object
label selector matches?
label selector matches?<br>
yes
yes
get cluster for machineset
get cluster for machineset
cluster exist &&  ownerRef > 0
[Not supported by viewer]
no
no
yes
yes
set ownerRef && set blockOwnerDeletion
set ownerRef && set blockOwnerDeletion
cluster exist &&  no delete timetamp
[Not supported by viewer]
no
no
yes
yes
add delete dependents finalizer if not present
add delete dependents finalizer if not present
machineset for deployment
exist?
machineset for deployment<br>exist?<br>
no
no
yes
yes
machineMap for
deployment
exit?
[Not supported by viewer]
no
no
yes
yes
ready to
deleted?
[Not supported by viewer]
no
no
yes
yes
is paused?
is paused?<br>
no
no
yes
yes
strategy
known?
[Not supported by viewer]
no
no
yes
yes
execute sync
execute sync
execute deployment strategy
execute deployment strategy
requeue
requeue
no
no
\ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machineset_reconciliation.drawio b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machineset_reconciliation.drawio new file mode 100644 index 0000000000..eafd93bf95 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machineset_reconciliation.drawio @@ -0,0 +1 @@ +7Vxbd5s4EP41fkwPSNz82FyantNmu5s8bPOIQRgajFyQa3t//UogDEi+yDbG2EkeWjRIgEffzHwzjD2Ad5PFY+pOwyfso3gANH8xgPcDAHR96ND/mGTJJZpjFJJxGvlcVgleov9QOZFLZ5GPssZEgnFMomlT6OEkQR5pyNw0xfPmtADHzbtO3TGSBC+eG8vSfyOfhIXUMbVK/hVF47C8s67xMxO3nMwFWej6eF4TwYcBvEsxJsXRZHGHYqa9Ui/Fui8bzq4eLEUJUVlg/lq8jn6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z+HJBpOud2QFecEtNcjdSW0dErf0h2XC1igxaclmoeDTrKo6FQfjEteGg5TeFShX7a94BDsMOf7VxxGn8G5CpBtkw8KnlG05hawPvzZpaxJuvv1JsBOeu/Gm92uGcCqvkZ6Ki1RTRZ29A6fiVd4uLgnjK22+fsKDPMZvKpa2BdO0i3XWVym85s6jMlCZ06GdXcTK6iXK1jtIF29lYdcFG9Ol3VP4Fqsw6wunGNhpCdWUNT0TVuZlqtO0+5aJHNPA9R07309xii+m3NPHvvDpAbHS7oVcaezTtlzlZmabVVJ8jZSiT3tePHdoS+cUfVG+zkXI4uca6WUjixG8g29K1Pdp7uISDXo671zU63dRB1m+rF2yBLKG3Ypmou0qP3QUCu4gWYbRNTDy9LuEFRbH2Kkmfk+ssX5OHELxpuLytGS54MyhHaWBOhaY50ohAN5WLQR4huyZ0M+x2iHdhEo2FAJe+xb1Q1hZzSsbaXRcWouu/8bqIwlAt21xqFOzABaPcxojq2cIn+x1Mop1wp+j1DdHC1RatVzx5X99A8//fLoEzSj/MNV1HPL9HZXkhsOwZCtRjYmrnK9JfRLy2Okrf1Ralme27V3ruzaSq/rs86pRi5JtEEZYSdvCwKbTU9qwnWVrn0tRza3IyO475LetEcurOKNVQlA/qB3+k5tmNXbC+yun63Z3xwSnUYCehQwJUBzsApxaY1C6p+iblHrNIAEjBd36/HEx9R3Pgof9wgonCk4GFhKWINvQlCjGheLQEVC3E9eGlqyG+0e8w/uwpBJY57wz9F72BD1Zhz9K+laNA+rtuMDqufVyqmV79SBR/+Bw== \ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machineset_reconciliation.svg b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machineset_reconciliation.svg new file mode 100644 index 0000000000..0df7571478 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_machineset_reconciliation.svg @@ -0,0 +1,2 @@ + +
Get machineset object
Get machineset object
label selector matches?
label selector matches?<br>
no
no
yes
yes
get cluster for machineset
get cluster for machineset
cluster exist &&  ownerRef > 0
[Not supported by viewer]
no
no
yes
yes
set ownerRef && set blockOwnerDeletion
set ownerRef && set blockOwnerDeletion
filter machine BLOCK
filter machine BLOCK
sync Replica BLOCK
sync Replica BLOCK
update machineset status
update machineset status
succeed
succeed<br>
no
no
yes
yes
force resync after MinReadySeconds?
force resync after MinReadySeconds?
no
no
yes
yes
requeue
requeue
no linked
 cluster && no delete timestamp
[Not supported by viewer]
no
no
yes
yes
add delete dependent finalizer if needed
add delete dependent finalizer if needed
\ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_node_reconciliation.drawio b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_node_reconciliation.drawio new file mode 100644 index 0000000000..9a4b399235 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_node_reconciliation.drawio @@ -0,0 +1 @@ +7VnLcpswFP0aL5PhYRyydBwnmU47k9aLtkvZCFAjECPk2OTre2WEQcgPkphx29QbpKMn955zJa4H7iRZ33OUxV9YgOnAsYL1wL0dOI5tX/vwkEhRIa5bIhEngcJqYEZesAIthS5JgHOto2CMCpLp4IKlKV4IDUOcs5XeLWRUXzVDETaA2QJRE/1OAhGXqO9ZNf6ASRRXK9uWaklQ1VkBeYwCtmpA7nTgTjhjoiwl6wmm0nqVXcpxd3tatxvjOBVdBoz56vk+v/35IKbfxh55+fz46euFmuUZ0aV6YbVZUVQWgFnA2FC5iUVCAbOhCC+TyfZcIC5mAgnZHhJKJ4wyvhnoWpuf7Cw4e8KNljBULWp1zAVe730te2ssoBlmCRa8gC7VAMsrhyiGjVR1VXvLVR6IG46qMKT4EW0nrk0IBWXFV1jU6WDRACimqoyLmEUsRXRao01LS+MQ4OOYkigFbM6EYAk04DQYS4LLSTKclogSkH/Q6mBZXvwA0Lr0qupPWa0qt2utVqha+SJy94d9BS/LlnyBj/MO2BNhcaCfu9v3HFMkyLO+j12uVEMfGYEdbjnjWxpl7FGLDOW21KCaD2BuVDS6ZbJDvn8Z22mt4/i6Ql/XHwrlDmpybk3ydr66Bl/vsdxTCrEcHmz+S4bVNoU5W6YBDhRHVzEReJahjctXcBLoFEZ8oXg5lDQKWSp2hYlW+Ajht+g9fIxaJh86l2YA2TqmGUGGfUWQ4f8I0iGCuB0jiNdLBGlL1amuNUdCyKlU6xkcgZsXFoSlA2dEwR43cw6lSJYESTCc00lmNuE1yeF5Z7aYio9ZMl/mx9V+FhlftdxRibMpYmuHiK/6EvHIcFDK3idjpORLcSj6VrWm6Vri/ava66hq/yAbquvFO0W+ZVHFqjZbehb5lcGhAue9kkiw7G8/F7oyyLY6UajQD/sTHxtux5unMdGF/tFz4bTmYWGY415I6RukpCR9qi+Mgm0+fhcxSfG/e200QoN37lvj9Ye7NR4NBf7eKHI8OvTz4elab9P/qcRbZdUaLFmmun5DDl7+AAoe7fHE2QRsd8nF/TEKPskN8XiayNrj1vNJuH2ED3tKHhkE9Vvp3df17yd5ZJvZI5Ozh/LHknjnzB47vn6RcvtLH0O1TvaXDqj/M3GnvwE= \ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_node_reconciliation.svg b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_node_reconciliation.svg new file mode 100644 index 0000000000..2ea20cdf32 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/activity_node_reconciliation.svg @@ -0,0 +1,2 @@ + +
Get node object
Get node object
deletion
timestamp
exist?
[Not supported by viewer]
no
no
yes
yes
link node to machine
link node to machine
unlink node from machine
unlink node from machine
\ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_creation.drawio b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_creation.drawio new file mode 100644 index 0000000000..d9af47523f --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_creation.drawio @@ -0,0 +1 @@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dSNtlLw7K83qMHQopTmb/RxXaeZ1Hi/K9SEJXmgoj9JhgOWnf/481/9CHrXIdPe9LnImHYaOVMg7JynkRx8wz9mnyV92uzxvv8HtqqBph529q3PZrH4sz4dX/zlAN/8B \ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_creation.svg b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_creation.svg new file mode 100644 index 0000000000..c6a3e796ad --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_creation.svg @@ -0,0 +1,2 @@ + +
kubectl
kubectl
k8s apiserver
k8s apiserver
cluster controller
cluster controller
cluster object
cluster object
cluster actuator
cluster actuator
create cluster.yaml
create cluster.yaml
enqueue
enqueue
queue
queue
dequeue
dequeue
add finalizer
add finalizer
reconcile
reconcile
update status
update status
return
return
requeue if reconcile failed
requeue if reconcile failed
return
return
\ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_deletion.drawio b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_deletion.drawio new file mode 100644 index 0000000000..1230c4e953 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_deletion.drawio @@ -0,0 +1 @@ +7VrLcpswFP0az7SLZHg6sEycR2faTtJkkZnsZJCNGoGIEH706ysZAQbZBts4dsddBY6kK+mew71XinvmIJw9UBAHP4kPcc/Q/FnPvO0Zhq67Dv8jkLlENMfKkDFFvsRK4AX9gXlHiabIh0mlIyMEMxRXQY9EEfRYBQOUkmm124jg6qwxGEMFePEAVtFX5LMgQx1bK/FvEI2DfGZdky0hyDtLIAmAT6ZLkHnXMweUEJY9hbMBxMJ7uV+ycfdrWouFURixNgMeH58mg/Dx2jVH8dto9K7/+tAvpJUJwKnc8Hs65H7Ecs1snjuCLz8Wj2mIf6ARxCjibzcxpCiEDFLegiX8VGI30wAx+BIDTwydco1wLGAh5m86f+SsMcCH0OIdYxAnaLiYVeMIhV5KEzSBzzDJxCFQkjIx06AgXYCqQ/LdQcrgbAmSDnqAhK+TznkX2WpJrqRaHfk6LZkv+A2WWLfycUCqbVxYLgnhD5KTLfgxVH6cREwUowRSvrHz5EnvnxpRpkKUh9NEOHcRmxjlHjtXtiztiGw9T0bgYqYxE+lv9y4dJq/h94u+wtYtxNy5X74qDC35VewY8dRwjdE44tiQMEZC3gAj/1rkGoFh4r2vdNsm2TBAx3BTPzvrB/1KtlI9vuTS3MsUYsA41dXUuMKj0toTQXzJBXl2lTvTqHGSkJR6UA5aTj81O7rZYCjzgWJowW+xw90/UGvDB0qGv4Xgz/LjtI1TC6X2BqaAx1LAyJkG0v7J1SdXClf+IpCKrJeRdjkHoVpNdhZVpQ+zKNRc6DYGWuNogVbXq+QWNc7WkdZtMLQm0nJng/lSt1h0SDYseM08pZ4yi52GcUcRnODz6PIyWsrLPZq8jFr+NbQd5WVeNRjqSF7FxmvzHFReriKvjxTyx7NMN3UGjp9udLWKo5ClNNo3ApAY8qYbHyQB9OU43izvo5y9YoPdMjaYLWPDnoGgXzs7W7sGgiu9wVBHgaBfO4Lk8lq3Ltvd2P8wgUNXj5Snr8y2WUv/HGUaNUEZ9TjSugKqXTi0PWtuXQGtORx3pbSVdxfqlW0iKiBtUXgjEglCecZJGAjjfcX3eYWR1VJi3RdGptWR6iy7wVBHquNx9tJeOdNBdWcouktjHzC1NjpZjR2x+K5dshR2ty6+tQZDXRXfdS07n6Awtbg7ibNd2zvaI8rLbch3reVVN2QfRl7KPJ+RONV7xQCI/6WNUAQwL6f4sev+31Hb8RKmVTsWmrsmTLvfYKgjtdm1DG92fFG1Um3qzSiFIZnAiuD+q61ZbfXjqtuR2hRDXZVnrl6dZ7/UyV/L34hk3cuf2ph3fwE= \ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_deletion.svg b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_deletion.svg new file mode 100644 index 0000000000..316ece5b05 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_cluster_deletion.svg @@ -0,0 +1,2 @@ + +
kubectl
kubectl
k8s apiserver
k8s apiserver
cluster controller
cluster controller
Delete()
Delete()
cluster object
cluster object
cluster actuator
cluster actuator
delete cluster.yaml
delete cluster.yaml
get
get
queue
queue
return
return
return
return
set deletion timestamp
set deletion timestamp
update
update
get
get
has finalizer?
has finalizer?
remove finalizer
remove finalizer
\ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_creation.drawio b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_creation.drawio new file mode 100644 index 0000000000..86cbf774e0 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_creation.drawio @@ -0,0 +1 @@ +5VpRc6IwEP41PvZGCCg+Xm17Nzd3M53rzN1zhFVyDYSGULW//pYSQIhWa9Hq+FT4kuwm+31u1rU9Mo4W3yRNwl8iAN6z+8GiR256tm1ZIw//5MiyRAgpkJlkgcZq4IG9gAb7Gs1YAGljohKCK5Y0QV/EMfiqgVEpxbw5bSp402tCZ2AADz7lJvqXBSosUM/t1/h3YLOw9Gz19UhEy8kaSEMaiPkKRG57ZCyFUMVTtBgDz6NXxqVYd7dhtNqYhFjtssC1Bt7dy9Xkyem//PizCIHcqCtt5ZnyTB/4MZtgHLnes1qWgcDtJ/ljFvGfbAqcxfh2nYBkESiQOMI1fF9j1/OQKXhIqJ8vnaNGEAtVxPHNwkdkTVFcIqt3zmmSssmr1z4iEvxMpuwZfkNaiCNHRaZyT+OK9BzURwGpYLExRlYVedQsCNynXOIUvcDRXC2br/Oa+YrfcIV1pwSpVtusslwTgg+ak3fwY5v8eGnuKGEpSDzrZfJkDU6NKGIQFVE/zIP/mpuUxIhdKltV1E+GLecNtsTkX376i2TKtU+NKfcNpqivMqrEhX6qBid3WQ0MrnwJVMFrNfRK2pcljczSYiXIeUQYVl9fOZvFiE2EUiLCAYiDr3k5l2Nc+I9VDCEwCrhWBNGXyKQP28sgReUM1Lbr2GRkJeSeDq4EThVKoVmQrom4tnYvGG66vuCsJrmW3SKtOJJetVr1tQ2NthgqzmwYwmDT5cq0JJ+QvrHhDX5qPRUWa3VV8dtfcENDcBA/ZYAvpycxe0eJeceSmE1ajA32lBgZbjHUkcSqg7f8HFRiniGx9QK7iCunzcDnXzkjg54ATjUDkJPLAK0Kwhp2lAHsNt8dZQCHrPdz0AxQ3sQrGqNBgMCUxZTjh86sP89Ha86xtOa2CppKe+/VmutuMbRBa53JwWyZwYKlGOS7M9aB+2k68PbUwdDZYqijnDOw1/s5bM4x20kSVCbjj0pMJIBD1wFNQwj0OhzWfXevW/G5O4qPrBffB5U2aPUIyb717dDaYqgrpTnr/RxWaWYrTJYVVJ9N82uOMo5aOd/cdrR6irQIdPf90u54WwwdqJ5yjlJPmS29M8xtGzpBH63I27dju5DeVUGj/Qryzjg2W4FZEhStwLxf2y8bg2ebVI5WMDmt71Zk36TSLpwNQ11dY2S9nz2TCr7Wv5EX0+t/NSC3/wE= \ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_creation.svg b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_creation.svg new file mode 100644 index 0000000000..98e1651031 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_creation.svg @@ -0,0 +1,2 @@ + +
kubectl
kubectl
k8s apiserver
k8s apiserver
machine controller
machine controller
machine object
machine object
machine actuator
machine actuator
create machine.yaml
create machine.yaml
enqueue
enqueue
queue
queue
get
get
add finalizer
add finalizer
exist?
exist?
return
return
requeue if failed
requeue if failed
return
return
update or create
update or create
\ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_deletion.drawio b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_deletion.drawio new file mode 100644 index 0000000000..52183cde73 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_deletion.drawio @@ -0,0 +1 @@ +5Zpbc6IwGIZ/jZftcBDEy609XWxnO9uZ3esIUbINhIbgYX/9fpEgh1ilVtGuV8KbkJDvfUi+ZOzZo2jxwFESPrEA055lBIuefduzLNMcevAjlaVSDK+fK1NOAqWVwgv5i4uKSs1IgNNaRcEYFSSpiz6LY+yLmoY4Z/N6tQmj9V4TNMWa8OIjqqu/SSDCXPUco9QfMZmGRc+moUoiVFRWQhqigM0rkn3Xs0ecMZFfRYsRpjJ6RVzy5+7fKV2/GMexaPPA46/Jj+VDvFiQq+XUdvy3p8n9lTJjhmimBvyajSGOVL2zWBaBgNdP5GUW0e9kgimJ4e4mwZxEWGAOJVTJz6V2Mw+JwC8J8uWjc2AEtFBEFO5MuATXBIJH+PqeUpSkZLzq1QCFYz/jKZnhnzjN4ZAqy4TsabQ2XYp6QFSMZpgLvKhIKkAPmMF78iVUUaV95dWyfjsvnV/7G1Zc7xcVkaJtum65NAQulCcf8MfR/fFS2VFCUsxhYJfpk+mem1GuZlSE/FAGfzU3CQ4Ru1S3+sa5uTXY4hYb/5Gjv0inHOvcnPK2OIV8kSHBLvSrcs9usRpqXkE6CMFdZUMr066XKNJTi0qQ5fAJZF/fKJnGoI2ZECyCAhwH32Q6JzXK/NdtMUxZxn28O+sRiE+x2L364qCWI+qOVELuqeByTJEAFOoJ6YaIq9aeGYFRlAucWTfXtBqm5WNUT1WzvmZDwx0N5UHQGoJgo2WlWiIrpFte+J1+Sp7yFku61vHbH7giSBXipKEn58tpyZdpngwwy2745e4JmD3Y0dCBAFsPvNHPcQErZuUSsLcMw+VFrjhNC06/4pjWeU4A7heYABrpgzk40ARgGceZAJq7iCIQx50AbA2wEMkN+ITEiMInB9/m/dfhbXAy3JxGQmM154S2uDnOjoYOhFuzH7uThEY/j7tVKfRXQcw7H8S8PREb9Hc0dCDE3MZu2+4kpdGPFDkWGY8/ixhLMBTdBCgNcaCeg2J1pO99Cj6vJXxuS/g+SZrrbjbu46SZOxo6FGnaCVwXpOmnbOdPWtutW78b0qzmnNZMrtqSNuwmSTObyWA9Sdt5ztFNUqcfVKVy12CsjqsIiyUAsElLBYqSo6+8DYTaMtrFimrbB6LP6WyPYG7s56g4Fat4BacsCVAHSdspto2HyuM1to6Ux8PAr52NPR0XCv3kiOOIzXBt7/gfAtJv7Ju0w5995wytoQ8DUjtq2uox3JZ/zMirl/9vse/+AQ== \ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_deletion.svg b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_deletion.svg new file mode 100644 index 0000000000..ce600d79c2 --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/images/sequence_machine_deletion.svg @@ -0,0 +1,2 @@ + +
kubectl
kubectl
k8s apiserver
k8s apiserver
machine controller
machine controller
machine object
machine object
machine actuator
machine actuator
delete machine.yaml
delete machine.yaml
get
get
queue
queue
get
get
has finalizer?
has finalizer?
Delete
Delete
return
return
return
return
set deletion timestamp
set deletion timestamp
update
update
remove finalizer
remove finalizer
\ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/machine_controller.md b/vendor/github.com/openshift/cluster-api/docs/book/common_code/machine_controller.md index 198b3baeae..b4770eeb89 100644 --- a/vendor/github.com/openshift/cluster-api/docs/book/common_code/machine_controller.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/machine_controller.md @@ -109,11 +109,6 @@ The definition of `Exists()` is determined by the provider. ## Machine Controller Semantics -{% panel style="info", title="Logic sequence" %} -We need a diagram tracing the logic from resource creation through updates -and finally deletion. -{% endpanel %} - 0. Determine the `Cluster` associated with the `Machine` from its `cluster.k8s.io/cluster-name` label. - If the `Machine` hasn't been deleted and doesn't have a finalizer, add one. - If the `Machine` is being deleted, and there is no finalizer, we're done @@ -142,6 +137,20 @@ There are two consequences of this: delete the `Machine`. Therefore `Machine`s must be deleted before `Cluster`s. {% endpanel %} +#### machine reconciliation logic +![machine reconciliation logic](images/activity_machine_controller_reconciliation.svg) + +#### machine deletion block +![machine deletion block](images/activity_machine_deletion_block.svg) + +#### machine object creation sequence + +![machine object creation](images/sequence_machine_creation.svg) + +#### machine object deletion sequence + +![machine object deletion](images/sequence_machine_deletion.svg) + --- [^1] One reason a `Machine` may not be deleted is if it corresponds to the diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/machinedeployment_controller.md b/vendor/github.com/openshift/cluster-api/docs/book/common_code/machinedeployment_controller.md index e8d868ce64..510ec51023 100644 --- a/vendor/github.com/openshift/cluster-api/docs/book/common_code/machinedeployment_controller.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/machinedeployment_controller.md @@ -15,8 +15,28 @@ {% endmethod %} {% method %} +## MachineDeploymentStrategy + +{% sample lang="go" %} +[import:'MachineDeploymentStrategy'](../../../pkg/apis/cluster/v1alpha1/machinedeployment_types.go) +{% endmethod %} + +{% method %} +## MachineRollingUpdateDeployment + +{% sample lang="go" %} +[import:'MachineRollingUpdateDeployment'](../../../pkg/apis/cluster/v1alpha1/machinedeployment_types.go) +{% endmethod %} + +{% method %} + ## MachineDeploymentStatus {% sample lang="go" %} [import:'MachineDeploymentStatus'](../../../pkg/apis/cluster/v1alpha1/machinedeployment_types.go) {% endmethod %} + +## MachineDeployment Controller Semantics + +![machinedeployment object reconciliation logic](images/activity_machinedeployment_reconciliation.svg) + diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/machineset_controller.md b/vendor/github.com/openshift/cluster-api/docs/book/common_code/machineset_controller.md index c4ca6014df..37cbeea994 100644 --- a/vendor/github.com/openshift/cluster-api/docs/book/common_code/machineset_controller.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/machineset_controller.md @@ -32,3 +32,24 @@ which implement their intent by modifying provider-specific `Cluster` and {% sample lang="go" %} [import:'MachineSetStatus'](../../../pkg/apis/cluster/v1alpha1/machineset_types.go) {% endmethod %} + +## MachineSet Controller Semantics + +![machineset object reconciliation logic](images/activity_machineset_reconciliation.svg) + +#### filter machine BLOCK + +This code block examines all machines in the namespace of the machineset and filters out machines that do NOT +have all the following conditions (in this order): + +1. The machine has a controller and is controlled by the machineset. +2. The machine is not scheduled for deletion. +3. The machine's label selector matches that of the machineset. + +For machines that fails condition 1, an attempt is made to adopt the machine into the machineset. The result +of this code block is a filtered list of machines that will be processed in the next code block. + +#### sync replica BLOCK + +This code block looks at the filtered machine list and determines whether to scale up or down the number of +machines to match the replica count defined in the machineset. diff --git a/vendor/github.com/openshift/cluster-api/docs/book/common_code/node_controller.md b/vendor/github.com/openshift/cluster-api/docs/book/common_code/node_controller.md new file mode 100644 index 0000000000..d18d4994ba --- /dev/null +++ b/vendor/github.com/openshift/cluster-api/docs/book/common_code/node_controller.md @@ -0,0 +1,22 @@ +# Node Controller + +The node controller has one simple job. It links or unlinks a `Machine` to the underlying +core k8s `Node` object if an optional annotation `cluster.k8s.io/machine` is present on the `Node`. The +decision to add the annotation is left to each infrastructure-specific provider. When the +controller links a `Machine`, it assigns the machine's `Status.NodeRef` to the `Node`'s +objectRef. + +The simplest way for Infrastructure-specific providers to add this support is to annotate +nodes in their node bootup script as part of the `kubeadm join` operation (via a commandline +parameter). + +## Node Controller Semantics + +The node controller is very simple. In the current design, a `Machine` will exist before the +backing `Node` is created. When a node is created and ready, the controller checks if the +annotation exist. If it does, it links `Node` to the `Machine`. If the `Node` is slated for +deletion, it unlinks the `Node` from the `Machine`. + +#### node reconciliation logic + +![node object reconciliation logic](images/activity_node_reconciliation.svg) \ No newline at end of file diff --git a/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/register_schemes.md b/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/register_schemes.md index 08d42988ed..50b5326450 100644 --- a/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/register_schemes.md +++ b/vendor/github.com/openshift/cluster-api/docs/book/provider_implementations/register_schemes.md @@ -28,6 +28,7 @@ import ( "fmt" "os" + "k8s.io/klog" "sigs.k8s.io/cluster-api-provider-solas/pkg/apis" "sigs.k8s.io/cluster-api-provider-solas/pkg/cloud/solas/actuators/cluster" "sigs.k8s.io/cluster-api-provider-solas/pkg/cloud/solas/actuators/machine" @@ -43,6 +44,8 @@ import ( ) func main() { + klog.InitFlags(nil) + cfg := config.GetConfigOrDie() if cfg == nil { panic(fmt.Errorf("GetConfigOrDie didn't die")) diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go index af6c17e0dd..d416f0e7d0 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go @@ -38,6 +38,8 @@ const ( // Machine is the Schema for the machines API // +k8s:openapi-gen=true // +kubebuilder:subresource:status +// +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" type Machine struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -57,9 +59,12 @@ type MachineSpec struct { // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // Taints is the full, authoritative list of taints to apply to the corresponding - // Node. This list will overwrite any modifications made to the Node on - // an ongoing basis. + // 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 // +optional Taints []corev1.Taint `json:"taints,omitempty"` @@ -87,12 +92,12 @@ type MachineSpec struct { // 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 login in the autoscaler compares machines v/s nodes to find out + // 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 queries from the k8s apiserver - // and then 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 who will + // 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. // +optional ProviderID *string `json:"providerID,omitempty"` diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go index 56aa44b268..0e7ec62afd 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go @@ -59,6 +59,11 @@ type MachineSetSpec struct { // +optional MinReadySeconds int32 `json:"minReadySeconds,omitempty"` + // 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 + DeletePolicy string `json:"deletePolicy,omitempty"` + // Selector is a label query over machines that should match the replica count. // Label keys and values that must match in order to be controlled by this MachineSet. // It must match the machine template's labels. @@ -71,6 +76,30 @@ type MachineSetSpec struct { Template MachineTemplateSpec `json:"template,omitempty"` } +// MachineSetDeletePolicy defines how priority is assigned to nodes to delete when +// downscaling a MachineSet. Defaults to "Random". +type MachineSetDeletePolicy string + +const ( + // RandomMachineSetDeletePolicy prioritizes both Machines that have the annotation + // "cluster.k8s.io/delete-machine=yes" and Machines that are unhealthy + // (Status.ErrorReason or Status.ErrorMessage are set to a non-empty value). + // Finally, it picks Machines at random to delete. + RandomMachineSetDeletePolicy MachineSetDeletePolicy = "Random" + + // NewestMachineSetDeletePolicy prioritizes both Machines that have the annotation + // "cluster.k8s.io/delete-machine=yes" and Machines that are unhealthy + // (Status.ErrorReason or Status.ErrorMessage are set to a non-empty value). + // It then prioritizes the newest Machines for deletion based on the Machine's CreationTimestamp. + NewestMachineSetDeletePolicy MachineSetDeletePolicy = "Newest" + + // OldestMachineSetDeletePolicy prioritizes both Machines that have the annotation + // "cluster.k8s.io/delete-machine=yes" and Machines that are unhealthy + // (Status.ErrorReason or Status.ErrorMessage are set to a non-empty value). + // It then prioritizes the oldest Machines for deletion based on the Machine's CreationTimestamp. + OldestMachineSetDeletePolicy MachineSetDeletePolicy = "Oldest" +) + /// [MachineSetSpec] // doxygen marker /// [MachineTemplateSpec] // doxygen marker @@ -171,6 +200,12 @@ func (m *MachineSet) Default() { if len(m.Namespace) == 0 { m.Namespace = metav1.NamespaceDefault } + + if m.Spec.DeletePolicy == "" { + randomPolicy := string(RandomMachineSetDeletePolicy) + log.Printf("Defaulting to %s\n", randomPolicy) + m.Spec.DeletePolicy = randomPolicy + } } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machine_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machine_types.go index cab20ee095..62ec393376 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machine_types.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machine_types.go @@ -65,9 +65,12 @@ type MachineSpec struct { // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // Taints is the full, authoritative list of taints to apply to the corresponding - // Node. This list will overwrite any modifications made to the Node on - // an ongoing basis. + // 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 // +optional Taints []corev1.Taint `json:"taints,omitempty"` @@ -78,12 +81,12 @@ type MachineSpec struct { // 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 login in the autoscaler compares machines v/s nodes to find out + // 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 queries from the k8s apiserver - // and then 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 who will + // 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. // +optional ProviderID *string `json:"providerID,omitempty"` diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineset_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineset_types.go index ee5ed9855b..b4edb7a303 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineset_types.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineset_types.go @@ -59,6 +59,11 @@ type MachineSetSpec struct { // +optional MinReadySeconds int32 `json:"minReadySeconds,omitempty"` + // 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 + DeletePolicy string `json:"deletePolicy,omitempty"` + // Selector is a label query over machines that should match the replica count. // Label keys and values that must match in order to be controlled by this MachineSet. // It must match the machine template's labels. @@ -71,6 +76,30 @@ type MachineSetSpec struct { Template MachineTemplateSpec `json:"template,omitempty"` } +// MachineSetDeletePolicy defines how priority is assigned to nodes to delete when +// downscaling a MachineSet. Defaults to "Random". +type MachineSetDeletePolicy string + +const ( + // RandomMachineSetDeletePolicy prioritizes both Machines that have the annotation + // "cluster.k8s.io/delete-machine=yes" and Machines that are unhealthy + // (Status.ErrorReason or Status.ErrorMessage are set to a non-empty value). + // Finally, it picks Machines at random to delete. + RandomMachineSetDeletePolicy MachineSetDeletePolicy = "Random" + + // NewestMachineSetDeletePolicy prioritizes both Machines that have the annotation + // "cluster.k8s.io/delete-machine=yes" and Machines that are unhealthy + // (Status.ErrorReason or Status.ErrorMessage are set to a non-empty value). + // It then prioritizes the newest Machines for deletion based on the Machine's CreationTimestamp. + NewestMachineSetDeletePolicy MachineSetDeletePolicy = "Newest" + + // OldestMachineSetDeletePolicy prioritizes both Machines that have the annotation + // "cluster.k8s.io/delete-machine=yes" and Machines that are unhealthy + // (Status.ErrorReason or Status.ErrorMessage are set to a non-empty value). + // It then prioritizes the oldest Machines for deletion based on the Machine's CreationTimestamp. + OldestMachineSetDeletePolicy MachineSetDeletePolicy = "Oldest" +) + /// [MachineSetSpec] // doxygen marker /// [MachineTemplateSpec] // doxygen marker @@ -171,6 +200,12 @@ func (m *MachineSet) Default() { if len(m.Namespace) == 0 { m.Namespace = metav1.NamespaceDefault } + + if m.Spec.DeletePolicy == "" { + randomPolicy := string(RandomMachineSetDeletePolicy) + log.Printf("Defaulting to %s\n", randomPolicy) + m.Spec.DeletePolicy = randomPolicy + } } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go index 3809d8673c..94b3337e7b 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go @@ -106,7 +106,7 @@ type ReconcileMachine struct { // Reconcile reads that state of the cluster for a Machine object and makes changes based on the state read // and what is in the Machine.Spec -// +kubebuilder:rbac:groups=machine.openshift.io,resources=machines,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=machine.openshift.io,resources=machines;machines/status,verbs=get;list;watch;create;update;patch;delete func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Result, error) { // TODO(mvladev): Can context be passed from Kubebuilder? ctx := context.TODO() diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go index a97f281188..207da2c167 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go @@ -230,10 +230,11 @@ func (r *ReconcileMachineDeployment) reconcile(ctx context.Context, d *v1beta1.M } // Add foregroundDeletion finalizer if MachineDeployment isn't deleted and linked to a cluster. - if cluster != nil && d.ObjectMeta.DeletionTimestamp.IsZero() { - if !util.Contains(d.Finalizers, metav1.FinalizerDeleteDependents) { - d.Finalizers = append(d.ObjectMeta.Finalizers, metav1.FinalizerDeleteDependents) - } + if cluster != nil && + d.ObjectMeta.DeletionTimestamp.IsZero() && + !util.Contains(d.Finalizers, metav1.FinalizerDeleteDependents) { + + d.Finalizers = append(d.ObjectMeta.Finalizers, metav1.FinalizerDeleteDependents) if err := r.Client.Update(context.Background(), d); err != nil { klog.Infof("Failed to add finalizers to MachineSet %q: %v", d.Name, err) diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/BUILD.bazel index 3ff2333d8b..cd535e6d51 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/BUILD.bazel @@ -44,6 +44,7 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/apis:go_default_library", + "//pkg/apis/cluster/common:go_default_library", "//pkg/apis/machine/v1beta1:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go index 6be5f38703..353f118fbd 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go @@ -211,10 +211,11 @@ func (r *ReconcileMachineSet) reconcile(ctx context.Context, machineSet *machine } // Add foregroundDeletion finalizer if MachineSet isn't deleted and linked to a cluster. - if cluster != nil && machineSet.ObjectMeta.DeletionTimestamp.IsZero() { - if !util.Contains(machineSet.Finalizers, metav1.FinalizerDeleteDependents) { - machineSet.Finalizers = append(machineSet.ObjectMeta.Finalizers, metav1.FinalizerDeleteDependents) - } + if cluster != nil && + machineSet.ObjectMeta.DeletionTimestamp.IsZero() && + !util.Contains(machineSet.Finalizers, metav1.FinalizerDeleteDependents) { + + machineSet.Finalizers = append(machineSet.ObjectMeta.Finalizers, metav1.FinalizerDeleteDependents) if err := r.Client.Update(context.Background(), machineSet); err != nil { klog.Infof("Failed to add finalizers to MachineSet %q: %v", machineSet.Name, err) @@ -349,8 +350,13 @@ func (r *ReconcileMachineSet) syncReplicas(ms *machinev1beta1.MachineSet, machin klog.Infof("Too many replicas for %v %s/%s, need %d, deleting %d", controllerKind, ms.Namespace, ms.Name, *(ms.Spec.Replicas), diff) + deletePriorityFunc, err := getDeletePriorityFunc(ms) + if err != nil { + return err + } + klog.Infof("Found %s delete policy", ms.Spec.DeletePolicy) // Choose which Machines to delete. - machinesToDelete := getMachinesToDeletePrioritized(machines, diff, simpleDeletePriority) + machinesToDelete := getMachinesToDeletePrioritized(machines, diff, deletePriorityFunc) // TODO: Add cap to limit concurrent delete calls. errCh := make(chan error, diff) diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/delete_policy.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/delete_policy.go index c84f577570..8dfd77c895 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/delete_policy.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/delete_policy.go @@ -17,39 +17,90 @@ limitations under the License. package machineset import ( + "math" + "sort" + + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" ) -type deletePriority int +type deletePriority float64 const ( - mustDelete deletePriority = 100 - betterDelete deletePriority = 50 - couldDelete deletePriority = 20 - // mustNotDelete deletePriority = 0 + + // DeleteNodeAnnotation marks nodes that will be given priority for deletion + // when a machineset scales down. This annotation is given top priority on all delete policies. + DeleteNodeAnnotation = "machine.openshift.io/cluster-api-delete-machine" + + mustDelete deletePriority = 100.0 + betterDelete deletePriority = 50.0 + couldDelete deletePriority = 20.0 + mustNotDelete deletePriority = 0.0 + + secondsPerTenDays float64 = 864000 ) type deletePriorityFunc func(machine *v1beta1.Machine) deletePriority -// machineDeleteAnnotationKey annotates machines to be delete among first ones -var machineDeleteAnnotationKey = "machine.openshift.io/cluster-api-delete-machine" +// maps the creation timestamp onto the 0-100 priority range +func oldestDeletePriority(machine *v1beta1.Machine) deletePriority { + if machine.DeletionTimestamp != nil && !machine.DeletionTimestamp.IsZero() { + return mustDelete + } + if machine.ObjectMeta.Annotations != nil && machine.ObjectMeta.Annotations[DeleteNodeAnnotation] != "" { + return mustDelete + } + if machine.Status.ErrorReason != nil || machine.Status.ErrorMessage != nil { + return mustDelete + } + if machine.ObjectMeta.CreationTimestamp.Time.IsZero() { + return mustNotDelete + } + d := metav1.Now().Sub(machine.ObjectMeta.CreationTimestamp.Time) + if d.Seconds() < 0 { + return mustNotDelete + } + return deletePriority(float64(mustDelete) * (1.0 - math.Exp(-d.Seconds()/secondsPerTenDays))) +} -func simpleDeletePriority(machine *v1beta1.Machine) deletePriority { +func newestDeletePriority(machine *v1beta1.Machine) deletePriority { if machine.DeletionTimestamp != nil && !machine.DeletionTimestamp.IsZero() { return mustDelete } - if _, exists := machine.Annotations[machineDeleteAnnotationKey]; exists { + if machine.ObjectMeta.Annotations != nil && machine.ObjectMeta.Annotations[DeleteNodeAnnotation] != "" { + return mustDelete + } + if machine.Status.ErrorReason != nil || machine.Status.ErrorMessage != nil { return mustDelete } + return mustDelete - oldestDeletePriority(machine) +} +func randomDeletePolicy(machine *v1beta1.Machine) deletePriority { + if machine.DeletionTimestamp != nil && !machine.DeletionTimestamp.IsZero() { + return mustDelete + } + if machine.ObjectMeta.Annotations != nil && machine.ObjectMeta.Annotations[DeleteNodeAnnotation] != "" { + return betterDelete + } if machine.Status.ErrorReason != nil || machine.Status.ErrorMessage != nil { return betterDelete } return couldDelete } -// TODO: Define machines deletion policies. -// see: https://github.com/kubernetes/kube-deploy/issues/625 +type sortableMachines struct { + machines []*v1beta1.Machine + priority deletePriorityFunc +} + +func (m sortableMachines) Len() int { return len(m.machines) } +func (m sortableMachines) Swap(i, j int) { m.machines[i], m.machines[j] = m.machines[j], m.machines[i] } +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 []*v1beta1.Machine, diff int, fun deletePriorityFunc) []*v1beta1.Machine { if diff >= len(filteredMachines) { return filteredMachines @@ -57,24 +108,27 @@ func getMachinesToDeletePrioritized(filteredMachines []*v1beta1.Machine, diff in return []*v1beta1.Machine{} } - machines := make(map[deletePriority][]*v1beta1.Machine) - - for _, machine := range filteredMachines { - priority := fun(machine) - machines[priority] = append(machines[priority], machine) + sortable := sortableMachines{ + machines: filteredMachines, + priority: fun, } + sort.Sort(sortable) - result := []*v1beta1.Machine{} - for _, priority := range []deletePriority{ - mustDelete, - betterDelete, - couldDelete, - } { - result = append(result, machines[priority]...) - if len(result) >= diff { - break - } - } + return sortable.machines[:diff] +} - return result[:diff] +func getDeletePriorityFunc(ms *v1beta1.MachineSet) (deletePriorityFunc, error) { + // Map the Spec.DeletePolicy value to the appropriate delete priority function + switch msdp := v1beta1.MachineSetDeletePolicy(ms.Spec.DeletePolicy); msdp { + case v1beta1.RandomMachineSetDeletePolicy: + return randomDeletePolicy, nil + case v1beta1.NewestMachineSetDeletePolicy: + return newestDeletePriority, nil + case v1beta1.OldestMachineSetDeletePolicy: + return oldestDeletePriority, nil + case "": + return randomDeletePolicy, nil + default: + return nil, errors.Errorf("Unsupported delete policy %s. Must be one of 'Random', 'Newest', or 'Oldest'", msdp) + } } diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/status.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/status.go index 51e3758fe2..88ad651816 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/status.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/status.go @@ -112,7 +112,7 @@ func updateMachineSetStatus(c client.Client, ms *v1beta1.MachineSet, newStatus v break } // Update the MachineSet with the latest resource version for the next poll - if getErr = c.Get(context.Background(), client.ObjectKey{Name: ms.Name}, ms); getErr != nil { + if getErr = c.Get(context.Background(), client.ObjectKey{Namespace: ms.Namespace, Name: ms.Name}, ms); getErr != nil { // If the GET fails we can't trust status.Replicas anymore. This error // is bound to be more interesting than the update failure. return nil, getErr