From 91cacdb151c55a4d16a79ca34dab908b4f404111 Mon Sep 17 00:00:00 2001 From: Celian Raimbault Date: Thu, 16 Jan 2025 15:52:23 +0100 Subject: [PATCH] [create-vm-agent-config-adxt-84] Updated run for agentparams --- scenarios/aws/ec2/vm_run.go | 9 +++++++++ scenarios/aws/eks/run.go | 9 +++++++++ scenarios/aws/kindvm/run.go | 4 ++++ scenarios/azure/aks/run.go | 2 ++ scenarios/azure/compute/run/vm_run.go | 7 +++++++ scenarios/gcp/compute/run/vm_run.go | 7 +++++++ scenarios/gcp/gke/run.go | 2 ++ scenarios/local/podman/run/vm_run.go | 7 +++++++ 8 files changed, 47 insertions(+) diff --git a/scenarios/aws/ec2/vm_run.go b/scenarios/aws/ec2/vm_run.go index 6ae86154d..a09c1370a 100644 --- a/scenarios/aws/ec2/vm_run.go +++ b/scenarios/aws/ec2/vm_run.go @@ -144,6 +144,15 @@ func VMRunWithDocker(ctx *pulumi.Context) error { agentOptions = append(agentOptions, dockeragentparams.WithFakeintake(fakeintake)) } + // TODO A: Update docker params + // if env.AgentConfigPath() != "" { + // configContent, err := env.CustomAgentConfig() + // if err != nil { + // return err + // } + // agentOptions = append(agentOptions, dockeragentparams.WithAgentConfig(configContent)) + // } + if env.TestingWorkloadDeploy() { agentOptions = append(agentOptions, dockeragentparams.WithExtraComposeManifest(dogstatsd.DockerComposeManifest.Name, dogstatsd.DockerComposeManifest.Content)) agentOptions = append(agentOptions, dockeragentparams.WithEnvironmentVariables(pulumi.StringMap{"HOST_IP": vm.Address})) diff --git a/scenarios/aws/eks/run.go b/scenarios/aws/eks/run.go index dccb999bd..e1565dcf9 100644 --- a/scenarios/aws/eks/run.go +++ b/scenarios/aws/eks/run.go @@ -97,6 +97,15 @@ func Run(ctx *pulumi.Context) error { return err } + // TODO A + // if awsEnv.AgentConfigPath() != "" { + // configContent, err := awsEnv.CustomAgentConfig() + // if err != nil { + // return + // } + // // ? + // } + if err := k8sAgentComponent.Export(awsEnv.Ctx(), nil); err != nil { return err } diff --git a/scenarios/aws/kindvm/run.go b/scenarios/aws/kindvm/run.go index 321cdcbf9..bfab998f4 100644 --- a/scenarios/aws/kindvm/run.go +++ b/scenarios/aws/kindvm/run.go @@ -133,6 +133,8 @@ agents: return err } + // TODO A + if err := k8sAgentComponent.Export(awsEnv.Ctx(), nil); err != nil { return err } @@ -188,6 +190,8 @@ spec: return err } + // TODO A: here? + dependsOnDDAgent = utils.PulumiDependsOn(k8sAgentWithOperatorComp) if err := k8sAgentWithOperatorComp.Export(awsEnv.Ctx(), nil); err != nil { diff --git a/scenarios/azure/aks/run.go b/scenarios/azure/aks/run.go index ed4b7d997..1f357420d 100644 --- a/scenarios/azure/aks/run.go +++ b/scenarios/azure/aks/run.go @@ -93,6 +93,8 @@ providers: return err } + // TODO A + if err := k8sAgentComponent.Export(env.Ctx(), nil); err != nil { return err } diff --git a/scenarios/azure/compute/run/vm_run.go b/scenarios/azure/compute/run/vm_run.go index 2e247c78b..4dfc9ff3e 100644 --- a/scenarios/azure/compute/run/vm_run.go +++ b/scenarios/azure/compute/run/vm_run.go @@ -42,6 +42,13 @@ func VMRun(ctx *pulumi.Context) error { if env.AgentFlavor() != "" { agentOptions = append(agentOptions, agentparams.WithFlavor(env.AgentFlavor())) } + if env.AgentConfigPath() != "" { + configContent, err := env.CustomAgentConfig() + if err != nil { + return err + } + agentOptions = append(agentOptions, agentparams.WithAgentConfig(configContent)) + } _, err = agent.NewHostAgent(&env, vm, agentOptions...) return err } diff --git a/scenarios/gcp/compute/run/vm_run.go b/scenarios/gcp/compute/run/vm_run.go index a8f479181..2f31879a1 100644 --- a/scenarios/gcp/compute/run/vm_run.go +++ b/scenarios/gcp/compute/run/vm_run.go @@ -40,6 +40,13 @@ func VMRun(ctx *pulumi.Context) error { if env.AgentFlavor() != "" { agentOptions = append(agentOptions, agentparams.WithFlavor(env.AgentFlavor())) } + if env.AgentConfigPath() != "" { + configContent, err := env.CustomAgentConfig() + if err != nil { + return err + } + agentOptions = append(agentOptions, agentparams.WithAgentConfig(configContent)) + } _, err = agent.NewHostAgent(&env, vm, agentOptions...) return err } diff --git a/scenarios/gcp/gke/run.go b/scenarios/gcp/gke/run.go index d57eb816e..13945c218 100644 --- a/scenarios/gcp/gke/run.go +++ b/scenarios/gcp/gke/run.go @@ -80,6 +80,8 @@ func Run(ctx *pulumi.Context) error { return err } + // TODO A + if err := k8sAgentComponent.Export(env.Ctx(), nil); err != nil { return err } diff --git a/scenarios/local/podman/run/vm_run.go b/scenarios/local/podman/run/vm_run.go index d118d157a..7595efc7f 100644 --- a/scenarios/local/podman/run/vm_run.go +++ b/scenarios/local/podman/run/vm_run.go @@ -41,6 +41,13 @@ func VMRun(ctx *pulumi.Context) error { agentOptions = append(agentOptions, agentparams.WithFlavor(env.AgentFlavor())) } agentOptions = append(agentOptions, agentparams.WithHostname("localpodman-vm")) + if env.AgentConfigPath() != "" { + configContent, err := env.CustomAgentConfig() + if err != nil { + return err + } + agentOptions = append(agentOptions, agentparams.WithAgentConfig(configContent)) + } _, err = agent.NewHostAgent(&env, vm, agentOptions...) return err }