-
Bug
-
Resolution: Done
-
Critical
-
3.1.0.GA
-
None
-
False
-
None
-
False
-
Release Notes
-
-
Known Issue
-
Done
-
Workaround Exists
-
-
- Login into DS as OCP user with admin rights
- Start Java Fuse or Node JS sample workspace
- Run the deploy to OC command in the workspace
Deploy to openshift doesn't work out of the box when Dev Spaces is installed and using as kubeadmin user, because there is no default project when admin user is logging into OpenShift, so there is not OpenShift project to deployed to:
Red Hat Fuse devfile
[INFO] --- openshift-maven-plugin:7.10.0.fuse-sb2-7_10_0-00014-redhat-00001:build (default) @ fuse-rest-http-booster --- [INFO] oc: Using OpenShift build with strategy S2I [INFO] oc: Running in OpenShift mode [INFO] oc: Running generator spring-boot [INFO] oc: spring-boot: Using Docker image registry.redhat.io/fuse7/fuse-java-openshift-jdk11-rhel8:1.10 as base / builder [INFO] oc: [fuse-rest-http-booster:latest] "spring-boot": Created docker source tar /projects/fuse-rest-http-booster/target/docker/fuse-rest-http-booster/latest/tmp/docker-build.tar [INFO] oc: Creating BuildServiceConfig fuse-rest-http-booster-s2i for Source build [INFO] oc: Creating ImageStream fuse-rest-http-booster [ERROR] oc: Failed to execute the build [Unable to build the image using the OpenShift build service] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7.105 s [INFO] Finished at: 2022-08-04T07:11:56Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.jboss.redhat-fuse:openshift-maven-plugin:7.10.0.fuse-sb2-7_10_0-00014-redhat-00001:build (default) on project fuse-rest-http-booster: Failed to execute the build: Unable to build the image using the OpenShift build service: Namespace not specified. But operation requires namespace. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[user@workspace1931f90a3c65496a-58bc8d857c-bkxqs fuse-rest-http-booster]$ oc whoami admin [user@workspace1931f90a3c65496a-58bc8d857c-bkxqs fuse-rest-http-booster]$ oc project No project has been set. Pass a project name to make that the default.
Node JS devfile
This applies to all devfiles that have deploy-to-openshift step.
There is no such a problem for non-admin users, because they are logged into OpenShift having user specific project by default:
$ oc login --token=sha256~rrwTzU_IyEdffI8STZX0lYK7yqUGW4BnTID2YbvOmlw --server=https://api.ocp410-ltst-ds.crw-qe.com:6443 Logged into "https://api.ocp410-ltst-ds.crw-qe.com:6443" as "user" using the token provided. You have one project on this server: "user-devspaces"
- is documented by
-
CRW-3393 [RN] the default namespace is selected automatically when you run the deploy command included with the sample devfile projects
- Closed
-
CRW-3454 [Bug Fix] OCP admin user fails to deploy application to openshift from DS workspace
- Closed
- is related to
-
CRW-3214 Devfile samples contain outdated OC login command
- Resolved