From 0c99f4b5b378c53bea1382bd972882998df543d1 Mon Sep 17 00:00:00 2001 From: mrproliu <741550557@qq.com> Date: Wed, 3 Jul 2024 22:24:30 +0800 Subject: [PATCH] Adding `setup.kind.no-wait` configuration --- CHANGES.md | 4 ++++ docs/en/setup/Configuration-File.md | 1 + internal/components/setup/kind.go | 4 +++- internal/config/e2eConfig.go | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index ef8ca61..fd201cd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,10 @@ Release Notes. 1.4.0 ------------------ +#### Features + +* Adding `setup.kind.no-wait` to support should wait for the kind cluster to be ready or not. + #### Bug Fixes * Fix kind load docker-image error diff --git a/docs/en/setup/Configuration-File.md b/docs/en/setup/Configuration-File.md index d6e833c..d171214 100644 --- a/docs/en/setup/Configuration-File.md +++ b/docs/en/setup/Configuration-File.md @@ -39,6 +39,7 @@ setup: label-selector: # The resource label selector for: # The wait condition kind: + no-wait: false # Should wait the kind cluster resource ready, default is false, means wait for the cluster to be ready, otherwise it would not wait. import-images: # import docker images to KinD - image:version # support using env to expand image, such as `${env_key}` or `$env_key` expose-ports: # Expose resource for host access diff --git a/internal/components/setup/kind.go b/internal/components/setup/kind.go index a344fe0..137c966 100644 --- a/internal/components/setup/kind.go +++ b/internal/components/setup/kind.go @@ -285,7 +285,9 @@ func createKindCluster(kindConfigPath string, e2eConfig *config.E2EConfig) error "create", "cluster", "--config", kindConfigPath, "--kubeconfig", kubeConfigPath, - "--wait", e2eConfig.Setup.GetTimeout().String(), + } + if !e2eConfig.Setup.Kind.NoWait { + args = append(args, "--wait", e2eConfig.Setup.GetTimeout().String()) } logger.Log.Info("creating kind cluster...") diff --git a/internal/config/e2eConfig.go b/internal/config/e2eConfig.go index 18a3352..34271bf 100644 --- a/internal/config/e2eConfig.go +++ b/internal/config/e2eConfig.go @@ -78,6 +78,7 @@ type Step struct { type KindSetup struct { ImportImages []string `yaml:"import-images"` ExposePorts []KindExposePort `yaml:"expose-ports"` + NoWait bool `yaml:"no-wait"` } type KindExposePort struct {