use of com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSAccount.ClusterCredential in project halyard by spinnaker.
the class DCOSAddAccountCommand method buildAccount.
@Override
protected Account buildAccount(String accountName) {
DCOSAccount account = (DCOSAccount) new DCOSAccount().setName(accountName);
dockerRegistries.forEach(registryName -> account.getDockerRegistries().add(new DockerRegistryReference().setAccountName(registryName)));
if (!isNull(serviceKeyFile) && !isNull(password)) {
throw new IllegalArgumentException("Only one of --service-key-file or --password may be set");
}
account.setClusters(Lists.newArrayList(new ClusterCredential(cluster, uid, password, serviceKeyFile)));
return account;
}
Aggregations