use of com.netflix.spinnaker.halyard.config.model.v1.providers.containers.DockerRegistryReference in project halyard by spinnaker.
the class KubernetesAccountValidator method validate.
@Override
public void validate(ConfigProblemSetBuilder psBuilder, KubernetesAccount account) {
DeploymentConfiguration deploymentConfiguration;
// TODO(lwander) this is still a little messy - I should use the filters to get the necessary docker account
Node parent = account.getParent();
while (!(parent instanceof DeploymentConfiguration)) {
// Note this will crash in the above check if the halconfig representation is corrupted
// (that's ok, because it indicates a more serious error than we want to validate).
parent = parent.getParent();
}
deploymentConfiguration = (DeploymentConfiguration) parent;
validateKindConfig(psBuilder, account);
// TODO(lwander) validate all config with clouddriver's v2 creds
switch(account.getProviderVersion()) {
case V1:
final List<String> dockerRegistryNames = account.getDockerRegistries().stream().map(DockerRegistryReference::getAccountName).collect(Collectors.toList());
validateDockerRegistries(psBuilder, deploymentConfiguration, dockerRegistryNames, Provider.ProviderType.KUBERNETES);
validateKubeconfig(psBuilder, account);
case V2:
break;
default:
throw new IllegalStateException("Unknown provider version " + account.getProviderVersion());
}
}
Aggregations