Skip to content

Commit

Permalink
Removing KUDO references and Warning on Deprecated use of kudo.dev (#236
Browse files Browse the repository at this point in the history
)

Signed-off-by: Ken Sipe <kensipe@gmail.com>
  • Loading branch information
kensipe authored Oct 20, 2020
1 parent d273e14 commit 0f356f8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/kuttlctl/cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The test operator supports connecting to an existing Kubernetes cluster or it ca
It can also apply manifests before running the tests. If no arguments are provided, the test harness will attempt to
load the test configuration from kuttl-test.yaml.
For more detailed documentation, visit: https://kudo.dev/docs/testing`,
For more detailed documentation, visit: https://kuttl.dev`,
Example: testExample,
PreRunE: func(cmd *cobra.Command, args []string) error {
flags := cmd.Flags()
Expand Down
2 changes: 1 addition & 1 deletion pkg/test/case.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (t *Case) determineNamespace() *namespace {
}
// no preferred ns, means we auto-create with petnames
if t.PreferredNamespace == "" {
ns.Name = fmt.Sprintf("kudo-test-%s", petname.Generate(2, "-"))
ns.Name = fmt.Sprintf("kuttl-test-%s", petname.Generate(2, "-"))
ns.AutoCreated = true
}
// if we have a preferred namespace, we do NOT auto-create
Expand Down
4 changes: 2 additions & 2 deletions pkg/test/step_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func TestCheckResourceIntegration(t *testing.T) {
},
} {
t.Run(test.testName, func(t *testing.T) {
namespace := fmt.Sprintf("kudo-test-%s", petname.Generate(2, "-"))
namespace := fmt.Sprintf("kuttl-test-%s", petname.Generate(2, "-"))

err := testenv.Client.Create(context.TODO(), testutils.NewResource("v1", "Namespace", namespace, ""))
if !k8serrors.IsAlreadyExists(err) {
Expand Down Expand Up @@ -404,7 +404,7 @@ func TestStepFailure(t *testing.T) {
},
}

namespace := fmt.Sprintf("kudo-test-%s", petname.Generate(2, "-"))
namespace := fmt.Sprintf("kuttl-test-%s", petname.Generate(2, "-"))

err := testenv.Client.Create(context.TODO(), testutils.NewResource("v1", "Namespace", namespace, ""))
if !k8serrors.IsAlreadyExists(err) {
Expand Down
15 changes: 9 additions & 6 deletions pkg/test/utils/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ func ConvertUnstructured(in runtime.Object) (runtime.Object, error) {
// Deprecated: kudo.dev is deprecated.
kudoGroup := "kudo.dev"
kuttlGroup := "kuttl.dev"
if group == kudoGroup {
log.Print("WARNING: kudo.dev group has been deprecated and is schedule to be removed in KUTTL 0.8.0")
}
if (group == kudoGroup || group == kuttlGroup) && kind == "TestStep" {
converted = &harness.TestStep{}
} else if (group == kudoGroup || group == kuttlGroup) && kind == "TestAssert" {
Expand Down Expand Up @@ -1043,10 +1046,10 @@ func RunCommand(ctx context.Context, namespace string, cmd harness.Command, cwd
return nil, fmt.Errorf("command %q with %w", cmd.Command, err)
}

kudoENV := make(map[string]string)
kudoENV["NAMESPACE"] = namespace
kudoENV["KUBECONFIG"] = fmt.Sprintf("%s/kubeconfig", actualDir)
kudoENV["PATH"] = fmt.Sprintf("%s/bin/:%s", actualDir, os.Getenv("PATH"))
kuttlENV := make(map[string]string)
kuttlENV["NAMESPACE"] = namespace
kuttlENV["KUBECONFIG"] = fmt.Sprintf("%s/kubeconfig", actualDir)
kuttlENV["PATH"] = fmt.Sprintf("%s/bin/:%s", actualDir, os.Getenv("PATH"))

// by default testsuite timeout is the command timeout
// 0 is allowed for testsuite which means forever (or no timeout)
Expand All @@ -1070,7 +1073,7 @@ func RunCommand(ctx context.Context, namespace string, cmd harness.Command, cwd
defer cancel()
}

builtCmd, err := GetArgs(cmdCtx, cmd, namespace, kudoENV)
builtCmd, err := GetArgs(cmdCtx, cmd, namespace, kuttlENV)
if err != nil {
return nil, fmt.Errorf("processing command %q with %w", cmd.Command, err)
}
Expand All @@ -1083,7 +1086,7 @@ func RunCommand(ctx context.Context, namespace string, cmd harness.Command, cwd
builtCmd.Stderr = stderr
}
builtCmd.Env = os.Environ()
for key, value := range kudoENV {
for key, value := range kuttlENV {
builtCmd.Env = append(builtCmd.Env, fmt.Sprintf("%s=%s", key, value))
}

Expand Down

0 comments on commit 0f356f8

Please sign in to comment.