harbor-container-webhook icon indicating copy to clipboard operation
harbor-container-webhook copied to clipboard

Add method to skip wrong reference format

Open paretl opened this issue 1 year ago • 0 comments

Observation When an image reference format is wrong, the mutating webhook is failing and the deployment cannot go further. Even if the regex does not include this image.

I think that it should be great to skip that case and let the mutating webhook deploies this deployment anyway.

I detected that in a case where ArgoCD + Image updater need to deploy a pod without tag before finding / applying a new tag. So without this the ArgoCD deployments could be broken

Solution

Add a method to verify the reference format, if it's wrong, just skip the mutating webhook changes and return the same imageRef

Tests

  • unit test for this case is done
  • I have tested it in a real environment and it works as expected

paretl avatar Mar 26 '25 11:03 paretl