Add tags to interop images for vulnerability scan exclusion

pull/36695/head
Arjan Bal 10 months ago
parent 4dc1097d04
commit e86419df7f
  1. 5
      tools/interop_matrix/create_matrix_images.py

@ -409,7 +409,12 @@ for lang in languages:
jobset.message("START", "Uploading %s" % image, do_newline=True)
# docker image name must be in the format <gcr_path>/<image>:<gcr_tag>
assert image.startswith(args.gcr_path) and image.find(":") != -1
# Add a tag to exclude the image from the GCP Vulnerability Scanner.
(image_name, tag_name) = image.rsplit(":", 1)
alternate_image_name = f"{image_name}:infrastructure-public-image-{tag_name}"
subprocess.call(["docker", "image" "tag", image, alternate_image_name])
subprocess.call(["gcloud", "docker", "--", "push", image])
subprocess.call(["gcloud", "docker", "--", "push", alternate_image_name])
else:
# Uploading (and overwriting images) by default can easily break things.
print(

Loading…
Cancel
Save