Skip to content

Commit 18892a8

Browse files
committed
Add a new line before warning, and use corev1.NamespaceDefault instead of default
Signed-off-by: Parthvi Vala <[email protected]>
1 parent 01397ac commit 18892a8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/odo/genericclioptions/util.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package genericclioptions
22

33
import (
4+
"fmt"
45
"github.com/redhat-developer/odo/pkg/kclient"
56
"github.com/redhat-developer/odo/pkg/log"
67
pkgUtil "github.com/redhat-developer/odo/pkg/util"
8+
v1 "k8s.io/api/core/v1"
79

810
dfutil "github.com/devfile/library/v2/pkg/util"
911
)
@@ -39,12 +41,12 @@ func ApplyIgnore(ignores *[]string, sourcePath string) (err error) {
3941

4042
// WarnIfDefaultNamespace warns when user tries to run `odo dev` or `odo deploy` in the default namespace
4143
func WarnIfDefaultNamespace(namespace string, kubeClient kclient.ClientInterface) {
42-
if namespace == "default" {
44+
if namespace == v1.NamespaceDefault {
4345
noun := "namespace"
4446
if isOC, _ := kubeClient.IsProjectSupported(); isOC {
4547
noun = "project"
4648
}
47-
49+
fmt.Println()
4850
log.Warningf("You are using \"default\" %[1]s, odo may not work as expected in the default %[1]s.", noun)
4951
log.Warningf("You may set a new %[1]s by running `odo create %[1]s <name>`, or set an existing one by running `odo set %[1]s <name>`", noun)
5052
}

0 commit comments

Comments
 (0)