mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00:00
use maps.Clone() over Copy() when possible
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
637de6022f
commit
4417e6269c
2 changed files with 3 additions and 6 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue