From 8a7fb9e828cda51a79002332f6a98dc74ab12b20 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Wed, 30 Oct 2024 11:05:18 +0530 Subject: [PATCH 01/27] Add ci for everest Signed-off-by: Mayank Shah --- .github/workflows/everest-lint-test.yaml | 61 ++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/everest-lint-test.yaml diff --git a/.github/workflows/everest-lint-test.yaml b/.github/workflows/everest-lint-test.yaml new file mode 100644 index 00000000..3c29785b --- /dev/null +++ b/.github/workflows/everest-lint-test.yaml @@ -0,0 +1,61 @@ +name: Everest Lint & Test +on: + pull_request: + paths: + - 'charts/everest/**' +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + sparse-checkout: | + charts/everest + + - name: Set up Helm + uses: azure/setup-helm@v4.2.0 + with: + version: v3.15.4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.9' + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --config .github/ct.yaml) + if [[ -n "$changed" ]]; then + echo "changed=true" >> $GITHUB_OUTPUT + fi + + # TODO: Add more tests + - name: Run chart-testing (lint) + run: ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --charts=everest --check-version-increment=false + + - name: Create kind cluster + uses: helm/kind-action@v1.10.0 + # Only build a kind cluster if there are chart changes to test. + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + run: | + ct install --config .github/ct.yaml --charts=everest --namespace=everest-system + + - name: Build chart package + run: | + changed=$(ct list-changed --config .github/ct.yaml) + [ $(echo -n "$changed" | grep -c '^') == 1 ] && helm package $changed || echo "skipping package" + + - name: Upload helm chart + uses: actions/upload-artifact@v4 + with: + path: ./*.tgz + retention-days: 30 + if-no-files-found: ignore + From 7686008d0b2b42f51f354210357b44c5fc279aaa Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Wed, 30 Oct 2024 19:18:04 +0530 Subject: [PATCH 02/27] Add PR checks for Everest chart Signed-off-by: Mayank Shah --- ...-lint-test.yaml => everest-pr-checks.yaml} | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) rename .github/workflows/{everest-lint-test.yaml => everest-pr-checks.yaml} (63%) diff --git a/.github/workflows/everest-lint-test.yaml b/.github/workflows/everest-pr-checks.yaml similarity index 63% rename from .github/workflows/everest-lint-test.yaml rename to .github/workflows/everest-pr-checks.yaml index 3c29785b..976b0a9f 100644 --- a/.github/workflows/everest-lint-test.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -1,4 +1,4 @@ -name: Everest Lint & Test +name: Everest PR checks on: pull_request: paths: @@ -33,16 +33,37 @@ jobs: if [[ -n "$changed" ]]; then echo "changed=true" >> $GITHUB_OUTPUT fi - - # TODO: Add more tests + + - name: Ensure version increment for common chart + run: | + if git diff --quiet origin/main -- charts/everest/charts/common/; then + ct lint --chart-dirs=charts/everest/charts --charts=common + else + fi + + - name: Ensure updated Chart.lock + run: | + helm dependency update charts/everest + helm dependency update charts/everest/charts/everest-db-namespace + if ! git diff --quiet; then + echo "Chart.lock is out-of-date" + exit 1 + else + echo "Chart.lock is up-to-date" + fi + + - name: Run chart-testing (lint) - run: ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --charts=everest --check-version-increment=false + run: | + ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --charts=everest --check-version-increment=false + ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts/everest/charts --check-version-increment=false - name: Create kind cluster uses: helm/kind-action@v1.10.0 # Only build a kind cluster if there are chart changes to test. if: steps.list-changed.outputs.changed == 'true' + # TODO: Add more tests - name: Run chart-testing (install) run: | ct install --config .github/ct.yaml --charts=everest --namespace=everest-system From 6a385bfd632d843c730eb45d1386f62258b8968a Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Wed, 30 Oct 2024 19:19:19 +0530 Subject: [PATCH 03/27] delete line Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index 976b0a9f..5272dd6f 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -52,7 +52,6 @@ jobs: echo "Chart.lock is up-to-date" fi - - name: Run chart-testing (lint) run: | ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --charts=everest --check-version-increment=false From 8bf477c384258c399c5117cf0904d39c55239c24 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 10:28:14 +0530 Subject: [PATCH 04/27] test Signed-off-by: Mayank Shah --- charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl b/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl index b0932c57..1fd7f564 100644 --- a/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl +++ b/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl @@ -1,4 +1,4 @@ -# +## test comment # @param .namespace The namespace where the operator is installed # {{- define "everest.csvCleanup" }} From 3a99ba20af06e57c4c03928053d2a1eafe749db5 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 10:31:18 +0530 Subject: [PATCH 05/27] update sparse checkout Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index 5272dd6f..cd80f1f2 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -12,6 +12,7 @@ jobs: with: fetch-depth: 0 sparse-checkout: | + .github/ charts/everest - name: Set up Helm From c19a0605211b47bd8e543ce7bb414603b15a5957 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 10:32:39 +0530 Subject: [PATCH 06/27] fix broken syntax Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index cd80f1f2..d00f8be0 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -39,7 +39,6 @@ jobs: run: | if git diff --quiet origin/main -- charts/everest/charts/common/; then ct lint --chart-dirs=charts/everest/charts --charts=common - else fi - name: Ensure updated Chart.lock From 4fdb1fed1c8b8834d8a083a137f1fbdb4f8108d9 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 10:41:28 +0530 Subject: [PATCH 07/27] fix check Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index d00f8be0..dcdcd666 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -37,7 +37,7 @@ jobs: - name: Ensure version increment for common chart run: | - if git diff --quiet origin/main -- charts/everest/charts/common/; then + if ! git diff --quiet origin/main -- charts/everest/charts/common/; then ct lint --chart-dirs=charts/everest/charts --charts=common fi From efb88e04f3ef65582f07dcc2f91d311bc3eba7ab Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 10:44:28 +0530 Subject: [PATCH 08/27] remove sparse checkout Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index dcdcd666..d1bcaec2 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -8,12 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - sparse-checkout: | - .github/ - charts/everest - name: Set up Helm uses: azure/setup-helm@v4.2.0 From bc3e951dd16380dbdfc113cd2522a10bdf964dcc Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:02:07 +0530 Subject: [PATCH 09/27] fix ci Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index d1bcaec2..54df538c 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -35,7 +35,7 @@ jobs: - name: Ensure version increment for common chart run: | if ! git diff --quiet origin/main -- charts/everest/charts/common/; then - ct lint --chart-dirs=charts/everest/charts --charts=common + ct lint --chart-dirs=charts/everest/charts --excluded-charts=everest-db-namespaces fi - name: Ensure updated Chart.lock @@ -51,7 +51,7 @@ jobs: - name: Run chart-testing (lint) run: | - ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --charts=everest --check-version-increment=false + ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --check-version-increment=false ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts/everest/charts --check-version-increment=false - name: Create kind cluster From e2d4170b266a1b0384c264923016413778924e0d Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:03:29 +0530 Subject: [PATCH 10/27] fix ci Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index 54df538c..46dc8eea 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -35,7 +35,7 @@ jobs: - name: Ensure version increment for common chart run: | if ! git diff --quiet origin/main -- charts/everest/charts/common/; then - ct lint --chart-dirs=charts/everest/charts --excluded-charts=everest-db-namespaces + ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts/everest/charts --excluded-charts=everest-db-namespaces fi - name: Ensure updated Chart.lock From f2c6156850b040a1208b613c050dec55ed34f8d0 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:04:44 +0530 Subject: [PATCH 11/27] undo change Signed-off-by: Mayank Shah --- charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl b/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl index 1fd7f564..b0932c57 100644 --- a/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl +++ b/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl @@ -1,4 +1,4 @@ -## test comment +# # @param .namespace The namespace where the operator is installed # {{- define "everest.csvCleanup" }} From 0ffeebce1f981519d52456882bfbca46d980ec4b Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:13:18 +0530 Subject: [PATCH 12/27] Update workflow Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index 46dc8eea..1721db14 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -32,13 +32,18 @@ jobs: echo "changed=true" >> $GITHUB_OUTPUT fi - - name: Ensure version increment for common chart + - name: Run chart-testing (lint) run: | - if ! git diff --quiet origin/main -- charts/everest/charts/common/; then - ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts/everest/charts --excluded-charts=everest-db-namespaces - fi + # Ensure common sub-chart is linted and has version increment + ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts/everest/charts --excluded-charts=everest-db-namespaces + + # Ensure main chart is linted, skip version increment check + ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --check-version-increment=false + + # Ensure all sub-charts are linted, skip version increment check + ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts/everest/charts --check-version-increment=false - - name: Ensure updated Chart.lock + - name: Check Chart.lock run: | helm dependency update charts/everest helm dependency update charts/everest/charts/everest-db-namespace @@ -49,11 +54,6 @@ jobs: echo "Chart.lock is up-to-date" fi - - name: Run chart-testing (lint) - run: | - ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --check-version-increment=false - ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts/everest/charts --check-version-increment=false - - name: Create kind cluster uses: helm/kind-action@v1.10.0 # Only build a kind cluster if there are chart changes to test. From 98715a2b5f3ec68ddaa9b0109266ce171e69f65e Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:13:38 +0530 Subject: [PATCH 13/27] dummy change Signed-off-by: Mayank Shah --- charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl b/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl index b0932c57..2ca20c1b 100644 --- a/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl +++ b/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl @@ -1,3 +1,4 @@ +### # # @param .namespace The namespace where the operator is installed # From 7534c61c7ed25ab24b9839b58c34eb49d324bfaf Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:14:42 +0530 Subject: [PATCH 14/27] test bump version Signed-off-by: Mayank Shah --- charts/everest/charts/common/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/everest/charts/common/Chart.yaml b/charts/everest/charts/common/Chart.yaml index fd7c6274..61d33246 100644 --- a/charts/everest/charts/common/Chart.yaml +++ b/charts/everest/charts/common/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: common description: A library chart for Everest containing common resources. type: library -version: 0.0.1 -appVersion: "0.0.1" +version: 0.0.2 +appVersion: "0.0.2" From 4301da3aa7dc10cdec9d0abff2dec095b139dc8b Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:24:11 +0530 Subject: [PATCH 15/27] added maintainers Signed-off-by: Mayank Shah --- charts/everest/charts/common/Chart.yaml | 9 +++++++++ charts/everest/charts/everest-db-namespace/Chart.yaml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/charts/everest/charts/common/Chart.yaml b/charts/everest/charts/common/Chart.yaml index 61d33246..34b1a033 100644 --- a/charts/everest/charts/common/Chart.yaml +++ b/charts/everest/charts/common/Chart.yaml @@ -4,3 +4,12 @@ description: A library chart for Everest containing common resources. type: library version: 0.0.2 appVersion: "0.0.2" +maintainers: + - name: mayankshah1607 + email: mayank.shah@percona.com + - name: oksana-grishchenko + email: oksana.grishchenko@percona.com + - name: recharte + email: diogo.recharte@percona.com + - name: michal-kralik + email: michal.kralik@percona.com diff --git a/charts/everest/charts/everest-db-namespace/Chart.yaml b/charts/everest/charts/everest-db-namespace/Chart.yaml index 143a75e3..09268c5c 100644 --- a/charts/everest/charts/everest-db-namespace/Chart.yaml +++ b/charts/everest/charts/everest-db-namespace/Chart.yaml @@ -8,3 +8,12 @@ dependencies: - name: common version: 0.0.1 repository: "file://../common" +maintainers: + - name: mayankshah1607 + email: mayank.shah@percona.com + - name: oksana-grishchenko + email: oksana.grishchenko@percona.com + - name: recharte + email: diogo.recharte@percona.com + - name: michal-kralik + email: michal.kralik@percona.com From 54a6b4899907f4d0f7e526c714e5998f06a4e4b2 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:26:26 +0530 Subject: [PATCH 16/27] fix deps Signed-off-by: Mayank Shah --- charts/everest/Chart.yaml | 2 +- charts/everest/charts/everest-db-namespace/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index 8ab00d99..f0b8a3fe 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -16,7 +16,7 @@ maintainers: email: michal.kralik@percona.com dependencies: - name: common - version: 0.0.1 + version: 0.0.* repository: "file://charts/common" # This is not really a dependency, but we define it as one so that we're # able to conditionally disable rendering these manifests along with the core chart manifests. diff --git a/charts/everest/charts/everest-db-namespace/Chart.yaml b/charts/everest/charts/everest-db-namespace/Chart.yaml index 09268c5c..3a3285c0 100644 --- a/charts/everest/charts/everest-db-namespace/Chart.yaml +++ b/charts/everest/charts/everest-db-namespace/Chart.yaml @@ -6,7 +6,7 @@ version: 0.0.0 appVersion: 0.0.0 dependencies: - name: common - version: 0.0.1 + version: 0.0.* repository: "file://../common" maintainers: - name: mayankshah1607 From a65ea2a488960c310d5f2b21ed6741867c15f1d0 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:30:47 +0530 Subject: [PATCH 17/27] update linter Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index 1721db14..62e53bc0 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -35,7 +35,7 @@ jobs: - name: Run chart-testing (lint) run: | # Ensure common sub-chart is linted and has version increment - ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts/everest/charts --excluded-charts=everest-db-namespaces + ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts/everest/charts --excluded-charts=everest-db-namespace # Ensure main chart is linted, skip version increment check ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --check-version-increment=false @@ -43,17 +43,6 @@ jobs: # Ensure all sub-charts are linted, skip version increment check ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts/everest/charts --check-version-increment=false - - name: Check Chart.lock - run: | - helm dependency update charts/everest - helm dependency update charts/everest/charts/everest-db-namespace - if ! git diff --quiet; then - echo "Chart.lock is out-of-date" - exit 1 - else - echo "Chart.lock is up-to-date" - fi - - name: Create kind cluster uses: helm/kind-action@v1.10.0 # Only build a kind cluster if there are chart changes to test. From 532c13c8b120e50177f82a126a985af96433e2a8 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:31:57 +0530 Subject: [PATCH 18/27] revert changes Signed-off-by: Mayank Shah --- charts/everest/charts/common/Chart.yaml | 4 ++-- charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/charts/everest/charts/common/Chart.yaml b/charts/everest/charts/common/Chart.yaml index 34b1a033..7a8a1954 100644 --- a/charts/everest/charts/common/Chart.yaml +++ b/charts/everest/charts/common/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: common description: A library chart for Everest containing common resources. type: library -version: 0.0.2 -appVersion: "0.0.2" +version: 0.0.1 +appVersion: "0.0.1" maintainers: - name: mayankshah1607 email: mayank.shah@percona.com diff --git a/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl b/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl index 2ca20c1b..b0932c57 100644 --- a/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl +++ b/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl @@ -1,4 +1,3 @@ -### # # @param .namespace The namespace where the operator is installed # From fb79f6831b9a495f72a240dd7b78ea86712e57f2 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:33:41 +0530 Subject: [PATCH 19/27] bump version Signed-off-by: Mayank Shah --- charts/everest/charts/common/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/everest/charts/common/Chart.yaml b/charts/everest/charts/common/Chart.yaml index 7a8a1954..34b1a033 100644 --- a/charts/everest/charts/common/Chart.yaml +++ b/charts/everest/charts/common/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: common description: A library chart for Everest containing common resources. type: library -version: 0.0.1 -appVersion: "0.0.1" +version: 0.0.2 +appVersion: "0.0.2" maintainers: - name: mayankshah1607 email: mayank.shah@percona.com From 8787ff1c79b2d614ba5db6104b706054f58c63e9 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:35:54 +0530 Subject: [PATCH 20/27] update deps Signed-off-by: Mayank Shah --- charts/everest/Chart.lock | 6 +++--- charts/everest/charts/everest-db-namespace/Chart.lock | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/everest/Chart.lock b/charts/everest/Chart.lock index a0a0101d..fed704e9 100644 --- a/charts/everest/Chart.lock +++ b/charts/everest/Chart.lock @@ -1,9 +1,9 @@ dependencies: - name: common repository: file://charts/common - version: 0.0.1 + version: 0.0.2 - name: everest-db-namespace repository: file://charts/everest-db-namespace version: 0.0.0 -digest: sha256:c41bc5832c4bf3829a3ceabb7b3fcd2461035cc66986aa0acea8e7b366a6e036 -generated: "2024-10-21T20:53:46.621274+05:30" +digest: sha256:c640ee1595ced2f8d4024f9f37b38d6ca685bc4edba9d451f9bcd56edc22ee23 +generated: "2024-10-31T11:35:48.801214+05:30" diff --git a/charts/everest/charts/everest-db-namespace/Chart.lock b/charts/everest/charts/everest-db-namespace/Chart.lock index 6804aa43..eb50b79f 100644 --- a/charts/everest/charts/everest-db-namespace/Chart.lock +++ b/charts/everest/charts/everest-db-namespace/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: common repository: file://../common - version: 0.0.1 -digest: sha256:a25c79b74ec6d89ca5c732e4222f8726ed02aa6a4a21f376afc499e53696c9b5 -generated: "2024-10-05T15:02:38.315401+05:30" + version: 0.0.2 +digest: sha256:e26bbcf7da416e9ea599f57a116c90e4a8b38bb7293945ef17a4f5243043cd99 +generated: "2024-10-31T11:35:45.12716+05:30" From ab9bb237350b4c5a7dc3b49ff4618f7f471a2e1a Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:44:27 +0530 Subject: [PATCH 21/27] fix cmd Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index 62e53bc0..14abbafe 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -51,7 +51,7 @@ jobs: # TODO: Add more tests - name: Run chart-testing (install) run: | - ct install --config .github/ct.yaml --charts=everest --namespace=everest-system + ct install --config .github/ct.yaml --charts=./charts/everest --namespace=everest-system - name: Build chart package run: | From d9a7d6d75d2a3b229411e51c326538a9cd4d434a Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:49:45 +0530 Subject: [PATCH 22/27] setup kubectl Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index 14abbafe..56f85b9a 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -17,9 +17,7 @@ jobs: with: version: v3.15.4 - - uses: actions/setup-python@v5 - with: - python-version: '3.9' + - uses: actions/setup-kubectl@v4 - name: Set up chart-testing uses: helm/chart-testing-action@v2.6.1 From 9cee1f6e54a9eee2d1f02bbb473eff621843a6d7 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:50:13 +0530 Subject: [PATCH 23/27] ensure create namespace Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index 56f85b9a..3034648b 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -49,6 +49,7 @@ jobs: # TODO: Add more tests - name: Run chart-testing (install) run: | + kubectl create namespace everest-system ct install --config .github/ct.yaml --charts=./charts/everest --namespace=everest-system - name: Build chart package From c1c86a7845c17890b3054ad184c25a27c2bb543b Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:51:47 +0530 Subject: [PATCH 24/27] fix action Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index 3034648b..57c7d7a4 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -17,7 +17,7 @@ jobs: with: version: v3.15.4 - - uses: actions/setup-kubectl@v4 + - uses: azure/setup-kubectl@v4 - name: Set up chart-testing uses: helm/chart-testing-action@v2.6.1 From 7e3481834ffdfc674c100a0b78ac1c119f484643 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 11:55:47 +0530 Subject: [PATCH 25/27] install everest ns Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index 57c7d7a4..b12ea544 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -52,6 +52,9 @@ jobs: kubectl create namespace everest-system ct install --config .github/ct.yaml --charts=./charts/everest --namespace=everest-system + kubectl create namespace everest + ct install --config .github/ct.yaml --charts=./charts/everest/charts/everest-db-namespace --namespace=everest + - name: Build chart package run: | changed=$(ct list-changed --config .github/ct.yaml) From 1c5fc54429c8c322eff9980b1cd7b8b9bea9d9a3 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 12:08:58 +0530 Subject: [PATCH 26/27] add label Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index b12ea544..d77c850f 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -53,6 +53,7 @@ jobs: ct install --config .github/ct.yaml --charts=./charts/everest --namespace=everest-system kubectl create namespace everest + kubectl label namespace everest app.kubernetes.io/managed-by=everest ct install --config .github/ct.yaml --charts=./charts/everest/charts/everest-db-namespace --namespace=everest - name: Build chart package From 049329c586c0710b0609e2baae36f62fcd2fb2c3 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 31 Oct 2024 13:19:01 +0530 Subject: [PATCH 27/27] improve tests Signed-off-by: Mayank Shah --- .github/workflows/everest-pr-checks.yaml | 44 ++++++++++++++++++++---- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml index d77c850f..1b4792bc 100644 --- a/.github/workflows/everest-pr-checks.yaml +++ b/.github/workflows/everest-pr-checks.yaml @@ -46,15 +46,45 @@ jobs: # Only build a kind cluster if there are chart changes to test. if: steps.list-changed.outputs.changed == 'true' - # TODO: Add more tests - - name: Run chart-testing (install) + - name: Basic tests run: | - kubectl create namespace everest-system - ct install --config .github/ct.yaml --charts=./charts/everest --namespace=everest-system + # Install the chart + helm install everest-core ./charts/everest --create-namespace --namespace everest-system - kubectl create namespace everest - kubectl label namespace everest app.kubernetes.io/managed-by=everest - ct install --config .github/ct.yaml --charts=./charts/everest/charts/everest-db-namespace --namespace=everest + # Wait for system components + kubectl wait --for=condition=available --timeout=60s deployment/percona-everest -n everest-system + kubectl wait --for=condition=available --timeout=60s deployment/everest-operator -n everest-system + + # Provision DB namespace + kubectl create ns everest + kubectl label ns everest app.kubernetes.io/managed-by=everest + helm install everest ./charts/everest/charts/everest-db-namespace --namespace everest + + # Ensure operators are installed + subs=$(kubectl -n everest get subscription -o jsonpath='{.items[*].metadata.name}') + for sub in $subs + do + echo "Waiting for InstallPlan to be created for Subscription $sub" + kubectl wait --for=jsonpath='.status.installplan.name' sub/$sub -n everest --timeout=600s + + ip=$(kubectl -n everest get sub $sub -o jsonpath='{.status.installplan.name}') + echo "InstallPlan $ip created for Subscription $sub" + + echo "Waiting for InstallPlan to be complete $ip" + kubectl wait --for=jsonpath='.status.phase'=Complete installplan/$ip -n everest --timeout=600s + + csv=$(kubectl get sub $sub -n everest -o jsonpath='{.status.installedCSV}') + echo "Waiting for CSV $csv to succeed" + kubectl wait --for=jsonpath='.status.phase'=Succeeded csv/$csv -n everest --timeout=600s + done + + # Uninstall + helm uninstall everest -n everest + kubectl delete ns everest + kubectl wait --for=delete namespace/everest --timeout=120s + helm uninstall everest-core -n everest-system + kubectl delete ns everest-system + kubectl wait --for=delete namespace/everest-system --timeout=120s - name: Build chart package run: |