Skip to content

Commit

Permalink
Add a new line before warning, and use corev1.NamespaceDefault instea…
Browse files Browse the repository at this point in the history
…d of default

Signed-off-by: Parthvi Vala <pvala@redhat.com>
  • Loading branch information
valaparthvi committed Mar 28, 2023
1 parent 01397ac commit 18892a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/odo/genericclioptions/util.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package genericclioptions

import (
"fmt"
"github.com/redhat-developer/odo/pkg/kclient"
"github.com/redhat-developer/odo/pkg/log"
pkgUtil "github.com/redhat-developer/odo/pkg/util"
v1 "k8s.io/api/core/v1"

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

// WarnIfDefaultNamespace warns when user tries to run `odo dev` or `odo deploy` in the default namespace
func WarnIfDefaultNamespace(namespace string, kubeClient kclient.ClientInterface) {
if namespace == "default" {
if namespace == v1.NamespaceDefault {
noun := "namespace"
if isOC, _ := kubeClient.IsProjectSupported(); isOC {
noun = "project"
}

fmt.Println()
log.Warningf("You are using \"default\" %[1]s, odo may not work as expected in the default %[1]s.", noun)
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)
}
Expand Down

0 comments on commit 18892a8

Please sign in to comment.