Revanth14 commented on code in PR #2018:
URL: https://github.com/apache/iceberg-go/pull/2018#discussion_r4047330353
##########
io/gocloud/azure/azure_test.go:
##########
@@ -81,20 +103,28 @@ func
TestCreateAzureBucketManagedIdentityCredentialCalled(t *testing.T) {
parsedURL, err :=
url.Parse("abfs://[email protected]/path")
assert.NoError(t, err)
- // NewManagedIdentityCredential never fails at construction, so bucket
creation always succeeds.
- bucket, err := createAzureBucket(ctx, parsedURL, map[string]string{
- "adls.auth.managed-identity.enabled": "true",
- })
- assert.NoError(t, err)
- assert.NotNil(t, bucket)
+ managedIdentityCalled := false
+ credentialFactories := azureCredentialFactories{
+ newDefaultCredential:
func(*azidentity.DefaultAzureCredentialOptions) (azcore.TokenCredential, error)
{
+ t.Fatal("default credential factory should not be
called")
+
+ return nil, nil
+ },
+ newManagedIdentity: func(opts
*azidentity.ManagedIdentityCredentialOptions) (azcore.TokenCredential, error) {
+ managedIdentityCalled = true
+ require.Nil(t, opts)
Review Comment:
Agreed, updated this to cover both cases. The no-client-ID case now accepts
nil or empty options and checks that no ID is forwarded. The new client-ID case
passes `icebergio.ADLSClientID` and verifies `opts.ID` matches
`azidentity.ClientID(clientID)`.
Azure package tests pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]