rename internal pkg

This commit is contained in:
ReallyLiri 2024-06-13 11:47:06 +03:00
parent 4997a261dc
commit 33119d980e
44 changed files with 50 additions and 50 deletions

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -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 {

View File

@ -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.

View File

@ -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"
) )

View File

@ -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.

View File

@ -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) {

View File

@ -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) {

View File

@ -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.

View File

@ -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.

View File

@ -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{}

View File

@ -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.

View File

@ -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 {

View File

@ -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{}

View File

@ -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"
) )

View File

@ -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")

View File

@ -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) {

View File

@ -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 {

View File

@ -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) {

View File

@ -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.

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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"

View File

@ -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) {

View File

@ -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) {

View File

@ -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 (

View File

@ -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 (