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

odo dev not handling changes to the Devfile after removing a Kubernetes resource #6101

Closed
rm3l opened this issue Sep 7, 2022 · 3 comments · Fixed by #6189
Closed

odo dev not handling changes to the Devfile after removing a Kubernetes resource #6101

rm3l opened this issue Sep 7, 2022 · 3 comments · Fixed by #6189
Assignees
Labels
area/binding Issues or PRs related to `odo add/delete binding *` commands or Service Binding Operator kind/bug Categorizes issue or PR as related to a bug. priority/Medium Nice to have issue. Getting it done before priority changes would be great.
Milestone

Comments

@rm3l
Copy link
Member

rm3l commented Sep 7, 2022

/kind bug
/area binding

What versions of software are you using?

Operating System:
Fedora 36

Output of odo version:
odo v3.0.0-rc1 (897f5f3)

How did you run odo exactly?

Reproduction steps:

  1. New project, but you can use any other project: odo init --name my-sample-go --devfile go --starter go-starter
  2. Run odo dev, and wait until the Dev session is up and running
  3. Add a new binding, e.g.: odo add binding --name my-sample-go-postgresql-binding --service postgresql => Changes to the Devfile are automatically handled, and the pod is recreated and binding information injected, which is fine.
  4. Wait until the Dev session is ok again. Now, if I remove the previous binding from the Devfile with odo remove binding --name my-sample-go-postgresql-binding, the running odo dev session will just display "Updating component...", but it looks like nothing is actually happening in the cluster.

Actual behavior

The pod is not recreated and the binding information is still there in the pod.

Expected behavior

Similar to how odo add binding affects the currently running Dev pod, I would expect odo remove binding to cause the Dev pod to be recreated with no binding data injected in it.

Any logs, error output, etc?

@openshift-ci openshift-ci bot added kind/bug Categorizes issue or PR as related to a bug. area/binding Issues or PRs related to `odo add/delete binding *` commands or Service Binding Operator labels Sep 7, 2022
@valaparthvi
Copy link
Contributor

Please check with #5923, this bug might be a regression.

@valaparthvi valaparthvi added the triage/needs-information Indicates an issue needs more information in order to work on it. label Sep 8, 2022
@valaparthvi valaparthvi removed this from odo v3.0.0 Sep 8, 2022
@kadel kadel added the priority/Medium Nice to have issue. Getting it done before priority changes would be great. label Sep 9, 2022
@rm3l
Copy link
Member Author

rm3l commented Sep 12, 2022

FYI, this regression was caused by this commit: 6d82a57 (#6029):

/triage ready

@rm3l rm3l removed the triage/needs-information Indicates an issue needs more information in order to work on it. label Sep 12, 2022
@valaparthvi
Copy link
Contributor

valaparthvi commented Sep 22, 2022

This issue holds true for all the resources that are created by odo dev. It does not check if the resources in devfile and cluster match. Although that is not a regression, it was just something we never implemented.
I tested with 27f9dff.

@valaparthvi valaparthvi moved this to Done in odo v3.0.0 Sep 22, 2022
@valaparthvi valaparthvi moved this to Done in after v3.0.0 Sep 22, 2022
@valaparthvi valaparthvi reopened this Sep 22, 2022
Repository owner moved this from Done to To Do in odo v3.0.0 Sep 22, 2022
@valaparthvi valaparthvi changed the title odo dev not handling changes to the Devfile after removing a Binding with odo remove binding odo dev not handling changes to the Devfile after removing a Kubernetes resource Sep 22, 2022
@rm3l rm3l mentioned this issue Sep 26, 2022
3 tasks
@rm3l rm3l added this to odo Project Sep 29, 2022
@rm3l rm3l added this to the v3.1.0 🚀 milestone Sep 29, 2022
@rm3l rm3l added the backlog label Sep 29, 2022
@rm3l rm3l moved this to To Do 📝 in odo Project Sep 30, 2022
@rm3l rm3l removed the status in odo Project Oct 1, 2022
@valaparthvi valaparthvi moved this from To Do to For Review in odo v3.0.0 Oct 4, 2022
@rm3l rm3l moved this to In Progress 🚧 in odo Project Oct 10, 2022
@valaparthvi valaparthvi moved this from In Progress 🚧 to In Review 👀 in odo Project Oct 11, 2022
@rm3l rm3l modified the milestones: v3.1.0 🚀, v3.2.0 🚀 Oct 18, 2022
@rm3l rm3l modified the milestones: v3.2.0 🚀, v3.3.0 🚀 Oct 28, 2022
Repository owner moved this from In Review 👀 to Done ✅ in odo Project Nov 18, 2022
Repository owner moved this from For Review to Done in odo v3.0.0 Nov 18, 2022
rm3l added a commit to rm3l/odo that referenced this issue Jan 5, 2023
rm3l added a commit to rm3l/odo that referenced this issue Jan 26, 2023
openshift-merge-robot pushed a commit that referenced this issue Jan 27, 2023
* Make 'helper.Component#Exec' accept an additional parameter that allows checking (or not) the remote command execution

* In E2E tests, wait until the app is completely ready before sending requests to the local forwarded port

Otherwise, sending a request too early causes
"connection refused" errors, which causes port-forwarding to be restarted
(with new local ports because "odo dev" is running with "--random-ports").
As a first start, here we are making sure that the application port is available in the container,
prior to sending requests to the local forwarded port. This should reduce the likeliness
of port-forwarding restarts.

In the future, we might want to make the test detect the new local ports and use those instead.
We could even make sure to make "odo dev" reuse the previous random ports it had, provided
they are available again.

* Increase timeout and polling interval when waiting for port-forward restart

* Add a '/ping' endpoint to the sample Go app used in E2E

This allows checking the application running in the container.

* Do not stop the DevSession process before removing the Binding from the Devfile

#6101 has been fixed.

* fixup! Make 'helper.Component#Exec' accept an additional parameter that allows checking (or not) the remote command execution

* fixup! In E2E tests, wait until the app is completely ready before sending requests to the local forwarded port

* Create reusable 'helper.WaitAppReadyInContainer' helper function, as suggested in review

Co-authored-by: Philippe Martin <phmartin@redhat.com>

---------

Co-authored-by: Philippe Martin <phmartin@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/binding Issues or PRs related to `odo add/delete binding *` commands or Service Binding Operator kind/bug Categorizes issue or PR as related to a bug. priority/Medium Nice to have issue. Getting it done before priority changes would be great.
Projects
Archived in project
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants