Skip to content

Commit

Permalink
use a more specific error message for when image is not found (redhat…
Browse files Browse the repository at this point in the history
…-developer#3322)

* use a specific error message for when image is not found

* added amit's changes
  • Loading branch information
Girish Ramnani authored and cdrage committed Jun 17, 2020
1 parent a6ccc0f commit 0d32275
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/occlient/occlient.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ func (c *Client) GetImageStream(imageNS string, imageName string, imageTag strin
if e != nil && err != nil {
// Imagestream not found in openshift and current namespaces
if experimental.IsExperimentalModeEnabled() {
return nil, fmt.Errorf("component %q not found", imageName)
return nil, fmt.Errorf("component type %q not found", imageName)
}
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/odo/cli/component/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ func (co *CreateOptions) Complete(name string, cmd *cobra.Command, args []string
openshiftCluster = false
}
if !openshiftCluster {
return errors.New("component not found")
return errors.New("component type not found")
}

// check to see if config file exists or not, if it does that
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/devfile/cmd_devfile_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var _ = Describe("odo devfile create command tests", func() {
It("should fail to create the devfile componet with invalid component type", func() {
fakeComponentName := "fake-component"
output := helper.CmdShouldFail("odo", "create", fakeComponentName)
expectedString := "\"" + fakeComponentName + "\" not found"
expectedString := "component type \"" + fakeComponentName + "\" not found"
helper.MatchAllInOutput(output, []string{expectedString})
})
})
Expand Down

0 comments on commit 0d32275

Please sign in to comment.