diff --git a/.github/workflows/everest-pr-checks.yaml b/.github/workflows/everest-pr-checks.yaml new file mode 100644 index 00000000..1b4792bc --- /dev/null +++ b/.github/workflows/everest-pr-checks.yaml @@ -0,0 +1,100 @@ +name: Everest PR checks +on: + pull_request: + paths: + - 'charts/everest/**' +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v4.2.0 + with: + version: v3.15.4 + + - uses: azure/setup-kubectl@v4 + + - 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 + + - 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-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 + + # 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: 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: Basic tests + run: | + # Install the chart + helm install everest-core ./charts/everest --create-namespace --namespace everest-system + + # 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: | + 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 + 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/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/common/Chart.yaml b/charts/everest/charts/common/Chart.yaml index fd7c6274..34b1a033 100644 --- a/charts/everest/charts/common/Chart.yaml +++ b/charts/everest/charts/common/Chart.yaml @@ -2,5 +2,14 @@ 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 + - 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.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" diff --git a/charts/everest/charts/everest-db-namespace/Chart.yaml b/charts/everest/charts/everest-db-namespace/Chart.yaml index 143a75e3..3a3285c0 100644 --- a/charts/everest/charts/everest-db-namespace/Chart.yaml +++ b/charts/everest/charts/everest-db-namespace/Chart.yaml @@ -6,5 +6,14 @@ version: 0.0.0 appVersion: 0.0.0 dependencies: - name: common - version: 0.0.1 + version: 0.0.* 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