-
Notifications
You must be signed in to change notification settings - Fork 129
Add --agent-version flag for flexible Elastic Agent version configuration
#3054
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
base: main
Are you sure you want to change the base?
Conversation
| DataStreamRootPath: dataStreamPath, | ||
| Variant: variantFlag, | ||
| StackVersion: stackVersion.Version(), | ||
| AgentVersion: stackVersion.Version(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The service cmd needs an agent version definition? or the default (same as stack) is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess deployers that manage their own agents could use this version, though not sure if we need a different setting for stack and agent version 🤔
In any case this is internal by now, right? No change for users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now there is no "agent version" param, its all dependent of the stackVersion. With this separation, the agent version by default will be the same as the stack version, unless the flag is introduced
💔 Build Failed
Failed CI Steps
History
|
--agent-version flag for flexible Elastic Agent version configuration
| if url, ok := config.Parameters[stack.ParamServerlessFleetURL]; ok { | ||
| fleetURL = url | ||
| } | ||
| if version, ok := config.Parameters[stack.ParamServerlessLocalStackVersion]; ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the flag value will be overriden by the config file one
I think it should be the other way around, if a user is setting a flag in the command line, this value should be prioritized over the one in config files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the code overrides the default value of stack version with the config one
| stackVersion = version |
This param (stackVersion) is originated at the test case mapping from the default stack version (kibana client).
Now there is a flag introduced to modify the agent version in the tests. 🤔 So...
If the test specifies agent-version this should override the value at the config for the stack version. Should there also be an agent-version param at the config to be more specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the code overrides the default value of stack version with the config one
Umm, you are right, this seems unexpected to me 🤔 let's keep this behaviour then by now.
Should there also be an agent-version param at the config to be more specific?
Yes, we should probably record the agent-version used on stack up, and use it in these cases.
This PR introduces a new --agent-version flag that allows users to specify a different Elastic Agent version from the stack version when running tests and booting up the stack.
What changed
Added --agent-version flag to stack up, stack update, and test system commands
The flag defaults to the stack version if not specified, maintaining backward compatibility
Environment variables (ELASTIC_AGENT_IMAGE_REF_OVERRIDE) and configuration file settings (stack.image_ref_overrides.elastic-agent) still take precedence over the flag
System tests now support running with different agent versions, making it easier to test compatibility with older agent versions
Why
With the new agent.version condition being introduced in package manifests to specify minimum compatible Elastic Agent versions, we need an easier way to test packages against different agent versions. Previously, you had to use environment variables or modify the config file. Now you can just pass --agent-version 8.10.0 to quickly test with a specific agent version.
This is especially useful for ensuring packages maintain compatibility with older agent versions without breaking changes.
Resolves #2852