-
Notifications
You must be signed in to change notification settings - Fork 244
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
Extend with plugins #2733
Extend with plugins #2733
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2733 +/- ##
=======================================
Coverage 43.20% 43.20%
=======================================
Files 97 97
Lines 8888 8888
=======================================
Hits 3840 3840
Misses 4684 4684
Partials 364 364 Continue to review full report at Codecov.
|
@bigkevmcd Thanks for the pr. I really don't understand what is the usecase and the acceptance criteria of this pr. May be you can add a document for it with more details. Can you please create an issue and link to this pr. I am saying this because i feel we need to discuss properly and validate the thoughts behind it among the team. ping @girishramnani @kadel |
I had a brief discussion about this with @bigkevmcd on Slack. I would treat is as a hidden easter egg that should be used only for demos and experiments. Before making this available for anyone to use, I would like to have some kind of plugin management and distribution system (maybe something like https://krew.sigs.k8s.io/) /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kadel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
+1 |
@bigkevmcd UT is failing at line - https://travis-ci.com/github/openshift/odo/jobs/300352024#L155. PTAL |
ping @bigkevmcd |
Sorry, I'll get to this tomorrow, been a bit hectic with other things, but we still would like to get this landed. |
/hold cancel |
if runtime.GOOS == "windows" { | ||
t.Skip() | ||
} | ||
tempDir, cleanup := makeTempDir(t) |
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.
Ideally unit tests shouldn’t interact with external entities such as a filesystem which are subject to change. Can you please use the mocked filesystem we have inplace?
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.
Right, @girishramnani Can you please add some reference where we have already done it. Reference would really be helpful.
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.
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.
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 looks like I'd need to reimplement https://golang.org/pkg/os/exec/#LookPath on top of afero.
In other words, replace https://github.com/golang/go/blob/master/src/os/exec/lp_unix.go#L34 with a version that worked on top of afero, purely for test purposes.
I'm not sure of the value of this? It wouldn't be testing the core logic?
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.
Then maybe consider writing an integration test?
/hold Waiting for this to get resolved #2733 (comment) |
/test v4.3-integration-e2e-benchmark |
This adds support for external tools as plugins. If the provided command is a known command, then it's executed, otherwise, odo attempts to find a matching executable on the path with the prefix "odo-" and execute that instead. e.g. "odo tkn list" would attempt to execute "odo-tkn" and pass the args on.
Does this work take the place of #1173 or it is separate? |
See also #1173 |
It os part of that. |
@girishramnani can you please re-check if your concerns were addressed? |
/lgtm. 👍 @bigkevmcd |
/retest |
/hold cancel |
/lgtm |
/retest Please review the full test history for this PR and help us cut down flakes. |
4 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
What type of PR is this?
What does does this PR do / why we need it:
It allows for external binaries to be used as plugins.
for example:
This would look for an executable called
odo-promote
on the path, and execute that, passing the parameters through.How to test changes / Special notes to the reviewer:
Write the following to an executable script on your PATH called "odo-testing" (perhaps in ~/bin if you have that on your PATH).
This should trigger executing your shell script