@Override public void validate(final ConfigProblemSetBuilder problems, final DCOSCluster cluster) { if (cluster.getInsecureSkipTlsVerify() != null && cluster.getInsecureSkipTlsVerify()) { problems.addProblem(WARNING, "You've chosen to not validate SSL connections. This setup is not recommended in production deployments."); } if (!Strings.isNullOrEmpty(cluster.getCaCertFile())) { String resolvedServiceKey = ValidatingFileReader.contents(problems, cluster.getCaCertFile()); if (Strings.isNullOrEmpty(resolvedServiceKey)) { problems.addProblem(ERROR, "The supplied CA certificate file does not exist or is empty.") .setRemediation("Supply a valid CA certificate file."); } } if (Strings.isNullOrEmpty(cluster.getDcosUrl())) { problems.addProblem(ERROR, "Cluster must have a URL"); } final DCOSCluster.LoadBalancer loadBalancer = cluster.getLoadBalancer(); if (loadBalancer == null || Strings.isNullOrEmpty(loadBalancer.getImage())) { problems.addProblem(WARNING, "Load balancer pipeline stages will not be able to be used unless a marathon-lb image is specified"); } } }
@Override public void validate(final ConfigProblemSetBuilder problems, final DCOSCluster cluster) { if (cluster.getInsecureSkipTlsVerify() != null && cluster.getInsecureSkipTlsVerify()) { problems.addProblem(WARNING, "You've chosen to not validate SSL connections. This setup is not recommended in production deployments."); } if (!Strings.isNullOrEmpty(cluster.getCaCertFile())) { String resolvedServiceKey = ValidatingFileReader.contents(problems, cluster.getCaCertFile()); if (Strings.isNullOrEmpty(resolvedServiceKey)) { problems.addProblem(ERROR, "The supplied CA certificate file does not exist or is empty.") .setRemediation("Supply a valid CA certificate file."); } } if (Strings.isNullOrEmpty(cluster.getDcosUrl())) { problems.addProblem(ERROR, "Cluster must have a URL"); } final DCOSCluster.LoadBalancer loadBalancer = cluster.getLoadBalancer(); if (loadBalancer == null || Strings.isNullOrEmpty(loadBalancer.getImage())) { problems.addProblem(WARNING, "Load balancer pipeline stages will not be able to be used unless a marathon-lb image is specified"); } } }