Skip to content

Commit

Permalink
Require providerSpec.Value[From] to be always set (#684)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ingvagabund authored and k8s-ci-robot committed Jan 25, 2019
1 parent ee38e8a commit f289c73
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/crds/cluster_v1alpha1_machine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions config/crds/cluster_v1alpha1_machinedeployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions config/crds/cluster_v1alpha1_machineset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f289c73

Please sign in to comment.