Skip to content

Commit

Permalink
virter: pass access network CIDR to container
Browse files Browse the repository at this point in the history
Set the environment variable VIRTER_ACCESS_NETWORK to the CIDR of the
access network when provisioning with a container.
  • Loading branch information
chrboe committed Apr 3, 2024
1 parent c102446 commit 49cd0c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/virter/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,14 @@ func (v *Virter) getSSHUserNames(vmNames []string) []string {
// VMExecContainer runs a container against some VMs.
func (v *Virter) VMExecContainer(ctx context.Context, containerProvider containerapi.ContainerProvider,
vmNames []string, containerCfg *containerapi.ContainerConfig, copyStep *ProvisionContainerCopyStep) error {

accessIPNet, err := v.getIPNet(v.provisionNetwork)
if err != nil {
return fmt.Errorf("could not get network: %w", err)
}

containerCfg.SetEnv("VIRTER_ACCESS_NETWORK", accessIPNet.String())

ips, err := v.getIPs(vmNames)
if err != nil {
return err
Expand Down

0 comments on commit 49cd0c8

Please sign in to comment.