Kubeconfig class

Kubeconfig holds the information needed to build connect to remote kubernetes clusters as a given user.

Available extensions
Annotations
  • @CopyWith()
  • @JsonSerializable(includeIfNull: false)
  • @immutable

Constructors

Kubeconfig({required List<NamedCluster>? clusters, required List<NamedContext>? contexts, required List<NamedAuthInfo>? authInfos, String? apiVersion, String? currentContext, String? kind, Preferences? preferences})
Kubeconfig holds the information needed to build connect to remote kubernetes clusters as a given user.
const
Kubeconfig.fromJson(Map<String, dynamic> json)
Creates a new instance from json.
factory
Kubeconfig.fromYaml(String yaml)
Creates a new instance from yaml.
factory

Properties

apiVersion String?
v1 (default value)
final
authInfos List<NamedAuthInfo>?
AuthInfos is a map of referencable names to user configs.
final
clusters List<NamedCluster>?
Clusters is a map of referencable names to cluster configs.
final
contexts List<NamedContext>?
Contexts is a map of referencable names to context configs.
final
copyWith → _$KubeconfigCWProxy

Available on Kubeconfig, provided by the $KubeconfigCopyWith extension

Returns a callable class that can be used as follows: instanceOfKubeconfig.copyWith(...) or like so:instanceOfKubeconfig.copyWith.fieldName(...).
no setter
currentContext String?
CurrentContext is the name of the context that you would like to use by default.
final
hashCode int
The hash code for this object.
no setterinherited
kind String?
Config (default value)
final
preferences Preferences?
Preferences holds general information to be use for cli interactions.
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool
If set to true, the toString method will be overridden to output this instance's props.
no setter

Methods

merge(Kubeconfig config, {bool validate = true, bool throwExceptions = false, bool preserveCurrentContext = false}) Kubeconfig?
Merges a kubeconfig into this object. Returns null if kubeconfig objects (source and target) are not valid when validate is true and throwExceptions is false
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts to json.
toString() String
A string representation of this object.
inherited
toYaml() String
Converts to yaml.
validate({bool throwExceptions = false}) ValidationResult
Validates the kubeconfig.

Operators

operator ==(Object other) bool
The equality operator.
inherited