Skip to content

Commit

Permalink
set cluster api group in hooks (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
anvddriesch authored Jul 31, 2024
1 parent 2f8a0de commit 23dfcc9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Change `cluster` in kubectl patch command to `cluster.cluster.x-k8s.io` inside hooks in case more than one API group is present.

## [0.58.0] - 2024-07-30

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ spec:
done
echo "Unpausing cluster ${CLUSTER_NAME} to allow deletion..."
kubectl patch -n ${NAMESPACE} cluster "${CLUSTER_NAME}" --type=merge -p '{"spec": {"paused": false}}'
kubectl patch -n ${NAMESPACE} cluster.cluster.x-k8s.io "${CLUSTER_NAME}" --type=merge -p '{"spec": {"paused": false}}'
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
command:
- "/bin/bash"
- "-xc"
- kubectl patch cluster -n {{ $.Release.Namespace }} {{ include "resource.default.name" $ }} --type=merge -p '{"spec":{"paused":true}}'
- kubectl patch cluster.cluster.x-k8s.io -n {{ $.Release.Namespace }} {{ include "resource.default.name" $ }} --type=merge -p '{"spec":{"paused":true}}'
{{- if (include "isIpamSvcLoadBalancerEnabled" $) }}
- kubectl patch helmrelease -n {{ $.Release.Namespace }} {{ include "resource.default.name" $ }}-cloud-provider-vsphere --type=merge -p '{"spec":{"suspend":true}}'
{{- end }}
Expand Down Expand Up @@ -146,6 +146,6 @@ spec:
set -o nounset
echo "New IPs have been assigned, upausing the Cluster '{{ include "resource.default.name" $ }}' resource.."
kubectl get ipaddresses.ipam.cluster.x-k8s.io -n {{ $.Release.Namespace }}
kubectl patch cluster -n {{ $.Release.Namespace }} {{ include "resource.default.name" $ }} --type=merge -p '{"spec":{"paused":false}}'
kubectl patch cluster.cluster.x-k8s.io -n {{ $.Release.Namespace }} {{ include "resource.default.name" $ }} --type=merge -p '{"spec":{"paused":false}}'
---
{{- end }}

0 comments on commit 23dfcc9

Please sign in to comment.