From 9462600a471d82f1e4c783ccdda4580c386f9e82 Mon Sep 17 00:00:00 2001 From: Ken Sipe Date: Thu, 5 Nov 2020 13:41:49 -0600 Subject: [PATCH 1/9] adding critic Signed-off-by: Ken Sipe --- .golangci.yml | 1 + pkg/kudoctl/packages/writer/writer_tar.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 93aad452d..abd841714 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,6 +5,7 @@ linters: - dupl - errcheck - goconst + - gocritic - gocyclo - gofmt - goimports diff --git a/pkg/kudoctl/packages/writer/writer_tar.go b/pkg/kudoctl/packages/writer/writer_tar.go index 0174f60e5..d412258eb 100644 --- a/pkg/kudoctl/packages/writer/writer_tar.go +++ b/pkg/kudoctl/packages/writer/writer_tar.go @@ -75,7 +75,7 @@ func TgzDir(fs afero.Fs, path string, w io.Writer) (err error) { } // update the name to correctly reflect the desired destination when untaring - header.Name = strings.TrimPrefix(strings.Replace(file, path, "", -1), string(filepath.Separator)) + header.Name = strings.TrimPrefix(strings.ReplaceAll(file, path, ""), string(filepath.Separator)) // change certain header metadata to make the build reproducible header.ModTime = time.Time{} From a9e11491f4c894f038ae21400311e608245fb3b7 Mon Sep 17 00:00:00 2001 From: Ken Sipe Date: Thu, 5 Nov 2020 13:59:33 -0600 Subject: [PATCH 2/9] remove if-else chain. there is more to change about this function Signed-off-by: Ken Sipe --- pkg/kudoctl/cmd/params/parser.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/kudoctl/cmd/params/parser.go b/pkg/kudoctl/cmd/params/parser.go index a93d25802..1d6dffd91 100644 --- a/pkg/kudoctl/cmd/params/parser.go +++ b/pkg/kudoctl/cmd/params/parser.go @@ -121,11 +121,12 @@ func parseParameter(raw string) (key string, param string, err *string) { var errMsg string s := strings.SplitN(raw, "=", 2) - if len(s) < 2 { + switch { + case len(s) < 2: errMsg = fmt.Sprintf("parameter not set: %+v", raw) - } else if s[0] == "" { + case s[0] == "": errMsg = fmt.Sprintf("parameter name can not be empty: %+v", raw) - } else if s[1] == "" { + case s[1] == "": errMsg = fmt.Sprintf("parameter value can not be empty: %+v", raw) } if errMsg != "" { From bbf31da3d00acc357d14df7d425fbca6234515a3 Mon Sep 17 00:00:00 2001 From: Ken Sipe Date: Thu, 5 Nov 2020 13:59:57 -0600 Subject: [PATCH 3/9] ignore this critique, it is correct Signed-off-by: Ken Sipe --- .../packages/verifier/template/verify_extended_parameters.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kudoctl/packages/verifier/template/verify_extended_parameters.go b/pkg/kudoctl/packages/verifier/template/verify_extended_parameters.go index 2ae64f1df..22a9370d0 100644 --- a/pkg/kudoctl/packages/verifier/template/verify_extended_parameters.go +++ b/pkg/kudoctl/packages/verifier/template/verify_extended_parameters.go @@ -182,7 +182,7 @@ func validDescription(description string) (bool, string) { return false, "has no description" } lastChar := description[len(description)-1:] - if !strings.Contains(".!?)", lastChar) { + if !strings.Contains(".!?)", lastChar) { //nolint:gocritic return false, "has a description not ending with one of '.!?)'" } if !IsUpper(description[0:1]) { From 1ce295b8bfde3d9961fc569ea11e7ec0c23b13f7 Mon Sep 17 00:00:00 2001 From: Ken Sipe Date: Thu, 5 Nov 2020 14:01:49 -0600 Subject: [PATCH 4/9] adding tech debate todo Signed-off-by: Ken Sipe --- pkg/kudoctl/cmd/params/parser.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/kudoctl/cmd/params/parser.go b/pkg/kudoctl/cmd/params/parser.go index 1d6dffd91..ad5caf677 100644 --- a/pkg/kudoctl/cmd/params/parser.go +++ b/pkg/kudoctl/cmd/params/parser.go @@ -119,6 +119,7 @@ func mergeParams(paramsFromCmdline map[string]string, paramsFromFiles map[string // detailed error message. func parseParameter(raw string) (key string, param string, err *string) { + //TODO (kensipe): this function and calling code should be refactored to NOT use `err` for strings. var errMsg string s := strings.SplitN(raw, "=", 2) switch { From 8bbdff387f38bf9cf1e6b449454dab2a22bb3cda Mon Sep 17 00:00:00 2001 From: Ken Sipe Date: Thu, 5 Nov 2020 14:02:58 -0600 Subject: [PATCH 5/9] remove comment code that violated critic comment standard Signed-off-by: Ken Sipe --- pkg/kudoctl/cmd/params/parser.go | 2 +- pkg/util/kudo/versions_test.go | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/kudoctl/cmd/params/parser.go b/pkg/kudoctl/cmd/params/parser.go index ad5caf677..0b05b9baa 100644 --- a/pkg/kudoctl/cmd/params/parser.go +++ b/pkg/kudoctl/cmd/params/parser.go @@ -119,7 +119,7 @@ func mergeParams(paramsFromCmdline map[string]string, paramsFromFiles map[string // detailed error message. func parseParameter(raw string) (key string, param string, err *string) { - //TODO (kensipe): this function and calling code should be refactored to NOT use `err` for strings. + //TODO (kensipe): this function and calling code should be refactored to NOT use `err` for strings. var errMsg string s := strings.SplitN(raw, "=", 2) switch { diff --git a/pkg/util/kudo/versions_test.go b/pkg/util/kudo/versions_test.go index 5d925e680..3be8feadd 100644 --- a/pkg/util/kudo/versions_test.go +++ b/pkg/util/kudo/versions_test.go @@ -77,9 +77,6 @@ func TestVersions(t *testing.T) { } l.Sort() - //for _, i := range l { - // fmt.Printf("sortableOp{name: %q, appVersion: %q, ovVersion: %q},\n", i.OperatorName(), i.AppVersion(), i.OperatorVersion()) - //} assert.Equal(t, l, sortedList) From f7525964e841be6a4d3b3e83a8d7044db48cd4bd Mon Sep 17 00:00:00 2001 From: Ken Sipe Date: Thu, 5 Nov 2020 14:15:54 -0600 Subject: [PATCH 6/9] fixing comments without spaces Signed-off-by: Ken Sipe --- cmd/manager/main.go | 2 +- pkg/apis/kudo/v1beta1/instance_types.go | 36 +++++++++++----------- pkg/engine/task/podexec/pod_exec.go | 2 +- pkg/engine/task/task.go | 2 +- pkg/engine/workflow/engine.go | 4 +-- pkg/kudoctl/clog/log.go | 4 +-- pkg/kudoctl/clog/log_test.go | 4 +-- pkg/kudoctl/cmd/params/parser.go | 2 +- pkg/kudoctl/cmd/plan.go | 2 +- pkg/kudoctl/cmd/prompt/operator.go | 2 +- pkg/kudoctl/cmd/test.go | 6 ++-- pkg/kudoctl/kudoinit/crd/crds.go | 2 +- pkg/kudoctl/kudoinit/manager/manager.go | 2 +- pkg/kudoctl/packages/reader/reader_test.go | 4 +-- pkg/kudoctl/packages/writer/writer_test.go | 2 +- pkg/kudoctl/util/kudo/kudo.go | 12 ++++---- pkg/kudoctl/util/repo/index.go | 2 +- 17 files changed, 45 insertions(+), 45 deletions(-) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 8d0bbdb74..261e8ae8b 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -201,7 +201,7 @@ func webhookPath(prefix string, obj runtime.Object, mgr manager.Manager) (string // if the strategy to generate this path changes we should update init code and webhook setup // right now this is in sync how controller-runtime generates these paths - return prefix + "-" + strings.Replace(gvk.Group, ".", "-", -1) + "-" + + return prefix + "-" + strings.ReplaceAll(gvk.Group, ".", "-") + "-" + gvk.Version + "-" + strings.ToLower(gvk.Kind), nil } diff --git a/pkg/apis/kudo/v1beta1/instance_types.go b/pkg/apis/kudo/v1beta1/instance_types.go index 00787142c..8356f1a62 100644 --- a/pkg/apis/kudo/v1beta1/instance_types.go +++ b/pkg/apis/kudo/v1beta1/instance_types.go @@ -62,24 +62,24 @@ type InstanceStatus struct { // // These are valid states and transitions // -// +----------------+ -// | Never executed | -// +-------+--------+ -// | -// v -//+-------------+ +-------+--------+ -//| Error |<------>| Pending | -//+------+------+ +-------+--------+ -// ^ | -// | v -// | +-------+--------+ -// +-------------->| In progress | -// | +-------+--------+ -// | | -// v v -//+------+------+ +-------+--------+ -//| Fatal error | | Complete | -//+-------------+ +----------------+ +// +----------------+ +// | Never executed | +// +-------+--------+ +// | +// v +// +-------------+ +-------+--------+ +// | Error |<------>| Pending | +// +------+------+ +-------+--------+ +// ^ | +// | v +// | +-------+--------+ +// +-------------->| In progress | +// | +-------+--------+ +// | | +// v v +// +------+------+ +-------+--------+ +// | Fatal error | | Complete | +// +-------------+ +----------------+ // type PlanStatus struct { Name string `json:"name,omitempty"` diff --git a/pkg/engine/task/podexec/pod_exec.go b/pkg/engine/task/podexec/pod_exec.go index 4a1c7660b..b6e9daed5 100644 --- a/pkg/engine/task/podexec/pod_exec.go +++ b/pkg/engine/task/podexec/pod_exec.go @@ -195,7 +195,7 @@ func untarFile(fs afero.Fs, r io.Reader, fileName string) error { return err } - written = written + w + written += w if written > writtenLimit { return errors.New("untar aborted because archive exceeds 4GiB") } diff --git a/pkg/engine/task/task.go b/pkg/engine/task/task.go index 8fc1e7ec3..76d5e3142 100644 --- a/pkg/engine/task/task.go +++ b/pkg/engine/task/task.go @@ -152,7 +152,7 @@ func newToggle(task *kudoapi.Task) (Tasker, error) { } var ( - pipeFileKeyRe = regexp.MustCompile(`^[a-zA-Z0-9_\-]+$`) //a-z, A-Z, 0-9, _ and - are allowed + pipeFileKeyRe = regexp.MustCompile(`^[a-zA-Z0-9_\-]+$`) // a-z, A-Z, 0-9, _ and - are allowed ) func validPipeFile(pf PipeFile) error { diff --git a/pkg/engine/workflow/engine.go b/pkg/engine/workflow/engine.go index 917210ce2..92caf1c2c 100644 --- a/pkg/engine/workflow/engine.go +++ b/pkg/engine/workflow/engine.go @@ -91,7 +91,7 @@ func Execute(pl *ActivePlan, em *engine.Metadata, c client.Client, di discovery. // Check current phase status: skip if finished, proceed if in progress, break out if a fatal error has occurred if phaseStatus.Status.IsFinished() { - phasesLeft = phasesLeft - 1 + phasesLeft-- continue } else if phaseStatus.Status.IsRunning() { phaseStatus.Set(kudoapi.ExecutionInProgress) @@ -221,7 +221,7 @@ func Execute(pl *ActivePlan, em *engine.Metadata, c client.Client, di discovery. } } else { phaseStatus.Set(kudoapi.ExecutionComplete) - phasesLeft = phasesLeft - 1 + phasesLeft-- } } diff --git a/pkg/kudoctl/clog/log.go b/pkg/kudoctl/clog/log.go index 870f1717f..3b62f3be4 100644 --- a/pkg/kudoctl/clog/log.go +++ b/pkg/kudoctl/clog/log.go @@ -40,7 +40,7 @@ func (l *Level) Get() interface{} { return *l } -//// Required for pflag.Value defined: https://godoc.org/github.com/spf13/pflag#Value +// Required for pflag.Value defined: https://godoc.org/github.com/spf13/pflag#Value // String is part of the flag.Value interface. func (l *Level) String() string { @@ -62,7 +62,7 @@ func (l *Level) Type() string { return fmt.Sprint(*l) } -//// pflag.Value interface ends +// pflag.Value interface ends type loggingT struct { verbosity Level // V logging level, the value of the -v flag/ diff --git a/pkg/kudoctl/clog/log_test.go b/pkg/kudoctl/clog/log_test.go index 7a88f4009..c86a27ee0 100644 --- a/pkg/kudoctl/clog/log_test.go +++ b/pkg/kudoctl/clog/log_test.go @@ -33,7 +33,7 @@ func TestLevelCheck(t *testing.T) { func TestDefaultPrintLevel(t *testing.T) { - //default is verbosity of 0 -v=0 or not supplied + // default is verbosity of 0 -v=0 or not supplied var buf bytes.Buffer logging.out = &buf @@ -53,7 +53,7 @@ func TestDefaultPrintLevel(t *testing.T) { } func TestErrorf(t *testing.T) { - //default is verbosity of 0 -v=0 or not supplied + // default is verbosity of 0 -v=0 or not supplied var buf bytes.Buffer logging.verbosity = Level(0) diff --git a/pkg/kudoctl/cmd/params/parser.go b/pkg/kudoctl/cmd/params/parser.go index 0b05b9baa..6e724bdfb 100644 --- a/pkg/kudoctl/cmd/params/parser.go +++ b/pkg/kudoctl/cmd/params/parser.go @@ -119,7 +119,7 @@ func mergeParams(paramsFromCmdline map[string]string, paramsFromFiles map[string // detailed error message. func parseParameter(raw string) (key string, param string, err *string) { - //TODO (kensipe): this function and calling code should be refactored to NOT use `err` for strings. + // TODO (kensipe): this function and calling code should be refactored to NOT use `err` for strings. var errMsg string s := strings.SplitN(raw, "=", 2) switch { diff --git a/pkg/kudoctl/cmd/plan.go b/pkg/kudoctl/cmd/plan.go index ebdacd3fd..f62b547c3 100644 --- a/pkg/kudoctl/cmd/plan.go +++ b/pkg/kudoctl/cmd/plan.go @@ -54,7 +54,7 @@ func NewPlanHistoryCmd() *cobra.Command { return cmd } -//NewPlanStatusCmd creates a new command that shows the status of an instance by looking at its current plan +// NewPlanStatusCmd creates a new command that shows the status of an instance by looking at its current plan func NewPlanStatusCmd(out io.Writer) *cobra.Command { options := &plan.StatusOptions{Out: out} cmd := &cobra.Command{ diff --git a/pkg/kudoctl/cmd/prompt/operator.go b/pkg/kudoctl/cmd/prompt/operator.go index 5afd16278..df8df21a7 100644 --- a/pkg/kudoctl/cmd/prompt/operator.go +++ b/pkg/kudoctl/cmd/prompt/operator.go @@ -182,7 +182,7 @@ func ForParameter(planNames []string, paramNameList []string) (*packages.Paramet parameter.Required = &t } - //PlanNameList + // PlanNameList if Confirm("Add Trigger Plan (defaults to deploy)") { var trigger string if len(planNames) == 0 { diff --git a/pkg/kudoctl/cmd/test.go b/pkg/kudoctl/cmd/test.go index b9583ab02..712c78733 100644 --- a/pkg/kudoctl/cmd/test.go +++ b/pkg/kudoctl/cmd/test.go @@ -131,9 +131,9 @@ For more detailed documentation, visit: https://kudo.dev/docs/testing`, return errors.New("only one of --start-control-plane and --start-kind can be set") } - //if isSet(flags, "start-kudo") { - // //TODO (kensipe): switch to a new way to start kudo (outside of kuttl) - //} + // if isSet(flags, "start-kudo") { + // TODO (kensipe): switch to a new way to start kudo (outside of kuttl) + // } if isSet(flags, "skip-delete") { options.SkipDelete = skipDelete diff --git a/pkg/kudoctl/kudoinit/crd/crds.go b/pkg/kudoctl/kudoinit/crd/crds.go index e7f8e1291..4337863b0 100644 --- a/pkg/kudoctl/kudoinit/crd/crds.go +++ b/pkg/kudoctl/kudoinit/crd/crds.go @@ -1,4 +1,4 @@ -//Defines the CRDs that the KUDO manager implements and watches. +// Defines the CRDs that the KUDO manager implements and watches. package crd import ( diff --git a/pkg/kudoctl/kudoinit/manager/manager.go b/pkg/kudoctl/kudoinit/manager/manager.go index 30db23730..cd12924a1 100644 --- a/pkg/kudoctl/kudoinit/manager/manager.go +++ b/pkg/kudoctl/kudoinit/manager/manager.go @@ -25,7 +25,7 @@ import ( // Ensure kudoinit.Step is implemented var _ kudoinit.Step = &Initializer{} -//Defines the deployment of the KUDO manager and it's service definition. +// Defines the deployment of the KUDO manager and it's service definition. type Initializer struct { options kudoinit.Options service *corev1.Service diff --git a/pkg/kudoctl/packages/reader/reader_test.go b/pkg/kudoctl/packages/reader/reader_test.go index 15fac9cb3..d9bb4b8e8 100644 --- a/pkg/kudoctl/packages/reader/reader_test.go +++ b/pkg/kudoctl/packages/reader/reader_test.go @@ -51,8 +51,8 @@ func TestReadFileSystemPackage(t *testing.T) { t.Errorf("Found unexpected error when loading golden files: %v", err) } - //we need to sort here because current yaml parsing is not preserving the order of fields - //at the same time, the deep library we use for equality does not support ignoring order + // we need to sort here because current yaml parsing is not preserving the order of fields + // at the same time, the deep library we use for equality does not support ignoring order sort.Slice(actual.OperatorVersion.Spec.Parameters, func(i, j int) bool { return actual.OperatorVersion.Spec.Parameters[i].Name < actual.OperatorVersion.Spec.Parameters[j].Name }) diff --git a/pkg/kudoctl/packages/writer/writer_test.go b/pkg/kudoctl/packages/writer/writer_test.go index dcfb73de3..bf29c4b45 100644 --- a/pkg/kudoctl/packages/writer/writer_test.go +++ b/pkg/kudoctl/packages/writer/writer_test.go @@ -34,7 +34,7 @@ func TestRegularFileTarball(t *testing.T) { err = f.Close() assert.NoError(t, err) - //open for reading in an untar + // open for reading in an untar f, err = fs.Open("/opt/zk.tgz") assert.NoError(t, err) defer f.Close() diff --git a/pkg/kudoctl/util/kudo/kudo.go b/pkg/kudoctl/util/kudo/kudo.go index 4dd24dd21..ad243ac80 100644 --- a/pkg/kudoctl/util/kudo/kudo.go +++ b/pkg/kudoctl/util/kudo/kudo.go @@ -329,7 +329,7 @@ func (c *Client) IsInstanceDone(instance, oldInstance *kudoapi.Instance) (bool, same = same && planStatus.UID == instance.Status.PlanStatus[planName].UID } if same { - //Nothing changed yet... waiting on the right plan to wait on + // Nothing changed yet... waiting on the right plan to wait on return false, nil } } @@ -485,11 +485,11 @@ func (c *Client) ValidateServerForOperator(operator *kudoapi.Operator) error { if err != nil { return fmt.Errorf("unable to parse operators kubernetes version: %w", err) } - //TODO : to be added in when we support kudo server providing server version - //expectedKudoVer, err := semver.NewVersion(operator.Spec.KudoVersion) - //if err != nil { - // return fmt.Errorf("Unable to parse operators kudo version: %w", err) - //} + // TODO : to be added in when we support kudo server providing server version + // expectedKudoVer, err := semver.NewVersion(operator.Spec.KudoVersion) + // if err != nil { + // return fmt.Errorf("Unable to parse operators kudo version: %w", err) + // } // semvar compares patch, for which we do not want to... compare maj, min only kVer, err := getKubeVersion(c.kudoClientset.Discovery()) if err != nil { diff --git a/pkg/kudoctl/util/repo/index.go b/pkg/kudoctl/util/repo/index.go index a0bce647f..57614d7ef 100644 --- a/pkg/kudoctl/util/repo/index.go +++ b/pkg/kudoctl/util/repo/index.go @@ -200,7 +200,7 @@ func ToPackageVersion(pf *packages.Files, digest string, url string) *PackageVer url = defaultURL } if url[len(url)-1:] != "/" { - url = url + "/" + url += "/" } if o.AppVersion == "" { url = fmt.Sprintf("%s%s-%v.tgz", url, o.Name, o.OperatorVersion) From 719746e599379be763534cee44e071169761a33d Mon Sep 17 00:00:00 2001 From: Ken Sipe Date: Thu, 5 Nov 2020 16:21:25 -0600 Subject: [PATCH 7/9] gocritic ignore and deref Signed-off-by: Ken Sipe --- pkg/kudoctl/kudoinit/prereq/webhook_test.go | 4 ++-- pkg/kudoctl/util/kudo/kudo.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/kudoctl/kudoinit/prereq/webhook_test.go b/pkg/kudoctl/kudoinit/prereq/webhook_test.go index 17cd8626d..c123d50ef 100644 --- a/pkg/kudoctl/kudoinit/prereq/webhook_test.go +++ b/pkg/kudoctl/kudoinit/prereq/webhook_test.go @@ -142,12 +142,12 @@ func TestPrereq_Ok_PreValidate_Webhook_CertManager_MultipleVersions(t *testing.T }) issuer := createCrd("issuers.certmanager.k8s.io", "v1alpha1") - issuer.Spec.Versions = append(cert.Spec.Versions, apiextensions.CustomResourceDefinitionVersion{ + issuer.Spec.Versions = append(cert.Spec.Versions, apiextensions.CustomResourceDefinitionVersion{ //nolint:gocritic Name: "v1beta1", Served: true, Storage: false, }) - issuer.Spec.Versions = append(cert.Spec.Versions, apiextensions.CustomResourceDefinitionVersion{ + issuer.Spec.Versions = append(cert.Spec.Versions, apiextensions.CustomResourceDefinitionVersion{ //nolint:gocritic Name: "v1beta2", Served: true, Storage: false, diff --git a/pkg/kudoctl/util/kudo/kudo.go b/pkg/kudoctl/util/kudo/kudo.go index ad243ac80..713d0fc8c 100644 --- a/pkg/kudoctl/util/kudo/kudo.go +++ b/pkg/kudoctl/util/kudo/kudo.go @@ -325,7 +325,7 @@ func (c *Client) IsInstanceDone(instance, oldInstance *kudoapi.Instance) (bool, // We want one of the plans UIDs to change to identify that a new plan ran. // If they're all the same, then nothing changed. same := true - for planName, planStatus := range (*oldInstance).Status.PlanStatus { + for planName, planStatus := range oldInstance.Status.PlanStatus { same = same && planStatus.UID == instance.Status.PlanStatus[planName].UID } if same { From ff7f8c37a3b1517cd0b46c1dc890da2952165b7c Mon Sep 17 00:00:00 2001 From: Ken Sipe Date: Thu, 5 Nov 2020 16:26:50 -0600 Subject: [PATCH 8/9] simplify if-else scenarios Signed-off-by: Ken Sipe --- pkg/kubernetes/status/health.go | 3 +-- pkg/kudoctl/cmd/params/parser_test.go | 6 ++---- pkg/webhook/instance_admission.go | 6 ++---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/pkg/kubernetes/status/health.go b/pkg/kubernetes/status/health.go index 7bd0c269d..70e6e1b96 100644 --- a/pkg/kubernetes/status/health.go +++ b/pkg/kubernetes/status/health.go @@ -67,8 +67,7 @@ func IsTerminallyFailed(obj runtime.Object) (terminal bool, msg string, err erro return true, "", nil } - switch obj := obj.(type) { - case *batchv1.Job: + if obj, ok := obj.(*batchv1.Job); ok { return isJobTerminallyFailed(obj) } return false, "", nil diff --git a/pkg/kudoctl/cmd/params/parser_test.go b/pkg/kudoctl/cmd/params/parser_test.go index d2e2bd11a..f691d9ce7 100644 --- a/pkg/kudoctl/cmd/params/parser_test.go +++ b/pkg/kudoctl/cmd/params/parser_test.go @@ -146,10 +146,8 @@ func TestGetParameterMap(t *testing.T) { if len(test.expectedError) == 0 { assert.NoError(t, err) assert.Equal(t, test.expected, params) - } else { - if assert.Error(t, err) { - assert.Equal(t, test.expectedError, err.Error()) - } + } else if assert.Error(t, err) { + assert.Equal(t, test.expectedError, err.Error()) } }) } diff --git a/pkg/webhook/instance_admission.go b/pkg/webhook/instance_admission.go index 9d8f42e3b..d258ac8a7 100644 --- a/pkg/webhook/instance_admission.go +++ b/pkg/webhook/instance_admission.go @@ -388,10 +388,8 @@ func checkImmutableParameters(old, new map[string]string, newOv, oldOv *kudoapi. return fmt.Errorf("parameter '%s' is immutable but was changed from '%v' to '%v'", p.Name, old[p.Name], new[p.Name]) } } - } else { - if err := validateOVUpgrade(new, newOv, oldOv); err != nil { - return err - } + } else if err := validateOVUpgrade(new, newOv, oldOv); err != nil { + return err } return nil } From 03ebf1dfc6d33921c4f9971a452e4abafe3e7d72 Mon Sep 17 00:00:00 2001 From: Ken Sipe Date: Thu, 5 Nov 2020 16:33:10 -0600 Subject: [PATCH 9/9] clean up if-else chains Signed-off-by: Ken Sipe desc update on crd Signed-off-by: Ken Sipe add the golden files Signed-off-by: Ken Sipe --- config/crds/kudo.dev_instances.yaml | 2 +- pkg/engine/workflow/engine.go | 15 ++++++++------- pkg/kudoctl/cmd/plan/plan_history.go | 7 ++++--- .../cmd/testdata/deploy-kudo-ns.yaml.golden | 2 +- .../cmd/testdata/deploy-kudo-sa.yaml.golden | 2 +- pkg/kudoctl/cmd/testdata/deploy-kudo.json.golden | 2 +- pkg/kudoctl/cmd/testdata/deploy-kudo.yaml.golden | 2 +- pkg/kudoctl/cmd/update_test.go | 8 ++++---- pkg/kudoctl/kudoinit/crd/bindata.go | 2 +- pkg/kudoctl/packages/reader/reader.go | 6 +++--- pkg/kudoctl/packages/resolver/resolver_local.go | 6 +++--- .../resources/upgrade/operatorversion_test.go | 8 ++++---- 12 files changed, 32 insertions(+), 30 deletions(-) diff --git a/config/crds/kudo.dev_instances.yaml b/config/crds/kudo.dev_instances.yaml index 1fd81cc3d..0ac9c934e 100644 --- a/config/crds/kudo.dev_instances.yaml +++ b/config/crds/kudo.dev_instances.yaml @@ -122,7 +122,7 @@ spec: type: array planStatus: additionalProperties: - description: "PlanStatus is representing status of a plan \n These are valid states and transitions \n | Never executed | | v | Error |<------>| Pending | ^ | | v | +-------+--------+ | +-------+--------+ | | v v | Fatal error | | Complete |" + description: "PlanStatus is representing status of a plan \n These are valid states and transitions \n | Never executed | | v | Error |<------>| Pending | ^ | | v | +-------+--------+ | +-------+--------+ | | v v | Fatal error | | Complete |" properties: lastUpdatedTimestamp: format: date-time diff --git a/pkg/engine/workflow/engine.go b/pkg/engine/workflow/engine.go index 92caf1c2c..cf87f97ef 100644 --- a/pkg/engine/workflow/engine.go +++ b/pkg/engine/workflow/engine.go @@ -90,12 +90,13 @@ func Execute(pl *ActivePlan, em *engine.Metadata, c client.Client, di discovery. } // Check current phase status: skip if finished, proceed if in progress, break out if a fatal error has occurred - if phaseStatus.Status.IsFinished() { + switch { + case phaseStatus.Status.IsFinished(): phasesLeft-- continue - } else if phaseStatus.Status.IsRunning() { + case phaseStatus.Status.IsRunning(): phaseStatus.Set(kudoapi.ExecutionInProgress) - } else { + default: break } @@ -115,13 +116,13 @@ func Execute(pl *ActivePlan, em *engine.Metadata, c client.Client, di discovery. } // Check current phase status: skip if finished, proceed if in progress, break out if a fatal error has occurred - if stepStatus.Status.IsFinished() { + switch { + case stepStatus.Status.IsFinished(): delete(stepsLeft, stepStatus.Name) continue - } else if stepStatus.Status.IsRunning() { + case stepStatus.Status.IsRunning(): stepStatus.Set(kudoapi.ExecutionInProgress) - } else { - // we are not in progress and not finished. An unexpected error occurred so that we can not proceed to the next phase + default: break } diff --git a/pkg/kudoctl/cmd/plan/plan_history.go b/pkg/kudoctl/cmd/plan/plan_history.go index 5309ed122..38b39e540 100644 --- a/pkg/kudoctl/cmd/plan/plan_history.go +++ b/pkg/kudoctl/cmd/plan/plan_history.go @@ -63,12 +63,13 @@ func planHistory(options *Options, settings *env.Settings) error { plan := instance.Status.PlanStatus[p] msg := "never run" // this is for the cases when status was not yet populated - if plan.LastUpdatedTimestamp != nil && !plan.LastUpdatedTimestamp.IsZero() { // plan already finished + switch { + case plan.LastUpdatedTimestamp != nil && !plan.LastUpdatedTimestamp.IsZero(): t := plan.LastUpdatedTimestamp.Format(timeLayout) msg = fmt.Sprintf("last finished run at %s (%s)", t, string(plan.Status)) - } else if plan.Status.IsRunning() { + case plan.Status.IsRunning(): msg = "is running" - } else if plan.Status != "" { + case plan.Status != "": msg = string(plan.Status) } historyDisplay := fmt.Sprintf("%s (%s)", plan.Name, msg) diff --git a/pkg/kudoctl/cmd/testdata/deploy-kudo-ns.yaml.golden b/pkg/kudoctl/cmd/testdata/deploy-kudo-ns.yaml.golden index b9282d20b..883ac7f1c 100644 --- a/pkg/kudoctl/cmd/testdata/deploy-kudo-ns.yaml.golden +++ b/pkg/kudoctl/cmd/testdata/deploy-kudo-ns.yaml.golden @@ -435,7 +435,7 @@ spec: type: array planStatus: additionalProperties: - description: "PlanStatus is representing status of a plan \n These are valid states and transitions \n | Never executed | | v | Error |<------>| Pending | ^ | | v | +-------+--------+ | +-------+--------+ | | v v | Fatal error | | Complete |" + description: "PlanStatus is representing status of a plan \n These are valid states and transitions \n | Never executed | | v | Error |<------>| Pending | ^ | | v | +-------+--------+ | +-------+--------+ | | v v | Fatal error | | Complete |" properties: lastUpdatedTimestamp: format: date-time diff --git a/pkg/kudoctl/cmd/testdata/deploy-kudo-sa.yaml.golden b/pkg/kudoctl/cmd/testdata/deploy-kudo-sa.yaml.golden index 3841e6775..795e7906e 100644 --- a/pkg/kudoctl/cmd/testdata/deploy-kudo-sa.yaml.golden +++ b/pkg/kudoctl/cmd/testdata/deploy-kudo-sa.yaml.golden @@ -435,7 +435,7 @@ spec: type: array planStatus: additionalProperties: - description: "PlanStatus is representing status of a plan \n These are valid states and transitions \n | Never executed | | v | Error |<------>| Pending | ^ | | v | +-------+--------+ | +-------+--------+ | | v v | Fatal error | | Complete |" + description: "PlanStatus is representing status of a plan \n These are valid states and transitions \n | Never executed | | v | Error |<------>| Pending | ^ | | v | +-------+--------+ | +-------+--------+ | | v v | Fatal error | | Complete |" properties: lastUpdatedTimestamp: format: date-time diff --git a/pkg/kudoctl/cmd/testdata/deploy-kudo.json.golden b/pkg/kudoctl/cmd/testdata/deploy-kudo.json.golden index 5fbf6eeaa..432712e3b 100644 --- a/pkg/kudoctl/cmd/testdata/deploy-kudo.json.golden +++ b/pkg/kudoctl/cmd/testdata/deploy-kudo.json.golden @@ -598,7 +598,7 @@ "description": "slice would be enough here but we cannot use slice because order of sequence in yaml is considered significant while here it's not", "type": "object", "additionalProperties": { - "description": "PlanStatus is representing status of a plan \n These are valid states and transitions \n | Never executed | | v | Error |\u003c------\u003e| Pending | ^ | | v | +-------+--------+ | +-------+--------+ | | v v | Fatal error | | Complete |", + "description": "PlanStatus is representing status of a plan \n These are valid states and transitions \n | Never executed | | v | Error |\u003c------\u003e| Pending | ^ | | v | +-------+--------+ | +-------+--------+ | | v v | Fatal error | | Complete |", "type": "object", "properties": { "lastUpdatedTimestamp": { diff --git a/pkg/kudoctl/cmd/testdata/deploy-kudo.yaml.golden b/pkg/kudoctl/cmd/testdata/deploy-kudo.yaml.golden index 5364ad650..7ac2e5532 100644 --- a/pkg/kudoctl/cmd/testdata/deploy-kudo.yaml.golden +++ b/pkg/kudoctl/cmd/testdata/deploy-kudo.yaml.golden @@ -435,7 +435,7 @@ spec: type: array planStatus: additionalProperties: - description: "PlanStatus is representing status of a plan \n These are valid states and transitions \n | Never executed | | v | Error |<------>| Pending | ^ | | v | +-------+--------+ | +-------+--------+ | | v v | Fatal error | | Complete |" + description: "PlanStatus is representing status of a plan \n These are valid states and transitions \n | Never executed | | v | Error |<------>| Pending | ^ | | v | +-------+--------+ | +-------+--------+ | | v v | Fatal error | | Complete |" properties: lastUpdatedTimestamp: format: date-time diff --git a/pkg/kudoctl/cmd/update_test.go b/pkg/kudoctl/cmd/update_test.go index 64aafbbe3..d71d1f04a 100644 --- a/pkg/kudoctl/cmd/update_test.go +++ b/pkg/kudoctl/cmd/update_test.go @@ -78,14 +78,14 @@ func TestUpdate(t *testing.T) { } err := update(testInstance.Name, c, &updateOptions{Parameters: tt.parameters}, env.DefaultSettings) - if err != nil { + switch { + case err != nil: if !strings.Contains(err.Error(), tt.errMessageContains) { t.Errorf("%s: expected error '%s' but got '%v'", tt.name, tt.errMessageContains, err) } - } else if tt.errMessageContains != "" { + case tt.errMessageContains != "": t.Errorf("%s: expected error '%s' but got nil", tt.name, tt.errMessageContains) - } else { - // the upgrade should have passed without error + default: instance, err := c.GetInstance(testInstance.Name, installNamespace) if err != nil { t.Errorf("%s: error when getting instance to verify the test: %v", tt.name, err) diff --git a/pkg/kudoctl/kudoinit/crd/bindata.go b/pkg/kudoctl/kudoinit/crd/bindata.go index 5e5f64f8a..313133c12 100644 --- a/pkg/kudoctl/kudoinit/crd/bindata.go +++ b/pkg/kudoctl/kudoinit/crd/bindata.go @@ -80,7 +80,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _configCrdsKudoDev_instancesYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xe4\x1a\x69\x73\xdb\xc6\xf5\xbb\x7e\xc5\x1b\xa6\x33\x92\x1c\x12\xb4\x94\x4c\x9a\x70\xea\x7a\x5c\xd9\xce\xa8\xf1\xa1\xb1\xe4\x74\x52\x49\x69\x96\xc0\x23\xb1\x11\xb0\x0b\xef\x2e\x44\x31\x71\xfe\x7b\xe7\xbd\x5d\x1c\x24\xc1\x43\x8a\x93\x7e\x28\xbe\x48\xdc\xe3\xdd\x37\xb0\x37\x18\x0c\xf6\x44\x21\xbf\x47\x63\xa5\x56\x23\x10\x85\xc4\x3b\x87\x8a\x7e\xd9\xe8\xe6\x6b\x1b\x49\x3d\xbc\x3d\x1a\xa3\x13\x47\x7b\x37\x52\x25\x23\x38\x29\xad\xd3\xf9\x3b\xb4\xba\x34\x31\x3e\xc7\x89\x54\xd2\x49\xad\xf6\x72\x74\x22\x11\x4e\x8c\xf6\x00\x84\x52\xda\x09\x5a\xb6\xf4\x13\x20\xd6\xca\x19\x9d\x65\x68\x06\x53\x54\xd1\x4d\x39\xc6\x71\x29\xb3\x04\x0d\x63\xa8\xf0\xdf\x3e\x8e\xbe\x8c\x1e\xef\x01\xc4\x06\xf9\xfa\x85\xcc\xd1\x3a\x91\x17\x23\x50\x65\x96\xed\x01\x28\x91\xe3\x08\xa4\xb2\x4e\xa8\x18\x6d\x74\x53\x26\x3a\x4a\xf0\x76\xcf\x16\x18\x13\xb2\xa9\xd1\x65\x31\x82\x7a\xdd\x5f\x09\x74\x78\x1e\x4e\xc3\x6d\x5e\xca\xa4\x75\xdf\x2d\x2c\xbf\x92\xd6\xf1\x56\x91\x95\x46\x64\x2d\x6c\xbc\x6a\xa5\x9a\x96\x99\x30\xcd\xfa\x1e\x80\x8d\x75\x81\x23\x78\x43\xa8\x0a\x11\x63\x42\x6b\xe5\xd8\x04\x39\x05\xf4\xd6\x09\x57\xda\x11\xfc\xfa\xdb\x1e\xc0\xad\xc8\x64\xc2\x5c\xfa\x4d\x5d\xa0\x7a\x76\x76\xfa\xfd\x17\xe7\x71\x8a\xb9\xf0\x8b\x00\x09\xda\xd8\xc8\x82\xcf\xd5\x24\x82\xb4\xe0\x52\x04\x7f\x14\x26\xda\xf0\xcf\x9a\x50\x78\x76\x76\x1a\x05\x00\x85\xd1\x05\x1a\x27\x2b\x22\xe8\x69\x29\xbd\x5e\x5b\x42\xb5\x4f\xb4\xf8\x33\x90\x90\x9a\xd1\xa3\x0c\xca\xc2\x04\xac\x47\xae\x27\xe0\x52\x69\xc1\x60\x61\xd0\xa2\xf2\x8a\xa7\x65\xa1\x40\x8f\x7f\xc6\xd8\x45\x70\x8e\x86\x2e\x82\x4d\x75\x99\x25\x64\x0f\xb7\x68\x1c\x18\x8c\xf5\x54\xc9\x5f\x6a\x68\x16\x9c\x66\x34\x99\x70\x68\x1d\x48\xe5\xd0\x28\x91\x91\xb4\x4a\xec\x83\x50\x09\xe4\x62\x0e\x06\x09\x2e\x94\xaa\x05\x81\x8f\xd8\x08\x5e\x6b\x43\xa2\x98\xe8\x11\xa4\xce\x15\x76\x34\x1c\x4e\xa5\xab\xcc\x39\xd6\x79\x5e\x2a\xe9\xe6\x43\x36\x4a\x39\x2e\x9d\x36\x76\x98\xe0\x2d\x66\x43\x2b\xa7\x03\x61\xe2\x54\x3a\x8c\x5d\x69\x70\x28\x0a\x39\x60\x62\x15\x5b\x73\x94\x27\x9f\xd5\x3a\xdd\x6f\x89\xce\xcd\x49\xfd\xd6\x19\xa9\xa6\xf5\x32\x5b\xdb\x5a\xf9\x92\xd1\x91\x1e\x45\xb8\xe6\xe9\x6f\xc4\x48\x4b\x24\x89\x77\x2f\xce\x2f\xa0\x42\xea\x45\xed\xa5\xda\x1c\xb5\x8d\x80\x49\x38\x52\x4d\xd0\xf8\x93\x13\xa3\x73\x86\x82\x2a\x29\xb4\x54\x8e\x7f\xc4\x99\x44\xe5\xc8\x40\x73\xe9\x48\x73\x1f\x4a\xb4\x8e\x64\x1f\xc1\x09\x3b\x2f\x8c\x11\xca\x22\x11\x0e\x93\x08\x4e\x15\x9c\x88\x1c\xb3\x13\x61\xf1\x0f\x17\x2f\x49\xd2\x0e\x48\x74\xdb\x05\xdc\x8e\x39\x8b\x07\xbd\x84\xea\xe5\x2a\x38\x74\x6a\xa2\x72\xaa\xf3\x02\xe3\x05\x53\x4f\xd0\x4a\x43\xa6\xe9\x84\x43\x32\xe8\xea\x64\xd4\x02\xd5\xe5\x5e\xc1\x9d\x8d\x70\xda\x74\xf8\xd9\x0a\x05\x6f\x17\xcf\x32\xb9\x72\x22\x91\x8c\xc3\xe0\x04\x0d\x92\xcf\x3b\x4d\xb6\xe2\xb7\xe2\x95\x3b\xc1\xd3\x96\xd0\xac\xa3\x6e\x7d\x10\xe8\x24\xf0\xd9\xd9\x69\xe5\xf8\xde\xdf\xb1\xa2\x6b\x05\xe3\x5a\x65\x55\xcf\x44\x62\x96\x9c\x09\x97\x6e\xc5\xba\x7f\x3a\xf1\x68\xd8\x3d\x98\xfd\x42\x62\x8c\x0b\xb1\x85\x83\x1e\x8a\x24\x2c\x92\x25\x19\x0c\x7b\x7d\xef\x04\xc1\xbf\x9a\xd8\xe3\x84\x54\x20\x7c\x04\x86\x7f\x9e\xbf\x7d\x33\xfc\x56\x7b\xba\x40\xc4\x31\x5a\xeb\x55\x9e\xa3\x72\x7d\xb0\x65\x9c\x82\xb0\x95\x35\x9c\xd3\x4e\x94\x0b\x25\x27\x68\x5d\x14\xa0\xa1\xb1\x97\xc7\xd7\x11\xbc\xd4\x06\xf0\x4e\xe4\x45\x86\x7d\x90\x5e\x52\xb5\xb7\x56\x8a\x94\xd6\x33\x53\xdf\x85\x99\x74\x29\x93\x54\xe8\x24\x10\x3d\x63\x62\x9d\xb8\x41\xd0\x81\xd8\x12\x21\x93\x37\x38\x82\x1e\x59\x41\x0b\xf5\xaf\x94\xe2\x7e\xeb\xc1\xc1\x2c\x45\x83\xd0\xa3\x9f\x3d\x8f\xb0\x0e\xa8\xb4\x56\xe9\xae\x41\xec\x52\xe1\xc0\x19\x39\x9d\x22\x59\x3a\x47\x0a\xf2\xc6\x43\xd0\x86\xe8\x57\xba\x75\x98\x41\x90\x3c\x83\x79\x26\x2b\x84\x5c\x1e\x5f\xf7\xe0\x60\x91\x2f\x90\x2a\xc1\x3b\x38\x06\xa9\x3c\x67\x85\x4e\x0e\x23\xb8\x60\xcd\xcc\x95\x13\x77\x04\x33\x4e\xb5\x45\x05\x5a\x65\x73\xa2\x38\x15\xb7\x08\x56\xe7\x08\x33\xcc\xb2\x81\xf7\xca\x04\x66\x62\x4e\x3c\x54\xa2\x24\xad\x0a\x28\x84\x71\x4b\xe9\xe6\xe2\xed\xf3\xb7\x23\x8f\x8d\xd4\x36\x55\x84\x82\xc2\xda\x44\x52\x32\xa1\x2c\xe2\xc3\x23\xeb\x9c\x08\x29\xbd\x92\x9c\x86\x38\x15\x6a\x8a\x9e\x5a\x84\x49\x49\x81\x2a\xda\xbf\xaf\x95\x2f\xc7\xfe\x6e\x03\xe7\x1c\xb0\xec\x50\xff\xa3\x08\xbb\x13\x5b\x5c\x7e\x6d\x65\xeb\x4d\xcb\xd6\x36\xb2\x45\x85\xa0\x51\xe8\x90\x39\x4b\x74\x6c\x89\xa9\x18\x0b\x67\x87\xfa\x16\xcd\xad\xc4\xd9\x70\xa6\xcd\x8d\x54\xd3\x01\x19\xd3\xc0\x6b\xd8\x0e\xb9\xa8\x1b\x7e\xc6\x7f\x1e\xc4\x05\x97\x69\xbb\xb1\xc2\x47\xff\x0c\x7e\x08\x8f\x1d\xde\x9b\x9d\xaa\x38\xd8\x35\x9a\xef\x9f\x57\x49\x64\xe9\x26\x99\xff\x2c\x95\x71\x5a\x55\x74\xad\x88\x95\x8b\xc4\x87\x34\xa1\xe6\x7f\xb8\x89\x92\xd0\x4a\x43\xb8\xe7\x83\xd0\x3b\x0c\x84\x4a\xe8\x7f\x2b\xad\xa3\xf5\x7b\x4b\xa9\x94\x3b\x38\xe4\xfb\xd3\xe7\x7f\x8e\xe1\x96\xf2\xde\xde\xd7\x59\xd9\xd0\x53\x08\x23\x72\x74\x68\x56\x92\xbc\x48\x12\xee\xce\x44\x76\xb6\xa1\x10\x78\x10\xce\x4c\xa8\x17\x77\x18\x97\x6e\x5b\x71\xb3\x7f\xc1\x49\x49\x18\x04\x37\xd3\x14\xc2\xa9\xac\xa1\xfb\x80\x15\x00\x88\x85\xa2\x92\xb3\xce\x44\x23\x80\xa3\x43\xca\x1c\xd2\x60\xec\x28\x27\xa4\x46\x97\xd3\x34\x14\xa5\x1c\xee\x21\xd6\xc6\xa0\x2d\xb4\x4a\x28\x11\xd4\x52\xa8\x42\x77\xbb\xae\x8b\xce\x6a\x19\x41\x2e\x0a\x80\xe3\x43\x58\x81\x6d\xd1\x71\xd5\x1d\x0c\x60\xf1\x7e\x9b\x5f\xfe\xc5\x41\xce\x27\x90\x7f\xa5\x32\xc3\x9a\x5a\x38\x38\x3a\xac\x38\xb1\x90\x8a\xa2\x40\x65\x29\xad\x9a\x39\x38\x99\x23\x08\x28\x2d\x9a\x90\x68\xac\xcf\x60\x9e\xb8\x3e\x88\x86\xac\x83\xe3\xc3\x56\x6a\x66\x81\xb1\x53\x5a\x2a\xf5\x93\xba\xe9\xb3\xd2\x95\xbe\xd7\x86\x59\x8a\xaa\x65\x0d\x90\x68\xb4\x6a\x7f\xdf\x55\x39\x0d\xa3\x69\x44\xe8\xd0\x48\x9d\xc8\x18\xc6\x22\xbe\x29\x0b\xae\x47\x6a\x3c\x64\xbd\x46\x26\x55\xf7\x81\x77\xd2\xb2\x50\xc2\xd9\x89\xcc\x30\x82\x67\xb5\x5d\x65\xf3\x50\xaf\x68\xe6\xd2\x68\x9d\x33\x65\x31\x49\x2e\xe3\x04\xad\x16\x80\x7a\xbf\x26\xfe\x4c\xa9\x14\x2b\x2e\x13\xca\x2e\xe5\x5b\x78\xa3\x1d\x8e\x60\x41\xea\x41\xd8\x55\x85\xce\x02\xe1\x92\x84\x30\xac\xb1\x05\xeb\x2b\x9c\xd3\x73\x38\x79\xff\xee\xdd\x8b\x37\x17\xaf\x7e\x08\x56\x47\x8d\xcd\x5b\x2e\xab\x5b\x8d\x73\x6b\x50\x01\x07\xa7\x27\x87\x24\x9a\x44\x2b\xf4\x85\x8c\x97\x47\xa0\xa6\xdf\xae\x20\x66\x32\xcb\xc8\x7e\xe3\x0c\x85\x21\xc8\x2f\x44\x9c\x2e\xdb\x78\x2a\x48\xd7\xa5\x92\x1f\x4a\x04\x0a\x34\x56\x57\x35\x29\xeb\x91\x58\xe1\x2b\x63\x0a\x3e\x83\x46\x25\xd2\x79\x04\x5c\x14\x09\x50\x38\xa3\xeb\xcb\xd1\x63\x53\xa9\x5f\x04\x7b\xed\x0a\x80\x1b\x83\x66\x98\x58\x6c\x8b\x9b\xb5\x8e\xce\xf9\x3c\xc4\xa2\x20\x35\xfa\x36\xaa\x6e\x9f\x38\xaa\xea\x2c\xd3\xe5\xfd\xbb\x86\x5d\xa2\x37\xc9\x94\x1b\x6a\x82\xe4\x15\x9f\xea\x2c\xb1\x95\xcc\x4f\x9f\x87\x19\x41\x1f\xa4\x8a\xb3\x92\x4d\xe5\xfd\xfb\xd3\xe7\x36\x02\xf8\x07\xc6\xa2\xb4\x54\x6f\x92\xc6\xf7\x1d\xbc\x7d\xf3\xea\x07\x72\x54\x7f\x22\xa8\x9b\xc0\x2b\x10\x99\xf4\x93\x0a\x4f\x2c\xdf\xf6\xb5\x28\x63\xae\xb9\x97\xca\x51\x9f\x4d\xf6\x99\x62\x56\x50\xe8\xb9\x41\xb0\xa5\x09\xd4\x11\x60\xde\xe5\xa4\x00\x89\xe6\x1a\x75\x8a\x8e\xec\x70\x92\x71\xf7\xfd\x49\x72\x44\x77\x53\xbc\xa2\xdb\xee\xb6\xd8\xab\xb4\xdd\x18\xeb\x71\x88\x41\x2b\x9d\xf1\x0e\x8d\x71\x4c\x3e\xda\x9a\x0d\x36\x8f\x74\x98\x77\xd8\xda\x02\x55\xbd\x93\xea\x7a\xd5\x98\x10\x69\x4e\xc8\xcc\x72\xdc\x21\x67\x15\xd4\x95\xb8\xba\xd9\xf1\x01\xa7\x6d\x86\x92\x07\x64\x50\x4d\x31\x23\x18\x0c\x06\xa1\x21\x71\xa6\xa4\x9e\x32\xe8\x2e\x09\x71\x36\x04\x76\xb2\x06\xe1\x2d\xc0\x18\x31\x07\xe1\xc7\x29\x3e\x06\x14\xc2\xa5\x10\x79\xa1\x46\x0d\x93\x11\x2c\x36\x85\x6c\x21\x2f\xb5\x0e\x62\xf5\x08\x7f\x65\x46\x87\x43\x78\x57\x8f\x74\x5a\x82\x0e\xd1\x9d\x73\xde\x44\xeb\x7d\xbb\xc8\x53\x54\x5d\xfe\x4e\xe9\x99\xea\x22\x81\x71\x0a\x83\x23\xb8\xea\x3d\xbb\x15\x32\x13\xe3\x0c\xaf\x7a\x7d\xb8\xea\x9d\x19\x3d\x35\x68\xad\x54\x53\x5a\x20\x63\xbc\xea\x3d\xc7\xa9\x11\x09\x26\x57\xbd\x0a\xf4\xe7\x85\x70\x71\xfa\x1a\xcd\x14\xbf\xc3\xf9\x13\x06\xb8\xb0\x75\xee\x8c\x70\x38\x9d\x3f\xc9\xe9\x4c\xbd\x97\x49\xeb\x2e\xe6\x05\x3e\xe1\xa4\xdb\x5a\x7c\x2d\x8a\x05\x40\xb5\x5a\x2d\x5c\x5e\xe7\xe8\xc4\xed\x51\xd4\xa8\xfa\xa7\x9f\xad\x56\xa3\xab\x5e\xc3\x53\x5f\xe7\x64\x2e\x85\x9b\x5f\xf5\x60\x81\x82\xd1\x55\x8f\x69\xa8\xd6\x2b\xa2\x47\x57\x3d\xc2\x46\xcb\x46\x3b\x3d\x2e\x27\xa3\xab\xde\x78\xee\xd0\xf6\x8f\xfa\x06\x8b\x3e\x39\xe1\x93\x06\xc3\x55\xef\x27\xb8\x52\x15\xd1\xda\xa5\x68\xbc\xa6\x2d\xfc\xd6\x5b\x8d\xb0\x1b\xa2\x2f\x40\x26\xac\xbb\x30\x42\x59\x59\x4d\xb5\xbb\x4e\x2d\x99\xfa\xea\xa5\x6a\xec\x4b\x3b\xbe\x94\x08\xdd\x7c\x10\x93\xab\x4f\x93\xdd\x1a\x9d\xb3\x3b\x78\x7b\xe0\x91\x83\x62\x36\xaa\xe6\xdb\xe7\x9e\x31\xfa\xba\x81\x40\x95\x2a\x41\x93\xcd\x39\x4f\x37\x7e\xc6\xc5\x43\x12\x01\x9c\x4e\x7c\xdc\x0a\xcd\xf4\x0d\xd9\x1b\x05\x46\x54\x50\xda\xaa\x62\x60\xba\x6a\x88\xe4\x67\xde\x3f\x02\x18\x0e\xa1\x31\x55\xca\x64\x84\x5d\xe1\x0d\xc8\xe5\x72\xe1\x46\x40\xa5\xde\x80\xe0\x75\x9e\xda\x98\x2f\x00\x72\xb4\x56\x4c\x77\x11\x74\x38\xe9\x73\x47\x5a\xe6\x42\x81\x41\x91\x10\x7d\xcd\x9e\x4a\x64\x2c\xb8\x12\xaa\xc2\x8d\x18\xeb\xd2\x07\x80\x46\xee\x41\xb4\xb9\x98\x93\x5c\x29\xfd\x93\x89\x56\x79\xa2\x93\x94\x5c\xdc\xbd\x42\x35\x75\xe9\x08\xbe\x38\xfe\xeb\x57\x5f\x3f\x84\xd7\x2a\x20\x7f\x8b\x0a\x8d\xe8\x2a\xc9\x3b\xd8\x5e\xbd\xd4\x9a\x28\x33\x5f\x51\x35\x60\x8d\xa6\xcd\x19\x3f\x32\x5a\xb0\xbb\x99\xb0\x54\x3c\xc3\x58\x58\x4c\xa0\x2c\x48\x0e\x14\xf4\xaa\xb2\x8a\xfb\xc6\x4e\x60\xd2\xb6\x0a\xc2\xa3\xe3\x3e\x8c\x83\x48\x57\xa3\xd8\xe5\xdd\x75\xd4\x41\xb2\xb4\xf0\x4d\x7f\x89\x1e\x2a\x47\x4b\x4e\x00\xdc\x2c\x70\xf1\x46\xd5\x61\x98\xf0\xac\xc9\x0a\x4d\x19\xb8\xd9\x2a\xa5\x72\x5f\x7d\xd9\xad\x4a\xa9\x64\x5e\xe6\x23\x78\xbc\x41\x89\x94\x58\xa6\x68\x3a\x4e\x18\x14\x76\x27\xcd\xf9\x83\x4d\x02\x14\x14\x7e\xa6\x46\xe4\xb9\x70\x32\x06\x99\x50\x2b\x3d\x91\xdc\x0a\xd5\x66\xeb\x7b\x5a\xbe\x58\xb5\x0e\xb5\xc4\xf6\x6d\x88\x29\x2d\x43\x3e\x33\x3a\x29\x63\x2a\xa1\xf5\xa4\x19\x3b\xb7\x82\xcd\xbc\x40\x6f\xe9\xbe\x34\x00\xbc\x23\x01\xd7\x2f\x62\xfc\xbb\x1a\x14\x54\xe3\xdb\x80\xb2\x2a\x98\x7d\xa2\x99\xa5\xc8\x51\x95\x5f\x2b\x85\x3b\x86\xa9\xb2\x32\xe1\xca\x57\xc0\xb4\x14\x46\x28\x87\x98\xf0\x3b\x2d\xb8\xa8\xce\xb6\xc2\x97\x68\x5e\x4f\xd4\x15\xd9\x45\x53\x9c\x13\x89\xe1\x95\x06\x7b\xe3\x56\x37\x3c\x7a\x7c\xbc\x56\xbf\xf5\x99\xce\x03\x85\x70\x0e\x8d\x1a\xc1\x8f\x97\xcf\x06\xff\x16\x83\x5f\xae\x0f\xc2\x3f\x8f\x07\xdf\xfc\xa7\x3f\xba\x7e\xd4\xfa\x79\x7d\xf8\xf4\x2f\x0f\x71\xf6\xf5\x35\xf9\x92\x99\x84\xc0\xdf\x0c\x7d\xbd\xe6\xfa\x9c\x15\xf4\x04\x2e\x4c\x89\x7d\x78\x29\x32\x8b\x7d\x78\xaf\x38\x9c\x77\x0b\x07\x55\x99\x77\x23\x1c\x40\x8f\xc0\xac\x26\xc4\xb0\xc9\xd0\xd7\xed\x06\x9c\x0f\x11\x02\x6f\x6f\x17\x01\xd7\x17\x7a\xd2\x8e\x0d\xad\x97\x59\x3c\xe4\x26\x77\xd0\x51\xa8\xcf\xa2\x58\xe7\xc3\xd6\xcb\x2e\x2a\x0c\x5f\x0b\x35\x87\x26\x10\xf9\x6a\x6a\xd9\x5e\xad\xaf\xf4\x63\xa3\xad\xad\xc7\x6a\x96\xe7\xf5\x50\x97\x5c\x3e\xbc\x8d\x43\xa7\x21\xcc\x58\x3a\x23\xcc\xbc\x55\x12\x57\x83\x90\xd2\xe2\xa4\xcc\xe0\xc0\x22\x42\xa4\x74\x82\xab\xf1\xf0\xd0\x47\x3d\x31\x96\x99\x74\x3c\x34\x4f\x90\xdb\x06\x19\x0a\xd8\xbc\xd0\xc6\x09\xe5\xbc\xd3\x18\x9c\xe2\x1d\xb5\x92\x39\x15\x45\xc8\xad\xcc\x41\xa2\xec\xd1\xd1\xf1\x17\xe7\xe5\x38\xd1\xb9\x90\xea\x65\xee\x86\x87\x4f\x0f\x3e\x94\x22\xe3\x01\x3f\xf5\x8c\x2f\x73\x77\xb8\x35\x71\x1d\x7d\xb5\xc5\x1f\x0e\x2e\xbd\xd5\x5f\x1f\x5c\x0e\xc2\x7f\x8f\xaa\xa5\xc3\xa7\x07\x57\xd1\xc6\xfd\xc3\x47\x44\x56\xcb\x97\xae\x2f\x07\x8d\x23\x45\xd7\x8f\x0e\x9f\xb6\xf6\x0e\x1f\xe0\x56\x06\x3f\x94\xd2\x60\x47\x93\x39\xe8\x28\xc4\x3a\x0e\x85\x42\xa1\x63\xc7\x07\xdd\x8e\x0d\xaf\xd2\x8e\x0d\xa2\x74\xcd\x94\xae\x63\x14\x57\x6d\x71\x4f\xb2\x32\xa4\x3b\xef\x8c\x16\xbb\x0d\x06\x17\x3b\xaf\xb3\x1a\x1a\xb4\x5f\xf7\xf3\xab\xb5\x3a\xd2\x84\xc9\xde\x95\x22\xa3\xb3\x7e\xec\xe7\xdf\xb3\x71\xa6\xf5\x59\xa1\x49\x33\xb6\x2a\xb1\x57\x9f\x8f\xf0\x06\x6f\xd1\xd4\xe3\x1a\xf8\xb8\xe6\x60\x73\x61\xf3\x73\xeb\x4f\xbc\x30\x46\x1b\x3e\xff\xb7\x01\x3f\x7f\xe7\xe5\x33\xf4\xa3\xa3\x36\xa4\x1f\xb7\x60\x5a\x87\xf1\x76\xcd\xfe\xe7\x1e\xe1\xa0\xfa\x3b\xf8\xfc\xf7\x1e\x5c\xa6\xe8\x76\x2d\x45\x1f\xe1\xa5\x70\x22\x03\x64\xf6\x3f\x2e\x5c\x3c\xd1\x14\xfb\x1c\x77\x62\x1f\x1f\xd2\xdb\xbc\xf7\x9f\x0a\x34\x9f\xeb\xfc\x8e\xb2\x5e\x95\x19\x07\xcb\x11\x38\x53\x7e\xfa\xca\x7f\xcb\xdd\x75\x2f\xb8\xb6\x5e\x2c\x52\x61\xbb\x05\xb4\x76\xb0\xe1\x9f\x05\x27\x3b\x23\x28\xbb\x38\x19\x9d\x5b\x03\x70\xb3\xba\xfc\xb3\x51\x44\x3b\xf1\xeb\x9f\xf5\xe2\xba\x07\x90\x4d\x05\x8d\x7f\x3e\xfd\xb0\xf1\x9e\x04\x62\xb1\x91\xbe\x8d\x0a\xee\x60\xe1\xdc\x61\xb1\x83\x96\x09\xef\x46\xa0\xbb\xa8\xda\x3f\x3b\x28\xdc\x3f\x3b\x09\xc4\x3f\xdb\x94\x7f\x6f\x80\xdb\x0d\xc1\x3f\x7f\x9c\x39\xdc\x93\xe4\x0d\x39\x79\xf5\xd8\x6a\x7e\xbe\x07\xa0\xcd\x20\x76\x6e\x09\x3e\x91\xb0\xb6\x08\x68\xcd\xb0\xfe\xff\x74\x5c\xbf\x45\x5c\x1b\x54\xbf\xd8\xcd\x65\x32\xc6\xf0\x59\x10\xb5\xb2\x8a\xdf\x59\xf2\xbb\x55\xea\x2a\x66\xc4\x08\x7f\xba\x47\x42\xf0\x87\xab\x4e\x43\x9b\x04\x0d\xb7\xf1\xf8\xa1\xf4\x2f\xf4\x15\xcc\x45\x9e\xf1\xfc\xa5\x69\xb7\xad\x9c\x2a\xea\xf2\x85\x72\x30\xe3\x77\x9a\x0c\x5e\xba\x7d\x1e\xf8\x3d\xf8\x5d\xc3\xd2\x52\xf3\xbd\x6f\xf8\xb4\xb8\x5e\x62\x13\x1e\x84\x8f\x7c\x9b\x5d\x00\x3f\xf6\x69\x95\x04\xd6\x69\x43\xf1\xcc\xaf\x34\xf6\xef\x47\x8b\xbe\x73\x59\xf8\xe8\xb7\xe7\xeb\x9a\xea\x9b\x5e\xfe\xd9\x7a\x15\x01\x97\xd7\x7b\x1e\x2a\x26\xdf\x57\xc4\xd0\xe2\x7f\x03\x00\x00\xff\xff\x1c\xbc\x32\x30\x25\x2d\x00\x00") +var _configCrdsKudoDev_instancesYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xe4\x1a\x69\x73\xdb\xc6\xf5\xbb\x7e\xc5\x1b\xa6\x33\x92\x1c\x12\xb4\x94\x4c\x9a\x70\xea\x7a\x5c\xd9\xce\xa8\xf1\xa1\xb1\xe4\x74\x52\x49\x69\x96\xc0\x23\xb1\x11\xb0\x0b\xef\x2e\x48\x31\x71\xfe\x7b\xe7\xbd\x5d\x1c\x14\xc1\x43\x8a\x93\x7e\x28\xbe\x48\xdc\xe3\xdd\x37\xb0\x37\x18\x0c\xf6\x44\x21\xbf\x47\x63\xa5\x56\x23\x10\x85\xc4\x5b\x87\x8a\x7e\xd9\xe8\xe6\x6b\x1b\x49\x3d\x9c\x1d\x8d\xd1\x89\xa3\xbd\x1b\xa9\x92\x11\x9c\x94\xd6\xe9\xfc\x1d\x5a\x5d\x9a\x18\x9f\xe3\x44\x2a\xe9\xa4\x56\x7b\x39\x3a\x91\x08\x27\x46\x7b\x00\x42\x29\xed\x04\x2d\x5b\xfa\x09\x10\x6b\xe5\x8c\xce\x32\x34\x83\x29\xaa\xe8\xa6\x1c\xe3\xb8\x94\x59\x82\x86\x31\x54\xf8\x67\x8f\xa3\x2f\xa3\xc7\x7b\x00\xb1\x41\xbe\x7e\x21\x73\xb4\x4e\xe4\xc5\x08\x54\x99\x65\x7b\x00\x4a\xe4\x38\x02\xa9\xac\x13\x2a\x46\x1b\xdd\x94\x89\x8e\x12\x9c\xed\xd9\x02\x63\x42\x36\x35\xba\x2c\x46\x50\xaf\xfb\x2b\x81\x0e\xcf\xc3\x69\xb8\xcd\x4b\x99\xb4\xee\xbb\xa5\xe5\x57\xd2\x3a\xde\x2a\xb2\xd2\x88\xac\x85\x8d\x57\xad\x54\xd3\x32\x13\xa6\x59\xdf\x03\xb0\xb1\x2e\x70\x04\x6f\x08\x55\x21\x62\x4c\x68\xad\x1c\x9b\x20\xa7\x80\xde\x3a\xe1\x4a\x3b\x82\x5f\x7f\xdb\x03\x98\x89\x4c\x26\xcc\xa5\xdf\xd4\x05\xaa\x67\x67\xa7\xdf\x7f\x71\x1e\xa7\x98\x0b\xbf\x08\x90\xa0\x8d\x8d\x2c\xf8\x5c\x4d\x22\x48\x0b\x2e\x45\xf0\x47\x61\xa2\x0d\xff\xac\x09\x85\x67\x67\xa7\x51\x00\x50\x18\x5d\xa0\x71\xb2\x22\x82\x9e\x96\xd2\xeb\xb5\x3b\xa8\xf6\x89\x16\x7f\x06\x12\x52\x33\x7a\x94\x41\x59\x98\x80\xf5\xc8\xf5\x04\x5c\x2a\x2d\x18\x2c\x0c\x5a\x54\x5e\xf1\xb4\x2c\x14\xe8\xf1\xcf\x18\xbb\x08\xce\xd1\xd0\x45\xb0\xa9\x2e\xb3\x84\xec\x61\x86\xc6\x81\xc1\x58\x4f\x95\xfc\xa5\x86\x66\xc1\x69\x46\x93\x09\x87\xd6\x81\x54\x0e\x8d\x12\x19\x49\xab\xc4\x3e\x08\x95\x40\x2e\x16\x60\x90\xe0\x42\xa9\x5a\x10\xf8\x88\x8d\xe0\xb5\x36\x24\x8a\x89\x1e\x41\xea\x5c\x61\x47\xc3\xe1\x54\xba\xca\x9c\x63\x9d\xe7\xa5\x92\x6e\x31\x64\xa3\x94\xe3\xd2\x69\x63\x87\x09\xce\x30\x1b\x5a\x39\x1d\x08\x13\xa7\xd2\x61\xec\x4a\x83\x43\x51\xc8\x01\x13\xab\xd8\x9a\xa3\x3c\xf9\xac\xd6\xe9\x7e\x4b\x74\x6e\x41\xea\xb7\xce\x48\x35\xad\x97\xd9\xda\xd6\xca\x97\x8c\x8e\xf4\x28\xc2\x35\x4f\x7f\x23\x46\x5a\x22\x49\xbc\x7b\x71\x7e\x01\x15\x52\x2f\x6a\x2f\xd5\xe6\xa8\x6d\x04\x4c\xc2\x91\x6a\x82\xc6\x9f\x9c\x18\x9d\x33\x14\x54\x49\xa1\xa5\x72\xfc\x23\xce\x24\x2a\x47\x06\x9a\x4b\x47\x9a\xfb\x50\xa2\x75\x24\xfb\x08\x4e\xd8\x79\x61\x8c\x50\x16\x89\x70\x98\x44\x70\xaa\xe0\x44\xe4\x98\x9d\x08\x8b\x7f\xb8\x78\x49\x92\x76\x40\xa2\xdb\x2e\xe0\x76\xcc\x59\x3e\xe8\x25\x54\x2f\x57\xc1\xa1\x53\x13\x95\x53\x9d\x17\x18\x2f\x99\x7a\x82\x56\x1a\x32\x4d\x27\x1c\x92\x41\x57\x27\xa3\x16\xa8\x2e\xf7\x0a\xee\x6c\x84\xd3\xa6\xc3\xcf\x56\x28\x78\xbb\x7c\x96\xc9\x95\x13\x89\x64\x1c\x06\x27\x68\x90\x7c\xde\x69\xb2\x15\xbf\x15\xaf\xdc\x09\x9e\x76\x07\xcd\x3a\xea\xd6\x07\x81\x4e\x02\x9f\x9d\x9d\x56\x8e\xef\xfd\x1d\x2b\xba\x56\x30\xae\x55\x56\xf5\x4c\x24\x66\xc9\x99\x70\xe9\x56\xac\xfb\xa7\x13\x8f\x86\xdd\x83\xd9\x2f\x24\xc6\xb8\x14\x5b\x38\xe8\xa1\x48\xc2\x22\x59\x92\xc1\xb0\xd7\xf7\x4e\x10\xfc\xab\x89\x3d\x4e\x48\x05\xc2\x47\x60\xf8\xe7\xf9\xdb\x37\xc3\x6f\xb5\xa7\x0b\x44\x1c\xa3\xb5\x5e\xe5\x39\x2a\xd7\x07\x5b\xc6\x29\x08\x5b\x59\xc3\x39\xed\x44\xb9\x50\x72\x82\xd6\x45\x01\x1a\x1a\x7b\x79\x7c\x1d\xc1\x4b\x6d\x00\x6f\x45\x5e\x64\xd8\x07\xe9\x25\x55\x7b\x6b\xa5\x48\x69\x3d\x33\xf5\x5d\x98\x4b\x97\x32\x49\x85\x4e\x02\xd1\x73\x26\xd6\x89\x1b\x04\x1d\x88\x2d\x11\x32\x79\x83\x23\xe8\x91\x15\xb4\x50\xff\x4a\x29\xee\xb7\x1e\x1c\xcc\x53\x34\x08\x3d\xfa\xd9\xf3\x08\xeb\x80\x4a\x6b\x95\xee\x1a\xc4\x2e\x15\x0e\x9c\x91\xd3\x29\x92\xa5\x73\xa4\x20\x6f\x3c\x04\x6d\x88\x7e\xa5\x5b\x87\x19\x04\xc9\x33\x98\x67\xb2\x42\xc8\xe5\xf1\x75\x0f\x0e\x96\xf9\x02\xa9\x12\xbc\x85\x63\x90\xca\x73\x56\xe8\xe4\x30\x82\x0b\xd6\xcc\x42\x39\x71\x4b\x30\xe3\x54\x5b\x54\xa0\x55\xb6\x20\x8a\x53\x31\x43\xb0\x3a\x47\x98\x63\x96\x0d\xbc\x57\x26\x30\x17\x0b\xe2\xa1\x12\x25\x69\x55\x40\x21\x8c\xbb\x93\x6e\x2e\xde\x3e\x7f\x3b\xf2\xd8\x48\x6d\x53\x45\x28\x28\xac\x4d\x24\x25\x13\xca\x22\x3e\x3c\xb2\xce\x89\x90\xd2\x2b\xc9\x69\x88\x53\xa1\xa6\xe8\xa9\x45\x98\x94\x14\xa8\xa2\xfd\xfb\x5a\xf9\xdd\xd8\xdf\x6d\xe0\x9c\x03\xee\x3a\xd4\xff\x28\xc2\xee\xc4\x16\x97\x5f\x5b\xd9\x7a\xd3\xb2\xb5\x8d\x6c\x51\x21\x68\x14\x3a\x64\xce\x12\x1d\x5b\x62\x2a\xc6\xc2\xd9\xa1\x9e\xa1\x99\x49\x9c\x0f\xe7\xda\xdc\x48\x35\x1d\x90\x31\x0d\xbc\x86\xed\x90\x8b\xba\xe1\x67\xfc\xe7\x41\x5c\x70\x99\xb6\x1b\x2b\x7c\xf4\xcf\xe0\x87\xf0\xd8\xe1\xbd\xd9\xa9\x8a\x83\x5d\xa3\xf9\xfe\x79\x95\x44\xee\xdc\x24\xf3\x9f\xa7\x32\x4e\xab\x8a\xae\x15\xb1\x72\x91\xf8\x90\x26\xd4\xe2\x0f\x37\x51\x12\x5a\x69\x08\xf7\x62\x10\x7a\x87\x81\x50\x09\xfd\x6f\xa5\x75\xb4\x7e\x6f\x29\x95\x72\x07\x87\x7c\x7f\xfa\xfc\xcf\x31\xdc\x52\xde\xdb\xfb\x3a\x2b\x1b\x7a\x0a\x61\x44\x8e\x0e\xcd\x4a\x92\x17\x49\xc2\xdd\x99\xc8\xce\x36\x14\x02\x0f\xc2\x99\x09\xf5\xe2\x16\xe3\xd2\x6d\x2b\x6e\xf6\x2f\x38\x29\x09\x83\xe0\xe6\x9a\x42\x38\x95\x35\x74\x1f\xb0\x02\x00\xb1\x50\x54\x72\xd6\x99\x68\x04\x70\x74\x48\x99\x43\x1a\x8c\x1d\xe5\x84\xd4\xe8\x72\x9a\x86\xa2\x94\xc3\x3d\xc4\xda\x18\xb4\x85\x56\x09\x25\x82\x5a\x0a\x55\xe8\x6e\xd7\x75\xd1\x59\x2d\x23\xc8\x45\x01\x70\x7c\x08\x2b\xb0\x2d\x3a\xae\xba\x83\x01\x2c\xdf\x6f\xf3\xcb\xbf\x38\xc8\xf9\x04\xf2\xaf\x54\x66\x58\x53\x0b\x07\x47\x87\x15\x27\x16\x52\x51\x14\xa8\x2c\xa5\x55\xb3\x00\x27\x73\x04\x01\xa5\x45\x13\x12\x8d\xf5\x19\xcc\x13\xd7\x07\xd1\x90\x75\x70\x7c\xd8\x4a\xcd\x2c\x30\x76\x4a\x4b\xa5\x7e\x52\x37\x7d\x56\xba\xd2\xf7\xda\x30\x4f\x51\xb5\xac\x01\x12\x8d\x56\xed\xef\xbb\x2a\xa7\x61\x34\x8d\x08\x1d\x1a\xa9\x13\x19\xc3\x58\xc4\x37\x65\xc1\xf5\x48\x8d\x87\xac\xd7\xc8\xa4\xea\x3e\xf0\x56\x5a\x16\x4a\x38\x3b\x91\x19\x46\xf0\xac\xb6\xab\x6c\x11\xea\x15\xcd\x5c\x1a\xad\x73\xa6\x2c\x26\xc9\x65\x9c\xa0\xd5\x12\x50\xef\xd7\xc4\x9f\x29\x95\x62\xc5\x65\x42\xd9\x3b\xf9\x16\xde\x68\x87\x23\x58\x92\x7a\x10\x76\x55\xa1\xb3\x40\xb8\x24\x21\x0c\x6b\x6c\xc1\xfa\x0a\xe7\xf4\x1c\x4e\xde\xbf\x7b\xf7\xe2\xcd\xc5\xab\x1f\x82\xd5\x51\x63\xf3\x96\xcb\xea\x56\xe3\xdc\x1a\x54\xc0\xc1\xe9\xc9\x21\x89\x26\xd1\x0a\x7d\x21\xe3\xe5\x11\xa8\xe9\xb7\x2b\x88\xb9\xcc\x32\xb2\xdf\x38\x43\x61\x08\xf2\x0b\x11\xa7\x77\x6d\x3c\x15\xa4\xeb\x52\xc9\x0f\x25\x02\x05\x1a\xab\xab\x9a\x94\xf5\x48\xac\xf0\x95\x31\x05\x9f\x41\xa3\x12\xe9\x3c\x02\x2e\x8a\x04\x28\x9c\xd3\xf5\xbb\xd1\x63\x53\xa9\x5f\x04\x7b\xed\x0a\x80\x1b\x83\x66\x98\x58\x6c\x8b\x9b\xb5\x8e\xce\xf9\x3c\xc4\xa2\x20\x35\xfa\x36\xaa\x6e\x9f\x38\xaa\xea\x2c\xd3\xe5\xfd\xbb\x86\x5d\xa2\x37\xc9\x94\x1b\x6a\x82\xe4\x15\x9f\xea\x2c\xb1\x95\xcc\x4f\x9f\x87\x19\x41\x1f\xa4\x8a\xb3\x92\x4d\xe5\xfd\xfb\xd3\xe7\x36\x02\xf8\x07\xc6\xa2\xb4\x54\x6f\x92\xc6\xf7\x1d\xbc\x7d\xf3\xea\x07\x72\x54\x7f\x22\xa8\x9b\xc0\x2b\x10\x99\xf4\x93\x0a\x4f\x2c\xdf\xf6\xb5\x28\x63\xae\xb9\x97\xca\x51\x9f\x4d\xf6\x99\x62\x56\x50\xe8\xb9\x41\xb0\xa5\x09\xd4\x11\x60\xde\xe5\xa4\x00\x89\xe6\x1a\x75\x8a\x8e\xec\x70\x92\x71\xf7\xfd\x49\x72\x44\x77\x53\xbc\xa2\xdb\xee\xb6\xd8\xab\xb4\xdd\x18\xeb\x71\x88\x41\x2b\x9d\xf1\x0e\x8d\x71\x4c\x3e\xda\x9a\x0d\x36\x8f\x74\x98\x77\xd8\xda\x12\x55\xbd\x93\xea\x7a\xd5\x98\x10\x69\x4e\xc8\xcc\x72\xdc\x21\x67\x15\xd4\x95\xb8\xba\xd9\xf1\x01\xa7\x6d\x86\x92\x07\x64\x50\x4d\x31\x23\x18\x0c\x06\xa1\x21\x71\xa6\xa4\x9e\x32\xe8\x2e\x09\x71\x36\x04\x76\xb2\x06\xe1\x2d\xc0\x18\xb1\x00\xe1\xc7\x29\x3e\x06\x14\xc2\xa5\x10\x79\xa1\x46\x0d\x93\x11\x2c\x37\x85\x6c\x21\x2f\xb5\x0e\x62\xf5\x08\x7f\x65\x46\x87\x43\x78\x57\x8f\x74\x5a\x82\x0e\xd1\x9d\x73\xde\x44\xeb\x7d\xbb\xcc\x53\x54\x5d\xfe\x4e\xe9\xb9\xea\x22\x81\x71\x0a\x83\x23\xb8\xea\x3d\x9b\x09\x99\x89\x71\x86\x57\xbd\x3e\x5c\xf5\xce\x8c\x9e\x1a\xb4\x56\xaa\x29\x2d\x90\x31\x5e\xf5\x9e\xe3\xd4\x88\x04\x93\xab\x5e\x05\xfa\xf3\x42\xb8\x38\x7d\x8d\x66\x8a\xdf\xe1\xe2\x09\x03\x5c\xda\x3a\x77\x46\x38\x9c\x2e\x9e\xe4\x74\xa6\xde\xcb\xa4\x75\x17\x8b\x02\x9f\x70\xd2\x6d\x2d\xbe\x16\xc5\x12\xa0\x5a\xad\x16\x2e\xaf\x73\x74\x62\x76\x14\x35\xaa\xfe\xe9\x67\xab\xd5\xe8\xaa\xd7\xf0\xd4\xd7\x39\x99\x4b\xe1\x16\x57\x3d\x58\xa2\x60\x74\xd5\x63\x1a\xaa\xf5\x8a\xe8\xd1\x55\x8f\xb0\xd1\xb2\xd1\x4e\x8f\xcb\xc9\xe8\xaa\x37\x5e\x38\xb4\xfd\xa3\xbe\xc1\xa2\x4f\x4e\xf8\xa4\xc1\x70\xd5\xfb\x09\xae\x54\x45\xb4\x76\x29\x1a\xaf\x69\x0b\xbf\xf5\x56\x23\xec\x86\xe8\x0b\x90\x09\xeb\x2e\x8c\x50\x56\x56\x53\xed\xae\x53\x77\x4c\x7d\xf5\x52\x35\xf6\xa5\x1d\x5f\x4a\x84\x6e\x3e\x88\xc9\xd5\xa7\xc9\x6e\x8d\xce\xd9\x1d\xbc\x3d\xf0\xc8\x41\x31\x1b\x55\xf3\xed\x73\xcf\x18\x7d\xdd\x40\xa0\x4a\x95\xa0\xc9\x16\x9c\xa7\x1b\x3f\xe3\xe2\x21\x89\x00\x4e\x27\x3e\x6e\x85\x66\xfa\x86\xec\x8d\x02\x23\x2a\x28\x6d\x55\x31\x30\x5d\x35\x44\xf2\x33\xef\x1f\x01\x0c\x87\xd0\x98\x2a\x65\x32\xc2\xae\xf0\x06\xe4\x72\xb9\x70\x23\xa0\x52\x6f\x40\xf0\x3a\x4f\x6d\xcc\x17\x00\x39\x5a\x2b\xa6\xbb\x08\x3a\x9c\xf4\xb9\x23\x2d\x73\xa1\xc0\xa0\x48\x88\xbe\x66\x4f\x25\x32\x16\x5c\x09\x55\xe1\x46\x8c\x75\xe9\x03\x40\x23\xf7\x20\xda\x5c\x2c\x48\xae\x94\xfe\xc9\x44\xab\x3c\xd1\x49\x4a\x2e\x6e\x5f\xa1\x9a\xba\x74\x04\x5f\x1c\xff\xf5\xab\xaf\x1f\xc2\x6b\x15\x90\xbf\x45\x85\x46\x74\x95\xe4\x1d\x6c\xaf\x5e\x6a\x4d\x94\x99\xaf\xa8\x1a\xb0\x46\xd3\xe6\x8c\x1f\x19\x2d\xd9\xdd\x5c\x58\x2a\x9e\x61\x2c\x2c\x26\x50\x16\x24\x07\x0a\x7a\x55\x59\xc5\x7d\x63\x27\x30\x69\x5b\x05\xe1\xd1\x71\x1f\xc6\x41\xa4\xab\x51\xec\xf2\xf6\x3a\xea\x20\x59\x5a\xf8\xa6\x7f\x87\x1e\x2a\x47\x4b\x4e\x00\xdc\x2c\x70\xf1\x46\xd5\x61\x98\xf0\xac\xc9\x0a\x4d\x19\xb8\xd9\x2a\xa5\x72\x5f\x7d\xd9\xad\x4a\xa9\x64\x5e\xe6\x23\x78\xbc\x41\x89\x94\x58\xa6\x68\x3a\x4e\x18\x14\x76\x27\xcd\xf9\x83\x4d\x02\x14\x14\x7e\xa6\x46\xe4\xb9\x70\x32\x06\x99\x50\x2b\x3d\x91\xdc\x0a\xd5\x66\xeb\x7b\x5a\xbe\x58\xb5\x0e\xb5\xc4\xf6\x6d\x88\x29\x2d\x43\x3e\x33\x3a\x29\x63\x2a\xa1\xf5\xa4\x19\x3b\xb7\x82\xcd\xa2\x40\x6f\xe9\xbe\x34\x00\xbc\x25\x01\xd7\x2f\x62\xfc\xbb\x1a\x14\x54\xe3\xdb\x80\xb2\x2a\x98\x7d\xa2\x99\xa7\xc8\x51\x95\x5f\x2b\x85\x3b\x86\xa9\xb2\x32\xe1\xca\x57\xc0\xb4\x14\x46\x28\x87\x98\xf0\x3b\x2d\xb8\xa8\xce\xb6\xc2\x97\x68\x5e\x4f\xd4\x15\xd9\x45\x53\x9c\x13\x89\xe1\x95\x06\x7b\xe3\x56\x37\x3c\x7a\x7c\xbc\x56\xbf\xf5\x99\xce\x03\x85\x70\x0e\x8d\x1a\xc1\x8f\x97\xcf\x06\xff\x16\x83\x5f\xae\x0f\xc2\x3f\x8f\x07\xdf\xfc\xa7\x3f\xba\x7e\xd4\xfa\x79\x7d\xf8\xf4\x2f\x0f\x71\xf6\xf5\x35\xf9\x1d\x33\x09\x81\xbf\x19\xfa\x7a\xcd\xf5\x39\x2b\xe8\x09\x5c\x98\x12\xfb\xf0\x52\x64\x16\xfb\xf0\x5e\x71\x38\xef\x16\x0e\xaa\x32\xef\x46\x38\x80\x1e\x81\x59\x4d\x88\x61\x93\xa1\xaf\xdb\x0d\x38\x1f\x22\x04\xde\xde\x2e\x02\xae\x2f\xf4\xa4\x1d\x1b\x5a\x2f\xb3\x78\xc8\x4d\xee\xa0\xa3\x50\x9f\x45\xb1\xce\x87\xad\x97\x5d\x54\x18\xbe\x16\x6a\x01\x4d\x20\xf2\xd5\xd4\x5d\x7b\xb5\xbe\xd2\x8f\x8d\xb6\xb6\x1e\xab\x59\x9e\xd7\x43\x5d\x72\xf9\xf0\x36\x0e\x9d\x86\x30\x63\xe9\x8c\x30\x8b\x56\x49\x5c\x0d\x42\x4a\x8b\x93\x32\x83\x03\x8b\x08\x91\xd2\x09\xae\xc6\xc3\x43\x1f\xf5\xc4\x58\x66\xd2\xf1\xd0\x3c\x41\x6e\x1b\x64\x28\x60\xf3\x42\x1b\x27\x94\xf3\x4e\x63\x70\x8a\xb7\xd4\x4a\xe6\x54\x14\x21\xb7\x32\x07\x89\xb2\x47\x47\xc7\x5f\x9c\x97\xe3\x44\xe7\x42\xaa\x97\xb9\x1b\x1e\x3e\x3d\xf8\x50\x8a\x8c\x07\xfc\xd4\x33\xbe\xcc\xdd\xe1\xd6\xc4\x75\xf4\xd5\x16\x7f\x38\xb8\xf4\x56\x7f\x7d\x70\x39\x08\xff\x3d\xaa\x96\x0e\x9f\x1e\x5c\x45\x1b\xf7\x0f\x1f\x11\x59\x2d\x5f\xba\xbe\x1c\x34\x8e\x14\x5d\x3f\x3a\x7c\xda\xda\x3b\x7c\x80\x5b\x19\xfc\x50\x4a\x83\x1d\x4d\xe6\xa0\xa3\x10\xeb\x38\x14\x0a\x85\x8e\x1d\x1f\x74\x3b\x36\xbc\x4a\x3b\x36\x88\xd2\x35\x53\xba\x8e\x51\x5c\xb5\xc5\x3d\xc9\xca\x90\xee\xbc\x33\x5a\xec\x36\x18\x5c\xee\xbc\xce\x6a\x68\xd0\x7e\xdd\xcf\xaf\xd6\xea\x48\x13\x26\x7b\x57\x8a\x8c\xce\xfa\xb1\x9f\x7f\xcf\xc6\x99\xd6\x67\x85\x26\xcd\xd8\xaa\xc4\xee\x78\x3e\xc2\x1b\x9c\xa1\xa9\xe7\x35\xf0\x71\xdd\xc9\xe6\xc6\x96\x67\xe6\x8f\xbc\x30\x46\x1b\xbe\xf0\xb7\x01\x3f\x7f\xe7\xe5\x33\xf4\xd3\xa3\x25\x50\x3f\x6e\xc3\xb5\x0e\xe9\x6c\xdd\x81\xcf\x3d\xce\x41\xf5\x77\xf0\xf9\xef\x3f\xb9\xb2\x3e\x5b\x4b\xd5\x47\x78\x29\x9c\xc8\x00\x59\x08\xcb\x6c\x9c\x68\x0a\x82\x8e\x5b\xb2\x8f\x0f\x69\x72\xde\xfb\x6f\x06\x9a\xef\x76\x7e\x47\x7d\xaf\xca\x8c\xa3\xe6\x08\x9c\x29\x3f\x7d\x0b\xb0\xe5\xee\xba\x37\x5d\x5b\x2f\x16\xa9\xb0\xdd\x02\x5a\x3b\xe1\xf0\xcf\x92\xb7\x9d\x11\x94\x5d\xbc\x8d\xce\xad\x01\xb8\x59\x5d\xfe\xd9\x28\xa2\x9d\xf8\xf5\xcf\x7a\x71\xdd\x03\xc8\xa6\xca\xc6\x3f\x9f\x7e\xea\x78\x4f\x02\xb1\xd8\x48\xdf\x46\x05\x77\xb0\x70\xee\xb0\xd8\x41\xcb\x84\x77\x23\xd0\x5d\x54\xed\x9f\x1d\x14\xee\x9f\x9d\x04\xe2\x9f\x6d\xca\xbf\x37\xc0\xed\x86\xe0\x9f\x3f\xce\x1c\xee\x49\xf2\x86\xe4\xbc\x7a\x6c\x35\x51\xdf\x03\xd0\x66\x10\x3b\xf7\x06\x9f\x48\x58\x5b\x04\xb4\x66\x6a\xff\x7f\x3a\xb7\xdf\x22\xae\x0d\xaa\x5f\x6e\xeb\x32\x19\x63\xf8\x3e\x88\x7a\x5a\xc5\x2f\x2f\xf9\x25\x2b\xb5\x17\x73\x62\x84\xbf\xe1\x23\x21\xf8\xc3\x55\xcb\xa1\x4d\x82\x86\xfb\x79\xfc\x50\xfa\x37\xfb\x0a\x16\x22\xcf\x78\x10\xd3\xf4\xdd\x56\x4e\x15\xb5\xfb\x42\x39\x98\xf3\xcb\x4d\x06\x2f\xdd\x3e\x4f\xfe\x1e\xfc\xd2\xe1\xce\x52\xf3\xe1\x6f\xf8\xc6\xb8\x5e\x62\x13\x1e\x84\xaf\x7d\x9b\x5d\x00\x3f\xff\x69\x95\x04\xd6\x69\x43\xf1\xcc\xaf\x34\xf6\xef\x67\x8c\xbe\x85\x59\xfa\xfa\xb7\xe7\xeb\x9a\xea\xe3\x5e\xfe\xd9\x7a\x27\x01\x97\xd7\x7b\x1e\x2a\x26\xdf\x57\xc4\xd0\xe2\x7f\x03\x00\x00\xff\xff\x94\xba\x21\x90\x2e\x2d\x00\x00") func configCrdsKudoDev_instancesYamlBytes() ([]byte, error) { return bindataRead( diff --git a/pkg/kudoctl/packages/reader/reader.go b/pkg/kudoctl/packages/reader/reader.go index 7ebd06020..accf1f1e2 100644 --- a/pkg/kudoctl/packages/reader/reader.go +++ b/pkg/kudoctl/packages/reader/reader.go @@ -25,10 +25,10 @@ func Read(fs afero.Fs, path string) (*packages.Resources, error) { if fi.Mode().IsRegular() && strings.HasSuffix(path, ".tgz") { clog.V(0).Printf("%v is a tgz package", path) return ReadTar(fs, path) - } else if fi.IsDir() { + } + if fi.IsDir() { clog.V(0).Printf("%v is a file package", path) return ResourcesFromDir(fs, path) - } else { - return nil, fmt.Errorf("unsupported file system format %v. Expect either a *.tgz file or a folder", path) } + return nil, fmt.Errorf("unsupported file system format %v. Expect either a *.tgz file or a folder", path) } diff --git a/pkg/kudoctl/packages/resolver/resolver_local.go b/pkg/kudoctl/packages/resolver/resolver_local.go index a51dcd3c1..721ac3c94 100644 --- a/pkg/kudoctl/packages/resolver/resolver_local.go +++ b/pkg/kudoctl/packages/resolver/resolver_local.go @@ -37,12 +37,12 @@ func (f *LocalResolver) Resolve(name string, appVersion string, operatorVersion if fi.Mode().IsRegular() && strings.HasSuffix(name, ".tgz") { clog.V(1).Printf("%v is a local tgz package", name) return reader.ReadTar(f.fs, name) - } else if fi.IsDir() { + } + if fi.IsDir() { clog.V(1).Printf("%v is a local file package", name) return reader.ResourcesFromDir(f.fs, name) - } else { - return nil, fmt.Errorf("unsupported file system format %v. Expect either a *.tgz file or a folder", name) } + return nil, fmt.Errorf("unsupported file system format %v. Expect either a *.tgz file or a folder", name) } // NewLocal creates a resolver for local operator package diff --git a/pkg/kudoctl/resources/upgrade/operatorversion_test.go b/pkg/kudoctl/resources/upgrade/operatorversion_test.go index 8d27f8108..06d55e828 100644 --- a/pkg/kudoctl/resources/upgrade/operatorversion_test.go +++ b/pkg/kudoctl/resources/upgrade/operatorversion_test.go @@ -103,14 +103,14 @@ func Test_UpgradeOperatorVersion(t *testing.T) { newOv.SetNamespace(installNamespace) err := OperatorVersion(c, &newOv, "test", nil, nil) - if err != nil { + switch { + case err != nil: if !strings.Contains(err.Error(), tt.errMessageContains) { t.Errorf("%s: expected error '%s' but got '%v'", tt.name, tt.errMessageContains, err) } - } else if tt.errMessageContains != "" { + case tt.errMessageContains != "": t.Errorf("%s: expected no error but got %v", tt.name, err) - } else { - // the upgrade should have passed without error + default: instance, err := c.GetInstance(testInstance.Name, installNamespace) if err != nil { t.Errorf("%s: error when getting instance to verify the test: %v", tt.name, err)