Skip to content

Commit

Permalink
remove v1 flag in getManifestWithConf
Browse files Browse the repository at this point in the history
  • Loading branch information
feilengcui008 committed Jan 4, 2017
1 parent 5e25874 commit 233bbda
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions contrib/registryapi/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class RegistryApi(object):
def __init__(self, username, password, registry_endpoint):
self.username = username
self.password = password
self.basic_token = base64.encodestring("%s:%s" % (str(username), str(password)))
self.basic_token = base64.encodestring("%s:%s" % (str(username), str(password)))[0:-1]
self.registry_endpoint = registry_endpoint.rstrip('/')
auth = self.pingRegistry("%s/v2/_catalog" % (self.registry_endpoint,))
if auth is None:
Expand Down Expand Up @@ -142,9 +142,9 @@ def deleteManifest(self, repository, reference):
return False
return True

def getManifestWithConf(self, repository, reference="latest", v1=False):
def getManifestWithConf(self, repository, reference="latest"):
""" get manifest for tag or digest """
manifest = self.getManifest(repository, reference, v1)
manifest = self.getManifest(repository, reference)
if manifest is None:
raise RegistryException("manifest for %s %s not exist" % (repository, reference))
config_digest = manifest["config"]["digest"]
Expand All @@ -157,8 +157,6 @@ def getManifestWithConf(self, repository, reference="latest", v1=False):
req.get_method = lambda: 'GET'
req.add_header('Authorization', r'Bearer %s' % (bear_token,))
req.add_header('Accept', 'application/vnd.docker.distribution.manifest.v2+json')
if v1:
req.add_header('Accept', 'application/vnd.docker.distribution.manifest.v1+json')
try:
response = urllib2.urlopen(req)
manifest["configContent"] = json.loads(response.read())
Expand Down

0 comments on commit 233bbda

Please sign in to comment.