Documentation ¶
Index ¶
- Variables
- func AuthInfosEqual(a, b *api.AuthInfo) bool
- func ClustersEqual(a, b *api.Cluster) bool
- func DefaultKubeconfigPath() string
- func DotKitPath() string
- func FindKubeconfigStore() (string, error)
- func InitLocal(remote string) error
- func InitRemote(client *RemoteClient) error
- func IsAlreadyInitialized(err error) bool
- func IsNotFound(err error) bool
- func KitConfigPath() string
- func RemoteCacheExists() bool
- func RemoteCachePath() string
- type ChangeType
- type ComplexDiffType
- type ConflictResolver
- type Diff
- type DiffItem
- type KitConfig
- type LocalData
- type NamedContext
- type RemoteCache
- type RemoteClient
Constants ¶
This section is empty.
Variables ¶
View Source
var AutoResolver = &autoResolver{}
View Source
var ErrAlreadyInitialized = errors.New("already initialized")
View Source
var ErrItemAlreadyExists = errors.New("an item with this name already exists")
View Source
var ErrKubeconfigDoesNotExist = errors.New("KUBECONFIG environment variable is set to a nonexistent file")
View Source
var ErrMultipleKubeconfigs = errors.New("KUBECONFIG environment variable contains more than one path")
View Source
var ErrRemoteDataNotFound = errors.New("remote cache does not exist")
View Source
var ErrVaultNoKVMount = errors.New("kv secret engine is not enabled in vault")
View Source
var ErrVaultNotInitialized = errors.New("vault is not initialized")
View Source
var ErrVaultSealed = errors.New("vault is sealed")
Functions ¶
func AuthInfosEqual ¶
func ClustersEqual ¶
func DefaultKubeconfigPath ¶
func DefaultKubeconfigPath() string
func DotKitPath ¶
func DotKitPath() string
func FindKubeconfigStore ¶
func InitRemote ¶
func InitRemote(client *RemoteClient) error
func IsAlreadyInitialized ¶
func IsNotFound ¶
func KitConfigPath ¶
func KitConfigPath() string
func RemoteCacheExists ¶
func RemoteCacheExists() bool
func RemoteCachePath ¶
func RemoteCachePath() string
Types ¶
type ChangeType ¶
type ChangeType int
const ( // A new kubeconfig was added and does not interfere with any existing ones ChangeTypeNew ChangeType = 1 << iota // A kubeconfig was renamed but otherwise has no conflicts ChangeTypeRename // An existing kubeconfig was removed ChangeTypeDelete // A new kubeconfig completely replaces an existing one ChangeTypeReplace // A new kubeconfig completely replaces an existing one ChangeTypeModify // Some additional things need to be taken care of ChangeTypeComplex )
type ComplexDiffType ¶
type ComplexDiffType int
const ( ComplexDiffTypeNone ComplexDiffType = 0 // The server URL has been changed ComplexDiffServerChanged ComplexDiffType = 1 << iota // The user auth info has changed ComplexDiffUserAuthChanged // The cluster CA has changed ComplexDiffClusterCAChanged // The preferences have changed (this field is currently unused) ComplexDiffPreferencesChanged // The kubeconfig needs to be renamed as it conflicts with an existing one ComplexDiffRenameRequired )
type ConflictResolver ¶
type Diff ¶
type Diff struct {
Items []DiffItem
}
func ComputeIncomingDiff ¶
func ComputeIncomingDiff(config *KitConfig, client *RemoteClient) (*Diff, error)
type DiffItem ¶
type DiffItem struct { AffectedIncoming NamedContext AffectedExisting NamedContext ChangeType ChangeType Complex ComplexDiffType }
type KitConfig ¶
type KitConfig struct { RemoteURL string `json:"remoteUrl"` KubeconfigPath string `json:"kubeconfigPath"` }
func ReadConfig ¶
func (*KitConfig) WriteToDisk ¶
type LocalData ¶
func ReadLocalData ¶
type NamedContext ¶
func NamedContextFrom ¶
func NamedContextFrom(contexts map[string]*api.Context, name string) NamedContext
func NewNamedContext ¶
func NewNamedContext(name string, context *api.Context) NamedContext
type RemoteCache ¶
func ReadRemoteCache ¶
func ReadRemoteCache() (*RemoteCache, error)
func (*RemoteCache) WriteToDisk ¶
func (cache *RemoteCache) WriteToDisk() error
type RemoteClient ¶
func NewRemoteClient ¶
func NewRemoteClient(config *KitConfig) (*RemoteClient, error)
func (*RemoteClient) CheckConnection ¶
func (r *RemoteClient) CheckConnection() error
func (*RemoteClient) CreateKitMount ¶
func (r *RemoteClient) CreateKitMount() error
func (*RemoteClient) KitMountExists ¶
func (r *RemoteClient) KitMountExists() (bool, error)
func (*RemoteClient) LoadRemoteData ¶
func (r *RemoteClient) LoadRemoteData() (*RemoteCache, error)
Click to show internal directories.
Click to hide internal directories.