in converter.py [0:0]
def build_dh_action(self, action, tag):
self.logger.log.info(f"Fetching tags for Dockerhub://{action}")
dh_uri = f"https://registry.hub.docker.com/v2/repositories/"
tags = self.dh_fetch(f"{dh_uri}/{action}/tags/?page_size=100")
t = {}
if "*" in tag:
# set to the newest tagged image
self.logger.log.info("Pinning DockerHub Image to newest Tagged Image")
sha = max(tags, key=lambda x: x["name"])["digest"]
else:
self.logger.log.info(f"Ensuring {tag} is a valid tag")
tl = [t["sha"] for t in tags if t["name"] == tag]
if len(tl) == 0:
sha = None
self.logger.log.error(
f"Tag: {tag} is not found in {action} tags! Skipping..."
)
else:
sha = tl[0]
if sha:
t[sha] = {"expires_at": DEFAULT_EXPIRATION_DATE}
else:
return None
return t