Skip to content

Commit

Permalink
Use non-default namespace for CDI chart hooks (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasdinov authored Dec 12, 2023
1 parent 978a792 commit 2e826a9
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 40 deletions.
Binary file modified assets/cdi/cdi-0.2.0.tgz
Binary file not shown.
6 changes: 3 additions & 3 deletions charts/cdi/0.2.0/templates/cdi-cr-uninstall.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: default
namespace: cdi
name: cdi-cr-uninstaller
annotations:
"helm.sh/hook": pre-delete
Expand Down Expand Up @@ -33,7 +33,7 @@ metadata:
"helm.sh/hook-weight": "2"
subjects:
- kind: ServiceAccount
namespace: default
namespace: cdi
name: cdi-cr-uninstaller
roleRef:
kind: ClusterRole
Expand All @@ -43,7 +43,7 @@ roleRef:
apiVersion: batch/v1
kind: Job
metadata:
namespace: default
namespace: cdi
name: cdi-cr-uninstaller
annotations:
"helm.sh/hook": pre-delete
Expand Down
23 changes: 16 additions & 7 deletions charts/cdi/0.2.0/templates/cdi-crd-uninstall.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
apiVersion: v1
kind: Namespace
metadata:
name: cdi-crd-uninstall
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "1"
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: default
namespace: cdi-crd-uninstall
name: cdi-crd-uninstaller
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "1"
"helm.sh/hook-weight": "2"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -15,7 +24,7 @@ metadata:
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "1"
"helm.sh/hook-weight": "2"
rules:
- apiGroups: [ "apiextensions.k8s.io" ]
resources: [ "customresourcedefinitions" ]
Expand All @@ -30,10 +39,10 @@ metadata:
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "2"
"helm.sh/hook-weight": "3"
subjects:
- kind: ServiceAccount
namespace: default
namespace: cdi-crd-uninstall
name: cdi-crd-uninstaller
roleRef:
kind: ClusterRole
Expand All @@ -43,12 +52,12 @@ roleRef:
apiVersion: batch/v1
kind: Job
metadata:
namespace: default
namespace: cdi-crd-uninstall
name: cdi-crd-uninstaller
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "3"
"helm.sh/hook-weight": "4"
spec:
template:
metadata:
Expand Down
27 changes: 18 additions & 9 deletions charts/cdi/0.2.0/templates/cdi-crd-upgrade.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
apiVersion: v1
kind: Namespace
metadata:
name: cdi-crd-upgrade
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "1"
---
apiVersion: v1
kind: ConfigMap
metadata:
namespace: default
namespace: cdi-crd-upgrade
name: cdi-crd-manifest
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "1"
"helm.sh/hook-weight": "2"
data:
crd: |-
{{ $.Files.Get "crds/cdi.yaml" | nindent 4 }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: default
namespace: cdi-crd-upgrade
name: cdi-crd-upgrader
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "2"
"helm.sh/hook-weight": "3"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -28,7 +37,7 @@ metadata:
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "2"
"helm.sh/hook-weight": "3"
rules:
- apiGroups: [ "" ]
resources: [ "configmaps" ]
Expand All @@ -48,10 +57,10 @@ metadata:
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "3"
"helm.sh/hook-weight": "4"
subjects:
- kind: ServiceAccount
namespace: default
namespace: cdi-crd-upgrade
name: cdi-crd-upgrader
roleRef:
kind: ClusterRole
Expand All @@ -61,12 +70,12 @@ roleRef:
apiVersion: batch/v1
kind: Job
metadata:
namespace: default
namespace: cdi-crd-upgrade
name: cdi-crd-upgrader
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "4"
"helm.sh/hook-weight": "5"
spec:
template:
metadata:
Expand Down
4 changes: 2 additions & 2 deletions index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ entries:
cdi:
- apiVersion: v2
appVersion: 1.57.0
created: "2023-12-05T16:21:51.029356+02:00"
created: "2023-12-06T17:40:36.160396+02:00"
description: A Helm chart for Containerized-Data-Importer (CDI)
digest: 70b8a281684f8f5a5414f5ac42b0d104bd6679f23e834b811abac85ac792fb85
digest: 90f31de768ef55729dccb75aab892181f9faf522fc15f5bde11186dd622d5aaf
icon: https://raw.githubusercontent.com/cncf/artwork/main/projects/kubevirt/icon/color/kubevirt-icon-color.svg
name: cdi
type: application
Expand Down
6 changes: 3 additions & 3 deletions packages/cdi/charts/templates/cdi-cr-uninstall.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: default
namespace: cdi
name: cdi-cr-uninstaller
annotations:
"helm.sh/hook": pre-delete
Expand Down Expand Up @@ -33,7 +33,7 @@ metadata:
"helm.sh/hook-weight": "2"
subjects:
- kind: ServiceAccount
namespace: default
namespace: cdi
name: cdi-cr-uninstaller
roleRef:
kind: ClusterRole
Expand All @@ -43,7 +43,7 @@ roleRef:
apiVersion: batch/v1
kind: Job
metadata:
namespace: default
namespace: cdi
name: cdi-cr-uninstaller
annotations:
"helm.sh/hook": pre-delete
Expand Down
23 changes: 16 additions & 7 deletions packages/cdi/charts/templates/cdi-crd-uninstall.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
apiVersion: v1
kind: Namespace
metadata:
name: cdi-crd-uninstall
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "1"
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: default
namespace: cdi-crd-uninstall
name: cdi-crd-uninstaller
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "1"
"helm.sh/hook-weight": "2"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -15,7 +24,7 @@ metadata:
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "1"
"helm.sh/hook-weight": "2"
rules:
- apiGroups: [ "apiextensions.k8s.io" ]
resources: [ "customresourcedefinitions" ]
Expand All @@ -30,10 +39,10 @@ metadata:
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "2"
"helm.sh/hook-weight": "3"
subjects:
- kind: ServiceAccount
namespace: default
namespace: cdi-crd-uninstall
name: cdi-crd-uninstaller
roleRef:
kind: ClusterRole
Expand All @@ -43,12 +52,12 @@ roleRef:
apiVersion: batch/v1
kind: Job
metadata:
namespace: default
namespace: cdi-crd-uninstall
name: cdi-crd-uninstaller
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "3"
"helm.sh/hook-weight": "4"
spec:
template:
metadata:
Expand Down
27 changes: 18 additions & 9 deletions packages/cdi/charts/templates/cdi-crd-upgrade.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
apiVersion: v1
kind: Namespace
metadata:
name: cdi-crd-upgrade
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "1"
---
apiVersion: v1
kind: ConfigMap
metadata:
namespace: default
namespace: cdi-crd-upgrade
name: cdi-crd-manifest
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "1"
"helm.sh/hook-weight": "2"
data:
crd: |-
{{ $.Files.Get "crds/cdi.yaml" | nindent 4 }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: default
namespace: cdi-crd-upgrade
name: cdi-crd-upgrader
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "2"
"helm.sh/hook-weight": "3"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -28,7 +37,7 @@ metadata:
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "2"
"helm.sh/hook-weight": "3"
rules:
- apiGroups: [ "" ]
resources: [ "configmaps" ]
Expand All @@ -48,10 +57,10 @@ metadata:
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "3"
"helm.sh/hook-weight": "4"
subjects:
- kind: ServiceAccount
namespace: default
namespace: cdi-crd-upgrade
name: cdi-crd-upgrader
roleRef:
kind: ClusterRole
Expand All @@ -61,12 +70,12 @@ roleRef:
apiVersion: batch/v1
kind: Job
metadata:
namespace: default
namespace: cdi-crd-upgrade
name: cdi-crd-upgrader
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-delete-policy": hook-succeeded
"helm.sh/hook-weight": "4"
"helm.sh/hook-weight": "5"
spec:
template:
metadata:
Expand Down

0 comments on commit 2e826a9

Please sign in to comment.