mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
kubeadm: fix broken kubeadm init --config
flag.
This code was changed in ea196490a0
to validate that `--config` wasn't passed along with other flags. Unfortunately, the implementation was checking `PersistentFlags()`, which was not parsed at the point it was being validated. The result was that `--config` was _always_ rejected, not just when it was specified alongside other flags.
The fix is to use `Flags()` instead, which contains the expected data.
This commit is contained in:
parent
f5757bce5b
commit
ae35377ef5
@ -206,7 +206,7 @@ type Init struct {
|
||||
|
||||
// Validate validates configuration passed to "kubeadm init"
|
||||
func (i *Init) Validate(cmd *cobra.Command) error {
|
||||
if err := validation.ValidateMixedArguments(cmd.PersistentFlags()); err != nil {
|
||||
if err := validation.ValidateMixedArguments(cmd.Flags()); err != nil {
|
||||
return err
|
||||
}
|
||||
return validation.ValidateMasterConfiguration(i.cfg).ToAggregate()
|
||||
|
Loading…
Reference in New Issue
Block a user