Tabnine Logo
ConfigProblemBuilder.setRemediation
Code IndexAdd Tabnine to your IDE (free)

How to use
setRemediation
method
in
com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder

Best Java code snippets using com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder.setRemediation (Showing top 20 results out of 315)

origin: spinnaker/halyard

@Override
public void validate(ConfigProblemSetBuilder p, DeploymentConfiguration n) {
 String timezone = n.getTimezone();
 if (Arrays.stream(TimeZone.getAvailableIDs()).noneMatch(t -> t.equals(timezone))) {
  p.addProblem(Problem.Severity.ERROR, "Timezone " + timezone + " does not match any known canonical timezone ID")
    .setRemediation("Pick a timezone from those listed here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones");
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

@Override
public void validate(ConfigProblemSetBuilder p, DeploymentConfiguration n) {
 String timezone = n.getTimezone();
 if (Arrays.stream(TimeZone.getAvailableIDs()).noneMatch(t -> t.equals(timezone))) {
  p.addProblem(Problem.Severity.ERROR, "Timezone " + timezone + " does not match any known canonical timezone ID")
    .setRemediation("Pick a timezone from those listed here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones");
 }
}
origin: spinnaker/halyard

private void validateGitDeployment(ConfigProblemSetBuilder p, DeploymentEnvironment n) {
 if (StringUtils.isEmpty(n.getGitConfig().getOriginUser())) {
  p.addProblem(Problem.Severity.FATAL, "A git origin user must be supplied when deploying from git.")
   .setRemediation("Your github username is recommended.");
 }
 if (StringUtils.isEmpty(n.getGitConfig().getUpstreamUser())) {
  p.addProblem(Problem.Severity.FATAL, "A git upstream user must be supplied when deploying from git.")
   .setRemediation("The user 'spinnaker' is recommended (unless you have a fork maintained by the org you develop under).");
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

private void validateGitDeployment(ConfigProblemSetBuilder p, DeploymentEnvironment n) {
 if (StringUtils.isEmpty(n.getGitConfig().getOriginUser())) {
  p.addProblem(Problem.Severity.FATAL, "A git origin user must be supplied when deploying from git.")
   .setRemediation("Your github username is recommended.");
 }
 if (StringUtils.isEmpty(n.getGitConfig().getUpstreamUser())) {
  p.addProblem(Problem.Severity.FATAL, "A git upstream user must be supplied when deploying from git.")
   .setRemediation("The user 'spinnaker' is recommended (unless you have a fork maintained by the org you develop under).");
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

 @Override
 public void validate(ConfigProblemSetBuilder p, AbstractCanaryAccount n) {
  if (n.getName() == null) {
   p.addProblem(Severity.FATAL, "Canary account name must be specified");
  } else if (!Pattern.matches(namePattern, n.getName())) {
   p.addProblem(Severity.ERROR, "Canary account name must match pattern " + namePattern)
    .setRemediation("It must start and end with a lower-case character or number, and only contain lower-case characters, numbers, dashes, or underscores");
  }
 }
}
origin: spinnaker/halyard

 @Override
 public void validate(ConfigProblemSetBuilder p, AbstractCanaryAccount n) {
  if (n.getName() == null) {
   p.addProblem(Severity.FATAL, "Canary account name must be specified");
  } else if (!Pattern.matches(namePattern, n.getName())) {
   p.addProblem(Severity.ERROR, "Canary account name must match pattern " + namePattern)
    .setRemediation("It must start and end with a lower-case character or number, and only contain lower-case characters, numbers, dashes, or underscores");
  }
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

 @Override
 public void validate(final ConfigProblemSetBuilder p, final DCOSProvider provider) {
  Set<String> clusters = new HashSet<>();

  for (DCOSCluster cluster : provider.getClusters()) {
   if (clusters.contains(cluster.getName())) {
    p.addProblem(Problem.Severity.FATAL, "Account \"" + cluster.getName() + "\" appears more than once")
      .setRemediation("Change the name of the cluster in " + provider.getNodeName());
   } else {
    clusters.add(cluster.getName());
   }
  }
 }
}
origin: spinnaker/halyard

 @Override
 public void validate(final ConfigProblemSetBuilder p, final DCOSProvider provider) {
  Set<String> clusters = new HashSet<>();

  for (DCOSCluster cluster : provider.getClusters()) {
   if (clusters.contains(cluster.getName())) {
    p.addProblem(Problem.Severity.FATAL, "Account \"" + cluster.getName() + "\" appears more than once")
      .setRemediation("Change the name of the cluster in " + provider.getNodeName());
   } else {
    clusters.add(cluster.getName());
   }
  }
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

private BaseImage getBaseImage(NodeFilter filter, String baseImageName) {
 List<BaseImage> matchingBaseImages = lookupService.getMatchingNodesOfType(filter, BaseImage.class);
 switch (matchingBaseImages.size()) {
  case 0:
   throw new ConfigNotFoundException(new ConfigProblemBuilder(
     Severity.FATAL, "No base image with name \"" + baseImageName + "\" was found")
     .setRemediation("Check if this base image was defined in another provider, or create a new one").build());
  case 1:
   return matchingBaseImages.get(0);
  default:
   throw new IllegalConfigException(new ConfigProblemBuilder(
     Severity.FATAL, "More than one base image named \"" + baseImageName + "\" was found")
     .setRemediation("Manually delete/rename duplicate base images with name \"" + baseImageName + "\" in your halconfig file").build());
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

private Cluster getCluster(NodeFilter filter, String clusterName) {
 List<Cluster> matchingClusters = lookupService.getMatchingNodesOfType(filter, Cluster.class);
 switch (matchingClusters.size()) {
 case 0:
  throw new ConfigNotFoundException(new ConfigProblemBuilder(
    Problem.Severity.FATAL, "No cluster with name \"" + clusterName + "\" was found")
    .setRemediation("Check if this cluster was defined in another provider, or create a new one").build());
 case 1:
  return matchingClusters.get(0);
 default:
  throw new IllegalConfigException(new ConfigProblemBuilder(
    Problem.Severity.FATAL, "More than one cluster named \"" + clusterName + "\" was found")
    .setRemediation("Manually delete/rename duplicate clusters with name \"" + clusterName + "\" in your halconfig file").build());
 }
}
origin: spinnaker/halyard

private ArtifactAccount getArtifactAccount(NodeFilter filter, String accountName) {
 List<ArtifactAccount> matchingArtifactAccounts = lookupService.getMatchingNodesOfType(filter, ArtifactAccount.class);
 switch (matchingArtifactAccounts.size()) {
  case 0:
   throw new ConfigNotFoundException(new ConfigProblemBuilder(
     Severity.FATAL, "No account with name \"" + accountName + "\" was found")
     .setRemediation("Check if this artifact account was defined in another provider, or create a new one").build());
  case 1:
   return matchingArtifactAccounts.get(0);
  default:
   throw new IllegalConfigException(new ConfigProblemBuilder(
     Severity.FATAL, "More than one account named \"" + accountName + "\" was found")
     .setRemediation("Manually delete/rename duplicate artifact accounts with name \"" + accountName + "\" in your halconfig file").build());
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

private Master getMaster(NodeFilter filter, String masterName) {
 List<Master> matchingMasters = lookupService.getMatchingNodesOfType(filter, Master.class);
 switch (matchingMasters.size()) {
  case 0:
   throw new ConfigNotFoundException(new ConfigProblemBuilder(
     Severity.FATAL, "No master with name \"" + masterName + "\" was found")
     .setRemediation("Check if this master was defined in another Continuous Integration service, or create a new one").build());
  case 1:
   return matchingMasters.get(0);
  default:
   throw new IllegalConfigException(new ConfigProblemBuilder(
     Severity.FATAL, "More than one master named \"" + masterName + "\" was found")
     .setRemediation("Manually delete/rename duplicate masters with name \"" + masterName + "\" in your halconfig file").build());
 }
}
origin: spinnaker/halyard

private Account getAccount(NodeFilter filter, String accountName) {
 List<Account> matchingAccounts = lookupService.getMatchingNodesOfType(filter, Account.class);
 switch (matchingAccounts.size()) {
  case 0:
   throw new ConfigNotFoundException(new ConfigProblemBuilder(
     Severity.FATAL, "No account with name \"" + accountName + "\" was found")
     .setRemediation("Check if this account was defined in another provider, or create a new one").build());
  case 1:
   return matchingAccounts.get(0);
  default:
   throw new IllegalConfigException(new ConfigProblemBuilder(
     Severity.FATAL, "More than one account named \"" + accountName + "\" was found")
     .setRemediation("Manually delete/rename duplicate accounts with name \"" + accountName + "\" in your halconfig file").build());
 }
}
origin: spinnaker/halyard

private Cluster getCluster(NodeFilter filter, String clusterName) {
 List<Cluster> matchingClusters = lookupService.getMatchingNodesOfType(filter, Cluster.class);
 switch (matchingClusters.size()) {
 case 0:
  throw new ConfigNotFoundException(new ConfigProblemBuilder(
    Problem.Severity.FATAL, "No cluster with name \"" + clusterName + "\" was found")
    .setRemediation("Check if this cluster was defined in another provider, or create a new one").build());
 case 1:
  return matchingClusters.get(0);
 default:
  throw new IllegalConfigException(new ConfigProblemBuilder(
    Problem.Severity.FATAL, "More than one cluster named \"" + clusterName + "\" was found")
    .setRemediation("Manually delete/rename duplicate clusters with name \"" + clusterName + "\" in your halconfig file").build());
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

private Subscription getSubscription(NodeFilter filter, String subscriptionName) {
 List<Subscription> matchingSubscriptions = lookupService.getMatchingNodesOfType(filter, Subscription.class);
 switch (matchingSubscriptions.size()) {
  case 0:
   throw new ConfigNotFoundException(new ConfigProblemBuilder(
     Severity.FATAL, "No subscription with name \"" + subscriptionName + "\" was found")
     .setRemediation("Check if this subscription was defined in another pubsub, or create a new one").build());
  case 1:
   return matchingSubscriptions.get(0);
  default:
   throw new IllegalConfigException(new ConfigProblemBuilder(
     Severity.FATAL, "More than one subscription named \"" + subscriptionName + "\" was found")
     .setRemediation("Manually delete/rename duplicate subscriptions with name \"" + subscriptionName + "\" in your halconfig file").build());
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

 @Override
 public void validate(ConfigProblemSetBuilder p, Account n) {
  if (n.getName() == null) {
   p.addProblem(Severity.FATAL, "Account name must be specified");
  } else if (!Pattern.matches(namePattern, n.getName())) {
   p.addProblem(Severity.ERROR, "Account name must match pattern " + namePattern)
    .setRemediation("It must start and end with a lower-case character or number, and only contain lower-case characters, numbers, or dashes");
  }
  if (n.getRequiredGroupMembership() != null && !n.getRequiredGroupMembership().isEmpty()) {
   p.addProblem(Problem.Severity.WARNING, "requiredGroupMembership has been "
     + "deprecated. Please consider moving to using permissions with the flags --read-permissions "
     + "and --write-permissions instead. Read more at https://www.spinnaker.io/setup/security/authorization." );
  }
 }
}
origin: spinnaker/halyard

 @Override
 public void validate(ConfigProblemSetBuilder p, Account n) {
  if (n.getName() == null) {
   p.addProblem(Severity.FATAL, "Account name must be specified");
  } else if (!Pattern.matches(namePattern, n.getName())) {
   p.addProblem(Severity.ERROR, "Account name must match pattern " + namePattern)
    .setRemediation("It must start and end with a lower-case character or number, and only contain lower-case characters, numbers, or dashes");
  }
  if (n.getRequiredGroupMembership() != null && !n.getRequiredGroupMembership().isEmpty()) {
   p.addProblem(Problem.Severity.WARNING, "requiredGroupMembership has been "
     + "deprecated. Please consider moving to using permissions with the flags --read-permissions "
     + "and --write-permissions instead. Read more at https://www.spinnaker.io/setup/security/authorization." );
  }
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

public HaService getHaService(String deploymentName, String serviceName) {
 NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setDeploymentEnvironment().setHaService(serviceName);
 List<HaService> matching = lookupService.getMatchingNodesOfType(filter, HaService.class);
 switch (matching.size()) {
  case 0:
   throw new ConfigNotFoundException(new ConfigProblemBuilder(Severity.FATAL,
     "No high availability service with name \"" + serviceName + "\" could be found")
     .setRemediation("Create a new high availability service with name \"" + serviceName + "\"").build());
  case 1:
   return matching.get(0);
  default:
   throw new IllegalConfigException(new ConfigProblemBuilder(Severity.FATAL,
     "More than one high availability service with name \"" + serviceName + "\" found")
     .setRemediation("Manually delete or rename duplicate high availability services with name \"" + serviceName + "\" in your halconfig file").build());
 }
}
origin: com.netflix.spinnaker.halyard/halyard-config

public ConfigProblemSetBuilder extend(HalException e) {
 e.getProblems()
   .getProblems()
   .forEach(p -> addProblem(p.getSeverity(), p.getMessage())
     .setOptions(p.getOptions())
     .setRemediation(p.getRemediation())
   );
 return this;
}
origin: spinnaker/halyard

public ConfigProblemSetBuilder extend(HalException e) {
 e.getProblems()
   .getProblems()
   .forEach(p -> addProblem(p.getSeverity(), p.getMessage())
     .setOptions(p.getOptions())
     .setRemediation(p.getRemediation())
   );
 return this;
}
com.netflix.spinnaker.halyard.config.problem.v1ConfigProblemBuildersetRemediation

Popular methods of ConfigProblemBuilder

  • <init>
  • build
  • setNode
  • setOptions

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • putExtra (Intent)
  • getApplicationContext (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JComboBox (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now