aboutsummaryrefslogtreecommitdiff
path: root/libpod/container_config.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-11-06 10:39:16 +0100
committerGitHub <noreply@github.com>2021-11-06 10:39:16 +0100
commitabbd6c167e8163a711680db80137a0731e06e564 (patch)
treec11c98dc0eeac187c62b74443ba98c5dcb0961f0 /libpod/container_config.go
parent6805befec2ca9b9a816b1efda0bf43a67cee09a7 (diff)
parent0136a66a83d027049da6338f8ce6dfa8052c8ca3 (diff)
downloadpodman-abbd6c167e8163a711680db80137a0731e06e564.tar.gz
podman-abbd6c167e8163a711680db80137a0731e06e564.tar.bz2
podman-abbd6c167e8163a711680db80137a0731e06e564.zip
Merge pull request #11890 from Luap99/ports
libpod: deduplicate ports in db
Diffstat (limited to 'libpod/container_config.go')
-rw-r--r--libpod/container_config.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/libpod/container_config.go b/libpod/container_config.go
index 8f803d744..412be835f 100644
--- a/libpod/container_config.go
+++ b/libpod/container_config.go
@@ -78,6 +78,11 @@ type ContainerConfig struct {
// These containers must be started before this container is started.
Dependencies []string
+ // rewrite is an internal bool to indicate that the config was modified after
+ // a read from the db, e.g. to migrate config fields after an upgrade.
+ // This field should never be written to the db, the json tag ensures this.
+ rewrite bool `json:"-"`
+
// embedded sub-configs
ContainerRootFSConfig
ContainerSecurityConfig
@@ -232,7 +237,12 @@ type ContainerNetworkConfig struct {
// PortMappings are the ports forwarded to the container's network
// namespace
// These are not used unless CreateNetNS is true
- PortMappings []types.OCICNIPortMapping `json:"portMappings,omitempty"`
+ PortMappings []types.PortMapping `json:"newPortMappings,omitempty"`
+ // OldPortMappings are the ports forwarded to the container's network
+ // namespace. As of podman 4.0 this field is deprecated, use PortMappings
+ // instead. The db will convert the old ports to the new structure for you.
+ // These are not used unless CreateNetNS is true
+ OldPortMappings []types.OCICNIPortMapping `json:"portMappings,omitempty"`
// ExposedPorts are the ports which are exposed but not forwarded
// into the container.
// The map key is the port and the string slice contains the protocols,