Skip to content

Commit

Permalink
[v2.9] support helm release v2beta2 only
Browse files Browse the repository at this point in the history
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
  • Loading branch information
chanwit committed Feb 16, 2024
1 parent 5d09a14 commit 402c9e4
Show file tree
Hide file tree
Showing 8 changed files with 503 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_v29.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main
paths:
- patches-argo-cd-v2.9/**
- patches-gitops-engine-v2.0.0/**
- patches-gitops-engine-v2.2.0/**
- VERSION_29
- .github/workflows/build_v29.yaml

Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
run: |
ln -s VERSION_29 VERSION
ln -s patches-argo-cd-v2.9 patches-argo-cd
ln -s patches-gitops-engine-v2.0.0 patches-gitops-engine
ln -s patches-gitops-engine-v2.2.0 patches-gitops-engine
rm -rf argo-cd || true
bash -x ./init.sh
source ./VERSION
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: init-v29
init-v29:
ln -s VERSION_29 VERSION
ln -s patches-gitops-engine-v2.0.0 patches-gitops-engine
ln -s patches-gitops-engine-v2.2.0 patches-gitops-engine
ln -s patches-argo-cd-v2.9 patches-argo-cd
make init

Expand Down
2 changes: 1 addition & 1 deletion patches-argo-cd-v2.9/02-implement-loopback.patch
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ index 000000000..f795c6a75
+ var hl *unstructured.Unstructured
+ hl, err = m.kubectl.GetResource(context.TODO(), config, schema.GroupVersionKind{
+ Group: "helm.toolkit.fluxcd.io",
+ Version: "v2beta1",
+ Version: "v2beta2",
+ Kind: "HelmRelease",
+ }, app.Name, app.Spec.Destination.Namespace)
+ if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions patches-argo-cd-v2.9/09-auto-create-flux-resources.patch
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ index f795c6a75..54bb28e4f 100644
+ )
hl, err = m.kubectl.GetResource(context.TODO(), config, schema.GroupVersionKind{
Group: "helm.toolkit.fluxcd.io",
Version: "v2beta1",
Version: "v2beta2",
Kind: "HelmRelease",
}, app.Name, app.Spec.Destination.Namespace)
+
Expand Down Expand Up @@ -317,7 +317,7 @@ index 000000000..7041569a2
+
+ release := map[string]interface{}{}
+ releaseTemplate := []byte(`
+apiVersion: helm.toolkit.fluxcd.io/v2beta1
+apiVersion: helm.toolkit.fluxcd.io/v2beta2
+kind: HelmRelease
+metadata:
+ name: undefined
Expand Down
2 changes: 1 addition & 1 deletion patches-argo-cd-v2.9/11-support-helm-oci-and.patch
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ index 7041569a2..65ccf8782 100644
+
release := map[string]interface{}{}
releaseTemplate := []byte(`
apiVersion: helm.toolkit.fluxcd.io/v2beta1
apiVersion: helm.toolkit.fluxcd.io/v2beta2
@@ -125,9 +134,17 @@ spec:
}

Expand Down
4 changes: 2 additions & 2 deletions patches-argo-cd-v2.9/13-upgrade-to-flux-v2.0.0-rc.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ index 18f41430d..28cd571cc 100644
+ },
+ HelmRelease: {
+ Group: "helm.toolkit.fluxcd.io",
+ Version: "v2beta1",
+ Version: "v2beta2",
+ Kind: "HelmRelease",
+ },
+ HelmRepository: {
Expand Down Expand Up @@ -70,7 +70,7 @@ index 18f41430d..28cd571cc 100644
)
- hl, err = m.kubectl.GetResource(context.TODO(), config, schema.GroupVersionKind{
- Group: "helm.toolkit.fluxcd.io",
- Version: "v2beta1",
- Version: "v2beta2",
- Kind: "HelmRelease",
- }, app.Name, app.Spec.Destination.Namespace)
+ hl, err = m.kubectl.GetResource(context.TODO(), config, supportedKinds[HelmRelease], app.Name, app.Spec.Destination.Namespace)
Expand Down

0 comments on commit 402c9e4

Please sign in to comment.