Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show imagestreams error on experimental mode #3265

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/occlient/occlient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
}

Expand Down
9 changes: 7 additions & 2 deletions pkg/odo/cli/component/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down