Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
  • Loading branch information
fahedouch committed Sep 10, 2021
1 parent faa686b commit 41c20a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions cmd/nerdctl/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,7 @@ func runAction(clicontext *cli.Context) error {
pidFile = clicontext.String("pidfile")
}

var extraHosts []string
if h := strutil.DedupeStrSlice(clicontext.StringSlice("add-host")); len(h) > 0 {
extraHosts = h
}
extraHosts := strutil.DedupeStrSlice(clicontext.StringSlice("add-host"))

ilOpt, err := withInternalLabels(ns, name, hostname, stateDir, extraHosts, netSlice, ports, logURI, anonVolumes, pidFile)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/labels/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const (
// Hostname
Hostname = Prefix + "hostname"

// ExtraHosts is a slice of Host:IP to appended to /etc/hosts
// ExtraHosts are HostIPs to appended to /etc/hosts
ExtraHosts = Prefix + "extraHosts"

// StateDir is "/var/lib/nerdctl/<ADDRHASH>/containers/<NAMESPACE>/<ID>"
Expand Down

0 comments on commit 41c20a4

Please sign in to comment.