redhat-developer / odo

odo - Developer-focused CLI for fast & iterative container-based application development on Podman and Kubernetes. Implementation of the open Devfile standard.
https://odo.dev
Apache License 2.0
794 stars 243 forks source link

Project created with -w flag immediately is not shown in "odo project list -o json" #3609

Closed amitkrout closed 4 years ago

amitkrout commented 4 years ago

/kind flake

What versions of software are you using?

Operating System: Supported Output of odo version: master

How did you run odo exactly?

CI reference - https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_odo/3587/pull-ci-openshift-odo-master-v4.2-integration-e2e/1285409549875941376#1:build-log.txt%3A94498

Actual behavior

See the failure log

Expected behavior

-o json should capture the project

Any logs, error output, etc?

 Running odo with args [odo project create tkcpwomgvs -w -v4]
[odo]  •  Waiting for project to come up  ...
[odo] I0721 05:05:46.364771   15651 occlient.go:541] Status of creation of project tkcpwomgvs is Active
[odo] I0721 05:05:46.364868   15651 occlient.go:546] Project tkcpwomgvs now exists
[odo] I0721 05:05:46.380088   15651 occlient.go:581] Status of creation of service account &ServiceAccount{ObjectMeta:{default  tkcpwomgvs /api/v1/namespaces/tkcpwomgvs/serviceaccounts/default d59574a5-cb0f-11ea-8497-0ad2f6981259 107447 0 2020-07-21 05:05:45 +0000 UTC <nil> <nil> map[] map[] [] []  []},Secrets:[]ObjectReference{ObjectReference{Kind:,Namespace:,Name:default-token-wc5kb,UID:,APIVersion:,ResourceVersion:,FieldPath:,},ObjectReference{Kind:,Namespace:,Name:default-dockercfg-6g9t4,UID:,APIVersion:,ResourceVersion:,FieldPath:,},},ImagePullSecrets:[]LocalObjectReference{LocalObjectReference{Name:default-dockercfg-6g9t4,},},AutomountServiceAccountToken:nil,} is ready
[odo] 
 ✓  Waiting for project to come up [799ms]
