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

Confusing message about default project. #4309

Closed
kadel opened this issue Dec 14, 2020 · 9 comments · Fixed by #4396
Closed

Confusing message about default project. #4309

kadel opened this issue Dec 14, 2020 · 9 comments · Fixed by #4396
Assignees
Labels
area/UX Issues or PRs related to User Experience good first issue Denotes an issue ready for a new contributor. Maintainers will help mentor new contributors. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).

Comments

@kadel
Copy link
Member

kadel commented Dec 14, 2020

▶ odo create java-maven
 ⚠  odo may not work as expected in a default project, please run the odo component in a non-default project. To create a new project, use `odo project create`.
Validation
 ✓  Checking devfile existence [23679ns]
 ✓  Creating a devfile component from registry: DefaultDevfileRegistry [51231ns]
 ✓  Validating devfile component [95996ns]

Please use `odo push` command to create the component with source deployed

⚠ odo may not work as expected in a default project, please run the odo component in a non-default project. To create a new project, use odo project create.

This is a really confusing message for both Kubernetes and OpenShift users

Kubernetes

For minikube or any other Kubernetes users this message provides no value. It doesn't matter if they are using the default project or not.

Solution

Add a condition that will check if the cluster supports Project resource. If not, the warning should not be displayed even if the default project is being used.

OpenShift

OpenShift users should not use the default project.
But the problem is that if the user does what the warning says; run odo project create it won't help them, the component project name is already recorded in env.yml, so it will have no effect on the existing component.

Solution

Not sure what to do here. I would probably make this warning error and completely prevent users from using default project on OpenShift.

(a little bit of background why we don't users to use default project is in #4027 (comment))

@kadel kadel added area/debug area/UX Issues or PRs related to User Experience priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). labels Dec 14, 2020
@girishramnani girishramnani self-assigned this Dec 30, 2020
@girishramnani
Copy link
Contributor

I can work on this

@dharmit
Copy link
Member

dharmit commented Jan 18, 2021

/unassign @girishramnani

/good-first-issue

@openshift-ci-robot
Copy link
Collaborator

@dharmit:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

/unassign @girishramnani

/good-first-issue

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added good first issue Denotes an issue ready for a new contributor. Maintainers will help mentor new contributors. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jan 18, 2021
@niconosenzo
Copy link
Contributor

@dharmit I would like to work on this if you don't mind.

@dharmit
Copy link
Member

dharmit commented Jan 22, 2021

/assign @niconosenzo

Nicolas, it's yours. Make sure to take a look at solution proposed by @kadel and ask us questions if anything's confusing. As for checking if the project resource is supported, we already have a function in odo code: https://github.com/openshift/odo/blob/474bfd6a30274a8e86691e9e3aa8f200bfb921cb/pkg/occlient/projects.go#L209-L212

@niconosenzo
Copy link
Contributor

niconosenzo commented Jan 22, 2021

@dharmit @kadel

		// Check whether resource "Project" is supported
		projectSupported, err := co.Client.IsProjectSupported()

		if err != nil {
			// we don't need to return (fail) if this happens
			log.Warning("Project resource supportability check failed.")
		}

		if projectSupported && componentNamespace == "default" {
			return errors.New("odo may not work as expected in a default project, please run the odo component in a non-default project")
		}

This code patch is currently lacking of user-kind verification, it will fail and exit if "default" project is being used, is there any preferred way to check if it's a kubernetes or Openshift User?

@dharmit
Copy link
Member

dharmit commented Jan 28, 2021

This code patch is currently lacking of user-kind verification
is there any preferred way to check if it's a kubernetes or Openshift User?

I'm lost about why the "user" thing matters here. I think the idea is to check if the user's running k8s cluster in backend or an OCP cluster. And the way to do that would be to check if Project is supported.

As far as user is concerned, we don't bother much about it.

Please let me know if I'm missing something w.r.t your question.

@niconosenzo
Copy link
Contributor

I'm lost about why the "user" thing matters here. I think the idea is to check if the user's running k8s cluster in backend or an OCP cluster.

Sorry that's what I meant. So, IsProjectSupported() would be fairly enough for that means, correct ? If so, I will submit the patch code.

@dharmit
Copy link
Member

dharmit commented Jan 29, 2021

Yes, IsProjectSupported should be good for starters. Once you have a patch, let's see if that suffices. I think it should. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/UX Issues or PRs related to User Experience good first issue Denotes an issue ready for a new contributor. Maintainers will help mentor new contributors. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants