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

context flag does not work with devfile url create #3767

Closed
amitkrout opened this issue Aug 18, 2020 · 17 comments
Closed

context flag does not work with devfile url create #3767

amitkrout opened this issue Aug 18, 2020 · 17 comments
Assignees
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
Projects

Comments

@amitkrout
Copy link
Contributor

amitkrout commented Aug 18, 2020

/kind bug

What versions of software are you using?

Operating System:
macOS
Output of odo version:
master

How did you run odo exactly?

$ odo project create test123
 ✓  Project 'test123' is ready for use
 ✓  New project created and now using project: test123

$ odo create nodejs --devfile devfiles/nodejs/devfile.yaml --project test123 --context devfiles/nodejs/
Experimental mode is enabled, use at your own risk

Validation
 ✓  Creating a devfile component from devfile path: /Users/amit/go/src/github.com/odo-devfiles/registry/devfiles/nodejs/devfile.yaml [999804ns]
 ✓  Validating devfile component [412213ns]

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

$ odo url create --port 8080 --host ased.com --context devfiles/nodejs/ --ingress
 ✗  The current directory does not represent an odo component. Use 'odo create' to create component here or switch to directory with a component

$ ls -a devfiles/nodejs/
.               .gitignore      build           devfile.yaml
..              .odo            deploy          meta.yaml

Actual behavior

$ odo url create --port 8080 --host ased.com --context devfiles/nodejs/ --ingress
 ✗  The current directory does not represent an odo component. Use 'odo create' to create component here or switch to directory with a component

Expected behavior

Should create the URL

Any logs, error output, etc?

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 18, 2020
@amitkrout amitkrout added area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). labels Aug 18, 2020
@mohammedzee1000
Copy link
Contributor

This does not seem to be happening to v2.0.0-alpha-2 atleast

❯ odo version
odo v2.0.0-alpha-2 (00d408ece)

Server: https://api.testocp4x.psiodo.net:6443
Kubernetes: v1.18.3+08c38ef

❯ wget https://raw.githubusercontent.com/odo-devfiles/registry/master/devfiles/nodejs/devfile.yaml

❯ ls
devfile.yaml  nodejs-ex

❯ odo create nodejs --devfile devfile.yaml --project mzee1000-test --context nodejs-ex/
Validation
 ✓  Creating a devfile component from devfile path: /home/mzee1000/workbench/work/test/odo-test/devfile.yaml [124926ns]
 ✓  Validating devfile component [149429ns]

Please use `odo push` command to create the component with source deployed
❯ ls -a nodejs-ex
.  ..  devfile.yaml  .git  .gitignore  helm  .odo  openshift  package.json  README.md  server.js  tests  views

❯ odo url create --port 8080 --host ased.com --context nodejs-ex/ --ingress
 ✗  given port 8080 is not exposed on given component, available ports are: 3000
❯ odo url create --port 3000 --host ased.com --context nodejs-ex/ --ingress
 ✓  URL nodejs-3000 created for component: nodejs

To apply the URL configuration changes, please use `odo push`

❯ cat nodejs-ex/.odo/env/env.yaml
ComponentSettings:
  Name: nodejs
  Namespace: mzee1000-test
  Url:
  - Name: nodejs-3000
    Port: 3000
    Host: ased.com
    Kind: ingress
  AppName: app


❯ odo push --context nodejs-ex/

Validation
 ✓  Validating the devfile [109648ns]

Creating Kubernetes resources for component nodejs
 ✓  Waiting for component to start [5s]

Applying URL changes
 ✓  URL nodejs-3000: http://nodejs-3000.ased.com created

Syncing to component nodejs
 ✓  Checking files for pushing [2ms]
 ✓  Syncing files to the component [16s]

Executing devfile commands for component nodejs
 ✓  Executing install command "npm install", if not running [10s]
 ✓  Executing run command "npm start", if not running [5s]

Pushing devfile component nodejs
 ✓  Changes successfully pushed to component

@mohammedzee1000
Copy link
Contributor

Also verified with 1.2.5

❯ odo version
odo v1.2.5 (0aeec48e4)

Server: https://api.testocp4x.psiodo.net:6443
Kubernetes: v1.18.3+08c38ef

❯ ls
devfile.yaml  nodejs-ex
❯ ls -a nodejs-ex
.  ..  .git  .gitignore  helm  openshift  package.json  README.md  server.js  tests  views

❯ odo create nodejs --devfile devfile.yaml --project mzee1000-test --context nodejs-ex/
Experimental mode is enabled, use at your own risk

Validation
 ✓  Creating a devfile component from devfile path: /home/mzee1000/workbench/work/test/odo-test/devfile.yaml [34935ns]
 ✓  Validating devfile component [35576ns]

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

Please use `odo push` command to create the component with source deployed
❯ odo url create --port 3000 --host ased.com --context nodejs-ex/ --ingress
 ✓  URL nodejs-3000 created for component: nodejs

To apply the URL configuration changes, please use `odo push`
❯ cat nodejs-ex/.odo/env/env.yaml
ComponentSettings:
  Name: nodejs
  Namespace: mzee1000-test
  Url:
  - Name: nodejs-3000
    Port: 3000
    Host: ased.com
    Kind: ingress
  AppName: app

❯ odo push --context nodejs-ex/

Validation
 ✓  Validating the devfile [129787ns]

Creating Kubernetes resources for component nodejs
 ✓  Waiting for component to start [4s]

Applying URL changes
 ✓  URL nodejs-3000: http://nodejs-3000.ased.com created

Syncing to component nodejs
 ✓  Checking files for pushing [795910ns]
 ✓  Syncing files to the component [15s]

Executing devfile commands for component nodejs
 ✓  Executing install command "npm install" [8s]
 ✓  Executing run command "npm start" [10s]

Pushing devfile component nodejs
 ✓  Changes successfully pushed to component


@mohammedzee1000
Copy link
Contributor

On master

commit 993414022bc27cb4a69171f4bea69fbbb75768fb (HEAD -> master, upstream/master, upstream-ssh/master, origin/master, origin/HEAD, local)

❯ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
❯ make bin
go build -ldflags="-w -X github.com/openshift/odo/pkg/version.GITCOMMIT=993414022" cmd/odo/odo.go
❯ ./odo version
odo v1.2.5 (993414022)

Server: https://api.testocp4x.psiodo.net:6443
Kubernetes: v1.18.3+08c38ef

❯ sudo cp -avrf ./odo /usr/bin/odo
<redacted>
'./odo' -> '/usr/bin/odo'

❯ ls
devfile.yaml  nodejs-ex

❯ ls -a nodejs-ex
.  ..  .git  .gitignore  helm  openshift  package.json  README.md  server.js  tests  views

❯ odo create nodejs --devfile devfile.yaml --project mzee1000-test --context nodejs-ex/
Experimental mode is enabled, use at your own risk

Validation
 ✓  Creating a devfile component from devfile path: /home/mzee1000/workbench/work/test/odo-test/devfile.yaml [85548ns]
 ✓  Validating devfile component [97966ns]

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

❯ odo url create --port 3000 --host ased.com --context nodejs-ex/ --ingress
 ✓  URL nodejs-3000 created for component: nodejs

To apply the URL configuration changes, please use `odo push`

❯ cat nodejs-ex/.odo/env/env.yaml
ComponentSettings:
  Name: nodejs
  Namespace: mzee1000-test
  Url:
  - Name: nodejs-3000
    Port: 3000
    Host: ased.com
    Kind: ingress
  AppName: app

❯ odo push --context nodejs-ex/

Validation
 ✓  Validating the devfile [170811ns]

Creating Kubernetes resources for component nodejs
 ✓  Waiting for component to start [5s]

Applying URL changes
 ✓  URL nodejs-3000: http://nodejs-3000.ased.com/ created

Syncing to component nodejs
 ✓  Checking files for pushing [1ms]
 ✓  Syncing files to the component [15s]

Executing devfile commands for component nodejs
 ✓  Executing install command "npm install", if not running [9s]
 ✓  Executing run command "npm start", if not running [5s]

Pushing devfile component nodejs
 ✓  Changes successfully pushed to component

@mohammedzee1000
Copy link
Contributor

mohammedzee1000 commented Aug 20, 2020

Unable to reproduce on Fedora 31

@mohammedzee1000
Copy link
Contributor

/triage needs-info

@openshift-ci-robot
Copy link
Collaborator

@mohammedzee1000: The label(s) triage/needs-info cannot be applied, because the repository doesn't have them

In response to this:

/triage needs-info

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.

@mohammedzee1000
Copy link
Contributor

It looks like it might be os related. Can you check with the same versions i tested on your OS and also report the OS on which this happened?
/triage needs-information

@openshift-ci-robot openshift-ci-robot added the triage/needs-information Indicates an issue needs more information in order to work on it. label Aug 20, 2020
@girishramnani girishramnani added this to For consideration in Sprint 189 via automation Aug 21, 2020
@girishramnani girishramnani moved this from For consideration to To do in Sprint 189 Aug 24, 2020
@amitkrout
Copy link
Contributor Author

$ pwd
/Users/amit/go/src/github.com/openshift/odo

$ odo create nodejs --devfile tests/examples/source/devfiles/nodejs/devfile.yaml --project test123 --context tests/examples/source/devfiles/nodejs/project/
Experimental mode is enabled, use at your own risk
[...]
Please use `odo push` command to create the component with source deployed


$ odo url create --port 8080 --host ased.com --context tests/examples/source/devfiles/nodejs/project/ --ingress -v 9
I0825 16:11:25.469180   79212 util.go:429] path devfile.yaml doesn't exist, skipping it
I0825 16:11:25.469240   79212 util.go:734] HTTPGetRequest: https://raw.githubusercontent.com/openshift/odo/master/build/VERSION
I0825 16:11:25.469560   79212 util.go:755] Response will be cached in /var/folders/c9/fb55pf_568dfd1fzj9w1v4n00000gn/T/odohttpcache for 1h0m0s
I0825 16:11:25.471565   79212 util.go:768] Cached response used.
I0825 16:11:25.475268   79212 loader.go:375] Config loaded from file:  /Users/amit/go/src/github.com/openshift/odo/auth/kubeconfig
I0825 16:11:25.479377   79212 loader.go:375] Config loaded from file:  /Users/amit/go/src/github.com/openshift/odo/auth/kubeconfig
 ✗  The current directory does not represent an odo component. Use 'odo create' to create component here or switch to directory with a component

I am able to reproduce it on macOS. @mohammedzee1000 Can you please execute the steps what exactly i am executing.

Surprisingly when i try @mohammedzee1000's steps i hit a weird error on macOS host

$ git clone https://github.com/openshift/nodejs-exCloning into 'nodejs-ex'...
remote: Enumerating objects: 653, done.
remote: Total 653 (delta 0), reused 0 (delta 0), pack-reused 653
Receiving objects: 100% (653/653), 260.96 KiB | 363.00 KiB/s, done.
Resolving deltas: 100% (253/253), done.

$ wget https://raw.githubusercontent.com/odo-devfiles/registry/master/devfiles/nodejs/devfile.yaml
--2020-08-25 16:22:08--  https://raw.githubusercontent.com/odo-devfiles/registry/master/devfiles/nodejs/devfile.yaml
Resolving raw.githubusercontent.com... 151.101.152.133
Connecting to raw.githubusercontent.com|151.101.152.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1369 (1.3K) [text/plain]
Saving to: ‘devfile.yaml.3’

devfile.yaml.3           100%[===============================>]   1.34K  --.-KB/s    in 0s      

2020-08-25 16:22:08 (38.4 MB/s) - ‘devfile.yaml.3’ saved [1369/1369]


$ odo create nodejs --devfile devfile.yaml --project testtest --context nodejs-ex/
Experimental mode is enabled, use at your own risk

Validation
 ✓  Creating a devfile component from devfile path: /Users/amit/go/src/github.com/openshift/odo/test/devfile.yaml [289997ns]
 ✓  Validating devfile component [143499ns]

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

$ odo url create --port 8080 --host ased.com --context nodejs-ex/ --ingress -v 9
I0825 16:34:03.803224   82812 util.go:734] HTTPGetRequest: https://raw.githubusercontent.com/openshift/odo/master/build/VERSION
I0825 16:34:03.803305   82812 preference.go:209] The path for preference file is /Users/amit/.odo/preference.yaml
I0825 16:34:03.803520   82812 util.go:755] Response will be cached in /var/folders/c9/fb55pf_568dfd1fzj9w1v4n00000gn/T/odohttpcache for 1h0m0s
I0825 16:34:03.803757   82812 util.go:768] Cached response used.
I0825 16:34:03.806259   82812 loader.go:375] Config loaded from file:  /Users/amit/go/src/github.com/openshift/odo/auth/kubeconfig
I0825 16:34:03.807447   82812 round_trippers.go:423] curl -k -v -XGET  -H "User-Agent: odo/v0.0.0 (darwin/amd64) kubernetes/$Format" -H "Authorization: Bearer sha256~Z_CxbQUK88ctkbjkH7jtMdHfmH7PQKFVYXdhUPQzvWY" -H "Accept: application/json, */*" 'https://api.jakumar-2308-214712-2.devcluster.openshift.com:6443/api/v1/namespaces/testtest'
I0825 16:34:04.848225   82812 round_trippers.go:443] GET https://api.jakumar-2308-214712-2.devcluster.openshift.com:6443/api/v1/namespaces/testtest 404 Not Found in 1040 milliseconds
I0825 16:34:04.848263   82812 round_trippers.go:449] Response Headers:
I0825 16:34:04.848271   82812 round_trippers.go:452]     Cache-Control: no-cache, private
I0825 16:34:04.848277   82812 round_trippers.go:452]     Content-Type: application/json
I0825 16:34:04.848283   82812 round_trippers.go:452]     X-Kubernetes-Pf-Flowschema-Uid: a56cb06e-880a-4a32-bab0-a8eef86e36d3
I0825 16:34:04.848289   82812 round_trippers.go:452]     X-Kubernetes-Pf-Prioritylevel-Uid: 9a5bf310-7ce0-4428-ba09-f4bb696420ec
I0825 16:34:04.848295   82812 round_trippers.go:452]     Content-Length: 196
I0825 16:34:04.848301   82812 round_trippers.go:452]     Date: Tue, 25 Aug 2020 11:04:04 GMT
I0825 16:34:04.848306   82812 round_trippers.go:452]     Audit-Id: dac3332c-59df-4349-baff-c263fd8dde43
I0825 16:34:04.848350   82812 request.go:1022] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"namespaces \"testtest\" not found","reason":"NotFound","details":{"name":"testtest","kind":"namespaces"},"code":404}
 ✗  You don't have permission to create or set namespace 'testtest' or the namespace doesn't exist. Please create or set a different namespace
        %!(EXTRA string=odo)

@amitkrout
Copy link
Contributor Author

@prietyc123 Can you please try the same step on your mac host just for cross verification.

@mohammedzee1000
Copy link
Contributor

Looks like mac problem

❯ odo-125 url create --port 3000 --host ased.com --context /redacted/nodejs-ex -v 9 --ingress
I0825 16:52:56.337641 2407034 preference.go:196] The path for preference file is /home/mzee1000/.odo/preference.yaml
I0825 16:52:56.340699 2407034 loader.go:375] Config loaded from file:  /home/mzee1000/.kube/config
I0825 16:52:56.341708 2407034 round_trippers.go:423] curl -k -v -XGET  -H "User-Agent: odo-125/v0.0.0 (linux/amd64) kubernetes/$Format" -H "Authorization: Bearer Qo2ozgZrM54XQFwGBSNXJYg3mPDIuHqxBIQN5nR35GQ" -H "Accept: application/json, */*" 'https://api.testocp4x.psiodo.net:6443/api/v1/namespaces/mzee1000-test1'
I0825 16:52:58.279655 2407034 round_trippers.go:443] GET https://api.testocp4x.psiodo.net:6443/api/v1/namespaces/mzee1000-test1 200 OK in 1937 milliseconds
I0825 16:52:58.279712 2407034 round_trippers.go:449] Response Headers:
I0825 16:52:58.279729 2407034 round_trippers.go:452]     Content-Type: application/json
I0825 16:52:58.279743 2407034 round_trippers.go:452]     X-Kubernetes-Pf-Flowschema-Uid: bb2cd36b-ea4e-4521-a5c2-6409fcb19328
I0825 16:52:58.279756 2407034 round_trippers.go:452]     X-Kubernetes-Pf-Prioritylevel-Uid: 2b0d272d-3704-49f7-a352-9a08da4ecd47
I0825 16:52:58.279774 2407034 round_trippers.go:452]     Content-Length: 1359
I0825 16:52:58.279824 2407034 round_trippers.go:452]     Date: Tue, 25 Aug 2020 11:22:15 GMT
I0825 16:52:58.279853 2407034 round_trippers.go:452]     Audit-Id: aa1aa08c-5a45-4166-9102-95e076296ab3
I0825 16:52:58.279871 2407034 round_trippers.go:452]     Cache-Control: no-cache, private
I0825 16:52:58.284762 2407034 request.go:1022] Response Body: {"kind":"Namespace","apiVersion":"v1","metadata":{"name":"mzee1000-test1","selfLink":"/api/v1/namespaces/mzee1000-test1","uid":"f2129447-8a45-401e-89e6-328d2da8b75f","resourceVersion":"5336032","creationTimestamp":"2020-08-25T10:26:45Z","annotations":{"openshift.io/description":"","openshift.io/display-name":"","openshift.io/requester":"mzee1000","openshift.io/sa.scc.mcs":"s0:c24,c14","openshift.io/sa.scc.supplemental-groups":"1000580000/10000","openshift.io/sa.scc.uid-range":"1000580000/10000"},"managedFields":[{"manager":"cluster-policy-controller","operation":"Update","apiVersion":"v1","time":"2020-08-25T10:26:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{"f:openshift.io/sa.scc.mcs":{},"f:openshift.io/sa.scc.supplemental-groups":{},"f:openshift.io/sa.scc.uid-range":{}}}}},{"manager":"openshift-apiserver","operation":"Update","apiVersion":"v1","time":"2020-08-25T10:26:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:openshift.io/description":{},"f:openshift.io/display-name":{},"f:openshift.io/requester":{}}},"f:status":{"f:phase":{}}}},{"manager":"openshift-controller-manager","operation":"Update","apiVersion":"v1","time":"2020-08-25T10:26:45Z","fieldsType":"FieldsV1","fieldsV1":{"f:spec":{"f:finalizers":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}}
I0825 16:52:58.295736 2407034 loader.go:375] Config loaded from file:  /home/mzee1000/.kube/config
I0825 16:52:58.298128 2407034 round_trippers.go:423] curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: odo-125/v0.0.0 (linux/amd64) kubernetes/$Format" -H "Authorization: Bearer Qo2ozgZrM54XQFwGBSNXJYg3mPDIuHqxBIQN5nR35GQ" 'https://api.testocp4x.psiodo.net:6443/apis/route.openshift.io/v1?timeout=32s'
I0825 16:52:58.894369 2407034 round_trippers.go:443] GET https://api.testocp4x.psiodo.net:6443/apis/route.openshift.io/v1?timeout=32s 200 OK in 596 milliseconds
I0825 16:52:58.894499 2407034 round_trippers.go:449] Response Headers:
I0825 16:52:58.894537 2407034 round_trippers.go:452]     Content-Length: 418
I0825 16:52:58.894580 2407034 round_trippers.go:452]     Cache-Control: no-cache, private
I0825 16:52:58.894620 2407034 round_trippers.go:452]     Cache-Control: no-store
I0825 16:52:58.894640 2407034 round_trippers.go:452]     Content-Type: application/json
I0825 16:52:58.894662 2407034 round_trippers.go:452]     Date: Tue, 25 Aug 2020 11:22:15 GMT
I0825 16:52:58.894693 2407034 round_trippers.go:452]     X-Kubernetes-Pf-Flowschema-Uid: bb2cd36b-ea4e-4521-a5c2-6409fcb19328
I0825 16:52:58.894715 2407034 round_trippers.go:452]     X-Kubernetes-Pf-Prioritylevel-Uid: 2b0d272d-3704-49f7-a352-9a08da4ecd47
I0825 16:52:58.894833 2407034 request.go:1022] Response Body: {"kind":"APIResourceList","apiVersion":"v1","groupVersion":"route.openshift.io/v1","resources":[{"name":"routes","singularName":"","namespaced":true,"kind":"Route","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"categories":["all"],"storageVersionHash":"jo1F7GfnXH4="},{"name":"routes/status","singularName":"","namespaced":true,"kind":"Route","verbs":["get","patch","update"]}]}
I0825 16:52:58.895910 2407034 context.go:69] absolute devfile path: '/home/mzee1000/workbench/work/test/odo-test/devfile.yaml'
I0825 16:52:58.897162 2407034 content.go:33] converted devfile YAML to JSON
I0825 16:52:58.897377 2407034 apiVersion.go:50] devfile apiVersion: '2.0.0'
I0825 16:52:58.897427 2407034 helper.go:35] devfile apiVersion '2.0.0' is supported in odo
I0825 16:52:58.913397 2407034 schema.go:47] validated devfile schema
I0825 16:52:58.913849 2407034 validate.go:32] Successfully validated devfile sections
I0825 16:52:58.913878 2407034 utils.go:99] Found component "Container" with name "runtime"
 ✓  URL nodejs-3000 created for component: nodejs

