Skip to content
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

Set build config via BuildOptions #421

Merged
merged 3 commits into from
Aug 26, 2021

Conversation

halvards
Copy link
Collaborator

Enables programmatically overriding build configs when ko is embedded in another tool.

Also minor cleanup of the unit test for NewPublisher().

Related: #340, #419

Enables programmatically overriding build configs when ko is
embedded in another tool.

Related: ko-build#340, ko-build#419
jonjohnsonjr
jonjohnsonjr previously approved these changes Aug 26, 2021
res, err := builder.Build(ctx, "ko://github.com/google/ko/test")
if err != nil {
t.Fatalf("builder.Build(): %v", err)
// TODO This test accesses the network and is slow. Implement a dry-run mode?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could revive this issue: #295

I think it's slow from hitting base image stuff?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it's slow because of the default base image on gcr.io.

#295 looks interesting. For now, I've pushed another commit that uses a local in-memory registry for these unit tests.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For now, I've pushed another commit that uses a local in-memory registry for these unit tests.

Brilliant.

Tests create a local registry (using ggcr) with a dummy base image. This
speeds up tests, since they don't need to hit gcr.io to fetch the
default distroless base image.
@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2021

Codecov Report

Merging #421 (b7156cb) into main (335c1ac) will increase coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #421      +/-   ##
==========================================
+ Coverage   53.39%   53.50%   +0.10%     
==========================================
  Files          36       36              
  Lines        1826     1828       +2     
==========================================
+ Hits          975      978       +3     
+ Misses        700      699       -1     
  Partials      151      151              
Impacted Files Coverage Δ
pkg/commands/resolver.go 31.84% <100.00%> (+0.68%) ⬆️
pkg/commands/config.go 59.63% <0.00%> (+0.91%) ⬆️

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 335c1ac...b7156cb. Read the comment docs.

@jonjohnsonjr jonjohnsonjr merged commit ae594dc into ko-build:main Aug 26, 2021
@halvards halvards deleted the programmatic-build-config branch August 27, 2021 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants