mirror of https://github.com/k3s-io/k3s
Merge pull request #4281 from brendandburns/fixer
Add some error checking to prevent obscure failures.pull/6/head
commit
ef71b43056
|
@ -57,6 +57,7 @@ Examples:
|
||||||
FilenameParam(flags.Filenames...).
|
FilenameParam(flags.Filenames...).
|
||||||
Flatten().
|
Flatten().
|
||||||
Do()
|
Do()
|
||||||
|
checkErr(r.Err())
|
||||||
|
|
||||||
count := 0
|
count := 0
|
||||||
err = r.Visit(func(info *resource.Info) error {
|
err = r.Visit(func(info *resource.Info) error {
|
||||||
|
|
|
@ -71,6 +71,7 @@ Examples:
|
||||||
ResourceTypeOrNameArgs(args...).
|
ResourceTypeOrNameArgs(args...).
|
||||||
Flatten().
|
Flatten().
|
||||||
Do()
|
Do()
|
||||||
|
checkErr(r.Err())
|
||||||
|
|
||||||
found := 0
|
found := 0
|
||||||
err = r.IgnoreErrors(errors.IsNotFound).Visit(func(r *resource.Info) error {
|
err = r.IgnoreErrors(errors.IsNotFound).Visit(func(r *resource.Info) error {
|
||||||
|
|
|
@ -86,6 +86,7 @@ func RunGet(f *Factory, out io.Writer, cmd *cobra.Command, args []string) {
|
||||||
ResourceTypeOrNameArgs(args...).
|
ResourceTypeOrNameArgs(args...).
|
||||||
SingleResourceType().
|
SingleResourceType().
|
||||||
Do()
|
Do()
|
||||||
|
checkErr(r.Err())
|
||||||
|
|
||||||
mapping, err := r.ResourceMapping()
|
mapping, err := r.ResourceMapping()
|
||||||
checkErr(err)
|
checkErr(err)
|
||||||
|
|
|
@ -60,6 +60,7 @@ Examples:
|
||||||
FilenameParam(flags.Filenames...).
|
FilenameParam(flags.Filenames...).
|
||||||
Flatten().
|
Flatten().
|
||||||
Do()
|
Do()
|
||||||
|
checkErr(r.Err())
|
||||||
|
|
||||||
patch := cmdutil.GetFlagString(cmd, "patch")
|
patch := cmdutil.GetFlagString(cmd, "patch")
|
||||||
if len(flags.Filenames) == 0 && len(patch) == 0 {
|
if len(flags.Filenames) == 0 && len(patch) == 0 {
|
||||||
|
|
Loading…
Reference in New Issue