* fix: avoid triggering %!/(MISSING) for docker output

* fix: suppress --platform for empty platform

Co-authored-by: Josh Soref <[email protected]>
This commit is contained in:
Josh Soref
2021-11-03 11:47:09 -07:00
committed by GitHub
co-authored by Josh Soref
parent aad724c87a
commit 7c73531008
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -29,7 +29,11 @@ type NewDockerBuildExecutorInput struct {
func NewDockerBuildExecutor(input NewDockerBuildExecutorInput) common.Executor { func NewDockerBuildExecutor(input NewDockerBuildExecutorInput) common.Executor {
return func(ctx context.Context) error { return func(ctx context.Context) error {
logger := common.Logger(ctx) logger := common.Logger(ctx)
logger.Infof("%sdocker build -t %s --platform %s %s", logPrefix, input.ImageTag, input.Platform, input.ContextDir) if input.Platform != "" {
logger.Infof("%sdocker build -t %s --platform %s %s", logPrefix, input.ImageTag, input.Platform, input.ContextDir)
} else {
logger.Infof("%sdocker build -t %s %s", logPrefix, input.ImageTag, input.ContextDir)
}
if common.Dryrun(ctx) { if common.Dryrun(ctx) {
return nil return nil
} }
+1 -1
View File
@@ -116,7 +116,7 @@ func logDockerResponse(logger logrus.FieldLogger, dockerResponse io.ReadCloser,
writeLog(logger, isError, "%s :: %s\n", msg.Status, msg.ID) writeLog(logger, isError, "%s :: %s\n", msg.Status, msg.ID)
} }
} else if msg.Stream != "" { } else if msg.Stream != "" {
writeLog(logger, isError, msg.Stream) writeLog(logger, isError, "%s", msg.Stream)
} else { } else {
writeLog(logger, false, "Unable to handle line: %s", string(line)) writeLog(logger, false, "Unable to handle line: %s", string(line))
} }