From 69f1266246989ccf6ff0c3068561754e5a186547 Mon Sep 17 00:00:00 2001 From: Shahram Kalantari Date: Thu, 17 Oct 2024 18:58:15 +1000 Subject: [PATCH] chore: address comments Signed-off-by: Shahram Kalantari --- pkg/common/oras/authprovider/azure/azureidentity.go | 3 ++- pkg/common/oras/authprovider/azure/azureworkloadidentity.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/common/oras/authprovider/azure/azureidentity.go b/pkg/common/oras/authprovider/azure/azureidentity.go index 0485ec1fa..0df0a2f8d 100644 --- a/pkg/common/oras/authprovider/azure/azureidentity.go +++ b/pkg/common/oras/authprovider/azure/azureidentity.go @@ -172,7 +172,8 @@ func (d *MIAuthProvider) Provide(ctx context.Context, artifact string) (provider var options *azcontainerregistry.AuthenticationClientOptions client, err := d.authClientFactory.CreateAuthClient(serverURL, options) if err != nil { - return provider.AuthConfig{}, re.ErrorCodeAuthDenied.NewError(re.AuthProvider, "", re.AzureWorkloadIdentityLink, err, "failed to create authentication client for container registry by azure managed identity token", re.HideStackTrace) + // return provider.AuthConfig{}, re.ErrorCodeAuthDenied.NewError(re.AuthProvider, "", re.AzureWorkloadIdentityLink, err, "failed to create authentication client for container registry by azure managed identity token", re.HideStackTrace) + return provider.AuthConfig{}, re.ErrorCodeAuthDenied.WithError(err).WithDetail("failed to create authentication client for container registry by azure managed identity token") } response, err := client.ExchangeAADAccessTokenForACRRefreshToken( diff --git a/pkg/common/oras/authprovider/azure/azureworkloadidentity.go b/pkg/common/oras/authprovider/azure/azureworkloadidentity.go index 404f91670..a79c98cc8 100644 --- a/pkg/common/oras/authprovider/azure/azureworkloadidentity.go +++ b/pkg/common/oras/authprovider/azure/azureworkloadidentity.go @@ -174,7 +174,8 @@ func (d *WIAuthProvider) Provide(ctx context.Context, artifact string) (provider var options *azcontainerregistry.AuthenticationClientOptions client, err := d.authClientFactory.CreateAuthClient(serverURL, options) if err != nil { - return provider.AuthConfig{}, re.ErrorCodeAuthDenied.NewError(re.AuthProvider, "", re.AzureWorkloadIdentityLink, err, "failed to create authentication client for container registry", re.HideStackTrace) + // return provider.AuthConfig{}, re.ErrorCodeAuthDenied.NewError(re.AuthProvider, "", re.AzureWorkloadIdentityLink, err, "failed to create authentication client for container registry", re.HideStackTrace) + return provider.AuthConfig{}, re.ErrorCodeAuthDenied.WithError(err).WithDetail("failed to create authentication client for container registry by azure managed identity token") } startTime := time.Now()