mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-08-29 20:22:58 +00:00
rename internal pkg
This commit is contained in:
parent
4997a261dc
commit
33119d980e
@ -20,7 +20,7 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
"github.com/ahmetb/kubectx/core/kubeconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CurrentOp prints the current context
|
// CurrentOp prints the current context
|
||||||
|
@ -19,8 +19,8 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
"github.com/ahmetb/kubectx/core/kubeconfig"
|
||||||
"github.com/ahmetb/kubectx/internal/printer"
|
"github.com/ahmetb/kubectx/core/printer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DeleteOp indicates intention to delete contexts.
|
// DeleteOp indicates intention to delete contexts.
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/cmdutil"
|
"github.com/ahmetb/kubectx/core/cmdutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UnsupportedOp indicates an unsupported flag.
|
// UnsupportedOp indicates an unsupported flag.
|
||||||
|
@ -24,10 +24,10 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/cmdutil"
|
"github.com/ahmetb/kubectx/core/cmdutil"
|
||||||
"github.com/ahmetb/kubectx/internal/env"
|
"github.com/ahmetb/kubectx/core/env"
|
||||||
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
"github.com/ahmetb/kubectx/core/kubeconfig"
|
||||||
"github.com/ahmetb/kubectx/internal/printer"
|
"github.com/ahmetb/kubectx/core/printer"
|
||||||
)
|
)
|
||||||
|
|
||||||
type InteractiveSwitchOp struct {
|
type InteractiveSwitchOp struct {
|
||||||
|
@ -21,9 +21,9 @@ import (
|
|||||||
"facette.io/natsort"
|
"facette.io/natsort"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/cmdutil"
|
"github.com/ahmetb/kubectx/core/cmdutil"
|
||||||
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
"github.com/ahmetb/kubectx/core/kubeconfig"
|
||||||
"github.com/ahmetb/kubectx/internal/printer"
|
"github.com/ahmetb/kubectx/core/printer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListOp describes listing contexts.
|
// ListOp describes listing contexts.
|
||||||
|
@ -19,9 +19,9 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/cmdutil"
|
"github.com/ahmetb/kubectx/core/cmdutil"
|
||||||
"github.com/ahmetb/kubectx/internal/env"
|
"github.com/ahmetb/kubectx/core/env"
|
||||||
"github.com/ahmetb/kubectx/internal/printer"
|
"github.com/ahmetb/kubectx/core/printer"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
"github.com/ahmetb/kubectx/core/kubeconfig"
|
||||||
"github.com/ahmetb/kubectx/internal/printer"
|
"github.com/ahmetb/kubectx/core/printer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RenameOp indicates intention to rename contexts.
|
// RenameOp indicates intention to rename contexts.
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/cmdutil"
|
"github.com/ahmetb/kubectx/core/cmdutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func kubectxPrevCtxFile() (string, error) {
|
func kubectxPrevCtxFile() (string, error) {
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/testutil"
|
"github.com/ahmetb/kubectx/core/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_readLastContext_nonExistingFile(t *testing.T) {
|
func Test_readLastContext_nonExistingFile(t *testing.T) {
|
||||||
|
@ -19,8 +19,8 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
"github.com/ahmetb/kubectx/core/kubeconfig"
|
||||||
"github.com/ahmetb/kubectx/internal/printer"
|
"github.com/ahmetb/kubectx/core/printer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SwitchOp indicates intention to switch contexts.
|
// SwitchOp indicates intention to switch contexts.
|
||||||
|
@ -19,8 +19,8 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
"github.com/ahmetb/kubectx/core/kubeconfig"
|
||||||
"github.com/ahmetb/kubectx/internal/printer"
|
"github.com/ahmetb/kubectx/core/printer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UnsetOp indicates intention to remove current-context preference.
|
// UnsetOp indicates intention to remove current-context preference.
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
"github.com/ahmetb/kubectx/core/kubeconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CurrentOp struct{}
|
type CurrentOp struct{}
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/cmdutil"
|
"github.com/ahmetb/kubectx/core/cmdutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UnsupportedOp indicates an unsupported flag.
|
// UnsupportedOp indicates an unsupported flag.
|
||||||
|
@ -24,10 +24,10 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/cmdutil"
|
"github.com/ahmetb/kubectx/core/cmdutil"
|
||||||
"github.com/ahmetb/kubectx/internal/env"
|
"github.com/ahmetb/kubectx/core/env"
|
||||||
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
"github.com/ahmetb/kubectx/core/kubeconfig"
|
||||||
"github.com/ahmetb/kubectx/internal/printer"
|
"github.com/ahmetb/kubectx/core/printer"
|
||||||
)
|
)
|
||||||
|
|
||||||
type InteractiveSwitchOp struct {
|
type InteractiveSwitchOp struct {
|
||||||
|
@ -26,8 +26,8 @@ import (
|
|||||||
_ "k8s.io/client-go/plugin/pkg/client/auth"
|
_ "k8s.io/client-go/plugin/pkg/client/auth"
|
||||||
"k8s.io/client-go/tools/clientcmd"
|
"k8s.io/client-go/tools/clientcmd"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
"github.com/ahmetb/kubectx/core/kubeconfig"
|
||||||
"github.com/ahmetb/kubectx/internal/printer"
|
"github.com/ahmetb/kubectx/core/printer"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ListOp struct{}
|
type ListOp struct{}
|
||||||
|
@ -19,9 +19,9 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/cmdutil"
|
"github.com/ahmetb/kubectx/core/cmdutil"
|
||||||
"github.com/ahmetb/kubectx/internal/env"
|
"github.com/ahmetb/kubectx/core/env"
|
||||||
"github.com/ahmetb/kubectx/internal/printer"
|
"github.com/ahmetb/kubectx/core/printer"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/cmdutil"
|
"github.com/ahmetb/kubectx/core/cmdutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
var defaultDir = filepath.Join(cmdutil.HomeDir(), ".kube", "kubens")
|
var defaultDir = filepath.Join(cmdutil.HomeDir(), ".kube", "kubens")
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/testutil"
|
"github.com/ahmetb/kubectx/core/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNSFile(t *testing.T) {
|
func TestNSFile(t *testing.T) {
|
||||||
|
@ -23,8 +23,8 @@ import (
|
|||||||
errors2 "k8s.io/apimachinery/pkg/api/errors"
|
errors2 "k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
"github.com/ahmetb/kubectx/core/kubeconfig"
|
||||||
"github.com/ahmetb/kubectx/internal/printer"
|
"github.com/ahmetb/kubectx/core/printer"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SwitchOp struct {
|
type SwitchOp struct {
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/printer"
|
"github.com/ahmetb/kubectx/core/printer"
|
||||||
)
|
)
|
||||||
|
|
||||||
func PrintDeprecatedEnvWarnings(out io.Writer, vars []string) {
|
func PrintDeprecatedEnvWarnings(out io.Writer, vars []string) {
|
@ -20,7 +20,7 @@ import (
|
|||||||
|
|
||||||
"github.com/mattn/go-isatty"
|
"github.com/mattn/go-isatty"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/env"
|
"github.com/ahmetb/kubectx/core/env"
|
||||||
)
|
)
|
||||||
|
|
||||||
// isTerminal determines if given fd is a TTY.
|
// isTerminal determines if given fd is a TTY.
|
@ -17,7 +17,7 @@ package cmdutil
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/testutil"
|
"github.com/ahmetb/kubectx/core/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_homeDir(t *testing.T) {
|
func Test_homeDir(t *testing.T) {
|
@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/testutil"
|
"github.com/ahmetb/kubectx/core/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestKubeconfig_DeleteContextEntry_errors(t *testing.T) {
|
func TestKubeconfig_DeleteContextEntry_errors(t *testing.T) {
|
@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/testutil"
|
"github.com/ahmetb/kubectx/core/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestKubeconfig_ContextNames(t *testing.T) {
|
func TestKubeconfig_ContextNames(t *testing.T) {
|
@ -17,7 +17,7 @@ package kubeconfig
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/testutil"
|
"github.com/ahmetb/kubectx/core/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestKubeconfig_GetCurrentContext(t *testing.T) {
|
func TestKubeconfig_GetCurrentContext(t *testing.T) {
|
@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/testutil"
|
"github.com/ahmetb/kubectx/core/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParse(t *testing.T) {
|
func TestParse(t *testing.T) {
|
@ -15,7 +15,7 @@
|
|||||||
package kubeconfig
|
package kubeconfig
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ahmetb/kubectx/internal/cmdutil"
|
"github.com/ahmetb/kubectx/core/cmdutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
@ -15,13 +15,13 @@
|
|||||||
package kubeconfig
|
package kubeconfig
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/ahmetb/kubectx/internal/cmdutil"
|
"github.com/ahmetb/kubectx/core/cmdutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/testutil"
|
"github.com/ahmetb/kubectx/core/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_kubeconfigPath(t *testing.T) {
|
func Test_kubeconfigPath(t *testing.T) {
|
@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/testutil"
|
"github.com/ahmetb/kubectx/core/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestKubeconfig_NamespaceOfContext_ctxNotFound(t *testing.T) {
|
func TestKubeconfig_NamespaceOfContext_ctxNotFound(t *testing.T) {
|
@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/env"
|
"github.com/ahmetb/kubectx/core/env"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/internal/testutil"
|
"github.com/ahmetb/kubectx/core/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
Loading…
Reference in New Issue
Block a user