Skip to content

Working extension invocation.#292

Closed
n3wscott wants to merge 1 commit intogoogle:masterfrom
n3wscott:move-cmd
Closed

Working extension invocation.#292
n3wscott wants to merge 1 commit intogoogle:masterfrom
n3wscott:move-cmd

Conversation

@n3wscott
Copy link
Copy Markdown

I moved the cmd setup into pkg and decoupled the commands from os.* This should make testing much easier when there are tests.

The change adds kubectl/git style plugins. For example:

⦿ ls ~/bin/ | grep ko
ko-scott
⦿ cat ~/bin/ko-scott
#! /bin/bash
echo "hello, extension!"
⦿ go run cmd/ko/main.go scott
hello, extension!

Comment thread pkg/ko/cmd/commands.go
"log"
"os"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look!!! 🎉

Comment thread pkg/ko/cmd/filestuff.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filestuff.go.... really?

@codecov-io
Copy link
Copy Markdown

codecov-io commented Oct 21, 2018

Codecov Report

Merging #292 into master will decrease coverage by 0.66%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #292      +/-   ##
=========================================
- Coverage   50.46%   49.8%   -0.67%     
=========================================
  Files          61      62       +1     
  Lines        2776    2813      +37     
=========================================
  Hits         1401    1401              
- Misses       1150    1187      +37     
  Partials      225     225
Impacted Files Coverage Δ
pkg/ko/cmd/filestuff.go 0% <ø> (ø)
pkg/ko/cmd/local.go 0% <ø> (ø)
pkg/ko/cmd/resolve.go 0% <ø> (ø)
pkg/ko/cmd/config.go 30.3% <ø> (ø)
pkg/ko/cmd/flatname.go 0% <ø> (ø)
pkg/ko/cmd/publish.go 9.3% <ø> (ø)
pkg/ko/cmd/extensions.go 0% <0%> (ø)
pkg/ko/cmd/commands.go 0% <0%> (ø)
pkg/ko/cmd/cmd.go 0% <0%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9ed1bc3...0410a3b. Read the comment docs.

@imjasonh
Copy link
Copy Markdown
Contributor

Is there a particular plugin you're hoping to enable with this? ko doesn't do a lot today, I'm not sure it needs a plugin story.

@n3wscott
Copy link
Copy Markdown
Author

@imjasonh
Copy link
Copy Markdown
Contributor

imjasonh commented Oct 21, 2018

What benefit do we expect ko-foo to get from being callable as ko foo? AFAICT the only context you'd gain from even knowing the user also uses ko is the presence of KO_DOCKER_REPO and .ko.yaml. Why not just ask the user to install and use ko-foo, renamed to just foo?

Supporting a plugin model means defining and supporting the plugin integration points. It means we probably can't add global flags or new subcommands or change the format of .ko.yaml without considering all possible plugins and taking care about versioning.

ko hasn't even had an official release yet. This feels premature to me.

@n3wscott
Copy link
Copy Markdown
Author

Perhaps you want the stdin/out refactors?

I am thinking I will make kubectl plugin that uses ko

@n3wscott
Copy link
Copy Markdown
Author

OK as an update, check this workflow out: https://github.com/n3wscott/kopond/tree/master/kubectl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants