mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
ineffectual assignment to isCanonical, delete it
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
This commit is contained in:
parent
77c9728847
commit
b28c1eae01
1 changed files with 1 additions and 4 deletions
|
@ -55,12 +55,9 @@ func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec,
|
||||||
// the image string if it didn't originally contain a digest. It assumes
|
// the image string if it didn't originally contain a digest. It assumes
|
||||||
// that the image string is not an image ID
|
// that the image string is not an image ID
|
||||||
func imageWithDigestString(image string, dgst digest.Digest) string {
|
func imageWithDigestString(image string, dgst digest.Digest) string {
|
||||||
isCanonical := false
|
|
||||||
ref, err := reference.ParseAnyReference(image)
|
ref, err := reference.ParseAnyReference(image)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
_, isCanonical = ref.(reference.Canonical)
|
if _, isCanonical := ref.(reference.Canonical); !isCanonical {
|
||||||
|
|
||||||
if !isCanonical {
|
|
||||||
namedRef, _ := ref.(reference.Named)
|
namedRef, _ := ref.(reference.Named)
|
||||||
img, err := reference.WithDigest(namedRef, dgst)
|
img, err := reference.WithDigest(namedRef, dgst)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue