Codota Logo
Config.getErrorMessages
Code IndexAdd Codota to your IDE (free)

How to use
getErrorMessages
method
in
io.fabric8.kubernetes.client.Config

Best Java code snippets using io.fabric8.kubernetes.client.Config.getErrorMessages (Showing top 8 results out of 315)

  • Common ways to obtain Config
private void myMethod () {
Config c =
  • Codota IconString str;new ConfigBuilder().withMasterUrl(str).build()
  • Codota Iconnew Config()
  • Codota Iconnew ConfigBuilder().build()
  • Smart code suggestions by Codota
}
origin: fabric8io/kubernetes-client

 config.setOauthToken(serviceTokenCandidate);
 String txt = "Configured service account doesn't have access. Service account may have been revoked.";
 config.getErrorMessages().put(401, "Unauthorized! " + txt);
 config.getErrorMessages().put(403, "Forbidden!" + txt);
 return true;
} else {
origin: fabric8io/kubernetes-client

/**
 * Checks if the response status code is the expected and throws the appropriate KubernetesClientException if not.
 *
 * @param request            The {#link Request} object.
 * @param response           The {@link Response} object.
 * @throws KubernetesClientException When the response code is not the expected.
 */
protected void assertResponseCode(Request request, Response response) {
 int statusCode = response.code();
 String customMessage = config.getErrorMessages().get(statusCode);
 if (response.isSuccessful()) {
  return;
 } else if (customMessage != null) {
  throw requestFailure(request, createStatus(statusCode, combineMessages(customMessage, createStatus(response))));
 } else {
  throw requestFailure(request, createStatus(response));
 }
}
origin: fabric8io/kubernetes-client

config.getErrorMessages().put(401, "Unauthorized! Token may have expired! Please log-in again.");
config.getErrorMessages().put(403, "Forbidden! User "+currentContext.getUser()+ " doesn't have permission.");
origin: org.domeos/kubernetes-client

private boolean tryServiceAccount(Config config) {
 LOGGER.debug("Trying to configure client from service account...");
 if (Utils.getSystemPropertyOrEnvVar(KUBERNETES_AUTH_TRYSERVICEACCOUNT_SYSTEM_PROPERTY, true)) {
  boolean serviceAccountCaCertExists = Files.isRegularFile(new File(KUBERNETES_SERVICE_ACCOUNT_CA_CRT_PATH).toPath());
  if (serviceAccountCaCertExists) {
   LOGGER.debug("Found service account ca cert at: ["+KUBERNETES_SERVICE_ACCOUNT_CA_CRT_PATH+"].");
   config.setCaCertFile(KUBERNETES_SERVICE_ACCOUNT_CA_CRT_PATH);
  } else {
   LOGGER.debug("Did not find service account ca cert at: ["+KUBERNETES_SERVICE_ACCOUNT_CA_CRT_PATH+"].");
  }
  try {
   String serviceTokenCandidate = new String(Files.readAllBytes(new File(KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH).toPath()));
   if (serviceTokenCandidate != null) {
    LOGGER.debug("Found service account token at: ["+KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH+"].");
    config.setOauthToken(serviceTokenCandidate);
    String txt = "Configured service account doesn't have access. Service account may have been revoked.";
    config.getErrorMessages().put(401, "Unauthorized! " + txt);
    config.getErrorMessages().put(403, "Forbidden!" + txt);
    return true;
   } else {
    LOGGER.debug("Did not find service account token at: ["+KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH+"].");
   }
  } catch (IOException e) {
   // No service account token available...
   LOGGER.warn("Error reading service account token from: ["+KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH+"]. Ignoring.");
  }
 }
 return false;
}
origin: org.domeos/kubernetes-client

/**
 * Checks if the response status code is the expected and throws the appropriate KubernetesClientException if not.
 *
 * @param request            The {#link Request} object.
 * @param response           The {@link Response} object.
 * @throws KubernetesClientException When the response code is not the expected.
 */
protected void assertResponseCode(Request request, Response response) {
 int statusCode = response.code();
 String customMessage = config.getErrorMessages().get(statusCode);
 if (response.isSuccessful()) {
  return;
 } else if (customMessage != null) {
  throw requestFailure(request, createStatus(statusCode, customMessage));
 } else {
  throw requestFailure(request, createStatus(response));
 }
}
origin: fabric8io/kubernetes-client

kubernetesConfig.getHttpsProxy(),
kubernetesConfig.getNoProxy(),
kubernetesConfig.getErrorMessages(),
kubernetesConfig.getUserAgent(),
kubernetesConfig.getTlsVersions(),
origin: org.domeos/kubernetes-client

config.getErrorMessages().put(401, "Unauthorized! Token may have expired! Please log-in again.");
config.getErrorMessages().put(403, "Forbidden! User "+currentContext.getUser()+ " doesn't have permission.");
origin: io.fabric8/openshift-client

kubernetesConfig.getHttpsProxy(),
kubernetesConfig.getNoProxy(),
kubernetesConfig.getErrorMessages(),
kubernetesConfig.getUserAgent(),
kubernetesConfig.getTlsVersions(),
io.fabric8.kubernetes.clientConfiggetErrorMessages

Popular methods of Config

  • getMasterUrl
  • getOauthToken
  • getNamespace
  • getPassword
  • getUsername
  • getCaCertData
  • getClientCertData
  • getClientKeyData
  • getClientKeyPassphrase
  • getCaCertFile
  • getClientCertFile
  • getClientKeyAlgo
  • getClientCertFile,
  • getClientKeyAlgo,
  • getClientKeyFile,
  • getRequestTimeout,
  • isTrustCerts,
  • autoConfigure,
  • getApiVersion,
  • getConnectionTimeout,
  • getRollingTimeout,
  • <init>

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now