ranem DeleteContext func
parent
f41a937f5e
commit
5621355004
|
@ -89,7 +89,7 @@ func runDelete(cmd *cobra.Command, args []string) {
|
|||
out.T(out.Crushed, `The "{{.cluster_name}}" cluster has been deleted.`, out.V{"cluster_name": profile})
|
||||
|
||||
machineName := pkg_config.GetMachineName()
|
||||
if err := kubeconfig.DeleteKubeConfigContext(constants.KubeconfigPath, machineName); err != nil {
|
||||
if err := kubeconfig.DeleteContext(constants.KubeconfigPath, machineName); err != nil {
|
||||
exit.WithError("update config", err)
|
||||
}
|
||||
|
||||
|
|
|
@ -54,8 +54,8 @@ func SetCurrentContext(kubeCfgPath, name string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// DeleteKubeConfigContext deletes the specified machine's kubeconfig context
|
||||
func DeleteKubeConfigContext(kubeCfgPath, machineName string) error {
|
||||
// DeleteContext deletes the specified machine's kubeconfig context
|
||||
func DeleteContext(kubeCfgPath, machineName string) error {
|
||||
kcfg, err := readOrNew(kubeCfgPath)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Error getting kubeconfig status")
|
||||
|
|
|
@ -22,9 +22,9 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
func TestDeleteKubeConfigContext(t *testing.T) {
|
||||
func TestDeleteContext(t *testing.T) {
|
||||
configFilename := tempFile(t, fakeKubeCfg)
|
||||
if err := DeleteKubeConfigContext(configFilename, "la-croix"); err != nil {
|
||||
if err := DeleteContext(configFilename, "la-croix"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue