-
Notifications
You must be signed in to change notification settings - Fork 60
Description
We hit this in a test dry run of microsoft/go-images#564:
10:30:47 info: ExecuteHelper[0] EXECUTING: oras discover --artifact-type application/vnd.microsoft.artifact.lifecycle --format json golangimages[...]
Error response from registry: unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information. CorrelationId: e3256c4c-f580-41d3-a0cf-4742ab139a06
This is also happening in .NET Docker Tools cleanup:
Copilot suggests that it's because oras doesn't accept OIDC (or rather... get the current auth? I didn't read carefully 😄):
Root cause: The
CleanAcrImagesCommand(in docker-tools ImageBuilder) authenticates to ACR via Azure SDK using OIDC — this works for listing/deleting manifests via the ACR API. However, thepruneEolaction callsHasExpiredEol()→LifecycleMetadataService.IsDigestAnnotatedForEol()→OrasClient.RunOrasCommand(), which shells out to theorasCLI binary. TheorasCLI uses a completely separate credential path (~/.docker/config.json), and nodocker loginororas loginis performed anywhere before these calls.For comparison, other ImageBuilder commands that use ORAS (e.g.,
AnnotateEolDigestsCommand) wrap their execution inExecuteWithCredentialsAsync(), which performsdocker loginbefore anddocker logoutafter.CleanAcrImagesCommanddoes not do this.The
deleteaction (forbuild-staging/*) does not use ORAS and is unaffected — onlypruneEolis broken.
Some talk here but not totally sure it's relevant:
Metadata
Metadata
Assignees
Labels
Type
Projects
Status