Class ConfigHelper

java.lang.Object
com.redhat.devtools.intellij.common.utils.ConfigHelper

public class ConfigHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    areEqual(io.fabric8.kubernetes.client.Config thisConfig, io.fabric8.kubernetes.client.Config thatConfig)
    Returns true if the given Configs are equal.
    static boolean
    areEqualAuthInfo(io.fabric8.kubernetes.client.Config thisConfig, io.fabric8.kubernetes.client.Config thatConfig)
    Returns true if both given Config are equal in auth info client cert file client cert data client key file client key data client key algo username password proxies token
    static boolean
    areEqualCluster(io.fabric8.kubernetes.client.Config thisConfig, io.fabric8.kubernetes.client.Config thatConfig)
    Returns true if both given Config are equal in master url (blindly) trust certificates proxies auth info
    static boolean
    areEqualContext(io.fabric8.kubernetes.api.model.NamedContext thisContext, io.fabric8.kubernetes.api.model.NamedContext thatContext)
    Returns true if both given NamedContext are equal in name cluster user current namespace
    static boolean
    areEqualContexts(io.fabric8.kubernetes.client.Config thisConfig, io.fabric8.kubernetes.client.Config thatConfig)
    Returns true if both given Config are equal in contexts.
    static boolean
    areEqualCurrentContext(io.fabric8.kubernetes.client.Config thisConfig, io.fabric8.kubernetes.client.Config thatConfig)
    Returns true if the given Configs are equal in current context.
    static boolean
    areEqualToken(io.fabric8.kubernetes.client.Config thisConfig, io.fabric8.kubernetes.client.Config thatConfig)
    Returns true if the (authentication) token in the given Config and the one in the other config are equal.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConfigHelper

      public ConfigHelper()
  • Method Details

    • areEqual

      public static boolean areEqual(io.fabric8.kubernetes.client.Config thisConfig, io.fabric8.kubernetes.client.Config thatConfig)
      Returns true if the given Configs are equal. They are considered equal if they're equal in
      • current context (cluster, user, current namespace)
      • auth info
      Parameters:
      thisConfig - the first config to compare
      thatConfig - the second config to compare
      Returns:
      true if both configs are equal in context, contexts and token
      See Also:
    • areEqualCurrentContext

      public static boolean areEqualCurrentContext(io.fabric8.kubernetes.client.Config thisConfig, io.fabric8.kubernetes.client.Config thatConfig)
      Returns true if the given Configs are equal in current context. They are considered equal if they're equal in
      • name
      • cluster
      • user
      • current namespace
      Parameters:
      thisConfig - the first config to compare
      thatConfig - the second config to compare
      Returns:
      true if both configs are equal in context, existing contexts and token
      See Also:
    • areEqualContext

      public static boolean areEqualContext(io.fabric8.kubernetes.api.model.NamedContext thisContext, io.fabric8.kubernetes.api.model.NamedContext thatContext)
      Returns true if both given NamedContext are equal in
      • name
      • cluster
      • user
      • current namespace
      Parameters:
      thisContext - the first context to compare
      thatContext - the second context to compare
      Returns:
      true if both contexts are equal
      See Also:
      • areEqualContext(Context, Context)
      • NamedContext
      • Context
    • areEqualCluster

      public static boolean areEqualCluster(io.fabric8.kubernetes.client.Config thisConfig, io.fabric8.kubernetes.client.Config thatConfig)
      Returns true if both given Config are equal in
      • master url
      • (blindly) trust certificates
      • proxies
      • auth info
      Parameters:
      thisConfig - the first config to compare
      thatConfig - the second config to compare
      Returns:
      true if both configs are equal in master url, trust certs, proxies and auth info
      See Also:
      • Config
    • areEqualAuthInfo

      public static boolean areEqualAuthInfo(io.fabric8.kubernetes.client.Config thisConfig, io.fabric8.kubernetes.client.Config thatConfig)
      Returns true if both given Config are equal in auth info
      • client cert file
      • client cert data
      • client key file
      • client key data
      • client key algo
      • username
      • password
      • proxies
      • token
      Parameters:
      thisConfig - the first config to compare
      thatConfig - the second config to compare
      Returns:
      true if both configs are equal in client cert file/data, key file/data/algo, username, password proxies and token
      See Also:
      • Config
    • areEqualContexts

      public static boolean areEqualContexts(io.fabric8.kubernetes.client.Config thisConfig, io.fabric8.kubernetes.client.Config thatConfig)
      Returns true if both given Config are equal in contexts. They are considered equal if they're equal in the number of contexts are these are equal individually.
      • cluster
      • user
      • current namespace
      • extensions
      Parameters:
      thisConfig - the first context to compare
      thatConfig - the second context to compare
      Returns:
      true if both contexts are equal
      See Also:
      • NamedContext
      • Context
      • Config.getContexts()
    • areEqualToken

      public static boolean areEqualToken(io.fabric8.kubernetes.client.Config thisConfig, io.fabric8.kubernetes.client.Config thatConfig)
      Returns true if the (authentication) token in the given Config and the one in the other config are equal. Returns false otherwise.
      Parameters:
      thisConfig - the config to compare the active token of
      thatConfig - the other config to compare the active token of
      Returns:
      true if both tokens are equal, false otherwise