Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add immutability check for nodegroup fields #152

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions apis/v1alpha1/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ resources:
references:
resource: Cluster
path: Spec.Name
is_immutable: true
Name:
is_immutable: true
NodeRole:
references:
service_name: iam
Expand All @@ -333,6 +336,10 @@ resources:
resource: Subnet
path: Status.SubnetID
is_immutable: true
AmiType:
is_immutable: true
InstanceTypes:
is_immutable: true
Taints:
compare:
is_ignored: true
Expand Down
4 changes: 4 additions & 0 deletions apis/v1alpha1/nodegroup.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions config/crd/bases/eks.services.k8s.aws_nodegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ spec:
Amazon EKS, see Customizing managed nodes with launch templates (https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html)
in the Amazon EKS User Guide.
type: string
x-kubernetes-validations:
- message: Value is immutable once set
rule: self == oldSelf
capacityType:
description: The capacity type for your node group.
type: string
Expand All @@ -96,6 +99,9 @@ spec:
clusterName:
description: The name of your cluster.
type: string
x-kubernetes-validations:
- message: Value is immutable once set
rule: self == oldSelf
clusterRef:
description: "AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference\ntype to provide more user friendly syntax
Expand Down Expand Up @@ -144,6 +150,9 @@ spec:
items:
type: string
type: array
x-kubernetes-validations:
- message: Value is immutable once set
rule: self == oldSelf
labels:
additionalProperties:
type: string
Expand All @@ -169,6 +178,9 @@ spec:
name:
description: The unique name to give your node group.
type: string
x-kubernetes-validations:
- message: Value is immutable once set
rule: self == oldSelf
nodeRole:
description: |-
The Amazon Resource Name (ARN) of the IAM role to associate with your node
Expand Down
7 changes: 7 additions & 0 deletions generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ resources:
references:
resource: Cluster
path: Spec.Name
is_immutable: true
Name:
is_immutable: true
NodeRole:
references:
service_name: iam
Expand All @@ -333,6 +336,10 @@ resources:
resource: Subnet
path: Status.SubnetID
is_immutable: true
AmiType:
is_immutable: true
InstanceTypes:
is_immutable: true
Taints:
compare:
is_ignored: true
Expand Down
12 changes: 12 additions & 0 deletions helm/crds/eks.services.k8s.aws_nodegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ spec:
Amazon EKS, see Customizing managed nodes with launch templates (https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html)
in the Amazon EKS User Guide.
type: string
x-kubernetes-validations:
- message: Value is immutable once set
rule: self == oldSelf
capacityType:
description: The capacity type for your node group.
type: string
Expand All @@ -96,6 +99,9 @@ spec:
clusterName:
description: The name of your cluster.
type: string
x-kubernetes-validations:
- message: Value is immutable once set
rule: self == oldSelf
clusterRef:
description: "AWSResourceReferenceWrapper provides a wrapper around
*AWSResourceReference\ntype to provide more user friendly syntax
Expand Down Expand Up @@ -144,6 +150,9 @@ spec:
items:
type: string
type: array
x-kubernetes-validations:
- message: Value is immutable once set
rule: self == oldSelf
labels:
additionalProperties:
type: string
Expand All @@ -169,6 +178,9 @@ spec:
name:
description: The unique name to give your node group.
type: string
x-kubernetes-validations:
- message: Value is immutable once set
rule: self == oldSelf
nodeRole:
description: |-
The Amazon Resource Name (ARN) of the IAM role to associate with your node
Expand Down