From f289c730dfad922d8e7f80bc138499df719efe9b Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Fri, 25 Jan 2019 20:57:52 +0100 Subject: [PATCH] Require providerSpec.Value[From] to be always set (#684) Machines with no provider spec set have no use in a cluster (up to testing purposes). We need to make sure at least one of Value or ValueFrom fields is set. To avoid the case where: 1. a machine with a valid provider spec field is set 2. underlying cloud provider instance is created 3. the machine provider spec field is edited/cleared (for any reason) leaving empty provider spec 4. the machine is deleted without removing the underlying instance due to missing provider spec Right now, any machine object without provider spec field set can not be removed since the aws actuator complains about missing `ProviderSpec.Value` and `ProviderSpec.ValueFrom` fields missing. Though, it's not an option to remove machines without provider spec --- config/crds/cluster_v1alpha1_machine.yaml | 5 +++++ config/crds/cluster_v1alpha1_machinedeployment.yaml | 5 +++++ config/crds/cluster_v1alpha1_machineset.yaml | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/config/crds/cluster_v1alpha1_machine.yaml b/config/crds/cluster_v1alpha1_machine.yaml index f24e69f338e6..fa765ec538f8 100644 --- a/config/crds/cluster_v1alpha1_machine.yaml +++ b/config/crds/cluster_v1alpha1_machine.yaml @@ -66,6 +66,11 @@ spec: type: string type: object type: object + oneOf: + - required: + - value + - required: + - valueFrom type: object taints: description: Taints is the full, authoritative list of taints to apply diff --git a/config/crds/cluster_v1alpha1_machinedeployment.yaml b/config/crds/cluster_v1alpha1_machinedeployment.yaml index 40bbc3036ca2..718ac56495e8 100644 --- a/config/crds/cluster_v1alpha1_machinedeployment.yaml +++ b/config/crds/cluster_v1alpha1_machinedeployment.yaml @@ -161,6 +161,11 @@ spec: type: string type: object type: object + oneOf: + - required: + - value + - required: + - valueFrom type: object taints: description: Taints is the full, authoritative list of taints diff --git a/config/crds/cluster_v1alpha1_machineset.yaml b/config/crds/cluster_v1alpha1_machineset.yaml index 4df91b3de86b..b8d073381aad 100644 --- a/config/crds/cluster_v1alpha1_machineset.yaml +++ b/config/crds/cluster_v1alpha1_machineset.yaml @@ -101,6 +101,11 @@ spec: type: string type: object type: object + oneOf: + - required: + - value + - required: + - valueFrom type: object taints: description: Taints is the full, authoritative list of taints