Check config path for command "kubeadm alpha phase kubelet write-env-file"

This commit is contained in:
xiangpengzhao 2018-08-08 14:29:53 +08:00
parent 81c6b735fa
commit 3f2c7b6fda

View File

@ -125,6 +125,10 @@ func NewCmdKubeletWriteEnvFile() *cobra.Command {
Long: kubeletWriteEnvFileLongDesc,
Example: kubeletWriteEnvFileExample,
Run: func(cmd *cobra.Command, args []string) {
if len(cfgPath) == 0 {
kubeadmutil.CheckErr(fmt.Errorf("The --config flag is mandatory"))
}
err := RunKubeletWriteEnvFile(cfgPath)
kubeadmutil.CheckErr(err)
},