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

[kube-prometheus-stack] Move CRDs into sub-charts #3547

Merged
merged 12 commits into from
Jul 12, 2023
5 changes: 5 additions & 0 deletions charts/kube-prometheus-stack/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Python development for hack
venv
pyvenv.cfg
!**
charts/*
!charts/crds/
!charts/crds/**
Chart.lock
4 changes: 3 additions & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 47.4.0
version: 48.0.0
appVersion: v0.66.0
kubeVersion: ">=1.16.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand All @@ -39,6 +39,8 @@ annotations:
url: https://github.com/prometheus-operator/kube-prometheus

dependencies:
- name: crds
version: "0.0.0"
jkroepke marked this conversation as resolved.
Show resolved Hide resolved
- name: kube-state-metrics
version: "5.8.*"
repository: https://prometheus-community.github.io/helm-charts
Expand Down
3 changes: 3 additions & 0 deletions charts/kube-prometheus-stack/charts/crds/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
apiVersion: v2
name: crds
version: 0.0.0
3 changes: 3 additions & 0 deletions charts/kube-prometheus-stack/charts/crds/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# crds subchart

See: [https://github.com/prometheus-community/helm-charts/issues/3548](https://github.com/prometheus-community/helm-charts/issues/3548)
10 changes: 6 additions & 4 deletions charts/kube-prometheus-stack/hack/update_crds.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash

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

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

FILES=(
Expand All @@ -27,9 +29,9 @@ for line in "${FILES[@]}"; do

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

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

if ! curl --silent --retry-all-errors --fail --location "${URL}" >> ../crds/"${DESTINATION}"; then
if ! curl --silent --retry-all-errors --fail --location "${URL}" >> "${SCRIPT_DIR}/../charts/crds/crds/${DESTINATION}"; then
echo -e "Failed to download ${URL}!"
exit 1
fi
Expand Down