Skip to content

Commit

Permalink
Merge pull request #494 from crossplane-contrib/backport-487-to-relea…
Browse files Browse the repository at this point in the history
…se-0.41

[Backport release-0.41] Add SSA merge strategy to container Cluster's nodeConfig to avoid fights over ownership.
  • Loading branch information
ulucinar authored Mar 21, 2024
2 parents 06973d5 + 0dbdc54 commit fff246e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
19 changes: 19 additions & 0 deletions apis/container/v1beta1/zz_cluster_types.go

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

15 changes: 15 additions & 0 deletions apis/container/v1beta1/zz_generated.deepcopy.go

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

11 changes: 11 additions & 0 deletions config/container/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@ func Configure(p *config.Provider) { //nolint:gocyclo
Type: "github.com/upbound/provider-gcp/apis/compute/v1beta1.Subnetwork",
Extractor: common.PathSelfLinkExtractor,
}
r.ServerSideApplyMergeStrategies["node_config"] = config.MergeStrategy{
ListMergeStrategy: config.ListMergeStrategy{
MergeStrategy: config.ListTypeMap,
ListMapKeys: config.ListMapKeys{
InjectedKey: config.InjectedKey{
Key: "index",
DefaultValue: `"0"`,
},
},
},
}
config.MarkAsRequired(r.TerraformResource, "location")
})

Expand Down
24 changes: 24 additions & 0 deletions package/crds/container.gcp.upbound.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,11 @@ spec:
The image type to use for this node. Note that changing the image type
will delete and recreate all nodes in the node pool.
type: string
index:
default: "0"
description: This is an injected field with a default value
for being able to merge items of the parent object list.
type: string
kubeletConfig:
description: |-
Kubelet configuration, currently supported attributes can be found here.
Expand Down Expand Up @@ -1445,6 +1450,9 @@ spec:
type: array
type: object
type: array
x-kubernetes-list-map-keys:
- index
x-kubernetes-list-type: map
nodeLocations:
description: |-
The list of zones in which the cluster's nodes
Expand Down Expand Up @@ -2834,6 +2842,11 @@ spec:
The image type to use for this node. Note that changing the image type
will delete and recreate all nodes in the node pool.
type: string
index:
default: "0"
description: This is an injected field with a default value
for being able to merge items of the parent object list.
type: string
kubeletConfig:
description: |-
Kubelet configuration, currently supported attributes can be found here.
Expand Down Expand Up @@ -3158,6 +3171,9 @@ spec:
type: array
type: object
type: array
x-kubernetes-list-map-keys:
- index
x-kubernetes-list-type: map
nodeLocations:
description: |-
The list of zones in which the cluster's nodes
Expand Down Expand Up @@ -4682,6 +4698,11 @@ spec:
The image type to use for this node. Note that changing the image type
will delete and recreate all nodes in the node pool.
type: string
index:
default: "0"
description: This is an injected field with a default value
for being able to merge items of the parent object list.
type: string
kubeletConfig:
description: |-
Kubelet configuration, currently supported attributes can be found here.
Expand Down Expand Up @@ -4930,6 +4951,9 @@ spec:
type: array
type: object
type: array
x-kubernetes-list-map-keys:
- index
x-kubernetes-list-type: map
nodeLocations:
description: |-
The list of zones in which the cluster's nodes
Expand Down

0 comments on commit fff246e

Please sign in to comment.