-
Notifications
You must be signed in to change notification settings - Fork 243
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
Display a warning that "odo dev" on Podman needs to be restarted if the Devfile is changed #6477
Merged
openshift-merge-robot
merged 6 commits into
redhat-developer:main
from
rm3l:6336-warn-users-that-odo-dev-needs-to-be-restarted-when-related-information-is-changed-in-devfile
Jan 10, 2023
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ffe78b6
Display a warning that "odo dev" on Podman might need to be restarted…
rm3l d45cfbd
Add integration test case
rm3l 7b71a78
fixup! Add integration test case
rm3l 6f51b75
amend! Display a warning that "odo dev" on Podman might need to be re…
rm3l 8058649
fixup! Add integration test case
rm3l 82ace2f
Assert that no warning is displayed if the Devfile has not changed
rm3l File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be displayed every time, even if the user only modifies sources files.
I would instead add an
else
part to theif equality.Semantic.DeepEqual(o.deployedPod, pod)
condition (in the reconcile.go file), and print the warning thereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, thanks for the pointer. Initially, I had changed the part that looks for changes in the Devfile watcher (in watch.go), but then I had an issue when manually sync'ing with
--no-watch
.This looks like a better approach. I'll make the change - thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I just noticed: if we display the warning as part of
if !equality.Semantic.DeepEqual(o.deployedPod, pod)
, the problem is that this would work only if the changes in the Devfile affect the resulting Pod spec.I noticed that if I only change for example the
run
command in the Devfile, the resulting Pod spec is still semantically the same as the previous one, so no warning is displayed. But, the changes were not taken into account (I think because we are still using the same Devfile Object from the context).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking of just re-parsing the Devfile when the watch handler is called and comparing it to the currently loaded one. And display the warning if there are any differences.
@feloy What do you think?
The Kubedev implementation actually re-parses the Devfile when the watch handler is called:
odo/pkg/dev/kubedev/kubedev.go
Lines 156 to 160 in 020009b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's a good solution IMO