Skip to content

Commit

Permalink
Add helm labels to allow chart downgrade (#767)
Browse files Browse the repository at this point in the history
- Ensure labels match to previous release for clusterctl-config CM

Signed-off-by: Danil-Grigorev <[email protected]>
  • Loading branch information
Danil-Grigorev authored Oct 4, 2024
1 parent f79221a commit 39f90d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/controllers/clusterctl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ type ConfigImage struct {
// Config returns current set of embedded turtles clusterctl overrides.
func Config() *corev1.ConfigMap {
configMap := config.DeepCopy()
configMap.Namespace = cmp.Or(os.Getenv("POD_NAMESPACE"), "rancher-turtles-system")

namespace := cmp.Or(os.Getenv("POD_NAMESPACE"), "rancher-turtles-system")
configMap.Namespace = namespace
configMap.Annotations["meta.helm.sh/release-namespace"] = namespace

return configMap
}
Expand Down
4 changes: 4 additions & 0 deletions internal/controllers/clusterctl/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: clusterctl-config
annotations:
meta.helm.sh/release-name: rancher-turtles
labels:
app.kubernetes.io/managed-by: Helm
data:
clusterctl.yaml: |
providers:
Expand Down

0 comments on commit 39f90d1

Please sign in to comment.