public class ConfigHelper
extends java.lang.Object
| Constructor and Description |
|---|
ConfigHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areEqual(java.util.Collection<io.fabric8.kubernetes.api.model.NamedContext> these,
java.util.Collection<io.fabric8.kubernetes.api.model.NamedContext> those) |
static boolean |
areEqual(io.fabric8.kubernetes.api.model.Config kubeConfig,
io.fabric8.kubernetes.client.Config clientConfig)
Returns
true if the given Config and
(client runtime) Config are equal. |
static boolean |
areEqual(io.fabric8.kubernetes.api.model.NamedContext thisContext,
io.fabric8.kubernetes.api.model.NamedContext thatContext)
Returns
true if both given contexts are equal. |
static boolean |
areEqualToken(io.fabric8.kubernetes.api.model.AuthInfo authInfo,
io.fabric8.kubernetes.client.Config clientConfig)
Returns
true if the token in the given AuthInfo (that's retrieved from the kube config file)
and Config (that's contains the runtime settings that the kubernetes-client is using) are equal. |
static boolean |
areEqualToken(io.fabric8.kubernetes.api.model.Config kubeConfig,
io.fabric8.kubernetes.client.Config clientConfig)
Returns
true if the token in the given (kubernetes file) Config
and (client runtime) Config are equal. |
static io.fabric8.kubernetes.api.model.NamedContext |
getCurrentContext() |
static java.lang.String |
getKubeConfigPath() |
static boolean |
isKubeConfigParsable() |
static boolean |
isKubeConfigParsable(java.io.File kubeConfig) |
static io.fabric8.kubernetes.api.model.Config |
loadKubeConfig() |
static io.fabric8.kubernetes.api.model.Config |
loadKubeConfig(java.lang.String path) |
static ToolsConfig |
loadToolsConfig() |
static ToolsConfig |
loadToolsConfig(java.net.URL url) |
static io.fabric8.kubernetes.api.model.Config |
safeLoadKubeConfig() |
static void |
saveKubeConfig(io.fabric8.kubernetes.api.model.Config config) |
public static java.lang.String getKubeConfigPath()
public static void saveKubeConfig(io.fabric8.kubernetes.api.model.Config config)
throws java.io.IOException
java.io.IOExceptionpublic static io.fabric8.kubernetes.api.model.Config safeLoadKubeConfig()
public static io.fabric8.kubernetes.api.model.Config loadKubeConfig()
throws java.io.IOException
java.io.IOExceptionpublic static io.fabric8.kubernetes.api.model.Config loadKubeConfig(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic static boolean isKubeConfigParsable()
public static boolean isKubeConfigParsable(java.io.File kubeConfig)
public static ToolsConfig loadToolsConfig() throws java.io.IOException
java.io.IOExceptionpublic static ToolsConfig loadToolsConfig(java.net.URL url) throws java.io.IOException
java.io.IOExceptionpublic static io.fabric8.kubernetes.api.model.NamedContext getCurrentContext()
public static boolean areEqual(io.fabric8.kubernetes.api.model.Config kubeConfig,
io.fabric8.kubernetes.client.Config clientConfig)
true if the given Config and
(client runtime) Config are equal. They are considered equal if they're
equal in
kubeConfig - the (file) config to compareclientConfig - the (client, runtime) config to comparepublic static boolean areEqual(io.fabric8.kubernetes.api.model.NamedContext thisContext,
io.fabric8.kubernetes.api.model.NamedContext thatContext)
true if both given contexts are equal. They are considered equal if they're equal in
thisContext - the first context to comparethatContext - the second context to compareNamedContext,
Contextpublic static boolean areEqual(java.util.Collection<io.fabric8.kubernetes.api.model.NamedContext> these,
java.util.Collection<io.fabric8.kubernetes.api.model.NamedContext> those)
public static boolean areEqualToken(io.fabric8.kubernetes.api.model.Config kubeConfig,
io.fabric8.kubernetes.client.Config clientConfig)
true if the token in the given (kubernetes file) Config
and (client runtime) Config are equal.
Returns false otherwise.kubeConfig - the (kube config) auth info that contains the tokenclientConfig - the (client) config that contains the tokenpublic static boolean areEqualToken(io.fabric8.kubernetes.api.model.AuthInfo authInfo,
io.fabric8.kubernetes.client.Config clientConfig)
true if the token in the given AuthInfo (that's retrieved from the kube config file)
and Config (that's contains the runtime settings that the kubernetes-client is using) are equal.
Returns false otherwise.authInfo - the (kube config) auth info that contains the tokenclientConfig - the (client) config that contains the token