YARN-11545. Fixed FS2CS ACL conversion when all users are allowed. (#5910)

This commit is contained in:
Peter Szucs 2023-08-03 16:29:41 +02:00 committed by GitHub
parent 04c34a2171
commit 6e6349c793
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -432,13 +432,13 @@ public class FSConfigToCSConfigConverter {
AccessControlList adminAcls = access.get(AccessType.ADMINISTER_QUEUE); AccessControlList adminAcls = access.get(AccessType.ADMINISTER_QUEUE);
if (!submitAcls.getGroups().isEmpty() || if (!submitAcls.getGroups().isEmpty() ||
!submitAcls.getUsers().isEmpty()) { !submitAcls.getUsers().isEmpty() || submitAcls.isAllAllowed()) {
capacitySchedulerConfig.set(PREFIX + queue + ".acl_submit_applications", capacitySchedulerConfig.set(PREFIX + queue + ".acl_submit_applications",
submitAcls.getAclString()); submitAcls.getAclString());
} }
if (!adminAcls.getGroups().isEmpty() || if (!adminAcls.getGroups().isEmpty() ||
!adminAcls.getUsers().isEmpty()) { !adminAcls.getUsers().isEmpty() || adminAcls.isAllAllowed()) {
capacitySchedulerConfig.set(PREFIX + queue + ".acl_administer_queue", capacitySchedulerConfig.set(PREFIX + queue + ".acl_administer_queue",
adminAcls.getAclString()); adminAcls.getAclString());
} }

View File

@ -263,9 +263,9 @@ public class TestFSConfigToCSConfigConverter {
conf.get(PREFIX + "root.admins.alice.acl_administer_queue")); conf.get(PREFIX + "root.admins.alice.acl_administer_queue"));
// root.users.john // root.users.john
assertEquals("root.users.john submit ACL", "john ", assertEquals("root.users.john submit ACL", "*",
conf.get(PREFIX + "root.users.john.acl_submit_applications")); conf.get(PREFIX + "root.users.john.acl_submit_applications"));
assertEquals("root.users.john admin ACL", "john ", assertEquals("root.users.john admin ACL", "*",
conf.get(PREFIX + "root.users.john.acl_administer_queue")); conf.get(PREFIX + "root.users.john.acl_administer_queue"));
// root.users.joe // root.users.joe

View File

@ -33,8 +33,8 @@
<weight>1.0</weight> <weight>1.0</weight>
<minResources>memory-mb=4096, vcores=1</minResources> <minResources>memory-mb=4096, vcores=1</minResources>
<schedulingPolicy>drf</schedulingPolicy> <schedulingPolicy>drf</schedulingPolicy>
<aclSubmitApps>john </aclSubmitApps> <aclSubmitApps>*</aclSubmitApps>
<aclAdministerApps>john </aclAdministerApps> <aclAdministerApps>*</aclAdministerApps>
<maxContainerAllocation>vcores=2,memory-mb=8192</maxContainerAllocation> <maxContainerAllocation>vcores=2,memory-mb=8192</maxContainerAllocation>
</queue> </queue>
<queue name="joe"> <queue name="joe">