Skip to content

Commit

Permalink
update return statments
Browse files Browse the repository at this point in the history
Signed-off-by: anandrkskd <[email protected]>
  • Loading branch information
anandrkskd committed Oct 1, 2021
1 parent 7d9e7a5 commit f673f55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion pkg/odo/cli/registry/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ func TestIsSecure(t *testing.T) {
t.Errorf("Unable to add registry to preference file with error: %v", err)
}

got, _ := IsSecure(tt.registryName)
got, err := IsSecure(tt.registryName)
if err != nil {
t.Errorf("Unable to check if the registry is secure or not")
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("Got: %t, want %t", got, tt.want)
}
Expand Down
7 changes: 4 additions & 3 deletions pkg/odo/genericclioptions/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/openshift/odo/pkg/devfile"
"github.com/openshift/odo/pkg/devfile/validate"
"github.com/openshift/odo/pkg/localConfigProvider"
"github.com/openshift/odo/pkg/odo/util"
odoutil "github.com/openshift/odo/pkg/util"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -202,12 +203,12 @@ func NewConfigContext(command *cobra.Command) (*Context, error) {

// NewContextCompletion disables checking for a local configuration since when we use autocompletion on the command line, we
// couldn't care less if there was a configuration. We only need to check the parameters.
func NewContextCompletion(command *cobra.Command) (*Context, error) {
func NewContextCompletion(command *cobra.Command) *Context {
ctx, err := newContext(command, false, true)
if err != nil {
return nil, err
util.LogErrorAndExit(err, "")
}
return ctx, nil
return ctx
}

// UpdatedContext returns a new context updated from config file
Expand Down

0 comments on commit f673f55

Please sign in to comment.