Search in sources :

Example 11 with MergeEnvironmentConfig

use of com.thoughtworks.go.config.merge.MergeEnvironmentConfig in project gocd by gocd.

the class PatchEnvironmentCommand method isValid.

@Override
public boolean isValid(CruiseConfig preprocessedConfig) {
    EnvironmentConfig preprocessedEnvironmentConfig = preprocessedConfig.getEnvironments().find(environmentConfig.name());
    boolean isValid = validateRemovalOfInvalidEntities();
    if (preprocessedEnvironmentConfig instanceof MergeEnvironmentConfig) {
        isValid = validateRemovalOfRemoteEntities(preprocessedEnvironmentConfig);
    }
    return isValid && super.isValid(preprocessedConfig);
}
Also used : MergeEnvironmentConfig(com.thoughtworks.go.config.merge.MergeEnvironmentConfig) MergeEnvironmentConfig(com.thoughtworks.go.config.merge.MergeEnvironmentConfig)

Aggregations

MergeEnvironmentConfig (com.thoughtworks.go.config.merge.MergeEnvironmentConfig)11 Test (org.junit.Test)9 FileConfigOrigin (com.thoughtworks.go.config.remote.FileConfigOrigin)4 RepoConfigOrigin (com.thoughtworks.go.config.remote.RepoConfigOrigin)4 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)3 ConfigRepoConfig (com.thoughtworks.go.config.remote.ConfigRepoConfig)3 ConfigRepoConfigTest (com.thoughtworks.go.config.remote.ConfigRepoConfigTest)3 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)3 Cloner (com.rits.cloning.Cloner)1 BasicEnvironmentConfig (com.thoughtworks.go.config.BasicEnvironmentConfig)1 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1