-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Remove Tagger from Builder interface #1601
Remove Tagger from Builder interface #1601
Conversation
384aa1b
to
ed84316
Compare
Codecov Report
@@ Coverage Diff @@
## master #1601 +/- ##
==========================================
+ Coverage 46.31% 47.01% +0.69%
==========================================
Files 117 117
Lines 5106 5118 +12
==========================================
+ Hits 2365 2406 +41
+ Misses 2508 2471 -37
- Partials 233 241 +8
Continue to review full report at Codecov.
|
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.
so much cleaner 😍 a few nits but it looks great
@@ -57,7 +43,7 @@ func TestLocalRun(t *testing.T) { | |||
var tests = []struct { | |||
description string | |||
api testutil.FakeAPIClient | |||
tagger tag.Tagger | |||
tagger tag.ByImage |
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.
nit: I'd change this to tags
instead of tagger
pkg/skaffold/build/prebuilt.go
Outdated
@@ -46,7 +46,7 @@ func (b *prebuiltImagesBuilder) Labels() map[string]string { | |||
} | |||
} | |||
|
|||
func (b *prebuiltImagesBuilder) Build(ctx context.Context, out io.Writer, tagger tag.Tagger, artifacts []*latest.Artifact) ([]Artifact, error) { | |||
func (b *prebuiltImagesBuilder) Build(ctx context.Context, out io.Writer, tagsIgnored tag.ByImage, artifacts []*latest.Artifact) ([]Artifact, error) { |
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.
if these are actually unused then can we just pass them as _ tag.ByImage
?
pkg/skaffold/build/tag/tag.go
Outdated
@@ -16,6 +16,9 @@ limitations under the License. | |||
|
|||
package tag | |||
|
|||
// ByImage maps image names to tags | |||
type ByImage map[string]string |
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 name is slightly confusing to me, maybe it makes more sense as ImageTags
or ImageToTag
?
pkg/skaffold/runner/runner.go
Outdated
@@ -254,9 +255,34 @@ func (r *SkaffoldRunner) Run(ctx context.Context, out io.Writer, artifacts []*la | |||
return nil | |||
} | |||
|
|||
// imageTags generates tags for a list of artifacts | |||
func (r *SkaffoldRunner) imageTags(out io.Writer, artifacts []*latest.Artifact) (tag.ByImage, error) { | |||
tags := make(tag.ByImage) |
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.
tags := make(tag.ByImage, len(artifacts))
?
Signed-off-by: David Gageot <[email protected]>
ed84316
to
c6f2b7d
Compare
@nkubala @priyawadhwa Should be ready for review |
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.
so hyped for this! LGTM
Tags are now computed by the runner and passed as a
map
to the builder.This makes it easier to transform builder into plugins that have basically no notion of tagging