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

Drop scary warning #439

Merged
merged 1 commit into from
Sep 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions pkg/build/gobuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,6 @@ import (

const (
defaultAppFilename = "ko-app"

gorootWarningTemplate = `NOTICE!
-----------------------------------------------------------------
ko and go have mismatched GOROOT:
go/build.Default.GOROOT = %q
$(go env GOROOT) = %q

Inferring GOROOT=%q

Run this to remove this warning:
export GOROOT=$(go env GOROOT)

For more information see:
https://github.com/google/ko/issues/106
-----------------------------------------------------------------
`
)

// GetBase takes an importpath and returns a base image reference and base image (or index).
Expand Down Expand Up @@ -233,11 +217,10 @@ func NewGo(ctx context.Context, dir string, options ...Option) (Interface, error
}

// If $(go env GOROOT) successfully returns a non-empty string that differs from
// the default build context GOROOT, print a warning and use $(go env GOROOT).
// the default build context GOROOT, use $(go env GOROOT) instead.
bc := gb.Default
bc.Dir = dir
if goroot != "" && bc.GOROOT != goroot {
log.Printf(gorootWarningTemplate, bc.GOROOT, goroot, goroot)
bc.GOROOT = goroot
}

Expand Down