GoogleConfig(GoogleCanaryServiceIntegration googleSvc) { enabled = googleSvc.isEnabled(); accounts = googleSvc.getAccounts(); } }
GoogleConfig(GoogleCanaryServiceIntegration googleSvc) { enabled = googleSvc.isEnabled(); accounts = googleSvc.getAccounts(); } }
@Override public void validate(ConfigProblemSetBuilder p, GoogleCanaryServiceIntegration n) { GoogleCanaryAccountValidator googleCanaryAccountValidator = new GoogleCanaryAccountValidator(halyardVersion); n.getAccounts().forEach(a -> googleCanaryAccountValidator.validate(p, a)); if (n.isGcsEnabled()) { List<GoogleCanaryAccount> accountsWithBucket = n.getAccounts() .stream() .filter(a -> a.getBucket() != null) .collect(Collectors.toList()); if (CollectionUtils.isEmpty(accountsWithBucket)) { p.addProblem(Problem.Severity.ERROR, "At least one Google account must specify a bucket if GCS is enabled."); } } } }
@Override public void validate(ConfigProblemSetBuilder p, GoogleCanaryServiceIntegration n) { GoogleCanaryAccountValidator googleCanaryAccountValidator = new GoogleCanaryAccountValidator() .setHalyardVersion(halyardVersion) .setRegistry(registry) .setTaskScheduler(taskScheduler); if (n.isGcsEnabled()) { List<GoogleCanaryAccount> accountsWithBucket = n.getAccounts() .stream() .filter(a -> a.getBucket() != null) .collect(Collectors.toList()); if (CollectionUtils.isEmpty(accountsWithBucket)) { p.addProblem(Problem.Severity.ERROR, "At least one Google account must specify a bucket if GCS is enabled."); } else { accountsWithBucket.forEach(a -> googleCanaryAccountValidator.validate(p, a)); } } } }
googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.METRICS_STORE)); } else { googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().remove(AbstractCanaryServiceIntegration.SupportedTypes.METRICS_STORE)); googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.CONFIGURATION_STORE)); googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.OBJECT_STORE)); } else { googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().remove(AbstractCanaryServiceIntegration.SupportedTypes.CONFIGURATION_STORE)); googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().remove(AbstractCanaryServiceIntegration.SupportedTypes.OBJECT_STORE));
googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.METRICS_STORE)); } else { googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().remove(AbstractCanaryServiceIntegration.SupportedTypes.METRICS_STORE)); googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.CONFIGURATION_STORE)); googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().add(AbstractCanaryServiceIntegration.SupportedTypes.OBJECT_STORE)); } else { googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().remove(AbstractCanaryServiceIntegration.SupportedTypes.CONFIGURATION_STORE)); googleCanaryServiceIntegration.getAccounts().forEach(a -> a.getSupportedTypes().remove(AbstractCanaryServiceIntegration.SupportedTypes.OBJECT_STORE));