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

feat(argo-cd): Generate crd from upstream #2614

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions charts/argo-cd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: v2.10.5
kubeVersion: ">=1.23.0-0"
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd
version: 6.7.6
version: 6.7.7
home: https://github.com/argoproj/argo-helm
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
sources:
Expand All @@ -26,5 +26,5 @@ annotations:
fingerprint: 2B8F22F57260EFA67BE1C5824B11F800CD9D2252
url: https://argoproj.github.io/argo-helm/pgp_keys.asc
artifacthub.io/changes: |
- kind: fixed
description: added missing crd change for 2.10.5
- kind: changed
description: generate CRDs from upstream tag
31 changes: 31 additions & 0 deletions charts/argo-cd/hack/update_crds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

if [[ $(uname -s) = "Darwin" ]]; then
VERSION="$(grep ^appVersion "${SCRIPT_DIR}/../Chart.yaml" | sed 's/appVersion: //g')"
else
VERSION="$(grep ^appVersion "${SCRIPT_DIR}/../Chart.yaml" | sed 's/appVersion:\s//g')"
fi

FILES=(
"crd-application.yaml : application-crd.yaml"
"crd-applicationset.yaml : applicationset-crd.yaml"
"crd-project.yaml : appproject-crd.yaml"
)

for line in "${FILES[@]}"; do
DESTINATION=$(echo "${line%%:*}" | xargs)
SOURCE=$(echo "${line##*:}" | xargs)

URL="https://raw.githubusercontent.com/argoproj/argo-cd/$VERSION/manifests/crds/$SOURCE"

echo -e "Downloading Prometheus Operator CRD with Version ${VERSION}:\n${URL}\n"

echo "# ${URL}" > "${SCRIPT_DIR}/../templates/crds/${DESTINATION}"

if ! curl --silent --retry-all-errors --fail --location "${URL}" >> "${SCRIPT_DIR}/../templates/crds/${DESTINATION}"; then
echo -e "Failed to download ${URL}!"
exit 1
fi
done
13 changes: 1 addition & 12 deletions charts/argo-cd/templates/crds/crd-application.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
{{- if .Values.crds.install }}
# https://raw.githubusercontent.com/argoproj/argo-cd/v2.10.5/manifests/crds/application-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
{{- if .Values.crds.keep }}
"helm.sh/resource-policy": keep
{{- end }}
{{- with .Values.crds.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: applications.argoproj.io
app.kubernetes.io/part-of: argocd
{{- with .Values.crds.additionalLabels }}
{{- toYaml . | nindent 4}}
{{- end }}
name: applications.argoproj.io
spec:
group: argoproj.io
Expand Down Expand Up @@ -4947,4 +4937,3 @@ spec:
served: true
storage: true
subresources: {}
{{- end }}
13 changes: 1 addition & 12 deletions charts/argo-cd/templates/crds/crd-applicationset.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
{{- if and .Values.crds.install .Values.applicationSet.enabled }}
# https://raw.githubusercontent.com/argoproj/argo-cd/v2.10.5/manifests/crds/applicationset-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
{{- if .Values.crds.keep }}
"helm.sh/resource-policy": keep
{{- end }}
{{- with .Values.crds.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: applicationsets.argoproj.io
app.kubernetes.io/part-of: argocd
{{- with .Values.crds.additionalLabels }}
{{- toYaml . | nindent 4}}
{{- end }}
name: applicationsets.argoproj.io
spec:
group: argoproj.io
Expand Down Expand Up @@ -15247,4 +15237,3 @@ spec:
storage: true
subresources:
status: {}
{{- end }}
13 changes: 1 addition & 12 deletions charts/argo-cd/templates/crds/crd-project.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
{{- if .Values.crds.install }}
# https://raw.githubusercontent.com/argoproj/argo-cd/v2.10.5/manifests/crds/appproject-crd.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
{{- if .Values.crds.keep }}
"helm.sh/resource-policy": keep
{{- end }}
{{- with .Values.crds.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: appprojects.argoproj.io
app.kubernetes.io/part-of: argocd
{{- with .Values.crds.additionalLabels }}
{{- toYaml . | nindent 4}}
{{- end }}
name: appprojects.argoproj.io
spec:
group: argoproj.io
Expand Down Expand Up @@ -333,4 +323,3 @@ spec:
type: object
served: true
storage: true
{{- end }}