summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-11-04 16:53:49 +0100
committerGitHub <noreply@github.com>2020-11-04 16:53:49 +0100
commit4fb7378ee4ca2af5d521f7f75b691d4fe00b089b (patch)
tree6570b9710ca377ed764e3074dc369ef55bc159d8 /libpod/options.go
parent303191bf522db9af32cabd98a5309e3079da0eb0 (diff)
parent844d540d042fe7477e62f8cf28e524fcd756f6c8 (diff)
downloadpodman-4fb7378ee4ca2af5d521f7f75b691d4fe00b089b.tar.gz
podman-4fb7378ee4ca2af5d521f7f75b691d4fe00b089b.tar.bz2
podman-4fb7378ee4ca2af5d521f7f75b691d4fe00b089b.zip
Merge pull request #8156 from mheon/add_net_aliases_db
Add network aliases for containers to DB
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 060887b7e..0f55f34a3 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -1506,6 +1506,20 @@ func WithCreateWorkingDir() CtrCreateOption {
}
}
+// WithNetworkAliases sets network aliases for the container.
+// Accepts a map of network name to aliases.
+func WithNetworkAliases(aliases map[string][]string) CtrCreateOption {
+ return func(ctr *Container) error {
+ if ctr.valid {
+ return define.ErrCtrFinalized
+ }
+
+ ctr.config.NetworkAliases = aliases
+
+ return nil
+ }
+}
+
// Volume Creation Options
// WithVolumeName sets the name of the volume.