|
@@ -16,6 +16,7 @@ import (
|
|
"time"
|
|
"time"
|
|
|
|
|
|
"github.com/Sirupsen/logrus"
|
|
"github.com/Sirupsen/logrus"
|
|
|
|
+ "github.com/docker/distribution/digest"
|
|
distreference "github.com/docker/distribution/reference"
|
|
distreference "github.com/docker/distribution/reference"
|
|
apierrors "github.com/docker/docker/api/errors"
|
|
apierrors "github.com/docker/docker/api/errors"
|
|
apitypes "github.com/docker/docker/api/types"
|
|
apitypes "github.com/docker/docker/api/types"
|
|
@@ -1021,6 +1022,9 @@ func (c *Cluster) GetServices(options apitypes.ServiceListOptions) ([]types.Serv
|
|
// TODO(nishanttotla): After the packages converge, the function must
|
|
// TODO(nishanttotla): After the packages converge, the function must
|
|
// convert distreference.Named -> distreference.Canonical, and the logic simplified.
|
|
// convert distreference.Named -> distreference.Canonical, and the logic simplified.
|
|
func (c *Cluster) imageWithDigestString(ctx context.Context, image string, authConfig *apitypes.AuthConfig) (string, error) {
|
|
func (c *Cluster) imageWithDigestString(ctx context.Context, image string, authConfig *apitypes.AuthConfig) (string, error) {
|
|
|
|
+ if _, err := digest.ParseDigest(image); err == nil {
|
|
|
|
+ return "", errors.New("image reference is an image ID")
|
|
|
|
+ }
|
|
ref, err := distreference.ParseNamed(image)
|
|
ref, err := distreference.ParseNamed(image)
|
|
if err != nil {
|
|
if err != nil {
|
|
return "", err
|
|
return "", err
|