mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-07-16 16:23:08 +00:00
Move kubeconfig utility to a shared pkg
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
parent
d5546f062d
commit
bef0a4cca7
@ -6,7 +6,7 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/cmd/kubectx/kubeconfig"
|
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CurrentOp prints the current context
|
// CurrentOp prints the current context
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/cmd/kubectx/kubeconfig"
|
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DeleteOp indicates intention to delete contexts.
|
// DeleteOp indicates intention to delete contexts.
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/cmd/kubectx/kubeconfig"
|
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/cmd/kubectx/kubeconfig"
|
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListOp describes listing contexts.
|
// ListOp describes listing contexts.
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/cmd/kubectx/kubeconfig"
|
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RenameOp indicates intention to rename contexts.
|
// RenameOp indicates intention to rename contexts.
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/cmd/kubectx/kubeconfig"
|
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SwitchOp indicates intention to switch contexts.
|
// SwitchOp indicates intention to switch contexts.
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/ahmetb/kubectx/cmd/kubectx/kubeconfig"
|
"github.com/ahmetb/kubectx/internal/kubeconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UnsetOp indicates intention to remove current-context preference.
|
// UnsetOp indicates intention to remove current-context preference.
|
||||||
@ -26,6 +26,6 @@ func (_ UnsetOp) Run(_, stderr io.Writer) error {
|
|||||||
return errors.Wrap(err, "failed to save kubeconfig file after modification")
|
return errors.Wrap(err, "failed to save kubeconfig file after modification")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := fmt.Fprintln(stderr, "Successfully unset the current context")
|
_, err := fmt.Fprintln(stderr, "Successfully unset the active context for kubectl.")
|
||||||
return errors.Wrap(err, "write error")
|
return errors.Wrap(err, "write error")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user