Skip to content

Commit

Permalink
[create-vm-agent-config-adxt-84] Updated run for agentparams
Browse files Browse the repository at this point in the history
  • Loading branch information
CelianR committed Jan 16, 2025
1 parent e8742c5 commit 91cacdb
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scenarios/aws/ec2/vm_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}))
Expand Down
9 changes: 9 additions & 0 deletions scenarios/aws/eks/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 4 additions & 0 deletions scenarios/aws/kindvm/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ agents:
return err
}

// TODO A

if err := k8sAgentComponent.Export(awsEnv.Ctx(), nil); err != nil {
return err
}
Expand Down Expand Up @@ -188,6 +190,8 @@ spec:
return err
}

// TODO A: here?

dependsOnDDAgent = utils.PulumiDependsOn(k8sAgentWithOperatorComp)

if err := k8sAgentWithOperatorComp.Export(awsEnv.Ctx(), nil); err != nil {
Expand Down
2 changes: 2 additions & 0 deletions scenarios/azure/aks/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ providers:
return err
}

// TODO A

if err := k8sAgentComponent.Export(env.Ctx(), nil); err != nil {
return err
}
Expand Down
7 changes: 7 additions & 0 deletions scenarios/azure/compute/run/vm_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
7 changes: 7 additions & 0 deletions scenarios/gcp/compute/run/vm_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions scenarios/gcp/gke/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
7 changes: 7 additions & 0 deletions scenarios/local/podman/run/vm_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 91cacdb

Please sign in to comment.