MCPcopy
hub / github.com/opencontainers/runc / handleCriuConfigurationFile

Method handleCriuConfigurationFile

libcontainer/criu_linux.go:149–172  ·  view source on GitHub ↗
(rpcOpts *criurpc.CriuOpts)

Source from the content-addressed store, hash-verified

147}
148
149func (c *Container) handleCriuConfigurationFile(rpcOpts *criurpc.CriuOpts) {
150 // CRIU will evaluate a configuration starting with release 3.11.
151 // Settings in the configuration file will overwrite RPC settings.
152 // Look for annotations. The annotation 'org.criu.config'
153 // specifies if CRIU should use a different, container specific
154 // configuration file.
155 configFile, exists := utils.SearchLabels(c.config.Labels, "org.criu.config")
156 if exists {
157 // If the annotation 'org.criu.config' exists and is set
158 // to a non-empty string, tell CRIU to use that as a
159 // configuration file. If the file does not exist, CRIU
160 // will just ignore it.
161 if configFile != "" {
162 rpcOpts.ConfigFile = mkPtr(configFile)
163 }
164 // If 'org.criu.config' exists and is set to an empty
165 // string, a runc specific CRIU configuration file will
166 // be not set at all.
167 } else {
168 // If the mentioned annotation has not been found, specify
169 // a default CRIU configuration file.
170 rpcOpts.ConfigFile = mkPtr("/etc/criu/runc.conf")
171 }
172}
173
174func (c *Container) criuSupportsExtNS(t configs.NamespaceType) bool {
175 var minVersion int

Callers 2

CheckpointMethod · 0.95
RestoreMethod · 0.95

Calls 2

SearchLabelsFunction · 0.92
mkPtrFunction · 0.70

Tested by

no test coverage detected