INNER CODE UNIT · Go

removeKubeconfig

kumahq/kuma · app/cni/pkg/install/main.go:62

func removeKubeconfig(mountedCniNetDir, kubeconfigName string) error {
	kubeconfigPath := mountedCniNetDir + "/" + kubeconfigName
	if files.FileExists(kubeconfigPath) {
		err := os.Remove(kubeconfigPath)
		if err != nil {
			return errors.Wrap(err, "couldn't remove kubeconfig file")
		}
	}
	return nil
}

func revertConfig(configPath string, chained bool) error {
	if !files.FileExists(configPath) {
		log.Info("no need to revert config - file does not exist", "configPath", configPath)
		return nil
	}

	if chained {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…