diff --git a/pkg/occlient/occlient.go b/pkg/occlient/occlient.go index 82e29b7b76e..62605768390 100644 --- a/pkg/occlient/occlient.go +++ b/pkg/occlient/occlient.go @@ -23,6 +23,7 @@ import ( "github.com/openshift/odo/pkg/config" "github.com/openshift/odo/pkg/devfile/adapters/common" "github.com/openshift/odo/pkg/log" + "github.com/openshift/odo/pkg/odo/util/experimental" "github.com/openshift/odo/pkg/preference" "github.com/openshift/odo/pkg/util" @@ -753,6 +754,9 @@ 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, err } diff --git a/pkg/odo/cli/component/create.go b/pkg/odo/cli/component/create.go index 068901dedf2..e4e0dd07b91 100644 --- a/pkg/odo/cli/component/create.go +++ b/pkg/odo/cli/component/create.go @@ -474,9 +474,14 @@ func (co *CreateOptions) Complete(name string, cmd *cobra.Command, args []string return errors.Wrap(err, "failed intiating local config") } - // Do not execute S2I specific code on Kubernetes Cluster + // Do not execute S2I specific code on Kubernetes Cluster or Docker // return from here, if it is not an openshift cluster. - openshiftCluster, _ := co.Client.IsImageStreamSupported() + var openshiftCluster bool + if !pushtarget.IsPushTargetDocker() { + openshiftCluster, _ = co.Client.IsImageStreamSupported() + } else { + openshiftCluster = false + } if !openshiftCluster { return errors.New("component not found") }