This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-helm-chart.git
The following commit(s) were added to refs/heads/master by this push:
new 1f20887 Fix kubeconform check and improve it (#456)
1f20887 is described below
commit 1f20887f096cf098357c398a714d8db20dc4d551
Author: Lari Hotari <[email protected]>
AuthorDate: Tue Feb 13 11:43:16 2024 +0200
Fix kubeconform check and improve it (#456)
- do "helm repo add" for the prometheus-community repo
- run checks for all k8s versions between 1.21.0-1.29.0
---
.ci/chart_test.sh | 2 ++
.ci/helm.sh | 7 +++++++
.github/workflows/pulsar-helm-chart-ci.yaml | 16 +++++++++++-----
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/.ci/chart_test.sh b/.ci/chart_test.sh
index cf70be3..624b1ec 100755
--- a/.ci/chart_test.sh
+++ b/.ci/chart_test.sh
@@ -33,6 +33,8 @@ source ${PULSAR_HOME}/.ci/helm.sh
# create cluster
ci::create_cluster
+ci::helm_repo_add
+
extra_opts=""
if [[ "x${SYMMETRIC}" == "xtrue" ]]; then
extra_opts="-s"
diff --git a/.ci/helm.sh b/.ci/helm.sh
index ffc0e50..8289a82 100644
--- a/.ci/helm.sh
+++ b/.ci/helm.sh
@@ -81,6 +81,13 @@ function ci::install_cert_manager() {
echo "Successfully installed the cert manager."
}
+function ci::helm_repo_add() {
+ echo "Adding the helm repo ..."
+ ${HELM} repo add prometheus-community
https://prometheus-community.github.io/helm-charts
+ ${HELM} repo update
+ echo "Successfully added the helm repo."
+}
+
function ci::print_pod_logs() {
echo "Logs for all pulsar containers:"
for k8sobject in $(${KUBECTL} get pods,jobs -n ${NAMESPACE} -l app=pulsar
-o=name); do
diff --git a/.github/workflows/pulsar-helm-chart-ci.yaml
b/.github/workflows/pulsar-helm-chart-ci.yaml
index 8e96fec..1a1f86a 100644
--- a/.github/workflows/pulsar-helm-chart-ci.yaml
+++ b/.github/workflows/pulsar-helm-chart-ci.yaml
@@ -127,23 +127,29 @@ jobs:
--validate-maintainers=false \
--target-branch ${{ github.event.repository.default_branch }}
- - name: Run kubeconform check
+ - name: Run kubeconform check for helm template with every major k8s
version 1.21.0-1.29.0
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
run: |
PULSAR_CHART_HOME=$(pwd)
source ${PULSAR_CHART_HOME}/hack/common.sh
+ source ${PULSAR_CHART_HOME}/.ci/helm.sh
+ hack::ensure_kubectl
+ hack::ensure_helm
hack::ensure_kubeconform
+ ci::helm_repo_add
+ helm dependency build charts/pulsar
validate_helm_template_with_k8s_version() {
local kube_version=$1
echo "Validating helm template with kubeconform for k8s version
$kube_version"
helm template charts/pulsar --set
kube-prometheus-stack.enabled=false --set components.pulsar_manager=true
--kube-version $kube_version | \
kubeconform -schema-location default -schema-location
'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json'
-strict -kubernetes-version $kube_version -summary
}
- helm dependency build charts/pulsar
set -o pipefail
- validate_helm_template_with_k8s_version 1.21.0
- validate_helm_template_with_k8s_version 1.27.0
-
+ for k8s_version_part in {21..29}; do
+ k8s_version="1.${k8s_version_part}.0"
+ echo "Validating helm template with kubeconform for k8s version
$k8s_version"
+ validate_helm_template_with_k8s_version $k8s_version
+ done
- name: Wait for ssh connection when build fails
# ssh access is enabled for builds in own forks
uses: ./.github/actions/ssh-access