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
This commit is contained in:
parent
24b80c1986
commit
1f20887f09
@ -33,6 +33,8 @@ source ${PULSAR_HOME}/.ci/helm.sh
|
|||||||
# create cluster
|
# create cluster
|
||||||
ci::create_cluster
|
ci::create_cluster
|
||||||
|
|
||||||
|
ci::helm_repo_add
|
||||||
|
|
||||||
extra_opts=""
|
extra_opts=""
|
||||||
if [[ "x${SYMMETRIC}" == "xtrue" ]]; then
|
if [[ "x${SYMMETRIC}" == "xtrue" ]]; then
|
||||||
extra_opts="-s"
|
extra_opts="-s"
|
||||||
|
|||||||
@ -81,6 +81,13 @@ function ci::install_cert_manager() {
|
|||||||
echo "Successfully installed the 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() {
|
function ci::print_pod_logs() {
|
||||||
echo "Logs for all pulsar containers:"
|
echo "Logs for all pulsar containers:"
|
||||||
for k8sobject in $(${KUBECTL} get pods,jobs -n ${NAMESPACE} -l app=pulsar -o=name); do
|
for k8sobject in $(${KUBECTL} get pods,jobs -n ${NAMESPACE} -l app=pulsar -o=name); do
|
||||||
|
|||||||
16
.github/workflows/pulsar-helm-chart-ci.yaml
vendored
16
.github/workflows/pulsar-helm-chart-ci.yaml
vendored
@ -127,23 +127,29 @@ jobs:
|
|||||||
--validate-maintainers=false \
|
--validate-maintainers=false \
|
||||||
--target-branch ${{ github.event.repository.default_branch }}
|
--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' }}
|
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
|
||||||
run: |
|
run: |
|
||||||
PULSAR_CHART_HOME=$(pwd)
|
PULSAR_CHART_HOME=$(pwd)
|
||||||
source ${PULSAR_CHART_HOME}/hack/common.sh
|
source ${PULSAR_CHART_HOME}/hack/common.sh
|
||||||
|
source ${PULSAR_CHART_HOME}/.ci/helm.sh
|
||||||
|
hack::ensure_kubectl
|
||||||
|
hack::ensure_helm
|
||||||
hack::ensure_kubeconform
|
hack::ensure_kubeconform
|
||||||
|
ci::helm_repo_add
|
||||||
|
helm dependency build charts/pulsar
|
||||||
validate_helm_template_with_k8s_version() {
|
validate_helm_template_with_k8s_version() {
|
||||||
local kube_version=$1
|
local kube_version=$1
|
||||||
echo "Validating helm template with kubeconform for k8s version $kube_version"
|
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 | \
|
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
|
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
|
set -o pipefail
|
||||||
validate_helm_template_with_k8s_version 1.21.0
|
for k8s_version_part in {21..29}; do
|
||||||
validate_helm_template_with_k8s_version 1.27.0
|
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
|
- name: Wait for ssh connection when build fails
|
||||||
# ssh access is enabled for builds in own forks
|
# ssh access is enabled for builds in own forks
|
||||||
uses: ./.github/actions/ssh-access
|
uses: ./.github/actions/ssh-access
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user