From b129fcd9e3918f3a5e89c097642d7cc85c0f0834 Mon Sep 17 00:00:00 2001 From: Teresa Romero Date: Thu, 30 Oct 2025 15:23:16 +0100 Subject: [PATCH 01/12] Add agent version flag to CLI for specifying Elastic Agent version --- internal/cobraext/flags.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/cobraext/flags.go b/internal/cobraext/flags.go index 1838404fd6..95c1968675 100644 --- a/internal/cobraext/flags.go +++ b/internal/cobraext/flags.go @@ -227,4 +227,7 @@ const ( ZipPackageFilePathFlagName = "zip" ZipPackageFilePathFlagShorthand = "z" ZipPackageFilePathFlagDescription = "path to the zip package file (*.zip)" + + AgentVersionFlagName = "agent-version" + AgentVersionFlagDescription = "Elastic Agent version to be used in the stack" ) From 3391c07618a91de066adf510d579ba797ccbd43f Mon Sep 17 00:00:00 2001 From: Teresa Romero Date: Thu, 30 Oct 2025 15:23:54 +0100 Subject: [PATCH 02/12] Add agent version support to stack command options --- cmd/stack.go | 6 ++++++ internal/stack/options.go | 1 + 2 files changed, 7 insertions(+) diff --git a/cmd/stack.go b/cmd/stack.go index b24164ad84..dd98b219d3 100644 --- a/cmd/stack.go +++ b/cmd/stack.go @@ -107,6 +107,11 @@ func setupStackCommand() *cobraext.Command { return cobraext.FlagParsingError(err, cobraext.StackVersionFlagName) } + agentVersion, err := cmd.Flags().GetString(cobraext.AgentVersionFlagName) + if err != nil { + return cobraext.FlagParsingError(err, cobraext.AgentVersionFlagName) + } + profile, err := cobraext.GetProfileFlag(cmd) if err != nil { return err @@ -133,6 +138,7 @@ func setupStackCommand() *cobraext.Command { Services: services, Profile: profile, Printer: cmd, + AgentVersion: agentVersion, }) if err != nil { return fmt.Errorf("booting up the stack failed: %w", err) diff --git a/internal/stack/options.go b/internal/stack/options.go index 1c8f2827d6..7f809cc694 100644 --- a/internal/stack/options.go +++ b/internal/stack/options.go @@ -12,6 +12,7 @@ import ( type Options struct { DaemonMode bool StackVersion string + AgentVersion string Services []string From 9c4c92c95c87bfc1d2fb939099398aaa91f2b118 Mon Sep 17 00:00:00 2001 From: Teresa Romero Date: Thu, 30 Oct 2025 15:48:35 +0100 Subject: [PATCH 03/12] Add agent version flag to stack command --- cmd/stack.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/stack.go b/cmd/stack.go index dd98b219d3..617f2fec2c 100644 --- a/cmd/stack.go +++ b/cmd/stack.go @@ -135,10 +135,10 @@ func setupStackCommand() *cobraext.Command { err = provider.BootUp(cmd.Context(), stack.Options{ DaemonMode: daemonMode, StackVersion: stackVersion, + AgentVersion: agentVersion, Services: services, Profile: profile, Printer: cmd, - AgentVersion: agentVersion, }) if err != nil { return fmt.Errorf("booting up the stack failed: %w", err) @@ -152,6 +152,7 @@ func setupStackCommand() *cobraext.Command { upCommand.Flags().StringSliceP(cobraext.StackServicesFlagName, "s", nil, fmt.Sprintf(cobraext.StackServicesFlagDescription, strings.Join(availableServicesAsList(), ","))) upCommand.Flags().StringP(cobraext.StackVersionFlagName, "", install.DefaultStackVersion, cobraext.StackVersionFlagDescription) + upCommand.Flags().StringP(cobraext.AgentVersionFlagName, "", install.DefaultStackVersion, cobraext.AgentVersionFlagDescription) upCommand.Flags().String(cobraext.StackProviderFlagName, "", fmt.Sprintf(cobraext.StackProviderFlagDescription, strings.Join(stack.SupportedProviders, ", "))) upCommand.Flags().StringSliceP(cobraext.StackUserParameterFlagName, cobraext.StackUserParameterFlagShorthand, nil, cobraext.StackUserParameterDescription) From f4545325ae2bce2b81c87573ddf434af39373888 Mon Sep 17 00:00:00 2001 From: Teresa Romero Date: Fri, 31 Oct 2025 09:50:34 +0100 Subject: [PATCH 04/12] Update applyResources function to accept agentVersion parameter --- internal/stack/resources.go | 4 ++-- internal/stack/resources_test.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/stack/resources.go b/internal/stack/resources.go index a16de5a4d9..802119a656 100644 --- a/internal/stack/resources.go +++ b/internal/stack/resources.go @@ -144,7 +144,7 @@ var ( } ) -func applyResources(profile *profile.Profile, stackVersion string) error { +func applyResources(profile *profile.Profile, stackVersion string, agentVersion string) error { stackDir := filepath.Join(profile.ProfilePath, ProfileStackPath) var agentPorts []string @@ -162,7 +162,7 @@ func applyResources(profile *profile.Profile, stackVersion string) error { "registry_base_image": PackageRegistryBaseImage, "elasticsearch_version": stackVersion, "kibana_version": stackVersion, - "agent_version": stackVersion, + "agent_version": agentVersion, "kibana_host": "https://kibana:5601", "fleet_url": "https://fleet-server:8220", diff --git a/internal/stack/resources_test.go b/internal/stack/resources_test.go index 435283af7e..e6391fd5f6 100644 --- a/internal/stack/resources_test.go +++ b/internal/stack/resources_test.go @@ -48,7 +48,8 @@ func TestApplyResourcesWithCustomGeoipDir(t *testing.T) { require.Equal(t, expectedGeoipPath, v) // Now, apply resources and check that the variable has been used. - err = applyResources(p, "8.6.1") + stackVersion := "8.6.1" + err = applyResources(p, stackVersion, stackVersion) require.NoError(t, err) d, err := os.ReadFile(p.Path(ProfileStackPath, ComposeFile)) From 48154ae3b589b6645a06b7f570e71deb55c2a1ad Mon Sep 17 00:00:00 2001 From: Teresa Romero Date: Fri, 31 Oct 2025 09:50:55 +0100 Subject: [PATCH 05/12] Update BootUp function to pass agentVersion to applyResources --- internal/stack/boot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/stack/boot.go b/internal/stack/boot.go index d076bce74d..14540b8bbf 100644 --- a/internal/stack/boot.go +++ b/internal/stack/boot.go @@ -75,7 +75,7 @@ func BootUp(ctx context.Context, options Options) error { options.Printer.Printf("- Local directory %s\n", buildPackagesPath) } - err = applyResources(options.Profile, options.StackVersion) + err = applyResources(options.Profile, options.StackVersion, options.AgentVersion) if err != nil { return fmt.Errorf("creating stack files failed: %w", err) } From ac8ab2d89fad743e88ab14dee94e03b3da1e2317 Mon Sep 17 00:00:00 2001 From: Teresa Romero Date: Wed, 5 Nov 2025 10:56:32 +0100 Subject: [PATCH 06/12] Add agent version support to stack update command --- cmd/stack.go | 7 +++++++ internal/stack/update.go | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/stack.go b/cmd/stack.go index 617f2fec2c..67d09e61b1 100644 --- a/cmd/stack.go +++ b/cmd/stack.go @@ -208,10 +208,16 @@ func setupStackCommand() *cobraext.Command { return cobraext.FlagParsingError(err, cobraext.StackVersionFlagName) } + agentVersion, err := cmd.Flags().GetString(cobraext.AgentVersionFlagName) + if err != nil { + return cobraext.FlagParsingError(err, cobraext.AgentVersionFlagName) + } + err = provider.Update(cmd.Context(), stack.Options{ StackVersion: stackVersion, Profile: profile, Printer: cmd, + AgentVersion: agentVersion, }) if err != nil { return fmt.Errorf("failed updating the stack images: %w", err) @@ -222,6 +228,7 @@ func setupStackCommand() *cobraext.Command { }, } updateCommand.Flags().StringP(cobraext.StackVersionFlagName, "", install.DefaultStackVersion, cobraext.StackVersionFlagDescription) + updateCommand.Flags().StringP(cobraext.AgentVersionFlagName, "", install.DefaultStackVersion, cobraext.AgentVersionFlagDescription) shellInitCommand := &cobra.Command{ Use: "shellinit", diff --git a/internal/stack/update.go b/internal/stack/update.go index ee7f6dfd80..7dd5aa3e90 100644 --- a/internal/stack/update.go +++ b/internal/stack/update.go @@ -13,7 +13,7 @@ import ( // Update pulls down the most recent versions of the Docker images. func Update(ctx context.Context, options Options) error { - err := applyResources(options.Profile, options.StackVersion) + err := applyResources(options.Profile, options.StackVersion, options.AgentVersion) if err != nil { return fmt.Errorf("creating stack files failed: %w", err) } From 0d329d66a7f9997eb8f329e5d1645b88f2a83330 Mon Sep 17 00:00:00 2001 From: Teresa Romero Date: Wed, 5 Nov 2025 15:12:24 +0100 Subject: [PATCH 07/12] Add agent version support across multiple components --- cmd/service.go | 1 + cmd/testrunner.go | 7 +++++ internal/agentdeployer/agent.go | 11 ++++--- internal/agentdeployer/factory.go | 3 ++ internal/agentdeployer/kubernetes.go | 29 +++++++++++-------- internal/benchrunner/runners/system/runner.go | 1 + internal/install/application_configuration.go | 20 +++++++++---- internal/service/boot.go | 2 ++ internal/servicedeployer/custom_agent.go | 5 +++- internal/servicedeployer/factory.go | 3 ++ internal/servicedeployer/kubernetes.go | 17 ++++++----- internal/stack/compose.go | 8 ++--- internal/stack/localresources.go | 4 +-- internal/stack/localservices.go | 2 +- internal/stack/logs.go | 2 +- internal/stack/serverless.go | 2 +- internal/testrunner/runners/system/runner.go | 4 +++ internal/testrunner/runners/system/tester.go | 5 ++++ 18 files changed, 88 insertions(+), 38 deletions(-) diff --git a/cmd/service.go b/cmd/service.go index 76c4ee7723..55a6d5e432 100644 --- a/cmd/service.go +++ b/cmd/service.go @@ -82,6 +82,7 @@ func upCommandAction(cmd *cobra.Command, args []string) error { DataStreamRootPath: dataStreamPath, Variant: variantFlag, StackVersion: stackVersion.Version(), + AgentVersion: stackVersion.Version(), }) if err != nil { return fmt.Errorf("up command failed: %w", err) diff --git a/cmd/testrunner.go b/cmd/testrunner.go index f06a33045c..1d0e08042a 100644 --- a/cmd/testrunner.go +++ b/cmd/testrunner.go @@ -420,6 +420,7 @@ func getTestRunnerSystemCommand() *cobra.Command { cmd.Flags().Bool(cobraext.SetupFlagName, false, cobraext.SetupFlagDescription) cmd.Flags().Bool(cobraext.TearDownFlagName, false, cobraext.TearDownFlagDescription) cmd.Flags().Bool(cobraext.NoProvisionFlagName, false, cobraext.NoProvisionFlagDescription) + cmd.Flags().StringP(cobraext.AgentVersionFlagName, "", install.DefaultStackVersion, cobraext.AgentVersionFlagDescription) cmd.MarkFlagsMutuallyExclusive(cobraext.SetupFlagName, cobraext.TearDownFlagName, cobraext.NoProvisionFlagName) cmd.MarkFlagsRequiredTogether(cobraext.ConfigFileFlagName, cobraext.SetupFlagName) @@ -451,6 +452,11 @@ func testRunnerSystemCommandAction(cmd *cobra.Command, args []string) error { return cobraext.FlagParsingError(err, cobraext.FailOnMissingFlagName) } + agentVersion, err := cmd.Flags().GetString(cobraext.AgentVersionFlagName) + if err != nil { + return cobraext.FlagParsingError(err, cobraext.AgentVersionFlagName) + } + generateTestResult, err := cmd.Flags().GetBool(cobraext.GenerateTestResultFlagName) if err != nil { return cobraext.FlagParsingError(err, cobraext.GenerateTestResultFlagName) @@ -585,6 +591,7 @@ func testRunnerSystemCommandAction(cmd *cobra.Command, args []string) error { WithCoverage: testCoverage, CoverageType: testCoverageFormat, RepositoryRoot: repositoryRoot, + AgentVersion: agentVersion, }) logger.Debugf("Running suite...") diff --git a/internal/agentdeployer/agent.go b/internal/agentdeployer/agent.go index c8fd2abcdd..49b05b7f6f 100644 --- a/internal/agentdeployer/agent.go +++ b/internal/agentdeployer/agent.go @@ -46,6 +46,7 @@ var staticSource = resource.NewSourceFS(static) type DockerComposeAgentDeployer struct { profile *profile.Profile stackVersion string + agentVersion string policyName string @@ -61,6 +62,7 @@ type DockerComposeAgentDeployer struct { type DockerComposeAgentDeployerOptions struct { Profile *profile.Profile StackVersion string + AgentVersion string PolicyName string PackageName string @@ -88,6 +90,7 @@ func NewCustomAgentDeployer(options DockerComposeAgentDeployerOptions) (*DockerC return &DockerComposeAgentDeployer{ profile: options.Profile, stackVersion: options.StackVersion, + agentVersion: options.AgentVersion, packageName: options.PackageName, dataStream: options.DataStream, policyName: options.PolicyName, @@ -101,7 +104,7 @@ func (d *DockerComposeAgentDeployer) SetUp(ctx context.Context, agentInfo AgentI logger.Debug("setting up agent using Docker Compose agent deployer") d.agentRunID = agentInfo.Test.RunID - appConfig, err := install.Configuration(install.OptionWithStackVersion(d.stackVersion)) + appConfig, err := install.Configuration(install.OptionWithStackVersion(d.stackVersion), install.OptionWithAgentVersion(d.agentVersion)) if err != nil { return nil, fmt.Errorf("can't read application configuration: %w", err) } @@ -281,7 +284,7 @@ func (d *DockerComposeAgentDeployer) installDockerCompose(ctx context.Context, a stackVersion = version } - agentImage, err := selectElasticAgentImage(stackVersion, agentInfo.Agent.BaseImage) + agentImage, err := selectElasticAgentImage(d.agentVersion, agentInfo.Agent.BaseImage) if err != nil { return "", nil } @@ -321,8 +324,8 @@ func (d *DockerComposeAgentDeployer) installDockerCompose(ctx context.Context, a return customAgentDir, nil } -func selectElasticAgentImage(stackVersion, agentBaseImage string) (string, error) { - appConfig, err := install.Configuration(install.OptionWithAgentBaseImage(agentBaseImage), install.OptionWithStackVersion(stackVersion)) +func selectElasticAgentImage(agentVersion, agentBaseImage string) (string, error) { + appConfig, err := install.Configuration(install.OptionWithAgentBaseImage(agentBaseImage), install.OptionWithAgentVersion(agentVersion)) if err != nil { return "", fmt.Errorf("can't read application configuration: %w", err) } diff --git a/internal/agentdeployer/factory.go b/internal/agentdeployer/factory.go index 5f3362c3c4..05b0ecbcf0 100644 --- a/internal/agentdeployer/factory.go +++ b/internal/agentdeployer/factory.go @@ -29,6 +29,7 @@ type FactoryOptions struct { DevDeployDir string Type string StackVersion string + AgentVersion string PolicyName string DeployerName string @@ -62,6 +63,7 @@ func Factory(options FactoryOptions) (AgentDeployer, error) { DataStream: options.DataStream, RunTearDown: options.RunTearDown, RunTestsOnly: options.RunTestsOnly, + AgentVersion: options.AgentVersion, } return NewCustomAgentDeployer(opts) case "agent": @@ -72,6 +74,7 @@ func Factory(options FactoryOptions) (AgentDeployer, error) { opts := KubernetesAgentDeployerOptions{ Profile: options.Profile, StackVersion: options.StackVersion, + AgentVersion: options.AgentVersion, PolicyName: options.PolicyName, DataStream: options.DataStream, RunSetup: options.RunSetup, diff --git a/internal/agentdeployer/kubernetes.go b/internal/agentdeployer/kubernetes.go index 184e11fc33..dae0b34e7b 100644 --- a/internal/agentdeployer/kubernetes.go +++ b/internal/agentdeployer/kubernetes.go @@ -27,6 +27,7 @@ import ( type KubernetesAgentDeployer struct { profile *profile.Profile stackVersion string + agentVersion string policyName string dataStream string @@ -40,6 +41,7 @@ type KubernetesAgentDeployer struct { type KubernetesAgentDeployerOptions struct { Profile *profile.Profile StackVersion string + AgentVersion string PolicyName string DataStream string @@ -53,11 +55,12 @@ type kubernetesDeployedAgent struct { profile *profile.Profile stackVersion string - agentName string + agentName string + agentVersion string } func (s kubernetesDeployedAgent) TearDown(ctx context.Context) error { - elasticAgentManagedYaml, err := getElasticAgentYAML(ctx, s.profile, s.agentInfo, s.stackVersion, s.agentName) + elasticAgentManagedYaml, err := getElasticAgentYAML(ctx, s.profile, s.agentInfo, s.stackVersion, s.agentName, s.agentVersion) if err != nil { return fmt.Errorf("can't retrieve Kubernetes file for Elastic Agent: %w", err) } @@ -92,6 +95,7 @@ func NewKubernetesAgentDeployer(opts KubernetesAgentDeployerOptions) (*Kubernete return &KubernetesAgentDeployer{ profile: opts.Profile, stackVersion: opts.StackVersion, + agentVersion: opts.AgentVersion, policyName: opts.PolicyName, dataStream: opts.DataStream, runSetup: opts.RunSetup, @@ -123,7 +127,7 @@ func (ksd *KubernetesAgentDeployer) SetUp(ctx context.Context, agentInfo AgentIn if ksd.runTearDown || ksd.runTestsOnly { logger.Debug("Skip install Elastic Agent in cluster") } else { - err = installElasticAgentInCluster(ctx, ksd.profile, agentInfo, ksd.stackVersion, agentName) + err = installElasticAgentInCluster(ctx, ksd.profile, agentInfo, ksd.stackVersion, agentName, ksd.agentVersion) if err != nil { return nil, fmt.Errorf("can't install Elastic-Agent in the Kubernetes cluster: %w", err) } @@ -139,6 +143,7 @@ func (ksd *KubernetesAgentDeployer) SetUp(ctx context.Context, agentInfo AgentIn profile: ksd.profile, stackVersion: ksd.stackVersion, agentName: agentName, + agentVersion: ksd.agentVersion, }, nil } @@ -155,10 +160,10 @@ func (ksd *KubernetesAgentDeployer) agentName() string { var _ AgentDeployer = new(KubernetesAgentDeployer) -func installElasticAgentInCluster(ctx context.Context, profile *profile.Profile, agentInfo AgentInfo, stackVersion, agentName string) error { +func installElasticAgentInCluster(ctx context.Context, profile *profile.Profile, agentInfo AgentInfo, stackVersion, agentName, agentVersion string) error { logger.Debug("install Elastic Agent in the Kubernetes cluster") - elasticAgentManagedYaml, err := getElasticAgentYAML(ctx, profile, agentInfo, stackVersion, agentName) + elasticAgentManagedYaml, err := getElasticAgentYAML(ctx, profile, agentInfo, stackVersion, agentName, agentVersion) if err != nil { return fmt.Errorf("can't retrieve Kubernetes file for Elastic Agent: %w", err) } @@ -176,8 +181,8 @@ func installElasticAgentInCluster(ctx context.Context, profile *profile.Profile, //go:embed _static/elastic-agent-managed.yaml.tmpl var elasticAgentManagedYamlTmpl string -func getElasticAgentYAML(ctx context.Context, profile *profile.Profile, agentInfo AgentInfo, stackVersion, agentName string) ([]byte, error) { - logger.Debugf("Prepare YAML definition for Elastic Agent running in stack v%s", stackVersion) +func getElasticAgentYAML(ctx context.Context, profile *profile.Profile, agentInfo AgentInfo, stackVersion, agentName, agentVersion string) ([]byte, error) { + logger.Debugf("Prepare YAML definition for Elastic Agent (v%s) running in stack v%s", agentVersion, stackVersion) config, err := stack.LoadConfig(profile) if err != nil { return nil, fmt.Errorf("failed to load config from profile: %w", err) @@ -191,7 +196,7 @@ func getElasticAgentYAML(ctx context.Context, profile *profile.Profile, agentInf fleetURL = url } if version, ok := config.Parameters[stack.ParamServerlessLocalStackVersion]; ok { - stackVersion = version + agentVersion = version } enrollmentToken := "" @@ -207,7 +212,7 @@ func getElasticAgentYAML(ctx context.Context, profile *profile.Profile, agentInf } } - appConfig, err := install.Configuration(install.OptionWithStackVersion(stackVersion)) + appConfig, err := install.Configuration(install.OptionWithAgentVersion(agentVersion)) if err != nil { return nil, fmt.Errorf("can't read application configuration: %w", err) } @@ -228,7 +233,7 @@ func getElasticAgentYAML(ctx context.Context, profile *profile.Profile, agentInf "enrollmentToken": enrollmentToken, "caCertPem": caCert, "elasticAgentImage": appConfig.StackImageRefs().ElasticAgent, - "elasticAgentTokenPolicyName": getTokenPolicyName(stackVersion, agentInfo.Policy.Name), + "elasticAgentTokenPolicyName": getTokenPolicyName(agentVersion, agentInfo.Policy.Name), "agentName": agentName, }) if err != nil { @@ -255,8 +260,8 @@ func readCACertBase64(profile *profile.Profile) (string, error) { // getTokenPolicyName function returns the policy name for the >= 8.x Elastic stacks. The agent's policy // is predefined in the Kibana configuration file. The logic is not present in older stacks and it uses // the default policy in Kibana (empty string). -func getTokenPolicyName(stackVersion, policyName string) string { - if strings.HasPrefix(stackVersion, "7.") { +func getTokenPolicyName(agentVersion, policyName string) string { + if strings.HasPrefix(agentVersion, "7.") { return "" } return policyName diff --git a/internal/benchrunner/runners/system/runner.go b/internal/benchrunner/runners/system/runner.go index b34efab3a2..cfaf1671d5 100644 --- a/internal/benchrunner/runners/system/runner.go +++ b/internal/benchrunner/runners/system/runner.go @@ -313,6 +313,7 @@ func (r *runner) setupService(ctx context.Context) (servicedeployer.DeployedServ Profile: r.options.Profile, Type: servicedeployer.TypeBench, StackVersion: stackVersion.Version(), + AgentVersion: stackVersion.Version(), DeployIndependentAgent: false, } serviceDeployer, err := servicedeployer.Factory(opts) diff --git a/internal/install/application_configuration.go b/internal/install/application_configuration.go index 137be01388..41e35b1134 100644 --- a/internal/install/application_configuration.go +++ b/internal/install/application_configuration.go @@ -77,6 +77,7 @@ type ApplicationConfiguration struct { c configFile agentBaseImage string stackVersion string + agentVersion string } type configFile struct { @@ -129,7 +130,7 @@ func (ir ImageRefs) AsEnv() []string { // StackImageRefs function selects the appropriate set of Docker image references for the given stack version. func (ac *ApplicationConfiguration) StackImageRefs() ImageRefs { refs := ac.c.Stack.ImageRefOverridesForVersion(ac.stackVersion) - refs.ElasticAgent = stringOrDefault(refs.ElasticAgent, fmt.Sprintf("%s:%s", selectElasticAgentImageName(ac.stackVersion, ac.agentBaseImage), ac.stackVersion)) + refs.ElasticAgent = stringOrDefault(refs.ElasticAgent, fmt.Sprintf("%s:%s", selectElasticAgentImageName(ac.agentVersion, ac.agentBaseImage), ac.agentVersion)) refs.Elasticsearch = stringOrDefault(refs.Elasticsearch, fmt.Sprintf("%s:%s", elasticsearchImageName, ac.stackVersion)) refs.Kibana = stringOrDefault(refs.Kibana, fmt.Sprintf("%s:%s", kibanaImageName, ac.stackVersion)) refs.Logstash = stringOrDefault(refs.Logstash, fmt.Sprintf("%s:%s", logstashImageName, ac.stackVersion)) @@ -157,14 +158,14 @@ func (ac *ApplicationConfiguration) SetCurrentProfile(name string) { // selectElasticAgentImageName function returns the appropriate image name for Elastic-Agent depending on the stack version. // This is mandatory as "elastic-agent-complete" is available since 7.15.0-SNAPSHOT. -func selectElasticAgentImageName(version, agentBaseImage string) string { - if version == "" { // as version is optional and can be empty +func selectElasticAgentImageName(agentVersion, agentBaseImage string) string { + if agentVersion == "" { // as version is optional and can be empty return elasticAgentWolfiImageName } - v, err := semver.NewVersion(version) + v, err := semver.NewVersion(agentVersion) if err != nil { - logger.Errorf("stack version not in semver format (value: %s): %v", version, err) + logger.Errorf("agent version not in semver format (value: %s): %v", agentVersion, err) return elasticAgentWolfiImageName } @@ -217,6 +218,7 @@ func selectElasticAgentSystemDImageName(version *semver.Version) string { type configurationOptions struct { agentBaseImage string stackVersion string + agentVersion string } type ConfigurationOption func(*configurationOptions) @@ -235,6 +237,13 @@ func OptionWithStackVersion(stackVersion string) ConfigurationOption { } } +// OptionWithAgentVersion sets the Elastic Agent version to be used. +func OptionWithAgentVersion(agentVersion string) ConfigurationOption { + return func(opts *configurationOptions) { + opts.agentVersion = agentVersion + } +} + // Configuration function returns the elastic-package configuration. func Configuration(options ...ConfigurationOption) (*ApplicationConfiguration, error) { configPath, err := locations.NewLocationManager() @@ -265,6 +274,7 @@ func Configuration(options ...ConfigurationOption) (*ApplicationConfiguration, e c: c, agentBaseImage: configOptions.agentBaseImage, stackVersion: configOptions.stackVersion, + agentVersion: configOptions.agentVersion, } return &configuration, nil diff --git a/internal/service/boot.go b/internal/service/boot.go index b60ef472c0..9737492f3e 100644 --- a/internal/service/boot.go +++ b/internal/service/boot.go @@ -30,6 +30,7 @@ type Options struct { DevDeployDir string DataStreamRootPath string StackVersion string + AgentVersion string Variant string } @@ -45,6 +46,7 @@ func BootUp(ctx context.Context, options Options) error { Variant: options.Variant, StackVersion: options.StackVersion, DeployIndependentAgent: false, + AgentVersion: options.AgentVersion, }) if errors.Is(err, os.ErrNotExist) { fmt.Println("No service defined.") diff --git a/internal/servicedeployer/custom_agent.go b/internal/servicedeployer/custom_agent.go index 360477f3fa..8b8537aebe 100644 --- a/internal/servicedeployer/custom_agent.go +++ b/internal/servicedeployer/custom_agent.go @@ -39,6 +39,7 @@ type CustomAgentDeployer struct { dockerComposeFile string stackVersion string policyName string + agentVersion string runTearDown bool runTestsOnly bool @@ -49,6 +50,7 @@ type CustomAgentDeployerOptions struct { DockerComposeFile string StackVersion string PolicyName string + AgentVersion string RunTearDown bool RunTestsOnly bool @@ -62,6 +64,7 @@ func NewCustomAgentDeployer(options CustomAgentDeployerOptions) (*CustomAgentDep profile: options.Profile, dockerComposeFile: options.DockerComposeFile, stackVersion: options.StackVersion, + agentVersion: options.AgentVersion, policyName: options.PolicyName, runTearDown: options.RunTearDown, runTestsOnly: options.RunTestsOnly, @@ -72,7 +75,7 @@ func NewCustomAgentDeployer(options CustomAgentDeployerOptions) (*CustomAgentDep func (d *CustomAgentDeployer) SetUp(ctx context.Context, svcInfo ServiceInfo) (DeployedService, error) { logger.Warn("DEPRECATED - setting up service using Docker Compose service deployer") - appConfig, err := install.Configuration(install.OptionWithStackVersion(d.stackVersion)) + appConfig, err := install.Configuration(install.OptionWithStackVersion(d.stackVersion), install.OptionWithAgentVersion(d.agentVersion)) if err != nil { return nil, fmt.Errorf("can't read application configuration: %w", err) } diff --git a/internal/servicedeployer/factory.go b/internal/servicedeployer/factory.go index d21f62e57e..c2736a1066 100644 --- a/internal/servicedeployer/factory.go +++ b/internal/servicedeployer/factory.go @@ -28,6 +28,7 @@ type FactoryOptions struct { DevDeployDir string Type string StackVersion string + AgentVersion string DeployIndependentAgent bool PolicyName string @@ -73,6 +74,7 @@ func Factory(options FactoryOptions) (ServiceDeployer, error) { RunTestsOnly: options.RunTestsOnly, RunTearDown: options.RunTearDown, DeployIndependentAgent: options.DeployIndependentAgent, + AgentVersion: options.AgentVersion, } return NewKubernetesServiceDeployer(opts) } @@ -108,6 +110,7 @@ func Factory(options FactoryOptions) (ServiceDeployer, error) { Profile: options.Profile, DockerComposeFile: customAgentCfgYMLPath, StackVersion: options.StackVersion, + AgentVersion: options.AgentVersion, PolicyName: policyName, RunTearDown: options.RunTearDown, diff --git a/internal/servicedeployer/kubernetes.go b/internal/servicedeployer/kubernetes.go index de988413a7..de4575e962 100644 --- a/internal/servicedeployer/kubernetes.go +++ b/internal/servicedeployer/kubernetes.go @@ -28,6 +28,7 @@ type KubernetesServiceDeployer struct { profile *profile.Profile definitionsDir string stackVersion string + agentVersion string policyName string deployIndependentAgent bool @@ -41,6 +42,7 @@ type KubernetesServiceDeployerOptions struct { Profile *profile.Profile DefinitionsDir string StackVersion string + AgentVersion string PolicyName string DeployIndependentAgent bool @@ -118,6 +120,7 @@ func NewKubernetesServiceDeployer(opts KubernetesServiceDeployerOptions) (*Kuber profile: opts.Profile, definitionsDir: opts.DefinitionsDir, stackVersion: opts.StackVersion, + agentVersion: opts.AgentVersion, policyName: opts.PolicyName, runSetup: opts.RunSetup, runTestsOnly: opts.RunTestsOnly, @@ -146,7 +149,7 @@ func (ksd KubernetesServiceDeployer) SetUp(ctx context.Context, svcInfo ServiceI if ksd.runTearDown || ksd.runTestsOnly || ksd.deployIndependentAgent { logger.Debug("Skip install Elastic Agent in cluster") } else { - err = installElasticAgentInCluster(ctx, ksd.profile, ksd.stackVersion, ksd.policyName) + err = installElasticAgentInCluster(ctx, ksd.profile, ksd.agentVersion, ksd.policyName) if err != nil { return nil, fmt.Errorf("can't install Elastic-Agent in the Kubernetes cluster: %w", err) } @@ -208,10 +211,10 @@ func findKubernetesDefinitions(definitionsDir string) ([]string, error) { return definitionPaths, nil } -func installElasticAgentInCluster(ctx context.Context, profile *profile.Profile, stackVersion, policyName string) error { +func installElasticAgentInCluster(ctx context.Context, profile *profile.Profile, agentVersion, policyName string) error { logger.Debug("install Elastic Agent in the Kubernetes cluster") - elasticAgentManagedYaml, err := getElasticAgentYAML(profile, stackVersion, policyName) + elasticAgentManagedYaml, err := getElasticAgentYAML(profile, agentVersion, policyName) if err != nil { return fmt.Errorf("can't retrieve Kubernetes file for Elastic Agent: %w", err) } @@ -226,10 +229,10 @@ func installElasticAgentInCluster(ctx context.Context, profile *profile.Profile, //go:embed _static/elastic-agent-managed.yaml.tmpl var elasticAgentManagedYamlTmpl string -func getElasticAgentYAML(profile *profile.Profile, stackVersion, policyName string) ([]byte, error) { - logger.Debugf("Prepare YAML definition for Elastic Agent running in stack v%s", stackVersion) +func getElasticAgentYAML(profile *profile.Profile, agentVersion, policyName string) ([]byte, error) { + logger.Debugf("Prepare YAML definition for Elastic Agent (v%s) running in stack ", agentVersion) - appConfig, err := install.Configuration(install.OptionWithStackVersion(stackVersion)) + appConfig, err := install.Configuration(install.OptionWithAgentVersion(agentVersion)) if err != nil { return nil, fmt.Errorf("can't read application configuration: %w", err) } @@ -247,7 +250,7 @@ func getElasticAgentYAML(profile *profile.Profile, stackVersion, policyName stri "kibanaURL": "https://kibana:5601", "caCertPem": caCert, "elasticAgentImage": appConfig.StackImageRefs().ElasticAgent, - "elasticAgentTokenPolicyName": getTokenPolicyName(stackVersion, policyName), + "elasticAgentTokenPolicyName": getTokenPolicyName(agentVersion, policyName), }) if err != nil { return nil, fmt.Errorf("can't generate elastic agent manifest: %w", err) diff --git a/internal/stack/compose.go b/internal/stack/compose.go index 483e638e80..88b4cfdea9 100644 --- a/internal/stack/compose.go +++ b/internal/stack/compose.go @@ -56,7 +56,7 @@ func dockerComposeBuild(ctx context.Context, options Options) error { return fmt.Errorf("could not create docker compose project: %w", err) } - appConfig, err := install.Configuration(install.OptionWithStackVersion(options.StackVersion)) + appConfig, err := install.Configuration(install.OptionWithStackVersion(options.StackVersion), install.OptionWithAgentVersion(options.AgentVersion)) if err != nil { return fmt.Errorf("can't read application configuration: %w", err) } @@ -82,7 +82,7 @@ func dockerComposePull(ctx context.Context, options Options) error { return fmt.Errorf("could not create docker compose project: %w", err) } - appConfig, err := install.Configuration(install.OptionWithStackVersion(options.StackVersion)) + appConfig, err := install.Configuration(install.OptionWithStackVersion(options.StackVersion), install.OptionWithAgentVersion(options.AgentVersion)) if err != nil { return fmt.Errorf("can't read application configuration: %w", err) } @@ -113,7 +113,7 @@ func dockerComposeUp(ctx context.Context, options Options) error { args = append(args, "-d") } - appConfig, err := install.Configuration(install.OptionWithStackVersion(options.StackVersion)) + appConfig, err := install.Configuration(install.OptionWithStackVersion(options.StackVersion), install.OptionWithAgentVersion(options.AgentVersion)) if err != nil { return fmt.Errorf("can't read application configuration: %w", err) } @@ -140,7 +140,7 @@ func dockerComposeDown(ctx context.Context, options Options) error { return fmt.Errorf("could not create docker compose project: %w", err) } - appConfig, err := install.Configuration(install.OptionWithStackVersion(options.StackVersion)) + appConfig, err := install.Configuration(install.OptionWithStackVersion(options.StackVersion), install.OptionWithAgentVersion(options.AgentVersion)) if err != nil { return fmt.Errorf("can't read application configuration: %w", err) } diff --git a/internal/stack/localresources.go b/internal/stack/localresources.go index 2a336d753d..907d522e41 100644 --- a/internal/stack/localresources.go +++ b/internal/stack/localresources.go @@ -39,8 +39,8 @@ var ( // applyLocalResources creates the local resources needed to run system tests when the stack // is not local. -func applyLocalResources(profile *profile.Profile, stackVersion string, config Config) error { - appConfig, err := install.Configuration(install.OptionWithStackVersion(stackVersion)) +func applyLocalResources(profile *profile.Profile, stackVersion, agentVersion string, config Config) error { + appConfig, err := install.Configuration(install.OptionWithStackVersion(stackVersion), install.OptionWithAgentVersion(agentVersion)) if err != nil { return fmt.Errorf("can't read application configuration: %w", err) } diff --git a/internal/stack/localservices.go b/internal/stack/localservices.go index 6c25162905..c2c385ed31 100644 --- a/internal/stack/localservices.go +++ b/internal/stack/localservices.go @@ -20,7 +20,7 @@ type localServicesManager struct { } func (m *localServicesManager) start(ctx context.Context, options Options, config Config) error { - err := applyLocalResources(m.profile, options.StackVersion, config) + err := applyLocalResources(m.profile, options.StackVersion, options.AgentVersion, config) if err != nil { return fmt.Errorf("could not initialize compose files for local services: %w", err) } diff --git a/internal/stack/logs.go b/internal/stack/logs.go index 7e6356de3b..0b0f8ca341 100644 --- a/internal/stack/logs.go +++ b/internal/stack/logs.go @@ -17,7 +17,7 @@ import ( ) func dockerComposeLogsSince(ctx context.Context, serviceName string, profile *profile.Profile, since time.Time) ([]byte, error) { - appConfig, err := install.Configuration(install.OptionWithStackVersion(install.DefaultStackVersion)) + appConfig, err := install.Configuration(install.OptionWithStackVersion(install.DefaultStackVersion), install.OptionWithAgentVersion(install.DefaultStackVersion)) if err != nil { return nil, fmt.Errorf("can't read application configuration: %w", err) } diff --git a/internal/stack/serverless.go b/internal/stack/serverless.go index eebef27c9f..8c064b4410 100644 --- a/internal/stack/serverless.go +++ b/internal/stack/serverless.go @@ -345,7 +345,7 @@ func (sp *serverlessProvider) localServicesComposeProject() (*compose.Project, e } func (sp *serverlessProvider) startLocalServices(ctx context.Context, options Options, config Config) error { - err := applyLocalResources(sp.profile, options.StackVersion, config) + err := applyLocalResources(sp.profile, options.StackVersion, options.AgentVersion, config) if err != nil { return fmt.Errorf("could not initialize compose files for local services: %w", err) } diff --git a/internal/testrunner/runners/system/runner.go b/internal/testrunner/runners/system/runner.go index 669089f125..074653ad0e 100644 --- a/internal/testrunner/runners/system/runner.go +++ b/internal/testrunner/runners/system/runner.go @@ -33,6 +33,7 @@ type runner struct { dataStreams []string serviceVariant string + agentVersion string globalTestConfig testrunner.GlobalRunnerTestConfig failOnMissingTests bool @@ -59,6 +60,7 @@ type SystemTestRunnerOptions struct { RepositoryRoot *os.Root KibanaClient *kibana.Client API *elasticsearch.API + AgentVersion string // FIXME: Keeping Elasticsearch client to be able to do low-level requests for parameters not supported yet by the API. ESClient *elasticsearch.Client @@ -100,6 +102,7 @@ func NewSystemTestRunner(options SystemTestRunnerOptions) *runner { withCoverage: options.WithCoverage, coverageType: options.CoverageType, repositoryRoot: options.RepositoryRoot, + agentVersion: options.AgentVersion, } r.resourcesManager = resources.NewManager() @@ -265,6 +268,7 @@ func (r *runner) GetTests(ctx context.Context) ([]testrunner.Tester, error) { GlobalTestConfig: r.globalTestConfig, WithCoverage: r.withCoverage, CoverageType: r.coverageType, + AgentVersion: r.agentVersion, }) if err != nil { return nil, fmt.Errorf( diff --git a/internal/testrunner/runners/system/tester.go b/internal/testrunner/runners/system/tester.go index e8c4028885..2159df94ca 100644 --- a/internal/testrunner/runners/system/tester.go +++ b/internal/testrunner/runners/system/tester.go @@ -218,6 +218,7 @@ type tester struct { dataStreamPath string stackVersion kibana.VersionInfo + agentVersion string locationManager *locations.LocationManager resourcesManager *resources.Manager pkgManifest *packages.PackageManifest @@ -247,6 +248,8 @@ type SystemTesterOptions struct { API *elasticsearch.API KibanaClient *kibana.Client + AgentVersion string + // FIXME: Keeping Elasticsearch client to be able to do low-level requests for parameters not supported yet by the API. ESClient *elasticsearch.Client @@ -281,6 +284,7 @@ func NewSystemTester(options SystemTesterOptions) (*tester, error) { withCoverage: options.WithCoverage, coverageType: options.CoverageType, runIndependentElasticAgent: true, + agentVersion: options.AgentVersion, } r.resourcesManager = resources.NewManager() r.resourcesManager.RegisterProvider(resources.DefaultKibanaProviderName, &resources.KibanaProvider{Client: r.kibanaClient}) @@ -459,6 +463,7 @@ func (r *tester) createAgentOptions(policyName, deployerName string) agentdeploy DevDeployDir: DevDeployDir, Type: agentdeployer.TypeTest, StackVersion: r.stackVersion.Version(), + AgentVersion: r.agentVersion, PackageName: r.testFolder.Package, DataStream: r.testFolder.DataStream, PolicyName: policyName, From c2213b43a268adeb64795e10da66f1c5fd83b8b6 Mon Sep 17 00:00:00 2001 From: Teresa Romero Date: Wed, 5 Nov 2025 16:24:32 +0100 Subject: [PATCH 08/12] Add default agent version fallback in stack command --- cmd/stack.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/stack.go b/cmd/stack.go index 67d09e61b1..e62a12cdd4 100644 --- a/cmd/stack.go +++ b/cmd/stack.go @@ -111,6 +111,10 @@ func setupStackCommand() *cobraext.Command { if err != nil { return cobraext.FlagParsingError(err, cobraext.AgentVersionFlagName) } + if agentVersion == "" { + // If agent version is not specified, use the stack version as default + agentVersion = stackVersion + } profile, err := cobraext.GetProfileFlag(cmd) if err != nil { @@ -152,7 +156,7 @@ func setupStackCommand() *cobraext.Command { upCommand.Flags().StringSliceP(cobraext.StackServicesFlagName, "s", nil, fmt.Sprintf(cobraext.StackServicesFlagDescription, strings.Join(availableServicesAsList(), ","))) upCommand.Flags().StringP(cobraext.StackVersionFlagName, "", install.DefaultStackVersion, cobraext.StackVersionFlagDescription) - upCommand.Flags().StringP(cobraext.AgentVersionFlagName, "", install.DefaultStackVersion, cobraext.AgentVersionFlagDescription) + upCommand.Flags().String(cobraext.AgentVersionFlagName, "", cobraext.AgentVersionFlagDescription) upCommand.Flags().String(cobraext.StackProviderFlagName, "", fmt.Sprintf(cobraext.StackProviderFlagDescription, strings.Join(stack.SupportedProviders, ", "))) upCommand.Flags().StringSliceP(cobraext.StackUserParameterFlagName, cobraext.StackUserParameterFlagShorthand, nil, cobraext.StackUserParameterDescription) @@ -212,6 +216,10 @@ func setupStackCommand() *cobraext.Command { if err != nil { return cobraext.FlagParsingError(err, cobraext.AgentVersionFlagName) } + if agentVersion == "" { + // If agent version is not specified, use the stack version as default + agentVersion = stackVersion + } err = provider.Update(cmd.Context(), stack.Options{ StackVersion: stackVersion, @@ -228,7 +236,7 @@ func setupStackCommand() *cobraext.Command { }, } updateCommand.Flags().StringP(cobraext.StackVersionFlagName, "", install.DefaultStackVersion, cobraext.StackVersionFlagDescription) - updateCommand.Flags().StringP(cobraext.AgentVersionFlagName, "", install.DefaultStackVersion, cobraext.AgentVersionFlagDescription) + updateCommand.Flags().String(cobraext.AgentVersionFlagName, "", cobraext.AgentVersionFlagDescription) shellInitCommand := &cobra.Command{ Use: "shellinit", From b4267a19058e6189027e3eebb60e6916a84b0971 Mon Sep 17 00:00:00 2001 From: Teresa Romero Date: Thu, 6 Nov 2025 11:41:25 +0100 Subject: [PATCH 09/12] Fix agent version assignment in applyLocalResources function --- internal/stack/localresources.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/stack/localresources.go b/internal/stack/localresources.go index 907d522e41..650052d50b 100644 --- a/internal/stack/localresources.go +++ b/internal/stack/localresources.go @@ -50,7 +50,7 @@ func applyLocalResources(profile *profile.Profile, stackVersion, agentVersion st resourceManager := resource.NewManager() resourceManager.AddFacter(resource.StaticFacter{ - "agent_version": stackVersion, + "agent_version": agentVersion, "agent_image": imageRefs.ElasticAgent, "logstash_image": imageRefs.Logstash, "isready_image": imageRefs.IsReady, From 4c62f33dbb99560723a5474897f48910f9f5ff0e Mon Sep 17 00:00:00 2001 From: Teresa Romero Date: Thu, 6 Nov 2025 11:41:49 +0100 Subject: [PATCH 10/12] Refactor agent version handling in test runner command --- cmd/testrunner.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/cmd/testrunner.go b/cmd/testrunner.go index 1d0e08042a..b3f58a727d 100644 --- a/cmd/testrunner.go +++ b/cmd/testrunner.go @@ -420,7 +420,7 @@ func getTestRunnerSystemCommand() *cobra.Command { cmd.Flags().Bool(cobraext.SetupFlagName, false, cobraext.SetupFlagDescription) cmd.Flags().Bool(cobraext.TearDownFlagName, false, cobraext.TearDownFlagDescription) cmd.Flags().Bool(cobraext.NoProvisionFlagName, false, cobraext.NoProvisionFlagDescription) - cmd.Flags().StringP(cobraext.AgentVersionFlagName, "", install.DefaultStackVersion, cobraext.AgentVersionFlagDescription) + cmd.Flags().String(cobraext.AgentVersionFlagName, "", cobraext.AgentVersionFlagDescription) cmd.MarkFlagsMutuallyExclusive(cobraext.SetupFlagName, cobraext.TearDownFlagName, cobraext.NoProvisionFlagName) cmd.MarkFlagsRequiredTogether(cobraext.ConfigFileFlagName, cobraext.SetupFlagName) @@ -452,11 +452,6 @@ func testRunnerSystemCommandAction(cmd *cobra.Command, args []string) error { return cobraext.FlagParsingError(err, cobraext.FailOnMissingFlagName) } - agentVersion, err := cmd.Flags().GetString(cobraext.AgentVersionFlagName) - if err != nil { - return cobraext.FlagParsingError(err, cobraext.AgentVersionFlagName) - } - generateTestResult, err := cmd.Flags().GetBool(cobraext.GenerateTestResultFlagName) if err != nil { return cobraext.FlagParsingError(err, cobraext.GenerateTestResultFlagName) @@ -547,6 +542,18 @@ func testRunnerSystemCommandAction(cmd *cobra.Command, args []string) error { return fmt.Errorf("can't create Kibana client: %w", err) } + agentVersion, err := cmd.Flags().GetString(cobraext.AgentVersionFlagName) + if err != nil { + return cobraext.FlagParsingError(err, cobraext.AgentVersionFlagName) + } + if agentVersion == "" { + stackVersion, err := kibanaClient.Version() + if err != nil { + return fmt.Errorf("can't get stack version: %w", err) + } + agentVersion = stackVersion.Version() + } + esClient, err := stack.NewElasticsearchClientFromProfile(profile) if err != nil { return fmt.Errorf("can't create Elasticsearch client: %w", err) From 5925e0b46710b05b71fc3a6d9e2011d87cd1a19b Mon Sep 17 00:00:00 2001 From: Teresa Romero Date: Thu, 6 Nov 2025 12:35:11 +0100 Subject: [PATCH 11/12] Add agent version to service options in createServiceOptions function --- internal/testrunner/runners/system/tester.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/testrunner/runners/system/tester.go b/internal/testrunner/runners/system/tester.go index 2159df94ca..15f7011a51 100644 --- a/internal/testrunner/runners/system/tester.go +++ b/internal/testrunner/runners/system/tester.go @@ -483,6 +483,7 @@ func (r *tester) createServiceOptions(variantName, deployerName string) serviced Variant: variantName, Type: servicedeployer.TypeTest, StackVersion: r.stackVersion.Version(), + AgentVersion: r.agentVersion, RunTearDown: r.runTearDown, RunTestsOnly: r.runTestsOnly, RunSetup: r.runSetup, From 300ba8dcd3430db6092a945d432b2273d39617dd Mon Sep 17 00:00:00 2001 From: Teresa Romero Date: Thu, 6 Nov 2025 14:04:20 +0100 Subject: [PATCH 12/12] Add support for specifying Elastic Agent version in stack commands --- README.md | 4 ++++ cmd/stack.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index a705a23033..224baca798 100644 --- a/README.md +++ b/README.md @@ -488,6 +488,8 @@ _Context: global_ Use this command to spin up a Docker-based Elastic Stack consisting of Elasticsearch, Kibana, and the Package Registry. By default the latest released version of the stack is spun up but it is possible to specify a different version, including SNAPSHOT versions by appending --version . +Use --agent-version to specify a different version for the Elastic Agent from the stack. + You can run your own custom images for Elasticsearch, Kibana or Elastic Agent, see [this document](./docs/howto/custom_images.md). Be aware that a common issue while trying to boot up the stack is that your Docker environments settings are too low in terms of memory threshold. @@ -542,6 +544,8 @@ Use this command to boot up the stack locally. By default the latest released version of the stack is spun up but it is possible to specify a different version, including SNAPSHOT versions by appending --version . +Use --agent-version to specify a different version for the Elastic Agent from the stack. + You can run your own custom images for Elasticsearch, Kibana or Elastic Agent, see [this document](./docs/howto/custom_images.md). Be aware that a common issue while trying to boot up the stack is that your Docker environments settings are too low in terms of memory threshold. diff --git a/cmd/stack.go b/cmd/stack.go index e62a12cdd4..aaf45f4ff6 100644 --- a/cmd/stack.go +++ b/cmd/stack.go @@ -31,6 +31,8 @@ var availableServices = map[string]struct{}{ const stackLongDescription = `Use this command to spin up a Docker-based Elastic Stack consisting of Elasticsearch, Kibana, and the Package Registry. By default the latest released version of the stack is spun up but it is possible to specify a different version, including SNAPSHOT versions by appending --version . +Use --agent-version to specify a different version for the Elastic Agent from the stack. + You can run your own custom images for Elasticsearch, Kibana or Elastic Agent, see [this document](./docs/howto/custom_images.md). Be aware that a common issue while trying to boot up the stack is that your Docker environments settings are too low in terms of memory threshold. @@ -43,6 +45,8 @@ const stackUpLongDescription = `Use this command to boot up the stack locally. By default the latest released version of the stack is spun up but it is possible to specify a different version, including SNAPSHOT versions by appending --version . +Use --agent-version to specify a different version for the Elastic Agent from the stack. + You can run your own custom images for Elasticsearch, Kibana or Elastic Agent, see [this document](./docs/howto/custom_images.md). Be aware that a common issue while trying to boot up the stack is that your Docker environments settings are too low in terms of memory threshold.