mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
Merge pull request #95944 from wangyx1992/error-log-captialize
cleanup: fix some error log capitalization
This commit is contained in:
commit
48fa50fb5e
@ -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)
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user