Skip to content

Commit

Permalink
Add podman remote support
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwin Chong committed Apr 23, 2024
1 parent 9d1fe15 commit 6c9d4d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (c *Connector) Deploy(ctx context.Context, image string) (deployer.Plugin,
SetCgroupNs(string(hostConfig.CgroupnsMode)).
SetNetworkMode(string(hostConfig.NetworkMode)).
SetPrivileged(hostConfig.Privileged)
SetConnection(c.config.Podman.Connection)

stdin, stdout, err := c.podmanCliWrapper.Deploy(image, commandArgs, []string{"--atp"})

Expand Down
7 changes: 7 additions & 0 deletions internal/argsbuilder/argsbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,10 @@ func (a *argsBuilder) SetPrivileged(privileged bool) ArgsBuilder {
}
return a
}

func (a *argsBuilder) SetConnection(connectionName string) ArgsBuilder {
if connectionName != "" {
*a.commandArgs = append(*a.commandArgs, "--connection", connectionName)
}
return a
}
1 change: 1 addition & 0 deletions internal/argsbuilder/argsbuilder_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type ArgsBuilder interface {
SetContainerName(name string) ArgsBuilder
SetNetworkMode(networkMode string) ArgsBuilder
SetPrivileged(privileged bool) ArgsBuilder
SetConnection(networkMode string) ArgsBuilder
}

func NewBuilder(commandArgs *[]string) ArgsBuilder {
Expand Down

0 comments on commit 6c9d4d6

Please sign in to comment.