Merge pull request #10747 from lujinda/anno-image-user-specified
[cri] use 'UserSpecifiedImage' to set the image-name annotation
This commit is contained in:
commit
363e50bee0
@ -183,6 +183,10 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta
|
|||||||
}
|
}
|
||||||
log.G(ctx).Debugf("Use OCI runtime %+v for sandbox %q and container %q", ociRuntime, sandboxID, id)
|
log.G(ctx).Debugf("Use OCI runtime %+v for sandbox %q and container %q", ociRuntime, sandboxID, id)
|
||||||
|
|
||||||
|
imageName := containerdImage.Name()
|
||||||
|
if name := config.GetImage().GetUserSpecifiedImage(); name != "" {
|
||||||
|
imageName = name
|
||||||
|
}
|
||||||
spec, err := c.buildContainerSpec(
|
spec, err := c.buildContainerSpec(
|
||||||
platform,
|
platform,
|
||||||
id,
|
id,
|
||||||
@ -190,7 +194,7 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta
|
|||||||
sandboxPid,
|
sandboxPid,
|
||||||
sandbox.NetNSPath,
|
sandbox.NetNSPath,
|
||||||
containerName,
|
containerName,
|
||||||
containerdImage.Name(),
|
imageName,
|
||||||
config,
|
config,
|
||||||
sandboxConfig,
|
sandboxConfig,
|
||||||
&image.ImageSpec.Config,
|
&image.ImageSpec.Config,
|
||||||
|
Loading…
Reference in New Issue
Block a user