From 9b0c44162a728656676f36fed13f6257e100a69b Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Tue, 22 Sep 2020 08:23:01 +0300 Subject: [PATCH] Validate bootstrap required components --- cmd/gotk/bootstrap.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/gotk/bootstrap.go b/cmd/gotk/bootstrap.go index cea44e90..b0c8b0b8 100644 --- a/cmd/gotk/bootstrap.go +++ b/cmd/gotk/bootstrap.go @@ -53,6 +53,7 @@ var ( bootstrapBranch string bootstrapWatchAllNamespaces bool bootstrapLogLevel string + bootstrapRequiredComponents = []string{"source-controller", "kustomize-controller"} ) const ( @@ -90,6 +91,12 @@ func bootstrapValidate() error { return fmt.Errorf("log level %s is not supported, can be %v", bootstrapLogLevel, supportedLogLevels) } + for _, component := range bootstrapRequiredComponents { + if !utils.containsItemString(bootstrapComponents, component) { + return fmt.Errorf("component %s is required", component) + } + } + return nil }