[odo]  ✓  Project 'tkcpwomgvs' is ready for use
[odo]  ✓  New project created and now using project: tkcpwomgvs
[odo] I0721 05:05:46.395732   15651 odo.go:72] Could not get the latest release information in time. Never mind, exiting gracefully :)
Running odo with args [odo project list -o json]
[odo] {
[odo]   "kind": "List",
[odo]   "apiVersion": "odo.dev/v1alpha1",
[odo]   "metadata": {},
[odo]   "items": [
[odo]       {
[odo]           "kind": "Project",
[odo]           "apiVersion": "odo.dev/v1alpha1",
[odo]           "metadata": {
[odo]               "name": "ci-operator-hub-project",
[odo]               "namespace": "ci-operator-hub-project",
[odo]               "creationTimestamp": null
[odo]           },
[odo]           "spec": {},
[odo]           "status": {
[odo]               "active": false
[odo]           }
[odo]       },
[odo]       {
[odo]           "kind": "Project",
[odo]           "apiVersion": "odo.dev/v1alpha1",
[odo]           "metadata": {
[odo]               "name": "lyuqwdvlqo",
[odo]               "namespace": "lyuqwdvlqo",
[odo]               "creationTimestamp": null
[odo]           },
[odo]           "spec": {},
[odo]           "status": {
[odo]               "active": false
[odo]           }
[odo]       },
[odo]       {
[odo]           "kind": "Project",
[odo]           "apiVersion": "odo.dev/v1alpha1",
[odo]           "metadata": {
[odo]               "name": "myproject",
[odo]               "namespace": "myproject",
[odo]               "creationTimestamp": null
[odo]           },
[odo]           "spec": {},
[odo]           "status": {
[odo]               "active": false
[odo]           }
[odo]       },
[odo]       {
[odo]           "kind": "Project",
[odo]           "apiVersion": "odo.dev/v1alpha1",
[odo]           "metadata": {
[odo]               "name": "ncsykelidz",
[odo]               "namespace": "ncsykelidz",
[odo]               "creationTimestamp": null
[odo]           },
[odo]           "spec": {},
[odo]           "status": {
[odo]               "active": false
[odo]           }
[odo]       },
[odo]       {
[odo]           "kind": "Project",
[odo]           "apiVersion": "odo.dev/v1alpha1",
[odo]           "metadata": {
[odo]               "name": "ortrrarady",
[odo]               "namespace": "ortrrarady",
[odo]               "creationTimestamp": null
[odo]           },
[odo]           "spec": {},
[odo]           "status": {
[odo]               "active": false
[odo]           }
[odo]       },
[odo]       {
[odo]           "kind": "Project",
[odo]           "apiVersion": "odo.dev/v1alpha1",
[odo]           "metadata": {
[odo]               "name": "pgnqqoellr",
[odo]               "namespace": "pgnqqoellr",
[odo]               "creationTimestamp": null
[odo]           },
[odo]           "spec": {},
[odo]           "status": {
[odo]               "active": false
[odo]           }
[odo]       }
[odo]   ]
[odo] }
Deleting project: tkcpwomgvs
Running odo with args [odo project delete tkcpwomgvs -f]
[odo] I0721 05:05:46.886950   15686 application.go:49] Unable to list Service Catalog instances: unable to list ServiceInstances: serviceinstances.servicecatalog.k8s.io is forbidden: User "developer" cannot list resource "serviceinstances" in API group "servicecatalog.k8s.io" in the namespace "tkcpwomgvs"
[odo]  ⚠  Warning! Projects are deleted from the cluster asynchronously. Odo does its best to delete the project. Due to multi-tenant clusters, the project may still exist on a different node.
[odo] I0721 05:05:46.922622   15686 odo.go:72] Could not get the latest release information in time. Never mind, exiting gracefully :)
[odo]  ✓  Deleted project : tkcpwomgvs
Deleting dir: /tmp/189744642
------------------------------
• Failure [1.542 seconds]
odo project command tests
/go/src/github.com/openshift/odo/tests/integration/project/cmd_project_test.go:15
  odo machine readable output on empty project
  /go/src/github.com/openshift/odo/tests/integration/project/cmd_project_test.go:52
    should be able to list current project [It]
    /go/src/github.com/openshift/odo/tests/integration/project/cmd_project_test.go:53
    Expected

        <string>: {"apiVersion":"odo.dev/v1alpha1","items":[{"apiVersion":"odo.dev/v1alpha1","kind":"Project","metadata":{"creationTimestamp":null,"name":"ci-operator-hub-project","namespace":"ci-operator-hub-project"},"spec":{},"status":{"active":false}},{"apiVersion":"odo.dev/v1alpha1","kind":"Project","metadata":{"creationTimestamp":null,"name":"lyuqwdvlqo","namespace":"lyuqwdvlqo"},"spec":{},"status":{"active":false}},{"apiVersion":"odo.dev/v1alpha1","kind":"Project","metadata":{"creationTimestamp":null,"name":"myproject","namespace":"myproject"},"spec":{},"status":{"active":false}},{"apiVersion":"odo.dev/v1alpha1","kind":"Project","metadata":{"creationTimestamp":null,"name":"ncsykelidz","namespace":"ncsykelidz"},"spec":{},"status":{"active":false}},{"apiVersion":"odo.dev/v1alpha1","kind":"Project","metadata":{"creationTimestamp":null,"name":"ortrrarady","namespace":"ortrrarady"},"spec":{},"status":{"active":false}},{"apiVersion":"odo.dev/v1alpha1","kind":"Project","metadata":{"creationTimestamp":null,"name":"pgnqqoellr","namespace":"pgnqqoellr"},"spec":{},"status":{"active":false}}],"kind":"List","metadata":{}}
    to contain substring
        <string>: {"apiVersion":"odo.dev/v1alpha1","kind":"Project","metadata":{"creationTimestamp":null,"name":"tkcpwomgvs","namespace":"tkcpwomgvs"},"spec":{},"status":{"active":true}}
    /go/src/github.com/openshift/odo/tests/integration/project/cmd_project_test.go:59 
amitkrout commented 4 years ago

Steps to reproduce it locally

Step 1:
$ cat test.sh 
#!/bin/bash
set -x

odo project create testproject -w
odo project list -o json | grep testproject

Step 2:
$ ./test.sh

Step 3:
Project name should be captured in the last command output

If you have time and patience then try to reproduce it locally.

mik-dass commented 4 years ago

Duplicate of https://github.com/openshift/odo/issues/2117

amitkrout commented 4 years ago

/close

openshift-ci-robot commented 4 years ago

@amitkrout: Closing this issue.

In response to [this](https://github.com/openshift/odo/issues/3609#issuecomment-661786590): >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.