kubeadm-reset: notify about a non-default certificates directory

Show the following warning when the user passes --cert-dir:
    [reset] WARNING: Cleaning a non-default certificates directory:
    <dir_name>

The motivation for this change is to notify the user of the
certificates directory which is about to be cleaned as a "warning"
instead of just listing it next to the rest of the directories
to be cleaned.

Makes sure that the user is properly notified that he/she has passed
a non-default path for cleanup.

Signed-off-by: Lubomir I. Ivanov <lubomirivanov@vmware.com>
This commit is contained in:
Lubomir I. Ivanov 2017-09-27 02:42:59 +03:00
parent e1d923a7cb
commit 039b3cdc00

View File

@ -133,6 +133,9 @@ func (r *Reset) Run(out io.Writer) error {
}
// Remove contents from the config and pki directories
if r.certsDir != kubeadmapiext.DefaultCertificatesDir {
fmt.Printf("[reset] WARNING: Cleaning a non-default certificates directory: %q\n", r.certsDir)
}
resetConfigDir(kubeadmconstants.KubernetesDir, r.certsDir)
return nil