To apply the URL configuration changes, please use `odo push`
I0825 16:52:58.914239 2407034 odo.go:72] Could not get the latest release information in time. Never mind, exiting gracefully :)


@amitkrout
Copy link
Contributor Author

✗ You don't have permission to create or set namespace 'testtest' or the namespace doesn't exist. Please create or set a different namespace
%!(EXTRA string=odo)

@mohammedzee1000 @girishramnani Does url create requires an existing namespace in the cluster ?

@mohammedzee1000
Copy link
Contributor

mohammedzee1000 commented Aug 25, 2020

Why should it do anything on the cluster? I though that was pushes jobS Someone is stealing jobs :p

@prietyc123
Copy link
Contributor

@prietyc123 Can you please try the same step on your mac host just for cross verification.

Even I have followed the same steps that zeeshan has followed and I am able to create the url successfully

$ odo url create --port 3000 --host fkfjd.com --context nodejs-ex/ --ingress -v 9
I0825 17:33:31.568342    7530 preference.go:209] The path for preference file is /Users/pkumari/.odo/preference.yaml
I0825 17:33:31.569461    7530 util.go:734] HTTPGetRequest: https://raw.githubusercontent.com/openshift/odo/master/build/VERSION
I0825 17:33:31.569846    7530 util.go:755] Response will be cached in /var/folders/g8/f12mz2jj1ygbsq8v51fz7dvr0000gn/T/odohttpcache for 1h0m0s
I0825 17:33:31.590803    7530 util.go:768] Cached response used.
I0825 17:33:31.595805    7530 loader.go:375] Config loaded from file:  /Users/pkumari/.kube/config
I0825 17:33:31.606299    7530 round_trippers.go:423] curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: odo/v0.0.0 (darwin/amd64) kubernetes/$Format" -H "Authorization: Bearer sha256~kQW_-5ECUJUqOV0LvVFG1dHx2dKbg__Fn3lOnDBEme0" 'https://api.jakumar-2308-214712-2.devcluster.openshift.com:6443/api/v1/namespaces/testurl'
I0825 17:33:32.752348    7530 round_trippers.go:443] GET https://api.jakumar-2308-214712-2.devcluster.openshift.com:6443/api/v1/namespaces/testurl 200 OK in 1145 milliseconds
I0825 17:33:32.752380    7530 round_trippers.go:449] Response Headers:
I0825 17:33:32.752389    7530 round_trippers.go:452]     Content-Length: 1346
I0825 17:33:32.752395    7530 round_trippers.go:452]     Date: Tue, 25 Aug 2020 12:03:32 GMT
I0825 17:33:32.752400    7530 round_trippers.go:452]     Audit-Id: b1b95a9f-5f44-4dc8-96ce-21ca9b7e993f
I0825 17:33:32.752405    7530 round_trippers.go:452]     Cache-Control: no-cache, private
I0825 17:33:32.752438    7530 round_trippers.go:452]     Content-Type: application/json
I0825 17:33:32.752450    7530 round_trippers.go:452]     X-Kubernetes-Pf-Flowschema-Uid: a56cb06e-880a-4a32-bab0-a8eef86e36d3
I0825 17:33:32.752458    7530 round_trippers.go:452]     X-Kubernetes-Pf-Prioritylevel-Uid: 9a5bf310-7ce0-4428-ba09-f4bb696420ec
I0825 17:33:32.760477    7530 request.go:1022] Response Body: {"kind":"Namespace","apiVersion":"v1","metadata":{"name":"testurl","selfLink":"/api/v1/namespaces/testurl","uid":"0d8553c5-9fd0-4f77-b810-9df82d3bf7ca","resourceVersion":"445883","creationTimestamp":"2020-08-25T11:29:52Z","annotations":{"openshift.io/description":"","openshift.io/display-name":"","openshift.io/requester":"kube:admin","openshift.io/sa.scc.mcs":"s0:c30,c10","openshift.io/sa.scc.supplemental-groups":"1000890000/10000","openshift.io/sa.scc.uid-range":"1000890000/10000"},"managedFields":[{"manager":"cluster-policy-controller","operation":"Update","apiVersion":"v1","time":"2020-08-25T11:29:52Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{"f:openshift.io/sa.scc.mcs":{},"f:openshift.io/sa.scc.supplemental-groups":{},"f:openshift.io/sa.scc.uid-range":{}}}}},{"manager":"openshift-apiserver","operation":"Update","apiVersion":"v1","time":"2020-08-25T11:29:52Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:openshift.io/description":{},"f:openshift.io/display-name":{},"f:openshift.io/requester":{}}},"f:status":{"f:phase":{}}}},{"manager":"openshift-controller-manager","operation":"Update","apiVersion":"v1","time":"2020-08-25T11:29:52Z","fieldsType":"FieldsV1","fieldsV1":{"f:spec":{"f:finalizers":{}}}}]},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}}
I0825 17:33:32.776439    7530 loader.go:375] Config loaded from file:  /Users/pkumari/.kube/config
I0825 17:33:32.780675    7530 round_trippers.go:423] curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: odo/v0.0.0 (darwin/amd64) kubernetes/$Format" -H "Authorization: Bearer sha256~kQW_-5ECUJUqOV0LvVFG1dHx2dKbg__Fn3lOnDBEme0" 'https://api.jakumar-2308-214712-2.devcluster.openshift.com:6443/apis/route.openshift.io/v1?timeout=32s'
I0825 17:33:33.150428    7530 round_trippers.go:443] GET https://api.jakumar-2308-214712-2.devcluster.openshift.com:6443/apis/route.openshift.io/v1?timeout=32s 200 OK in 369 milliseconds
I0825 17:33:33.150461    7530 round_trippers.go:449] Response Headers:
I0825 17:33:33.150469    7530 round_trippers.go:452]     X-Kubernetes-Pf-Prioritylevel-Uid: 9a5bf310-7ce0-4428-ba09-f4bb696420ec
I0825 17:33:33.150475    7530 round_trippers.go:452]     Content-Length: 418
I0825 17:33:33.150480    7530 round_trippers.go:452]     Cache-Control: no-cache, private
I0825 17:33:33.150485    7530 round_trippers.go:452]     Cache-Control: no-store
I0825 17:33:33.150490    7530 round_trippers.go:452]     Content-Type: application/json
I0825 17:33:33.150516    7530 round_trippers.go:452]     Date: Tue, 25 Aug 2020 12:03:32 GMT
I0825 17:33:33.150523    7530 round_trippers.go:452]     X-Kubernetes-Pf-Flowschema-Uid: a56cb06e-880a-4a32-bab0-a8eef86e36d3
I0825 17:33:33.150567    7530 request.go:1022] Response Body: {"kind":"APIResourceList","apiVersion":"v1","groupVersion":"route.openshift.io/v1","resources":[{"name":"routes","singularName":"","namespaced":true,"kind":"Route","verbs":["create","delete","deletecollection","get","list","patch","update","watch"],"categories":["all"],"storageVersionHash":"jo1F7GfnXH4="},{"name":"routes/status","singularName":"","namespaced":true,"kind":"Route","verbs":["get","patch","update"]}]}
I0825 17:33:33.158243    7530 context.go:69] absolute devfile path: '/Users/pkumari/go/src/github.com/openshift/odo/testjavadebug/devfile.yaml'
I0825 17:33:33.165196    7530 content.go:33] converted devfile YAML to JSON
I0825 17:33:33.165350    7530 apiVersion.go:50] devfile apiVersion: '2.0.0'
I0825 17:33:33.165413    7530 helper.go:35] devfile apiVersion '2.0.0' is supported in odo
I0825 17:33:33.190854    7530 schema.go:47] validated devfile schema
I0825 17:33:33.191659    7530 validate.go:37] Successfully validated devfile sections
I0825 17:33:33.191887    7530 utils.go:113] Found component "Container" with name "runtime"
 ✓  URL nodejs-3000 created for component: nodejs

