Merge pull request #33267 from YuPengZTE/devImageWithDigestString
ineffectual assignment to isCanonical, delete it, and make the "if" sentence to fit the golang usage
This commit is contained in:
commit
b0dd3dfc11
1 changed files with 1 additions and 4 deletions
|
@ -58,12 +58,9 @@ func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec,
|
|||
// the image string if it didn't originally contain a digest. It assumes
|
||||
// that the image string is not an image ID
|
||||
func imageWithDigestString(image string, dgst digest.Digest) string {
|
||||
isCanonical := false
|
||||
ref, err := reference.ParseAnyReference(image)
|
||||
if err == nil {
|
||||
_, isCanonical = ref.(reference.Canonical)
|
||||
|
||||
if !isCanonical {
|
||||
if _, isCanonical := ref.(reference.Canonical); !isCanonical {
|
||||
namedRef, _ := ref.(reference.Named)
|
||||
img, err := reference.WithDigest(namedRef, dgst)
|
||||
if err == nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue