mirror of
https://github.com/containers/podman.git
synced 2026-07-11 07:45:16 -04:00
use maps.Clone() over Copy() when possible
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@@ -416,13 +416,11 @@ func (c *Container) generateInspectContainerConfig(spec *spec.Spec) *define.Insp
|
||||
}
|
||||
|
||||
if len(c.config.Labels) != 0 {
|
||||
ctrConfig.Labels = make(map[string]string)
|
||||
maps.Copy(ctrConfig.Labels, c.config.Labels)
|
||||
ctrConfig.Labels = maps.Clone(c.config.Labels)
|
||||
}
|
||||
|
||||
if len(spec.Annotations) != 0 {
|
||||
ctrConfig.Annotations = make(map[string]string)
|
||||
maps.Copy(ctrConfig.Annotations, spec.Annotations)
|
||||
ctrConfig.Annotations = maps.Clone(spec.Annotations)
|
||||
}
|
||||
ctrConfig.StopSignal = signal.ToDockerFormat(c.config.StopSignal)
|
||||
// TODO: should JSON deep copy this to ensure internal pointers don't
|
||||
|
||||
@@ -87,8 +87,7 @@ func WithStorageConfig(config storage.StoreOptions) RuntimeOption {
|
||||
}
|
||||
|
||||
if config.PullOptions != nil {
|
||||
rt.storageConfig.PullOptions = make(map[string]string)
|
||||
maps.Copy(rt.storageConfig.PullOptions, config.PullOptions)
|
||||
rt.storageConfig.PullOptions = maps.Clone(config.PullOptions)
|
||||
}
|
||||
|
||||
// If any one of runroot, graphroot, graphdrivername,
|
||||
|
||||
Reference in New Issue
Block a user