diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-02-14 15:53:24 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-02-21 10:51:42 -0500 |
commit | 84feff2e06e9c3dd504be918f8dcf0b0a434a941 (patch) | |
tree | 52d809c77c5c920f2a948880333dee5c157134d8 /libpod/state.go | |
parent | 28d6eeb57a46b8df8960cff6bf6748c4611b61ef (diff) | |
download | podman-84feff2e06e9c3dd504be918f8dcf0b0a434a941.tar.gz podman-84feff2e06e9c3dd504be918f8dcf0b0a434a941.tar.bz2 podman-84feff2e06e9c3dd504be918f8dcf0b0a434a941.zip |
Add a function for overwriting container config
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/state.go')
-rw-r--r-- | libpod/state.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libpod/state.go b/libpod/state.go index 88d89f673..42dbe9cc1 100644 --- a/libpod/state.go +++ b/libpod/state.go @@ -97,6 +97,21 @@ type State interface { // returned. AllContainers() ([]*Container, error) + // PLEASE READ FULL DESCRIPTION BEFORE USING. + // Rewrite a container's configuration. + // This function breaks libpod's normal prohibition on a read-only + // configuration, and as such should be used EXTREMELY SPARINGLY and + // only in very specific circumstances. + // Specifically, it is ONLY safe to use thing function to make changes + // that result in a functionally identical configuration (migrating to + // newer, but identical, configuration fields), or during libpod init + // WHILE HOLDING THE ALIVE LOCK (to prevent other libpod instances from + // being initialized). + // There are a lot of capital letters and conditions here, but the short + // answer is this: use this only very sparingly, and only if you really + // know what you're doing. + RewriteContainerConfig(ctr *Container, newCfg *ContainerConfig) error + // Accepts full ID of pod. // If the pod given is not in the set namespace, an error will be // returned. |