Repository navigation
ci(testing): modularise cluster management scripts - #9281
Conversation
|
❗ By default, the pull request is configured to backport to all release branches.
|
524eb5e to
e16de22
Compare
e16de22 to
4847be5
Compare
281ffa5 to
5c58448
Compare
|
/test |
|
@gbartolini, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/20993664342 |
b1215b5 to
5f59527
Compare
|
/test |
|
@gbartolini, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/21013728703 |
5f59527 to
1d82595
Compare
|
E2E tests are failing, and I cannot figure out why. The first time I had to add the executable permissions to some kind specific scripts - as it was failing also locally. But now it works locally and I cannot find where the script fails. Will keep investigating, but would not mind a new fresh pair of eyes. |
b8f4360 to
9220633
Compare
|
/test |
|
@gbartolini, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/21031193503 |
9220633 to
f451765
Compare
|
/test |
|
@gbartolini, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/21032432063 |
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
Co-authored-by: danishedb <[email protected]> Signed-off-by: Gabriele Bartolini <[email protected]>
Thanks @danishedb Co-authored-by: danishedb <[email protected]> Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
…sages Signed-off-by: Niccolò Fei <[email protected]>
Signed-off-by: Niccolò Fei <[email protected]>
Adds multiple improvements to the testing cluster setup scripts: - Add validation for extracted image variables (POSTGRES_IMG, PGBOUNCER_IMG, MINIO_IMG) to fail fast if extraction from source files fails - Fix registry state check to properly verify container is running, not just whether inspect command succeeds - Add URL validation for DOCKER_REGISTRY_MIRROR to prevent potential TOML injection vulnerabilities - Add validate_required_tools function to check for required tools (kind, docker, kubectl, helm) before setup begins - Replace word-splitting prone 'for node in $(kind get nodes)' loops with safer 'while read' pattern to handle edge cases These changes improve error messages, security, and robustness of the testing infrastructure. Signed-off-by: Marco Nenciarini <[email protected]>
Move ensure_registry call from low-level function and wrapper to the central dispatcher for a single check per command. Before: registry checked twice (wrapper + build function) After: registry checked once (dispatcher only) This minimal change consolidates registry setup in manage.sh before dispatching to action handlers. Signed-off-by: Marco Nenciarini <[email protected]>
The registry container always listens on port 5000 internally. When Kind nodes access the registry via docker network (registry.dev), they connect to the internal port, not the host-exposed port (registry_port variable). This partially reverts commit d0fe950 which changed hardcoded :5000 to use ${registry_port} variable. That change was incorrect for Kind node access via docker network, though it was correct for the intent to make the host port configurable. Signed-off-by: Marco Nenciarini <[email protected]>
Distinguish between non-existent container (create with 'docker run') and stopped container (start with 'docker start') to avoid name conflict errors when registry is manually stopped. Signed-off-by: Marco Nenciarini <[email protected]>
caa37eb to
65af2b5
Compare
Refactors the monolithic `hack/setup-cluster.sh` script into a modular framework with clear separation between reusable utilities and vendor-specific provisioning logic. The new structure introduces `hack/testing-tools/k8s-engines/` for infrastructure-specific implementations and `hack/testing-tools/common/` for shared utilities. A central `manage.sh` dispatcher acts as the single entry point, replacing the command-handling logic of the original script by delegating actions (`create`, `teardown`, `load`, etc.) based on the `CLUSTER_ENGINE` variable. The kind implementation moves cluster lifecycle operations into dedicated scripts (`kind/setup.sh` and `kind/teardown.sh`) alongside add-on deployments for CSI driver and FluentD. All version constants and configuration are consolidated into `common/10-config.sh`. Each vendor directory must provide three required scripts: `setup.sh` for cluster creation, `teardown.sh` for destruction, and `export-logs.sh` for debugging. Optional scripts (`load.sh` and `load-helper-images.sh`) can provide vendor-specific optimizations with fallbacks to common implementations. The original `hack/setup-cluster.sh` becomes a backward compatibility wrapper ensuring existing CI jobs and user workflows continue functioning without changes. It preserves user-specified `CLUSTER_NAME` values while supporting the same command-line interface. Wait loops ensure CSI and FluentD deployments reach ready state before proceeding. Conditional deployment flags (`ENABLE_CSI_DRIVER`, `ENABLE_FLUENTD`) allow selective feature enablement. Error handling properly exits on missing required vendor scripts rather than silently continuing. This refactoring significantly improves maintainability and makes it straightforward to add support for additional Kubernetes distributions beyond kind. Related to #9220 --------- Signed-off-by: Gabriele Bartolini <[email protected]> Signed-off-by: Marco Nenciarini <[email protected]> Signed-off-by: Niccolò Fei <[email protected]> Co-authored-by: Marco Nenciarini <[email protected]> Co-authored-by: danishedb <[email protected]> Co-authored-by: Niccolò Fei <[email protected]> (cherry picked from commit 381b8fb)
Refactors the monolithic `hack/setup-cluster.sh` script into a modular framework with clear separation between reusable utilities and vendor-specific provisioning logic. The new structure introduces `hack/testing-tools/k8s-engines/` for infrastructure-specific implementations and `hack/testing-tools/common/` for shared utilities. A central `manage.sh` dispatcher acts as the single entry point, replacing the command-handling logic of the original script by delegating actions (`create`, `teardown`, `load`, etc.) based on the `CLUSTER_ENGINE` variable. The kind implementation moves cluster lifecycle operations into dedicated scripts (`kind/setup.sh` and `kind/teardown.sh`) alongside add-on deployments for CSI driver and FluentD. All version constants and configuration are consolidated into `common/10-config.sh`. Each vendor directory must provide three required scripts: `setup.sh` for cluster creation, `teardown.sh` for destruction, and `export-logs.sh` for debugging. Optional scripts (`load.sh` and `load-helper-images.sh`) can provide vendor-specific optimizations with fallbacks to common implementations. The original `hack/setup-cluster.sh` becomes a backward compatibility wrapper ensuring existing CI jobs and user workflows continue functioning without changes. It preserves user-specified `CLUSTER_NAME` values while supporting the same command-line interface. Wait loops ensure CSI and FluentD deployments reach ready state before proceeding. Conditional deployment flags (`ENABLE_CSI_DRIVER`, `ENABLE_FLUENTD`) allow selective feature enablement. Error handling properly exits on missing required vendor scripts rather than silently continuing. This refactoring significantly improves maintainability and makes it straightforward to add support for additional Kubernetes distributions beyond kind. Related to #9220 --------- Signed-off-by: Gabriele Bartolini <[email protected]> Signed-off-by: Marco Nenciarini <[email protected]> Signed-off-by: Niccolò Fei <[email protected]> Co-authored-by: Marco Nenciarini <[email protected]> Co-authored-by: danishedb <[email protected]> Co-authored-by: Niccolò Fei <[email protected]> (cherry picked from commit 381b8fb)
Refactors the monolithic `hack/setup-cluster.sh` script into a modular framework with clear separation between reusable utilities and vendor-specific provisioning logic. The new structure introduces `hack/testing-tools/k8s-engines/` for infrastructure-specific implementations and `hack/testing-tools/common/` for shared utilities. A central `manage.sh` dispatcher acts as the single entry point, replacing the command-handling logic of the original script by delegating actions (`create`, `teardown`, `load`, etc.) based on the `CLUSTER_ENGINE` variable. The kind implementation moves cluster lifecycle operations into dedicated scripts (`kind/setup.sh` and `kind/teardown.sh`) alongside add-on deployments for CSI driver and FluentD. All version constants and configuration are consolidated into `common/10-config.sh`. Each vendor directory must provide three required scripts: `setup.sh` for cluster creation, `teardown.sh` for destruction, and `export-logs.sh` for debugging. Optional scripts (`load.sh` and `load-helper-images.sh`) can provide vendor-specific optimizations with fallbacks to common implementations. The original `hack/setup-cluster.sh` becomes a backward compatibility wrapper ensuring existing CI jobs and user workflows continue functioning without changes. It preserves user-specified `CLUSTER_NAME` values while supporting the same command-line interface. Wait loops ensure CSI and FluentD deployments reach ready state before proceeding. Conditional deployment flags (`ENABLE_CSI_DRIVER`, `ENABLE_FLUENTD`) allow selective feature enablement. Error handling properly exits on missing required vendor scripts rather than silently continuing. This refactoring significantly improves maintainability and makes it straightforward to add support for additional Kubernetes distributions beyond kind. Related to #9220 --------- Signed-off-by: Gabriele Bartolini <[email protected]> Signed-off-by: Marco Nenciarini <[email protected]> Signed-off-by: Niccolò Fei <[email protected]> Co-authored-by: Marco Nenciarini <[email protected]> Co-authored-by: danishedb <[email protected]> Co-authored-by: Niccolò Fei <[email protected]> (cherry picked from commit 381b8fb)
Refactors the monolithic
hack/setup-cluster.shscript into a modular framework with clear separation between reusable utilities and vendor-specific provisioning logic.The new structure introduces
hack/testing-tools/k8s-engines/for infrastructure-specific implementations andhack/testing-tools/common/for shared utilities. A centralmanage.shdispatcher acts as the single entry point, replacing the command-handling logic of the original script by delegating actions (create,teardown,load, etc.) based on theCLUSTER_ENGINEvariable.The kind implementation moves cluster lifecycle operations into dedicated scripts (
kind/setup.shandkind/teardown.sh) alongside add-on deployments for CSI driver and FluentD. All version constants and configuration are consolidated intocommon/10-config.sh.Each vendor directory must provide three required scripts:
setup.shfor cluster creation,teardown.shfor destruction, andexport-logs.shfor debugging. Optional scripts (load.shandload-helper-images.sh) can provide vendor-specific optimizations with fallbacks to common implementations.The original
hack/setup-cluster.shbecomes a backward compatibility wrapper ensuring existing CI jobs and user workflows continue functioning without changes. It preserves user-specifiedCLUSTER_NAMEvalues while supporting the same command-line interface.Wait loops ensure CSI and FluentD deployments reach ready state before proceeding. Conditional deployment flags (
ENABLE_CSI_DRIVER,ENABLE_FLUENTD) allow selective feature enablement. Error handling properly exits on missing required vendor scripts rather than silently continuing.This refactoring significantly improves maintainability and makes it straightforward to add support for additional Kubernetes distributions beyond kind.
Related to #9220