ranem DeleteContext func

pull/5003/head
Medya Gh 2019-08-06 20:43:35 -07:00
parent f41a937f5e
commit 5621355004
3 changed files with 5 additions and 5 deletions

View File

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

View File

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

View File

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