1
0
mirror of https://github.com/ko-build/ko.git synced 2025-07-15 23:54:17 +02:00

Add ctx everywhere (#268)

* Add ctx to publish.Interface

I noticed that hitting ctrl-C didn't work when pushing images, this
should fix that.

* Use context everywhere that makes sense
This commit is contained in:
jonjohnsonjr
2020-12-21 11:47:05 -08:00
committed by GitHub
parent 552c3d4336
commit 522c37c4e0
28 changed files with 88 additions and 65 deletions

View File

@ -56,7 +56,8 @@ func addResolve(topLevel *cobra.Command) {
ko resolve --local -f config/`,
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
builder, err := makeBuilder(bo)
ctx := createCancellableContext()
builder, err := makeBuilder(ctx, bo)
if err != nil {
log.Fatalf("error creating builder: %v", err)
}
@ -65,7 +66,6 @@ func addResolve(topLevel *cobra.Command) {
log.Fatalf("error creating publisher: %v", err)
}
defer publisher.Close()
ctx := createCancellableContext()
if err := resolveFilesToWriter(ctx, builder, publisher, fo, so, sto, os.Stdout); err != nil {
log.Fatal(err)
}