Skip to content

Commit

Permalink
Do not update go.mod during packaging and testing (elastic#19823)
Browse files Browse the repository at this point in the history
(cherry picked from commit f91c96f)
  • Loading branch information
kvch committed Jul 13, 2020
1 parent 569e289 commit a423b1f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev-tools/mage/crossbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ func (b GolangCrossBuilder) Build() error {

args = append(args,
"--rm",
"--env", "GOFLAGS=-mod=readonly",
"--env", "MAGEFILE_VERBOSE="+verbose,
"--env", "MAGEFILE_TIMEOUT="+EnvOr("MAGEFILE_TIMEOUT", ""),
"--env", fmt.Sprintf("SNAPSHOT=%v", Snapshot),
Expand Down
2 changes: 2 additions & 0 deletions dev-tools/mage/fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func generateFieldsYAML(baseDir, output string, moduleDirs ...string) error {
}

cmd := []string{"run",
"-mod=readonly",
filepath.Join(beatsDir, globalFieldsCmdPath),
"-es_beats_path", beatsDir,
"-beat_path", baseDir,
Expand All @@ -127,6 +128,7 @@ func GenerateFieldsGo(fieldsYML, out string) error {
}

cmd := []string{"run",
"-mod=readonly",
filepath.Join(beatsDir, assetCmdPath),
"-pkg", "include",
"-in", fieldsYML,
Expand Down
1 change: 1 addition & 0 deletions dev-tools/mage/integtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ func initRunner(tester IntegrationTester, dir string, passInEnv map[string]strin
// Create the custom env for the runner.
env := map[string]string{
insideIntegrationTestEnvVar: "true",
"GOFLAGS": "-mod=vendor",
}
for name, value := range passInEnv {
env[name] = value
Expand Down

0 comments on commit a423b1f

Please sign in to comment.