From 1c10a3f67527313e9b384c077e6991404d9e65be Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Thu, 20 Jun 2019 10:06:48 -0700 Subject: [PATCH] Update generated files, add workaround for controller-tools (#1050) Signed-off-by: Vince Prignano --- .gitignore | 4 ++-- Makefile | 5 ++++- config/ci/rbac/kustomization.yaml | 4 ++-- config/crds/cluster_v1alpha1_machinedeployment.yaml | 10 +++++----- config/rbac/kustomization.yaml | 4 ++-- config/rbac/{rbac_role.yaml => manager_role.yaml} | 0 ...bac_role_binding.yaml => manager_role_binding.yaml} | 0 pkg/controller/noderef/BUILD.bazel | 1 + 8 files changed, 16 insertions(+), 12 deletions(-) rename config/rbac/{rbac_role.yaml => manager_role.yaml} (100%) rename config/rbac/{rbac_role_binding.yaml => manager_role_binding.yaml} (100%) diff --git a/.gitignore b/.gitignore index 162143310b98..9a13ce5b3ccf 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,7 @@ docs/book/node_modules/ *.tmp # rbac and manager config for example provider -config/ci/rbac/rbac_role_binding.yaml -config/ci/rbac/rbac_role.yaml +config/ci/rbac/manager_role_binding.yaml +config/ci/rbac/manager_role.yaml config/ci/manager/manager.yaml diff --git a/Makefile b/Makefile index 52187f36b303..660efc9cd2e7 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,10 @@ deploy: manifests ## Deploy controller in the configured Kubernetes cluster in ~ .PHONY: manifests manifests: ## Generate manifests e.g. CRD, RBAC etc. go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go all - cp -f ./config/rbac/rbac*.yaml ./config/ci/rbac/ + # TODO(vincepri) Remove this line. This is a workaround until + # https://github.com/kubernetes-sigs/controller-tools/pull/230 is merged. + go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go rbac + cp -f ./config/rbac/manager*.yaml ./config/ci/rbac/ cp -f ./config/manager/manager*.yaml ./config/ci/manager/ .PHONY: fmt diff --git a/config/ci/rbac/kustomization.yaml b/config/ci/rbac/kustomization.yaml index 69d3b73a2d55..e62b08f20a6b 100644 --- a/config/ci/rbac/kustomization.yaml +++ b/config/ci/rbac/kustomization.yaml @@ -4,5 +4,5 @@ # YAML string, with resources separated by document # markers ("---"). resources: -- rbac_role_binding.yaml -- rbac_role.yaml +- manager_role_binding.yaml +- manager_role.yaml diff --git a/config/crds/cluster_v1alpha1_machinedeployment.yaml b/config/crds/cluster_v1alpha1_machinedeployment.yaml index 4a1b0854dd86..d7da82b52778 100644 --- a/config/crds/cluster_v1alpha1_machinedeployment.yaml +++ b/config/crds/cluster_v1alpha1_machinedeployment.yaml @@ -79,6 +79,9 @@ spec: = 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%). @@ -91,10 +94,10 @@ spec: new MachineSet can be scaled up further, ensuring that total number of machines running at any time during the update is at most 130% of desired machines.' - oneOf: + maxUnavailable: + anyOf: - type: string - type: integer - maxUnavailable: description: 'The maximum number of machines that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired machines (ex: 10%). Absolute number @@ -106,9 +109,6 @@ spec: down further, followed by scaling up the new MachineSet, ensuring that the total number of machines available at all times during the update is at least 70% of desired machines.' - oneOf: - - type: string - - type: integer type: object type: description: Type of deployment. Currently the only supported strategy diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index 80ee5e480936..984ec5c18308 100644 --- a/config/rbac/kustomization.yaml +++ b/config/rbac/kustomization.yaml @@ -4,6 +4,6 @@ # YAML string, with resources separated by document # markers ("---"). resources: -- rbac_role_binding.yaml -- rbac_role.yaml +- manager_role_binding.yaml +- manager_role.yaml diff --git a/config/rbac/rbac_role.yaml b/config/rbac/manager_role.yaml similarity index 100% rename from config/rbac/rbac_role.yaml rename to config/rbac/manager_role.yaml diff --git a/config/rbac/rbac_role_binding.yaml b/config/rbac/manager_role_binding.yaml similarity index 100% rename from config/rbac/rbac_role_binding.yaml rename to config/rbac/manager_role_binding.yaml diff --git a/pkg/controller/noderef/BUILD.bazel b/pkg/controller/noderef/BUILD.bazel index a18e16a1ffd4..88ac19a74c38 100644 --- a/pkg/controller/noderef/BUILD.bazel +++ b/pkg/controller/noderef/BUILD.bazel @@ -42,6 +42,7 @@ go_test( "//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/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library", "//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library",