Skip to content

Commit 3a2bbed

Browse files
authored
Allow overriding AGENT_PACKAGE_VERSION and MANIFEST_URL when USE_PACKAGE_VERSION=true (#9864)
* Allow overriding AGENT_PACKAGE_VERSION and MANIFEST_URL when USE_PACKAGE_VERSION=true * Update dev-tools/mage/settings.go * fix lint errors
1 parent c8f5f63 commit 3a2bbed

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

dev-tools/mage/settings.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,18 @@ func initGlobals() {
162162

163163
versionQualifier, versionQualified = os.LookupEnv("VERSION_QUALIFIER")
164164

165-
agentPackageVersion = EnvOr(agentPackageVersionEnvVar, "")
166-
167-
ManifestURL = EnvOr(ManifestUrlEnvVar, "")
168-
PackagingFromManifest = ManifestURL != ""
169-
170-
// order matters this must be called last as it will override some of the
171-
// values above
165+
// order matters: this will override some of the values. Those values can be used
166+
// as fallback for the variables below (mainly agentPackageVersion and ManifestURL)
172167
err = initPackageVersion()
173168
if err != nil {
174169
panic(fmt.Errorf("failed to init package version: %w", err))
175170
}
171+
172+
agentPackageVersion = EnvOr(agentPackageVersionEnvVar, agentPackageVersion)
173+
174+
ManifestURL = EnvOr(ManifestUrlEnvVar, ManifestURL)
175+
PackagingFromManifest = ManifestURL != ""
176+
176177
}
177178

178179
// ProjectType specifies the type of project (OSS vs X-Pack).

0 commit comments

Comments
 (0)