To apply the URL configuration changes, please use `odo push`
I0825 17:33:33.193631    7530 odo.go:72] Could not get the latest release information in time. Never mind, exiting gracefully :)

@prietyc123
Copy link
Contributor

But yes, I am able to reproduce it using steps mentioned in description.

$ pwd
/Users/pkumari/go/src/github.com/openshift/odo

$ odo project create testnodejs
 ✓  Project 'testnodejs' is ready for use
 ✓  New project created and now using project: testnodejs

$ cd tests/examples/source/

$ odo create nodejs --devfile devfiles/nodejs/devfile.yaml --project testnodejs --context devfiles/nodejs/
Experimental mode is enabled, use at your own risk

Validation
 ✓  Creating a devfile component from devfile path: /Users/pkumari/go/src/github.com/openshift/odo/tests/examples/source/devfiles/nodejs/devfile.yaml [137471ns]
 ✓  Validating devfile component [321170ns]

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

$ odo url create --port 8080 --host ased.com --context devfiles/nodejs/ --ingress
 ✗  The current directory does not represent an odo component. Use 'odo create' to create component here or switch to directory with a component

I have also tried creating the component under project directory. But sadly failed there also.

$ odo create nodejs --devfile devfiles/nodejs/devfile.yaml --project testnodejs --context devfiles/nodejs/project/
Experimental mode is enabled, use at your own risk

