Skip to content

Commit

Permalink
move from local/docker to local/podman
Browse files Browse the repository at this point in the history
  • Loading branch information
pducolin committed Nov 25, 2024
1 parent d31d113 commit 1f661af
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions registry/scenarios.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/DataDog/test-infra-definitions/scenarios/azure/aks"
computerun "github.com/DataDog/test-infra-definitions/scenarios/azure/compute/run"
gcpcompute "github.com/DataDog/test-infra-definitions/scenarios/gcp/compute/run"
localdockerrun "github.com/DataDog/test-infra-definitions/scenarios/local/docker/run"
localpodmanrun "github.com/DataDog/test-infra-definitions/scenarios/local/podman/run"

"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
Expand All @@ -34,7 +34,7 @@ func Scenarios() ScenarioRegistry {
"az/aks": aks.Run,
"gcp/vm": gcpcompute.VMRun,
"gcp/gke": gke.Run,
"localdocker/vm": localdockerrun.VMRun,
"localpodman/vm": localpodmanrun.VMRun,
}
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package localdocker
package localpodman

import (
_ "embed"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package localdockerrun
package localpodmanrun

import (
"github.com/DataDog/test-infra-definitions/components/datadog/agent"
"github.com/DataDog/test-infra-definitions/components/datadog/agentparams"
"github.com/DataDog/test-infra-definitions/resources/local"
localdocker "github.com/DataDog/test-infra-definitions/scenarios/local/docker"
localpodman "github.com/DataDog/test-infra-definitions/scenarios/local/podman"

"github.com/DataDog/test-infra-definitions/components/datadog/fakeintake"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
Expand All @@ -16,7 +16,7 @@ func VMRun(ctx *pulumi.Context) error {
return err
}

vm, err := localdocker.NewVM(env, "vm")
vm, err := localpodman.NewVM(env, "vm")
if err != nil {
return err
}
Expand All @@ -37,7 +37,7 @@ func VMRun(ctx *pulumi.Context) error {
}
agentOptions = append(agentOptions, agentparams.WithFakeintake(fakeintake))
}
agentOptions = append(agentOptions, agentparams.WithHostname("localdocker-vm"))
agentOptions = append(agentOptions, agentparams.WithHostname("localpodman-vm"))
_, err = agent.NewHostAgent(&env, vm, agentOptions...)
return err
}
Expand Down
10 changes: 5 additions & 5 deletions scenarios/local/docker/vm.go → scenarios/local/podman/vm.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
package localdocker
package localpodman

import (
"github.com/DataDog/test-infra-definitions/components"
"github.com/DataDog/test-infra-definitions/components/command"
componentsos "github.com/DataDog/test-infra-definitions/components/os"
"github.com/DataDog/test-infra-definitions/components/remote"
"github.com/DataDog/test-infra-definitions/resources/local"
localdocker "github.com/DataDog/test-infra-definitions/resources/local/docker"
localpodman "github.com/DataDog/test-infra-definitions/resources/local/podman"

"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

// NewVM creates an localdocker Ubuntu VM Instance and returns a Remote component.
// NewVM creates an localpodman Ubuntu VM Instance and returns a Remote component.
// Without any parameter it creates an Ubuntu VM on AMD64 architecture.
func NewVM(e local.Environment, name string) (*remote.Host, error) {
// Create the EC2 instance
return components.NewComponent(&e, e.Namer.ResourceName(name), func(c *remote.Host) error {
vmArgs := &localdocker.VMArgs{
vmArgs := &localpodman.VMArgs{
Name: name,
}

// Create the EC2 instance
address, user, port, err := localdocker.NewInstance(e, *vmArgs, pulumi.Parent(c))
address, user, port, err := localpodman.NewInstance(e, *vmArgs, pulumi.Parent(c))
if err != nil {
return err
}
Expand Down

0 comments on commit 1f661af

Please sign in to comment.