error strings should not be capitalized
Signed-off-by: Zechun Chen <zechun.chen@daocloud.io>
This commit is contained in:
parent
4b80a2be96
commit
39bac0dbef
@ -65,12 +65,12 @@ var runCommand = cli.Command{
|
||||
|
||||
spec, err := os.ReadFile(context.Args().First())
|
||||
if err != nil {
|
||||
return fmt.Errorf("Failed to read sandbox config: %w", err)
|
||||
return fmt.Errorf("failed to read sandbox config: %w", err)
|
||||
}
|
||||
|
||||
ociSpec := oci.Spec{}
|
||||
if err = json.Unmarshal(spec, &ociSpec); err != nil {
|
||||
return fmt.Errorf("Failed to parse sandbox config: %w", err)
|
||||
return fmt.Errorf("failed to parse sandbox config: %w", err)
|
||||
}
|
||||
|
||||
client, ctx, cancel, err := commands.NewClient(context)
|
||||
|
@ -57,16 +57,16 @@ func getContextWithCancel() (context.Context, context.CancelFunc) {
|
||||
// verifySandboxStatus verified whether all required fields are set in PodSandboxStatus.
|
||||
func verifySandboxStatus(status *runtimeapi.PodSandboxStatus) error {
|
||||
if status.Id == "" {
|
||||
return fmt.Errorf("Id is not set")
|
||||
return fmt.Errorf("id is not set")
|
||||
}
|
||||
|
||||
if status.Metadata == nil {
|
||||
return fmt.Errorf("Metadata is not set")
|
||||
return fmt.Errorf("metadata is not set")
|
||||
}
|
||||
|
||||
metadata := status.Metadata
|
||||
if metadata.Name == "" || metadata.Namespace == "" || metadata.Uid == "" {
|
||||
return fmt.Errorf("Name, Namespace or Uid is not in metadata %q", metadata)
|
||||
return fmt.Errorf("name, namespace or uid is not in metadata %q", metadata)
|
||||
}
|
||||
|
||||
if status.CreatedAt == 0 {
|
||||
@ -79,16 +79,16 @@ func verifySandboxStatus(status *runtimeapi.PodSandboxStatus) error {
|
||||
// verifyContainerStatus verified whether all required fields are set in ContainerStatus.
|
||||
func verifyContainerStatus(status *runtimeapi.ContainerStatus) error {
|
||||
if status.Id == "" {
|
||||
return fmt.Errorf("Id is not set")
|
||||
return fmt.Errorf("id is not set")
|
||||
}
|
||||
|
||||
if status.Metadata == nil {
|
||||
return fmt.Errorf("Metadata is not set")
|
||||
return fmt.Errorf("metadata is not set")
|
||||
}
|
||||
|
||||
metadata := status.Metadata
|
||||
if metadata.Name == "" {
|
||||
return fmt.Errorf("Name is not in metadata %q", metadata)
|
||||
return fmt.Errorf("name is not in metadata %q", metadata)
|
||||
}
|
||||
|
||||
if status.CreatedAt == 0 {
|
||||
@ -96,7 +96,7 @@ func verifyContainerStatus(status *runtimeapi.ContainerStatus) error {
|
||||
}
|
||||
|
||||
if status.Image == nil || status.Image.Image == "" {
|
||||
return fmt.Errorf("Image is not set")
|
||||
return fmt.Errorf("image is not set")
|
||||
}
|
||||
|
||||
if status.ImageRef == "" {
|
||||
|
@ -32,7 +32,7 @@ import (
|
||||
|
||||
var (
|
||||
// ErrEmptyPrefix is an error returned if the prefix was empty.
|
||||
ErrEmptyPrefix = errors.New("Prefix can't be empty")
|
||||
ErrEmptyPrefix = errors.New("prefix can't be empty")
|
||||
|
||||
// ErrIllegalChar is returned when a space is in the ID
|
||||
ErrIllegalChar = errors.New("illegal character: ' '")
|
||||
|
@ -49,7 +49,7 @@ func init() {
|
||||
|
||||
localClient, ok := i.(*Local)
|
||||
if !ok {
|
||||
return nil, errors.New("Could not create a local client for introspection service")
|
||||
return nil, errors.New("could not create a local client for introspection service")
|
||||
}
|
||||
localClient.UpdateLocal(ic.Root)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user