Skip to content

Allow tag deletion on broken tags

Steve Abrams requested to merge 341939-delete-gray-container-tags into master

🏷 What does this MR do and why?

Sometimes when working with the container registry, one of the tags in your repository may be broken or corrupted. Currently, when that happens, we see it displayed with a warning symbol. The problem is, there is no way to delete the tag.

This MR:

  • Updates the frontend to allow users to delete broken tags.
  • Updates the public API to not reject requests to delete broken tags.

The frontend uses GraphQL, which does not include the validation that the public API is using. This is why we only update the API, but not GraphQL.

🎥 Screenshots or screen recordings

Before After
Screen_Shot_2021-12-29_at_2.01.30_PM Screen_Shot_2021-12-29_at_1.29.24_PM

🏠 How to set up and validate locally

  1. To use the exact examples below, create a project named brokenimage
  2. In a new directory, create a Dockerfile with the content:
    FROM alpine:3.14
  3. In the same directory, create a file buildkitd.toml with the content:
    debug = true
    # root is where all buildkit state is stored.
    root = "/var/lib/buildkit"
    # insecure-entitlements allows insecure entitlements, disabled by default.
    insecure-entitlements = [ "network.host", "security.insecure" ]
    
    [registry."gdk.test:5000"]
      http = true
      insecure = true
  4. Create a new buildx instance that allows insecure registry requests:
    docker buildx create --use --name insecure-b --config buildkitd.toml --buildkitd-flags '--allow-insecure-entitlement security.insecure'
  5. Push the broken image:
    docker buildx build --allow security.insecure --tag gdk.test:5000/root/brokenimage:asdf1234 --tag gdk.test:5000/root/brokenimage:foobar --cache-from=type=registry,ref=gdk.test:5000/root/brokenimage:foobar --cache-to=type=registry,ref=gdk.test:5000/root/brokenimage:foobar --push .
  6. Navigate to your project's registry and select the repository that has been created Packages & Registries -> Container Registry -> Root Image.
  7. You should see the broken tag.
  8. You should be able to select the checkbox. You should see the "more actions menu" on the right and should be able to delete the tag.

📐 MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #341939 (closed), #342866 (closed)

Edited by Steve Abrams

Merge request reports

Loading