Skip to content

Commit

Permalink
chore: address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Shahram Kalantari <[email protected]>
  • Loading branch information
shahramk64 committed Oct 17, 2024
1 parent 3adb7f9 commit 69f1266
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/common/oras/authprovider/azure/azureidentity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Check warning on line 176 in pkg/common/oras/authprovider/azure/azureidentity.go

View check run for this annotation

Codecov / codecov/patch

pkg/common/oras/authprovider/azure/azureidentity.go#L176

Added line #L176 was not covered by tests
}

response, err := client.ExchangeAADAccessTokenForACRRefreshToken(
Expand Down
3 changes: 2 additions & 1 deletion pkg/common/oras/authprovider/azure/azureworkloadidentity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Check warning on line 178 in pkg/common/oras/authprovider/azure/azureworkloadidentity.go

View check run for this annotation

Codecov / codecov/patch

pkg/common/oras/authprovider/azure/azureworkloadidentity.go#L178

Added line #L178 was not covered by tests
}

startTime := time.Now()
Expand Down

0 comments on commit 69f1266

Please sign in to comment.