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

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

Best Java code snippets using io.fabric8.kubernetes.client.Config.getHomeDir (Showing top 2 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

private static boolean tryKubeConfig(Config config, String context) {
 LOGGER.debug("Trying to configure client from Kubernetes config...");
 if (Utils.getSystemPropertyOrEnvVar(KUBERNETES_AUTH_TRYKUBECONFIG_SYSTEM_PROPERTY, true)) {
  String fileName = Utils.getSystemPropertyOrEnvVar(KUBERNETES_KUBECONFIG_FILE, new File(getHomeDir(), ".kube" + File.separator + "config").toString());
  // if system property/env var contains multiple files take the first one based on the environment
  // we are running in (eg. : for Linux, ; for Windows)
  String[] fileNames = fileName.split(File.pathSeparator);
  if (fileNames.length > 1) {
   LOGGER.debug("Found multiple Kubernetes config files [{}], using the first one: [{}].", fileNames, fileNames[0]);
   fileName = fileNames[0];
  }
  File kubeConfigFile = new File(fileName);
  boolean kubeConfigFileExists = Files.isRegularFile(kubeConfigFile.toPath());
  if (kubeConfigFileExists) {
   LOGGER.debug("Found for Kubernetes config at: ["+kubeConfigFile.getPath()+"].");
   String kubeconfigContents;
   try {
    kubeconfigContents = new String(Files.readAllBytes(kubeConfigFile.toPath()), StandardCharsets.UTF_8);
   } catch(IOException e) {
    LOGGER.error("Could not load Kubernetes config file from {}", kubeConfigFile.getPath(), e);
    return false;
   }
   Config.loadFromKubeconfig(config, context, kubeconfigContents, kubeConfigFile.getPath());
   return true;
  } else {
   LOGGER.debug("Did not find Kubernetes config at: ["+kubeConfigFile.getPath()+"]. Ignoring.");
  }
 }
 return false;
}
origin: org.domeos/kubernetes-client

if (Utils.getSystemPropertyOrEnvVar(KUBERNETES_AUTH_TRYKUBECONFIG_SYSTEM_PROPERTY, true)) {
 File kubeConfigFile = new File(
   Utils.getSystemPropertyOrEnvVar(KUBERNETES_KUBECONFIG_FILE, new File(getHomeDir(), ".kube" + File.separator + "config").toString()));
 boolean kubeConfigFileExists = Files.isRegularFile(kubeConfigFile.toPath());
 if (kubeConfigFileExists) {
io.fabric8.kubernetes.clientConfiggetHomeDir

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
  • putExtra (Intent)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
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