Browse Source

Fixups

layerset
Till Wegmueller 3 years ago
parent
commit
1ff90bcb06
  1. 8
      cmd/imageadm/import.go
  2. 6
      host/network.go
  3. 1
      image/pull.go

8
cmd/imageadm/import.go

@ -3,6 +3,7 @@ package imageadm
import (
"fmt"
"git.wegmueller.it/illumos/go-zone/config"
"git.wegmueller.it/opencloud/opencloud/image"
"git.wegmueller.it/opencloud/opencloud/image/reference"
"github.com/spf13/cobra"
@ -26,7 +27,12 @@ var importCmd = &cobra.Command{
return tracerr.Wrap(err)
}
return img.ImportZone(ref, zoneName)
z := config.New(zoneName)
if err := z.ReadFromFile(); err != nil {
return tracerr.Wrap(err)
}
return img.ImportZone(ref, z.Zonepath)
},
}

6
host/network.go

@ -75,8 +75,10 @@ func (h *Host) setupDNSInZone(c *pod.Container, n *opcNet.Network) error {
logrus.Debugf("setting up nsswitch.conf inside %s(%s)", c.UUID, c.Name)
nsswitchDnsPath := filepath.Join(c.Zone.Zonepath, "root/etc/nsswitch.dns")
nsswitchConfPath := filepath.Join(c.Zone.Zonepath, "root/etc/nsswitch.conf")
if _, err := fileutils.CopyFile(nsswitchDnsPath, nsswitchConfPath); err != nil {
return tracerr.Wrap(err)
if _, err := os.Stat(nsswitchDnsPath); err == nil {
if _, err := fileutils.CopyFile(nsswitchDnsPath, nsswitchConfPath); err != nil {
return tracerr.Wrap(err)
}
}
//render /etc/ipadm/ipadm.conf inside the zone

1
image/pull.go

@ -71,6 +71,7 @@ func (r *Repository) PullImage(ctx context.Context, ref reference.Reference) err
if config.IsPlatformSupported(descr.Platform.OS) && descr.Platform.Architecture == runtime.GOARCH {
manifestDescriptor = descr
continue
}
}

Loading…
Cancel
Save