This is an automated email from the ASF dual-hosted git repository.
jshao pushed a commit to branch branch-0.6
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/branch-0.6 by this push:
new b0ccd40a2 fix(authorization-ranger):the descr field of ranger table
x_group is not null (#5034)
b0ccd40a2 is described below
commit b0ccd40a271c335bdb2a8b3ba563eb047e5669bf
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Sep 27 17:34:49 2024 +0800
fix(authorization-ranger):the descr field of ranger table x_group is not
null (#5034)
### What changes were proposed in this pull request?
When calling the ranger CREATE_GROUP api, the desc field cannot be null
### Why are the changes needed?
When calling the ranger CREATE_GROUP api, ranger response is error.
### Does this PR introduce _any_ user-facing change?
### How was this patch tested?
yes, by hand.
Co-authored-by: yangyuxia <[email protected]>
Co-authored-by: yangyx <[email protected]>
---
.../gravitino/authorization/ranger/RangerAuthorizationPlugin.java | 3 ++-
.../org/apache/gravitino/authorization/ranger/reference/VXGroup.java | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git
a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java
b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java
index 75692e987..f53c42354 100644
---
a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java
+++
b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/RangerAuthorizationPlugin.java
@@ -383,7 +383,8 @@ public class RangerAuthorizationPlugin implements
AuthorizationPlugin {
@Override
public Boolean onGroupAdded(Group group) throws RuntimeException {
- return
rangerClient.createGroup(VXGroup.builder().withName(group.name()).build());
+ return rangerClient.createGroup(
+
VXGroup.builder().withName(group.name()).withDescription(group.name()).build());
}
@Override
diff --git
a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/reference/VXGroup.java
b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/reference/VXGroup.java
index f409cdeb0..3a58f5c95 100644
---
a/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/reference/VXGroup.java
+++
b/authorizations/authorization-ranger/src/main/java/org/apache/gravitino/authorization/ranger/reference/VXGroup.java
@@ -91,6 +91,11 @@ public class VXGroup extends VXDataObject implements
java.io.Serializable {
return this;
}
+ public Builder withDescription(String description) {
+ vxGroup.description = description;
+ return this;
+ }
+
public VXGroup build() {
return vxGroup;
}