Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support helm lookup by ArgoCD #634

Merged
merged 1 commit into from
Oct 12, 2024
Merged

Support helm lookup by ArgoCD #634

merged 1 commit into from
Oct 12, 2024

Conversation

motoki317
Copy link
Owner

Copy link

Diff

@@ (file level) @@
!   ---
+   apiVersion: rbac.authorization.k8s.io/v1
+   kind: ClusterRole
+   metadata:
+     name: argocd-repo-server
+     namespace: argocd
+   rules:
+   - resources:
+     - configmaps
+     - secrets
+     apiGroups:
+     - 
+     verbs:
+     - get
+     - list
+     - watch
+   apiVersion: rbac.authorization.k8s.io/v1
+   kind: ClusterRoleBinding
+   metadata:
+     name: argocd-repo-server
+     namespace: argocd
+   roleRef:
+     apiGroup: rbac.authorization.k8s.io
+     kind: ClusterRole
+     name: argocd-repo-server
+   subjects:
+   - kind: ServiceAccount
+     name: argocd-repo-server
+     namespace: argocd
+   apiVersion: v1
+   data:
+     helm: |
+       #!/bin/bash
+       
+       HELM_BIN=${HELM_BIN:-helm}
+       
+       new_args=()
+       template_found=false
+       
+       for arg in "$@"; do
+         if [[ "$arg" == "template" ]]; then
+           template_found=true
+           new_args+=("$arg")
+         elif $template_found && [[ "${#new_args[@]}" -eq 1 ]]; then
+           new_args+=("--dry-run=server" "$arg")
+           template_found=false
+         else
+           new_args+=("$arg")
+         fi
+       done
+       
+       $HELM_BIN "${new_args[@]}"
+       
+   kind: ConfigMap
+   metadata:
+     name: helm-replace-6ht4bgdhdm
+     namespace: argocd

@@ spec.template.spec.containers.argocd-repo-server.env @@
# apps/v1/Deployment/argocd/argocd-repo-server
! + one list entry added:
+   - name: HELM_BIN
+     value: /usr/local/bin/helm

@@ spec.template.spec.containers.argocd-repo-server.volumeMounts @@
# apps/v1/Deployment/argocd/argocd-repo-server
! + one list entry added:
+   - name: helm-replace
+     mountPath: /usr/local/sbin/helm
+     subPath: helm

@@ spec.template.spec.volumes @@
# apps/v1/Deployment/argocd/argocd-repo-server
! + one list entry added:
+   - name: helm-replace
+     configMap:
+       name: helm-replace-6ht4bgdhdm
+       defaultMode: 511

@motoki317 motoki317 merged commit ff27eae into master Oct 12, 2024
2 checks passed
@motoki317 motoki317 deleted the argocd-helm-lookup branch October 12, 2024 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant