roryqi commented on code in PR #12366:
URL: https://github.com/apache/gravitino/pull/12366#discussion_r3754685366
##########
core/src/main/java/org/apache/gravitino/catalog/FilesetOperationDispatcher.java:
##########
@@ -143,45 +148,67 @@ public Fileset createMultipleLocationFileset(
String comment,
Fileset.Type type,
Map<String, String> storageLocations,
- Map<String, String> properties)
+ Map<String, String> properties,
+ Map<String, SecretBinding> secretBindings,
+ Map<String, SecretReference> secretReferences)
throws NoSuchSchemaException, FilesetAlreadyExistsException {
+ // System entrance: normalize null secret maps to empty so
SecretManager.writeSecrets can
+ // require non-null arguments.
+ Map<String, SecretBinding> bindings = secretBindings == null ? Map.of() :
secretBindings;
+ Map<String, SecretReference> references =
+ secretReferences == null ? Map.of() : secretReferences;
+
NameIdentifier catalogIdent = getCatalogIdentifier(ident);
+ long uid = idGenerator.nextId();
+ Map<String, String> entityProperties =
SecretPropertyUtils.copyEntityProperties(properties);
+ List<SecretUrn> secretUrns =
+ secretManager.assembleSecretUrns(
+ properties, entityProperties, "fileset", uid, bindings,
references);
doWithCatalog(
catalogIdent,
c ->
c.doWithPropertiesMeta(
p -> {
- validatePropertyForCreate(p.filesetPropertiesMetadata(),
properties);
+ validatePropertyForCreate(p.filesetPropertiesMetadata(),
entityProperties);
return null;
}),
IllegalArgumentException.class);
- long uid = idGenerator.nextId();
+ secretManager.writeSecrets(bindings, secretUrns);
Review Comment:
Could do the secret bindings convert to secret urns? It maybe better to use
secret uris. The interface will be clearer.
--
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]