@Test public void testAliasCreationWithFQDN() { Stack stack = TestUtil.stack(); GatewayConfig primaryGatewayConfig = create("fqdn.stest.cloudera.site"); ServiceKeytabRequest request = underTest.create(stack, primaryGatewayConfig); assertEquals("CM", request.getServiceName()); assertEquals("fqdn.stest.cloudera.site", request.getServerHostName()); assertEquals("fqdn", request.getServerHostNameAlias()); }
public ServiceKeytabRequest create(Stack stack, GatewayConfig primaryGatewayConfig) { ServiceKeytabRequest request = new ServiceKeytabRequest(); request.setEnvironmentCrn(stack.getEnvironmentCrn()); request.setClusterCrn(stack.getResourceCrn()); String fqdn = primaryGatewayConfig.getHostname(); request.setServerHostName(fqdn); String hostname = StringUtils.substringBefore(fqdn, "."); if (!fqdn.equals(hostname)) { request.setServerHostNameAlias(hostname); } request.setServiceName("CM"); request.setDoNotRecreateKeytab(Boolean.TRUE); RoleRequest roleRequest = new RoleRequest(); roleRequest.setRoleName("hadoopadminrole-" + stack.getName()); roleRequest.setPrivileges(Set.of("Service Administrators", "Certificate Administrators", "CA Administrator")); request.setRoleRequest(roleRequest); return request; }
CmServiceKeytabRequestFactory { public ServiceKeytabRequest create(Stack stack, GatewayConfig primaryGatewayConfig) { ServiceKeytabRequest request = new ServiceKeytabRequest(); request.setEnvironmentCrn(stack.getEnvironmentCrn()); request.setClusterCrn(stack.getResourceCrn()); String fqdn = primaryGatewayConfig.getHostname(); request.setServerHostName(fqdn); String hostname = StringUtils.substringBefore(fqdn, "."); if (!fqdn.equals(hostname)) { request.setServerHostNameAlias(hostname); } request.setServiceName("CM"); request.setDoNotRecreateKeytab(Boolean.TRUE); RoleRequest roleRequest = new RoleRequest(); roleRequest.setRoleName("hadoopadminrole-" + stack.getName()); roleRequest.setPrivileges(Set.of("Service Administrators", "Certificate Administrators", "CA Administrator")); request.setRoleRequest(roleRequest); return request; } }
CmServiceKeytabRequestFactory { public ServiceKeytabRequest create(Stack stack, GatewayConfig primaryGatewayConfig) { ServiceKeytabRequest request = new ServiceKeytabRequest(); request.setEnvironmentCrn(stack.getEnvironmentCrn()); request.setClusterCrn(stack.getResourceCrn()); String fqdn = primaryGatewayConfig.getHostname(); request.setServerHostName(fqdn); String hostname = StringUtils.substringBefore(fqdn, "."); if (!fqdn.equals(hostname)) { request.setServerHostNameAlias(hostname); } request.setServiceName("CM"); request.setDoNotRecreateKeytab(Boolean.TRUE); RoleRequest roleRequest = new RoleRequest(); roleRequest.setRoleName("hadoopadminrole-" + stack.getName()); roleRequest.setPrivileges(Set.of("Service Administrators", "Certificate Administrators", "CA Administrator")); request.setRoleRequest(roleRequest); return request; }  }
CmServiceKeytabRequestFactory { public ServiceKeytabRequest create(Stack stack, GatewayConfig primaryGatewayConfig) { ServiceKeytabRequest request = new ServiceKeytabRequest(); request.setEnvironmentCrn(stack.getEnvironmentCrn()); request.setClusterCrn(stack.getResourceCrn()); String fqdn = primaryGatewayConfig.getHostname(); request.setServerHostName(fqdn); String hostname = StringUtils.substringBefore(fqdn, "."); if (!fqdn.equals(hostname)) { request.setServerHostNameAlias(hostname); } request.setServiceName("CM"); request.setDoNotRecreateKeytab(Boolean.TRUE); RoleRequest roleRequest = new RoleRequest(); roleRequest.setRoleName("hadoopadminrole-" + stack.getName()); roleRequest.setPrivileges(Set.of("Service Administrators", "Certificate Administrators", "CA Administrator")); request.setRoleRequest(roleRequest); return request; }  ServiceKeytabRequest create(Stack stack, GatewayConfig primaryGatewayConfig); }
CmServiceKeytabRequestFactory { public ServiceKeytabRequest create(Stack stack, GatewayConfig primaryGatewayConfig) { ServiceKeytabRequest request = new ServiceKeytabRequest(); request.setEnvironmentCrn(stack.getEnvironmentCrn()); request.setClusterCrn(stack.getResourceCrn()); String fqdn = primaryGatewayConfig.getHostname(); request.setServerHostName(fqdn); String hostname = StringUtils.substringBefore(fqdn, "."); if (!fqdn.equals(hostname)) { request.setServerHostNameAlias(hostname); } request.setServiceName("CM"); request.setDoNotRecreateKeytab(Boolean.TRUE); RoleRequest roleRequest = new RoleRequest(); roleRequest.setRoleName("hadoopadminrole-" + stack.getName()); roleRequest.setPrivileges(Set.of("Service Administrators", "Certificate Administrators", "CA Administrator")); request.setRoleRequest(roleRequest); return request; }  ServiceKeytabRequest create(Stack stack, GatewayConfig primaryGatewayConfig);  }