-
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
Fix kaniko default behaviour #1139
Conversation
If buildcontext isn't specified or localdir is specified, return localdir as the source context. Otherwise, return a GCS bucket. If no value is passed in for the bucket, one will be inferred from the project ID.
890d343
to
5f4df39
Compare
Codecov Report
@@ Coverage Diff @@
## master #1139 +/- ##
==========================================
+ Coverage 42.23% 42.31% +0.08%
==========================================
Files 90 89 -1
Lines 3990 3982 -8
==========================================
Hits 1685 1685
+ Misses 2137 2129 -8
Partials 168 168
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.
Setting default config should be done in
if err := c.withKanikoConfig( |
@@ -35,7 +35,7 @@ type BuildContextSource interface { | |||
|
|||
// Retrieve returns the correct build context based on the config | |||
func Retrieve(cfg *latest.KanikoBuild) (BuildContextSource, error) { | |||
if cfg.BuildContext.LocalDir != nil { | |||
if cfg.BuildContext == nil || cfg.BuildContext.LocalDir != nil { |
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.
Setting default config should be done in
if err := c.withKanikoConfig( |
BuildContext
is never nil
when parsing the config so that buildcontext is never nil
If buildcontext isn't specified or localdir is specified, return localdir as the source
context. Otherwise, return a GCS bucket. If no value is passed in for
the bucket, one will be inferred from the project ID.