kubeadmutil.CheckErr(fmt.Errorf("failed to write the new configuration to the file %q: %v",newCfgPath,err))
}
}
},
}
cmd.Flags().StringVar(&oldCfgPath,"old-config","","Path to the kubeadm config file that is using an old API version and should be converted. This flag is mandatory.")
cmd.Flags().StringVar(&newCfgPath,"new-config","","Path to the resulting equivalent kubeadm config file using the new API version. Optional, if not specified output will be sent to STDOUT.")
returncmd
}
// NewCmdConfigUpload returns cobra.Command for "kubeadm config upload" command
returnschema.EmptyObjectKind.GroupVersionKind(),fmt.Errorf("unable to decode config from bytes: %v",err)
}
kindStr,apiVersionStr:="",""
// As there was a bug in kubeadm v1.10 and earlier that made the YAML uploaded to the cluster configmap NOT have metav1.TypeMeta information
// we need to populate this here manually. If kind or apiVersion is empty, we know the apiVersion is v1alpha1, as by the time kubeadm had this bug,
// it could only write
// TODO: Remove this "hack" in v1.12 when we know the ConfigMap always contains v1alpha2 content written by kubeadm v1.11. Also, we will drop support for