use of com.sequenceiq.cloudbreak.ccm.cloudinit.CcmConnectivityParameters in project cloudbreak by hortonworks.
the class UserDataBuilderTest method testBuildUserDataWithCCMV2Params.
@Test
@DisplayName("test if CCM V2 parameters are passed the user data contains them")
void testBuildUserDataWithCCMV2Params() throws IOException {
CcmV2Parameters ccmV2Parameters = new DefaultCcmV2Parameters("invertingProxyHost", "invertingProxyCertificate", "agentCrn", "agentKeyId", "agentEncipheredPrivateKey", "agentCertificate");
CcmConnectivityParameters ccmConnectivityParameters = new CcmConnectivityParameters(ccmV2Parameters);
PlatformParameters platformParameters = mock(PlatformParameters.class);
ScriptParams scriptParams = mock(ScriptParams.class);
when(scriptParams.getDiskPrefix()).thenReturn("sd");
when(scriptParams.getStartLabel()).thenReturn(98);
when(platformParameters.scriptParams()).thenReturn(scriptParams);
String userData = underTest.buildUserData(ACCOUNT_ID, environment, Platform.platform("AZURE"), "priv-key".getBytes(), "cloudbreak", platformParameters, "pass", "cert", ccmConnectivityParameters, null);
String expectedUserData = FileReaderUtils.readFileFromClasspath("azure-ccm-v2-init.sh");
assertEquals(expectedUserData, userData);
}
use of com.sequenceiq.cloudbreak.ccm.cloudinit.CcmConnectivityParameters in project cloudbreak by hortonworks.
the class UpgradeCcmService method obtainAgentData.
public void obtainAgentData(Long stackId) {
Stack stack = stackService.getStackById(stackId);
CcmConnectivityParameters ccmConnectivityParameters = ccmUserDataService.fetchAndSaveCcmParameters(stack);
stack = stackService.getStackById(stackId);
stack.setCcmParameters(ccmConnectivityParameters);
stackService.save(stack);
}
use of com.sequenceiq.cloudbreak.ccm.cloudinit.CcmConnectivityParameters in project cloudbreak by hortonworks.
the class CcmUserDataService method getCcmV2ConnectivityParameters.
private CcmConnectivityParameters getCcmV2ConnectivityParameters(Stack stack, String keyId) {
String generatedClusterDomain = getGatewayFqdn(stack);
CcmV2Parameters ccmV2Parameters = ccmV2ParameterSupplier.getCcmV2Parameters(stack.getAccountId(), Optional.of(stack.getEnvironmentCrn()), generatedClusterDomain, keyId);
CcmConnectivityParameters ccmConnectivityParameters = new CcmConnectivityParameters(ccmV2Parameters);
saveCcmV2Config(stack.getId(), ccmV2Parameters);
return ccmConnectivityParameters;
}
Aggregations