All 4 scenario scripts (karmada-CLI-installtion-example, karmada-Failover-example, karmada-HA-workload-example1, karmada-HA-workload-example2) contain identical code for:
Common variable definitions (kind_version, IPs, paths)
Common functions (installKind(), createCluster(), cluster1Config(), cluster2Config(), copyConfigFilesToNode())
Common infrastructure setup steps
This resulted in ~300+ lines of duplicated code across 4 files, making maintenance difficult .
Solution
Extracted all common setup code into a single common-setup.sh file that all scenarios source and reuse.
part of karmada-io/karmada#7269
All 4 scenario scripts (
karmada-CLI-installtion-example,karmada-Failover-example,karmada-HA-workload-example1,karmada-HA-workload-example2) contain identical code for:Common variable definitions (kind_version, IPs, paths)
Common functions (
installKind(),createCluster(),cluster1Config(),cluster2Config(),copyConfigFilesToNode())Common infrastructure setup steps
This resulted in ~300+ lines of duplicated code across 4 files, making maintenance difficult .
Solution
Extracted all common setup code into a single common-setup.sh file that all scenarios source and reuse.
part of karmada-io/karmada#7269