Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tiered Storage] Fix Jclouds Azure credential error #8693

Merged
merged 1 commit into from
Nov 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public static BlobStoreManagedLedgerOffloader create(TieredStorageConfiguration
config.getBucket(), config.getRegion());

blobStores.putIfAbsent(config.getBlobStoreLocation(), config.getBlobStore());
log.info("The ledger offloader was created.");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,21 @@ public void validate(TieredStorageConfiguration config) throws IllegalArgumentEx

@Override
public BlobStore getBlobStore(TieredStorageConfiguration config) {
return BLOB_STORE_BUILDER.getBlobStore(config);
ContextBuilder contextBuilder = ContextBuilder.newBuilder(config.getProviderMetadata());
contextBuilder.overrides(config.getOverrides());

if (config.getProviderCredentials() != null) {
Credentials credentials = config.getProviderCredentials().get();
return contextBuilder
.credentials(credentials.identity, credentials.credential)
.buildView(BlobStoreContext.class)
.getBlobStore();
} else {
log.warn("The credentials is null. driver: {}, bucket: {}", config.getDriver(), config.getBucket());
return contextBuilder
.buildView(BlobStoreContext.class)
.getBlobStore();
}
}

@Override
Expand Down Expand Up @@ -254,11 +268,12 @@ public ProviderMetadata getProviderMetadata() {
.credentialsSupplier(config.getCredentials())
.buildView(BlobStoreContext.class)
.getBlobStore();
} else {
return contextBuilder
.buildView(BlobStoreContext.class)
.getBlobStore();
}
} else {
log.warn("The credentials is null. driver: {}, bucket: {}", config.getDriver(), config.getBucket());
return contextBuilder
.buildView(BlobStoreContext.class)
.getBlobStore();
}

};

Expand Down