Merge pull request #95944 from wangyx1992/error-log-captialize

cleanup: fix some error log capitalization
This commit is contained in:
Kubernetes Prow Robot 2020-11-04 13:25:21 -08:00 committed by GitHub
commit 48fa50fb5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 14 deletions

View File

@ -102,7 +102,7 @@ func parseEndpoint(endpoint string) (string, string, error) {
}
return "npipe", fmt.Sprintf("//%s%s", host, u.Path), nil
} else if u.Scheme == "" {
return "", "", fmt.Errorf("Using %q as endpoint is deprecated, please consider using full url format", endpoint)
return "", "", fmt.Errorf("using %q as endpoint is deprecated, please consider using full url format", endpoint)
} else {
return u.Scheme, "", fmt.Errorf("protocol %q not supported", u.Scheme)
}

View File

@ -41,20 +41,20 @@ 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("status.Id is not set")
}
if status.Metadata == nil {
return fmt.Errorf("Metadata is not set")
return fmt.Errorf("status.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("metadata.Name, metadata.Namespace or metadata.Uid is not in metadata %q", metadata)
}
if status.CreatedAt == 0 {
return fmt.Errorf("CreatedAt is not set")
return fmt.Errorf("status.CreatedAt is not set")
}
return nil
@ -63,28 +63,28 @@ 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("status.Id is not set")
}
if status.Metadata == nil {
return fmt.Errorf("Metadata is not set")
return fmt.Errorf("status.Metadata is not set")
}
metadata := status.Metadata
if metadata.Name == "" {
return fmt.Errorf("Name is not in metadata %q", metadata)
return fmt.Errorf("metadata.Name is not in metadata %q", metadata)
}
if status.CreatedAt == 0 {
return fmt.Errorf("CreatedAt is not set")
return fmt.Errorf("status.CreatedAt is not set")
}
if status.Image == nil || status.Image.Image == "" {
return fmt.Errorf("Image is not set")
return fmt.Errorf("status.Image is not set")
}
if status.ImageRef == "" {
return fmt.Errorf("ImageRef is not set")
return fmt.Errorf("status.ImageRef is not set")
}
return nil

View File

@ -291,7 +291,7 @@ func (pvs PersistentVolumeLister) Get(pvID string) (*v1.PersistentVolume, error)
return &pv, nil
}
}
return nil, fmt.Errorf("Unable to find persistent volume: %s", pvID)
return nil, fmt.Errorf("unable to find persistent volume: %s", pvID)
}
// List lists all PersistentVolumes in the indexer.
@ -311,7 +311,7 @@ func (classes StorageClassLister) Get(name string) (*storagev1.StorageClass, err
return &sc, nil
}
}
return nil, fmt.Errorf("Unable to find storage class: %s", name)
return nil, fmt.Errorf("unable to find storage class: %s", name)
}
// List lists all StorageClass in the indexer.

View File

@ -68,7 +68,7 @@ func ParseFileSource(source string) (keyName, filePath string, err error) {
case numSeparators == 1 && strings.HasSuffix(source, "="):
return "", "", fmt.Errorf("file path for key name %v missing", strings.TrimSuffix(source, "="))
case numSeparators > 1:
return "", "", errors.New("Key names or file paths cannot contain '='")
return "", "", errors.New("key names or file paths cannot contain '='")
default:
components := strings.Split(source, "=")
return components[0], components[1], nil