Fix casing in error strings

This commit is contained in:
Ole Markus With 2022-12-04 14:17:39 +01:00
parent 27113fd204
commit dc80fc2c63
7 changed files with 8 additions and 8 deletions

View File

@ -210,7 +210,7 @@ func RunCreate(ctx context.Context, f *util.Factory, out io.Writer, c *CreateOpt
default:
klog.V(2).Infof("Type of object was %T", v)
return fmt.Errorf("Unhandled kind %q in %s", gvk, f)
return fmt.Errorf("unhandled kind %q in %s", gvk, f)
}
}
}

View File

@ -842,7 +842,7 @@ func parseCloudLabels(s string) (map[string]string, error) {
r.TrimLeadingSpace = true
kvPairs, err := r.ReadAll()
if err != nil {
return nil, fmt.Errorf("One or more key=value pairs are malformed:\n%s\n:%v", records, err)
return nil, fmt.Errorf("one or more key=value pairs are malformed:\n%s\n:%w", records, err)
}
m := make(map[string]string, len(kvPairs))

View File

@ -84,7 +84,7 @@ func RunGetAll(ctx context.Context, f commandutils.Factory, out io.Writer, optio
}
if cluster == nil {
return fmt.Errorf("No cluster found")
return fmt.Errorf("no cluster found")
}
igList, err := client.InstanceGroupsFor(cluster).List(ctx, metav1.ListOptions{})
@ -157,7 +157,7 @@ func RunGetAll(ctx context.Context, f commandutils.Factory, out io.Writer, optio
}
default:
return fmt.Errorf("Unknown output format: %q", options.Output)
return fmt.Errorf("unknown output format: %q", options.Output)
}
return nil

View File

@ -184,7 +184,7 @@ func RunGetClusters(ctx context.Context, f commandutils.Factory, out io.Writer,
// kops get cluster test.example.com -o json will return a single object (since a specific cluster is selected)
return fullOutputJSON(out, singleClusterSelected, obj...)
default:
return fmt.Errorf("Unknown output format: %q", options.Output)
return fmt.Errorf("unknown output format: %q", options.Output)
}
}

View File

@ -253,7 +253,7 @@ func RunGetKeypairs(ctx context.Context, f commandutils.Factory, out io.Writer,
}
default:
return fmt.Errorf("Unknown output format: %q", options.Output)
return fmt.Errorf("unknown output format: %q", options.Output)
}
return nil

View File

@ -130,7 +130,7 @@ func RunGetSecrets(ctx context.Context, f *util.Factory, out io.Writer, options
}
if len(items) == 0 {
return fmt.Errorf("No secrets found")
return fmt.Errorf("no secrets found")
}
switch options.Output {

View File

@ -87,7 +87,7 @@ func NewCmdValidateCluster(f *util.Factory, out io.Writer) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
result, err := RunValidateCluster(context.TODO(), f, out, options)
if err != nil {
return fmt.Errorf("Validation failed: %v", err)
return fmt.Errorf("validation failed: %v", err)
}
// We want the validate command to exit non-zero if validation found a problem,