Skip to content

Commit 4a05e2e

Browse files
authored
Merge pull request #1896 from realyota/master
docs: quote boolean-like values in CHOp config example YAML
2 parents 06cb9f4 + ff98162 commit 4a05e2e

File tree

4 files changed

+41
-18
lines changed

4 files changed

+41
-18
lines changed

.github/workflows/release_chart.yaml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ on:
55
types:
66
- published
77
- edited
8+
workflow_dispatch:
9+
inputs:
10+
release_tag:
11+
description: 'release tag'
12+
required: true
813

914
jobs:
1015
release_chart:
1116
name: Release Chart
1217
permissions:
1318
contents: write
19+
packages: write
1420
runs-on: ubuntu-latest
1521
steps:
1622
- name: Checkout
@@ -20,28 +26,43 @@ jobs:
2026

2127
- name: Install chart-releaser
2228
run: |
23-
wget https://github.com/helm/chart-releaser/releases/download/v1.4.1/chart-releaser_1.4.1_linux_amd64.tar.gz
24-
tar -zxf chart-releaser_1.4.1_linux_amd64.tar.gz cr
29+
HELM_CHART_RELEASER_VERSION=$(curl -fsSL https://github.com/helm/chart-releaser/releases/latest -H "Accept: application/json" | jq -r .tag_name)
30+
wget -qO "chart-releaser_${HELM_CHART_RELEASER_VERSION#v}_linux_$(dpkg --print-architecture).tar.gz" "https://github.com/helm/chart-releaser/releases/download/${HELM_CHART_RELEASER_VERSION}/chart-releaser_${HELM_CHART_RELEASER_VERSION#v}_linux_$(dpkg --print-architecture).tar.gz"
31+
tar -zxf "chart-releaser_${HELM_CHART_RELEASER_VERSION#v}_linux_$(dpkg --print-architecture).tar.gz"
2532
sudo install cr /usr/local/bin/
2633
rm -f cr chart-releaser_1.4.1_linux_amd64.tar.gz
2734
2835
- name: Install Helm
2936
run: |
30-
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
37+
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-4 | bash
3138
3239
- name: Login to GitHub Container Registry
3340
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
3441

3542
- name: Package Chart
3643
run: cr package deploy/helm/clickhouse-operator
3744

45+
- name: Resolve Helm release ID and NAME
46+
run: |
47+
RELEASE_ID="${{ github.event.release.id }}"
48+
RELEASE_NAME="${{ github.event.release.name }}"
49+
if [[ -z "${RELEASE_ID}" || -z "${RELEASE_NAME}" ]]; then
50+
51+
RELEASE_ID=$(curl -s -H "Accept: application/json" https://github.com/${{ github.repository }}/releases/${{ github.event.inputs.release_tag }} | jq .id)
52+
RELEASE_NAME="${{ github.event.inputs.release_tag }}"
53+
fi
54+
echo "RELEASE_ID=$RELEASE_ID" >> "$GITHUB_ENV"
55+
echo "RELEASE_NAME=$RELEASE_NAME" >> "$GITHUB_ENV"
56+
57+
58+
3859
- name: Get Release Assets
3960
id: get_assets
4061
run: |
4162
CHART_PATH=$(ls .cr-release-packages/altinity-clickhouse-operator-*.tgz)
4263
ASSET_NAME=$(basename ${CHART_PATH})
4364
ASSET_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
44-
"https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets" | \
65+
"https://api.github.com/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets" | \
4566
jq -r ".[] | select(.name == \"$ASSET_NAME\") | .id")
4667
4768
echo "Asset ID is $ASSET_ID"
@@ -51,7 +72,7 @@ jobs:
5172
if: steps.get_assets.outputs.asset_id != ''
5273
run: |
5374
curl -X DELETE -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
54-
"https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets/${{ steps.get_assets.outputs.asset_id }}"
75+
"https://api.github.com/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets/${{ steps.get_assets.outputs.asset_id }}"
5576
5677
- name: Upload Release Artifacts
5778
run: |
@@ -61,7 +82,7 @@ jobs:
6182
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
6283
-H "Content-Type: application/gzip" \
6384
-T "${CHART_PATH}" \
64-
"https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ github.event.release.id }}/assets?name=$(basename ${CHART_PATH})"
85+
"https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=$(basename ${CHART_PATH})"
6586
- name: Validate Helm Repository Configuration
6687
run: |
6788
if [ -z "${{ secrets.HELM_GITHUB_TOKEN }}" ]; then
@@ -90,7 +111,7 @@ jobs:
90111
cr upload \
91112
--git-repo=${{ vars.HELM_GITHUB_REPOSITORY }} \
92113
--owner=${GITHUB_REPOSITORY_OWNER} \
93-
--release-name-template=${{ github.event.release.name }} \
114+
--release-name-template=${RELEASE_NAME} \
94115
--token=${{ secrets.HELM_GITHUB_TOKEN }} \
95116
--package-path=.cr-release-packages \
96117
--skip-existing
@@ -105,7 +126,7 @@ jobs:
105126
cr index \
106127
--git-repo=${GITHUB_REPOSITORY#*/} \
107128
--owner=${GITHUB_REPOSITORY_OWNER} \
108-
--release-name-template=${{ github.event.release.name }} \
129+
--release-name-template=${RELEASE_NAME} \
109130
--token=${{ secrets.GITHUB_TOKEN }} \
110131
--index-path=index.yaml \
111132
--remote=httpsorigin \
@@ -174,7 +195,7 @@ jobs:
174195
cr index \
175196
--git-repo=${{ vars.HELM_GITHUB_REPOSITORY }} \
176197
--owner=${GITHUB_REPOSITORY_OWNER} \
177-
--release-name-template=${{ github.event.release.name }} \
198+
--release-name-template=${RELEASE_NAME} \
178199
--token=${{ secrets.HELM_GITHUB_TOKEN }} \
179200
--package-path=.cr-release-packages \
180201
--index-path=index.yaml \

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ tests/image/cache
5555
.aider*
5656
CLAUDE.md
5757
AGENTS.md
58-
.claude
58+
.claude
59+
60+
/.cr-release-packages

deploy/helm/clickhouse-operator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ crdHook:
122122
| serviceMonitor.clickhouseMetrics.metricRelabelings | list | `[]` | |
123123
| serviceMonitor.clickhouseMetrics.relabelings | list | `[]` | |
124124
| serviceMonitor.clickhouseMetrics.scrapeTimeout | string | `""` | |
125-
| serviceMonitor.enabled | bool | `false` | ServiceMonitor Custom resource is created for a [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator) In serviceMonitor will be created two endpoints ch-metrics on port 8888 and op-metrics # 9999. Ypu can specify interval, scrapeTimeout, relabelings, metricRelabelings for each endpoint below |
125+
| serviceMonitor.enabled | bool | `false` | ServiceMonitor Custom resource is created for a [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator) In serviceMonitor will be created two endpoints ch-metrics on port 8888 and op-metrics # 9999. You can specify interval, scrapeTimeout, relabelings, metricRelabelings for each endpoint below |
126126
| serviceMonitor.operatorMetrics.interval | string | `"30s"` | |
127127
| serviceMonitor.operatorMetrics.metricRelabelings | list | `[]` | |
128128
| serviceMonitor.operatorMetrics.relabelings | list | `[]` | |

docs/chi-examples/70-chop-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,16 +154,16 @@ spec:
154154
# - to be included into a ClickHouse cluster
155155
# respectfully before moving forward with host reconcile
156156
wait:
157-
exclude: true
158-
queries: true
159-
include: false
157+
exclude: "true"
158+
queries: "true"
159+
include: "false"
160160
# The operator during reconcile procedure should wait for replicas to catch-up
161161
# replication delay a.k.a replication lag for the following replicas
162162
replicas:
163163
# All replicas (new and known earlier) are explicitly requested to wait for replication to catch-up
164-
all: no
164+
all: "no"
165165
# New replicas only are requested to wait for replication to catch-up
166-
new: yes
166+
new: "yes"
167167
# Replication catch-up is considered to be completed as soon as replication delay
168168
# a.k.a replication lag - calculated as "MAX(absolute_delay) FROM system.replicas"
169169
# is within this specified delay (in seconds)
@@ -172,11 +172,11 @@ spec:
172172
# Whether the operator during host launch procedure should wait for startup probe to succeed.
173173
# In case probe is unspecified wait is assumed to be completed successfully.
174174
# Default option value is to do not wait.
175-
startup: no
175+
startup: "no"
176176
# Whether the operator during host launch procedure should wait for readiness probe to succeed.
177177
# In case probe is unspecified wait is assumed to be completed successfully.
178178
# Default option value is to wait.
179-
readiness: yes
179+
readiness: "yes"
180180

181181
################################################
182182
##

0 commit comments

Comments
 (0)