[8.17](backport #8736) ci: pin elastic-agent version #8748
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.





What does this PR do?
This PR temporarily pins
AGENT_VERSIONandBEAT_VERSION(probably for historical reasons we need both, ty for theBEAT_VERSIONhint @pchila ) to9.1.0-SNAPSHOTin CI pipelines. This is an effort to mitigate breakages caused by the recent version bump to 9.2.0 which point to unavailable snapshot artifacts for9.2.0-SNAPSHOTin the unified release.In particular, this patch:
AGENT_VERSION,AGENT_PACKAGE_VERSION, andBEAT_VERSIONacross all affected pipelines.upgrade_broken_package_test.gosince it fails due to the version mismatch until the pinning is removed.version.goin Bash and PowerShell scripts to only run when theAGENT_VERSIONis not explicitly set.cloud:pushandcloud:loadmage targets to respect the pinnedAGENT_VERSION, replacing previously hardcoded fallback toversion.go.Why is it important?
Pinning the version ensures a consistent and known state for the CI runs until the 9.2.0 snapshot artifacts are fully available via DRA and unified stack release.
In addition, there's another issue introduced by #8352, which pins the ESS stack version used in CI to the latest stable version. This means that even if the 9.2.0 DRA snapshot was published, the CI would still be failing due to version incompatibility between the provisioned ESS stack and the
elastic-agentbinary under test, until the pinned ESS version point to a 9.2.0 stack.Also, the
cloud:pushandcloud:loadmage targets - introduced by #8035 - did not originally respect version overrides and required additional code changes to support environment-based overrides, similar to the rest of the codebase.Checklist
./changelog/fragmentsusing the changelog toolDisruptive User Impact
None expected. These changes only affect CI behavior and not end-user installations or interactions.
How to test this PR locally
This changes regard only CI pipelines
Related issues
N/A
This is an automatic backport of pull request #8736 done by [Mergify](https://mergify.com).