Search in sources :

Example 1 with EnvironmentAgentConfig

use of com.thoughtworks.go.config.EnvironmentAgentConfig in project gocd by gocd.

the class EnvironmentAgentValidator method validateConfig.

public List<ConfigErrors> validateConfig(CruiseConfig cruiseConfig) {
    List<ConfigErrors> errors = new ArrayList<>();
    Set<String> uuids = cruiseConfig.agents().acceptedUuids();
    if (!cruiseConfig.getEnvironments().validateContainOnlyUuids(uuids)) {
        for (EnvironmentConfig environmentConfig : cruiseConfig.getEnvironments()) {
            for (EnvironmentAgentConfig environmentAgentConfig : environmentConfig.getAgents()) {
                if (!environmentAgentConfig.errors().isEmpty()) {
                    errors.add(environmentAgentConfig.errors());
                }
            }
        }
    }
    return errors;
}
Also used : EnvironmentConfig(com.thoughtworks.go.config.EnvironmentConfig) ArrayList(java.util.ArrayList) EnvironmentAgentConfig(com.thoughtworks.go.config.EnvironmentAgentConfig) ConfigErrors(com.thoughtworks.go.domain.ConfigErrors)

Aggregations

EnvironmentAgentConfig (com.thoughtworks.go.config.EnvironmentAgentConfig)1 EnvironmentConfig (com.thoughtworks.go.config.EnvironmentConfig)1 ConfigErrors (com.thoughtworks.go.domain.ConfigErrors)1 ArrayList (java.util.ArrayList)1