use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.
the class HueConfigProvider method configureKnoxProxyHostsServiceConfig.
private void configureKnoxProxyHostsServiceConfig(TemplatePreparationObject source, List<ApiClusterTemplateConfig> result) {
GatewayView gateway = source.getGatewayView();
String cdhVersion = getCdhVersionString(source);
GeneralClusterConfigs generalClusterConfigs = source.getGeneralClusterConfigs();
if (externalFQDNShouldConfigured(gateway, generalClusterConfigs)) {
// CDPD version 7.1.0 and above have a dedicated knox_proxyhosts property to set the knox proxy hosts.
if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_1_0)) {
result.add(new ApiClusterTemplateConfig().name(KNOX_PROXYHOSTS).variable(HUE_KNOX_PROXYHOSTS));
} else {
result.add(new ApiClusterTemplateConfig().name("hue_service_safety_valve").variable(HUE_SAFETY_VALVE));
}
}
}
use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.
the class HueConfigProvider method configureKnoxProxyHostsConfigVariables.
private void configureKnoxProxyHostsConfigVariables(TemplatePreparationObject source, List<ApiClusterTemplateVariable> result) {
GatewayView gateway = source.getGatewayView();
String cdhVersion = getCdhVersionString(source);
GeneralClusterConfigs generalClusterConfigs = source.getGeneralClusterConfigs();
if (externalFQDNShouldConfigured(gateway, generalClusterConfigs)) {
Set<String> proxyHosts = new HashSet<>();
if (generalClusterConfigs.getPrimaryGatewayInstanceDiscoveryFQDN().isPresent()) {
proxyHosts.add(generalClusterConfigs.getPrimaryGatewayInstanceDiscoveryFQDN().get());
}
if (StringUtils.isNotEmpty(generalClusterConfigs.getExternalFQDN())) {
proxyHosts.add(generalClusterConfigs.getExternalFQDN());
}
if (generalClusterConfigs.getLoadBalancerGatewayFqdn().isPresent()) {
proxyHosts.add(generalClusterConfigs.getLoadBalancerGatewayFqdn().get());
}
if (!proxyHosts.isEmpty()) {
String proxyHostsString = String.join(",", proxyHosts);
if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_1_0)) {
LOGGER.debug("Using {} settings of [{}]", HUE_KNOX_PROXYHOSTS, proxyHostsString);
result.add(new ApiClusterTemplateVariable().name(HUE_KNOX_PROXYHOSTS).value(proxyHostsString));
} else {
LOGGER.debug("Adding knox proxy hosts [{}] to {}", proxyHostsString, HUE_SAFETY_VALVE);
String valveValue = SAFETY_VALVE_KNOX_PROXYHOSTS_KEY_PATTERN.concat(proxyHostsString);
result.add(new ApiClusterTemplateVariable().name(HUE_SAFETY_VALVE).value(valveValue));
}
}
}
}
Aggregations