Search in sources :

Example 1 with ClusterCredential

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;
}
Also used : DockerRegistryReference(com.netflix.spinnaker.halyard.config.model.v1.providers.containers.DockerRegistryReference) ClusterCredential(com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSAccount.ClusterCredential) DCOSAccount(com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSAccount)

Aggregations

DockerRegistryReference (com.netflix.spinnaker.halyard.config.model.v1.providers.containers.DockerRegistryReference)1 DCOSAccount (com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSAccount)1 ClusterCredential (com.netflix.spinnaker.halyard.config.model.v1.providers.dcos.DCOSAccount.ClusterCredential)1