mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
update kubectl subcommand with -k changes
This commit is contained in:
@@ -117,7 +117,6 @@ func NewCmdReplace(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobr
|
||||
o.DeleteFlags.AddFlags(cmd)
|
||||
o.RecordFlags.AddFlags(cmd)
|
||||
|
||||
cmd.MarkFlagRequired("filename")
|
||||
cmdutil.AddValidateFlags(cmd)
|
||||
cmdutil.AddApplyAnnotationFlags(cmd)
|
||||
|
||||
@@ -163,6 +162,11 @@ func (o *ReplaceOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []
|
||||
}
|
||||
o.DeleteOptions = deleteOpts
|
||||
|
||||
err = o.DeleteOptions.FilenameOptions.RequireFilenameOrKustomize()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
schema, err := f.Validator(o.validate)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -189,7 +193,7 @@ func (o *ReplaceOptions) Validate(cmd *cobra.Command) error {
|
||||
return fmt.Errorf("--timeout must have --force specified")
|
||||
}
|
||||
|
||||
if cmdutil.IsFilenameSliceEmpty(o.DeleteOptions.FilenameOptions.Filenames) {
|
||||
if cmdutil.IsFilenameSliceEmpty(o.DeleteOptions.FilenameOptions.Filenames, o.DeleteOptions.FilenameOptions.Kustomize) {
|
||||
return cmdutil.UsageErrorf(cmd, "Must specify --filename to replace")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user