Validation
 ✓  Creating a devfile component from devfile path: /Users/pkumari/go/src/github.com/openshift/odo/tests/examples/source/devfiles/nodejs/devfile.yaml [145843ns]
 ✓  Validating devfile component [316520ns]

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

$ odo url create --port 8080 --host ased.com --context devfiles/nodejs/project/ --ingress
 ✗  The current directory does not represent an odo component. Use 'odo create' to create component here or switch to directory with a component

@girishramnani girishramnani moved this from To do to For consideration in Sprint 189 Aug 26, 2020
@amitkrout
Copy link
Contributor Author

@mohammedzee1000 Have you tried the steps i mentioned here at - #3767 (comment).

@amitkrout amitkrout removed the triage/needs-information Indicates an issue needs more information in order to work on it. label Aug 27, 2020
@girishramnani girishramnani moved this from For consideration to To do in Sprint 189 Aug 27, 2020
@metacosm
Copy link
Contributor

metacosm commented Sep 8, 2020

I can reproduce it and I don't think it's OS-related. The issue is that the Complete function for url create checks if we're dealing with a devfile without taking the context flag into account so it's looking for a devfile in the current directory and not finding any decides to create a context for an s2i component and since there's no local config in the target directory, it fails as expected.

@girishramnani girishramnani moved this from To do to In progress in Sprint 189 Sep 9, 2020
@girishramnani girishramnani moved this from In progress to For review in Sprint 189 Sep 9, 2020
@girishramnani girishramnani added this to For consideration in Sprint 190 via automation Sep 14, 2020
@girishramnani girishramnani removed this from For review in Sprint 189 Sep 14, 2020
@girishramnani girishramnani moved this from For consideration to For review in Sprint 190 Sep 14, 2020
@girishramnani
Copy link
Contributor

This has been resolved by #3857

Sprint 190 automation moved this from For review to Done Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
Projects
No open projects
Sprint 190
  
Done
Development

No branches or pull requests

6 participants