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

Hotfix helm release 0.25.0 #1646

Open
wants to merge 9 commits into
base: 0.25.0
Choose a base branch
from
13 changes: 12 additions & 1 deletion .github/workflows/check_helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@ jobs:
with:
fetch-depth: 0

- uses: medyagh/setup-minikube@master
- name: Set up yq
uses: frenck/action-setup-yq@v1

- name: Setup jq
uses: dcarbone/install-jq-action@v3

- name: Setup helm-docs
uses: gabe565/setup-helm-docs-action@v1

- name: Setup minikube
uses: medyagh/setup-minikube@master
with:
driver: docker
container-runtime: containerd
Expand All @@ -29,6 +39,7 @@ jobs:
run: |
set -xe
minikube kubectl create ns test
./dev/generate_helm_chart.sh
helm install -n test test-operator ./deploy/helm/clickhouse-operator/
sleep 10
workflow_count=$(kubectl get all --all-namespaces | grep -c "test-operator")
Expand Down
1 change: 1 addition & 0 deletions deploy/helm/clickhouse-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ For upgrade please install CRDs separately:
| metrics.image.tag | string | `""` | image tag (chart's appVersion value will be used if not set) |
| metrics.resources | object | `{}` | custom resource configuration |
| nameOverride | string | `""` | override name of the chart |
| namespaceOverride | string | `""` | override namespace where operator will install |
| nodeSelector | object | `{}` | node for scheduler pod assignment, check `kubectl explain pod.spec.nodeSelector` for details |
| operator.containerSecurityContext | object | `{}` | |
| operator.env | list | `[]` | additional environment variables for the clickhouse-operator container in deployment possible format value `[{"name": "SAMPLE", "value": "text"}]` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ metadata:
namespace: {{ include "altinity-clickhouse-operator.namespace" . }}
labels: {{ include "altinity-clickhouse-operator.labels" . | nindent 4 }}
annotations: {{ toYaml .Values.serviceAccount.annotations | nindent 4 }}

# Template Parameters:
#
# NAMESPACE=kube-system
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/clickhouse-operator/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# namespaceOverride -- override namespace where operator will install
namespaceOverride: ""

operator:
image:
# operator.image.repository -- image repository
Expand Down
16 changes: 8 additions & 8 deletions dev/generate_helm_chart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function update_service_resource() {
fi

yq e -i '.metadata.name |= "{{ printf \"%s-metrics\" (include \"altinity-clickhouse-operator.fullname\" .) }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include "altinity-clickhouse-operator.namespace" . }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include \"altinity-clickhouse-operator.namespace\" . }}"' "${file}"
yq e -i '.metadata.labels |= "{{ include \"altinity-clickhouse-operator.labels\" . | nindent 4 }}"' "${file}"
yq e -i '.spec.selector |= "{{ include \"altinity-clickhouse-operator.selectorLabels\" . | nindent 4 }}"' "${file}"

Expand All @@ -179,7 +179,7 @@ function update_deployment_resource() {
fi

yq e -i '.metadata.name |= "{{ include \"altinity-clickhouse-operator.fullname\" . }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include "altinity-clickhouse-operator.namespace" . }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include \"altinity-clickhouse-operator.namespace\" . }}"' "${file}"
yq e -i '.metadata.labels |= "{{ include \"altinity-clickhouse-operator.labels\" . | nindent 4 }}"' "${file}"
yq e -i '.spec.selector.matchLabels |= "{{ include \"altinity-clickhouse-operator.selectorLabels\" . | nindent 6 }}"' "${file}"

Expand Down Expand Up @@ -252,7 +252,7 @@ function update_configmap_resource() {
camel_cased_name=$(to_camel_case "${name_suffix}")

yq e -i '.metadata.name |= "{{ printf \"%s-'"${name_suffix}"'\" (include \"altinity-clickhouse-operator.fullname\" .) }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include "altinity-clickhouse-operator.namespace" . }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include \"altinity-clickhouse-operator.namespace\" . }}"' "${file}"
yq e -i '.metadata.labels |= "{{ include \"altinity-clickhouse-operator.labels\" . | nindent 4 }}"' "${file}"
yq e -i '.data |= "{{ include \"altinity-clickhouse-operator.configmap-data\" (list . .Values.configs.'"${camel_cased_name}"') | nindent 2 }}"' "${file}"

Expand All @@ -275,10 +275,10 @@ function update_clusterrolebinding_resource() {
fi

yq e -i '.metadata.name |= "{{ include \"altinity-clickhouse-operator.fullname\" . }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include "altinity-clickhouse-operator.namespace" . }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include \"altinity-clickhouse-operator.namespace\" . }}"' "${file}"
yq e -i '.metadata.labels |= "{{ include \"altinity-clickhouse-operator.labels\" . | nindent 4 }}"' "${file}"
yq e -i '.roleRef.name |= "{{ include \"altinity-clickhouse-operator.fullname\" . }}"' "${file}"
yq e -i '(.subjects[] | select(.kind == "ServiceAccount")) |= with(. ; .name = "{{ include \"altinity-clickhouse-operator.serviceAccountName\" . }}" | .namespace = "{{ include "altinity-clickhouse-operator.namespace" . }}")' "${file}"
yq e -i '(.subjects[] | select(.kind == "ServiceAccount")) |= with(. ; .name = "{{ include \"altinity-clickhouse-operator.serviceAccountName\" . }}" | .namespace = "{{ include \"altinity-clickhouse-operator.namespace\" . }}")' "${file}"

printf '%s\n%s\n' '{{- if .Values.rbac.create -}}' "$(cat "${file}")" >"${file}"
printf '%s\n%s\n' "$(cat "${file}")" '{{- end }}' >"${file}"
Expand All @@ -296,7 +296,7 @@ function update_clusterrole_resource() {
fi

yq e -i '.metadata.name |= "{{ include \"altinity-clickhouse-operator.fullname\" . }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include "altinity-clickhouse-operator.namespace" . }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include \"altinity-clickhouse-operator.namespace\" . }}"' "${file}"
yq e -i '.metadata.labels |= "{{ include \"altinity-clickhouse-operator.labels\" . | nindent 4 }}"' "${file}"

yq e -i '(.rules[] | select(.resourceNames | contains(["clickhouse-operator"])) | .resourceNames) = ["{{ include \"altinity-clickhouse-operator.fullname\" . }}"]' "${file}"
Expand All @@ -317,7 +317,7 @@ function update_serviceaccount_resource() {
fi

yq e -i '.metadata.name |= "{{ include \"altinity-clickhouse-operator.serviceAccountName\" . }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include "altinity-clickhouse-operator.namespace" . }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include \"altinity-clickhouse-operator.namespace\" . }}"' "${file}"
yq e -i '.metadata.labels |= "{{ include \"altinity-clickhouse-operator.labels\" . | nindent 4 }}"' "${file}"
yq e -i '.metadata.annotations |= "{{ toYaml .Values.serviceAccount.annotations | nindent 4 }}"' "${file}"

Expand All @@ -337,7 +337,7 @@ function update_secret_resource() {
fi

yq e -i '.metadata.name |= "{{ include \"altinity-clickhouse-operator.fullname\" . }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include "altinity-clickhouse-operator.namespace" . }}"' "${file}"
yq e -i '.metadata.namespace |= "{{ include \"altinity-clickhouse-operator.namespace\" . }}"' "${file}"
yq e -i '.metadata.labels |= "{{ include \"altinity-clickhouse-operator.labels\" . | nindent 4 }}"' "${file}"

yq e -i '.data.username |= "{{ .Values.secret.username | b64enc }}"' "${file}"
Expand Down
7 changes: 3 additions & 4 deletions dev/go_build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
echo "Build operator"
source "${CUR_DIR}/go_build_operator.sh"

# helm builder is crushing after commit 6bcda277b752343afd814357666cc99a826fdabe
#CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
#echo "Build helm charts"
#source "${CUR_DIR}/generate_helm_chart.sh"
CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
echo "Build helm charts"
source "${CUR_DIR}/generate_helm_chart.sh"

#CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
#echo "Run source checker"
Expand Down
Loading