mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-18 04:27:06 +02:00
Kubeconfig is merged into `~/.kube/config` with rename option (existing configuration is never overwritten). If endpoint was used, it is automatically put into the `kubeconfig`. This should make OS X experience literally `talosctl cluster create` followed by any `kubectl get ...`. Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
22 lines
526 B
Go
22 lines
526 B
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
// Package kubeconfig provides Kubernetes config file handling.
|
|
package kubeconfig
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
// DefaultPath returns path to ~/.kube/config.
|
|
func DefaultPath() (string, error) {
|
|
home, err := os.UserHomeDir()
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
return filepath.Join(home, ".kube/config"), nil
|
|
}
|