Sync image display name to image labels

  • Related issues: #2630 [FEATURE] Sync image display_name to image labels

Category:

  • Image

Verification Steps

  1. Login harvester dashboard
  2. Access the Preference page
  3. Enable developer tool image
  4. Create an ubuntu focal image from url https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img image
  5. View API of the created image image
  6. Check can found the display name in the image API content
  7. Create the same ubuntu focal image from previous url again which would bring the same display name
  8. Check would be denied with error message
  9. Create a different ubuntu focal image with the same display name

Expected Results

  1. In image API content, label harvesterhci.io/imageDisplayName added to labels, and it’s value should be the displayName value image
  2. Image with the same display name in label would be denied by admission webhook “validator.harvesterhci.io” image
  3. Image with the same display name but different url would also be denied image