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)
|
||||
|
||||
imageName := containerdImage.Name()
|
||||
if name := config.GetImage().GetUserSpecifiedImage(); name != "" {
|
||||
imageName = name
|
||||
}
|
||||
spec, err := c.buildContainerSpec(
|
||||
platform,
|
||||
id,
|
||||
@ -190,7 +194,7 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta
|
||||
sandboxPid,
|
||||
sandbox.NetNSPath,
|
||||
containerName,
|
||||
containerdImage.Name(),
|
||||
imageName,
|
||||
config,
|
||||
sandboxConfig,
|
||||
&image.ImageSpec.Config,
|
||||
|
Loading…
Reference in New Issue
Block a user