diff --git a/nodeup/pkg/model/context.go b/nodeup/pkg/model/context.go index a11c6ca5b6..b61c36b32d 100644 --- a/nodeup/pkg/model/context.go +++ b/nodeup/pkg/model/context.go @@ -567,11 +567,11 @@ func EvaluateHostnameOverride(hostnameOverride string) (string, error) { } if len(result.Reservations) != 1 { - return "", fmt.Errorf("Too many reservations returned for the single instance-id") + return "", fmt.Errorf("too many reservations returned for the single instance-id") } if len(result.Reservations[0].Instances) != 1 { - return "", fmt.Errorf("Too many instances returned for the single instance-id") + return "", fmt.Errorf("too many instances returned for the single instance-id") } return *(result.Reservations[0].Instances[0].PrivateDnsName), nil } diff --git a/nodeup/pkg/model/file_assets.go b/nodeup/pkg/model/file_assets.go index 8de51ded2c..d0e81cb6aa 100644 --- a/nodeup/pkg/model/file_assets.go +++ b/nodeup/pkg/model/file_assets.go @@ -83,7 +83,7 @@ func (f *FileAssetsBuilder) buildFileAssets(c *fi.ModelBuilderContext, assets [] if asset.IsBase64 { decoded, err := base64.RawStdEncoding.DecodeString(content) if err != nil { - return fmt.Errorf("Failed on file asset: %s is invalid, unable to decode base64, error: %q", asset.Name, err) + return fmt.Errorf("failed on file asset: %s is invalid, unable to decode base64, error: %q", asset.Name, err) } content = string(decoded) } diff --git a/nodeup/pkg/model/kube_apiserver.go b/nodeup/pkg/model/kube_apiserver.go index 7f88507a22..ba07eaafa9 100644 --- a/nodeup/pkg/model/kube_apiserver.go +++ b/nodeup/pkg/model/kube_apiserver.go @@ -275,7 +275,7 @@ func (b *KubeAPIServerBuilder) writeAuthenticationConfig(c *fi.ModelBuilderConte return nil } - return fmt.Errorf("Unrecognized authentication config %v", b.Cluster.Spec.Authentication) + return fmt.Errorf("unrecognized authentication config %v", b.Cluster.Spec.Authentication) } // buildPod is responsible for generating the kube-apiserver pod and thus manifest file diff --git a/nodeup/pkg/model/kube_proxy.go b/nodeup/pkg/model/kube_proxy.go index fed47f7a95..09137fe64d 100644 --- a/nodeup/pkg/model/kube_proxy.go +++ b/nodeup/pkg/model/kube_proxy.go @@ -129,7 +129,7 @@ func (b *KubeProxyBuilder) buildPod() (*v1.Pod, error) { cpuRequest, err := resource.ParseQuantity(c.CPURequest) if err != nil { - return nil, fmt.Errorf("Error parsing CPURequest=%q", c.CPURequest) + return nil, fmt.Errorf("error parsing CPURequest=%q", c.CPURequest) } resourceRequests["cpu"] = cpuRequest @@ -137,7 +137,7 @@ func (b *KubeProxyBuilder) buildPod() (*v1.Pod, error) { if c.CPULimit != "" { cpuLimit, err := resource.ParseQuantity(c.CPULimit) if err != nil { - return nil, fmt.Errorf("Error parsing CPULimit=%q", c.CPULimit) + return nil, fmt.Errorf("error parsing CPULimit=%q", c.CPULimit) } resourceLimits["cpu"] = cpuLimit } @@ -145,7 +145,7 @@ func (b *KubeProxyBuilder) buildPod() (*v1.Pod, error) { if c.MemoryRequest != "" { memoryRequest, err := resource.ParseQuantity(c.MemoryRequest) if err != nil { - return nil, fmt.Errorf("Error parsing MemoryRequest=%q", c.MemoryRequest) + return nil, fmt.Errorf("error parsing MemoryRequest=%q", c.MemoryRequest) } resourceRequests["memory"] = memoryRequest } @@ -153,7 +153,7 @@ func (b *KubeProxyBuilder) buildPod() (*v1.Pod, error) { if c.MemoryLimit != "" { memoryLimit, err := resource.ParseQuantity(c.MemoryLimit) if err != nil { - return nil, fmt.Errorf("Error parsing MemoryLimit=%q", c.MemoryLimit) + return nil, fmt.Errorf("error parsing MemoryLimit=%q", c.MemoryLimit) } resourceLimits["memory"] = memoryLimit } diff --git a/nodeup/pkg/model/volumes.go b/nodeup/pkg/model/volumes.go index c63a2aef02..dc8bcbbd63 100644 --- a/nodeup/pkg/model/volumes.go +++ b/nodeup/pkg/model/volumes.go @@ -45,7 +45,7 @@ func (b *VolumesBuilder) Build(c *fi.ModelBuilderContext) error { for _, x := range b.InstanceGroup.Spec.VolumeMounts { // @check the directory exists, else create it if err := b.EnsureDirectory(x.Path); err != nil { - return fmt.Errorf("Failed to ensure the directory: %s, error: %s", x.Path, err) + return fmt.Errorf("failed to ensure the directory: %s, error: %s", x.Path, err) } m := &mount.SafeFormatAndMount{ @@ -64,7 +64,7 @@ func (b *VolumesBuilder) Build(c *fi.ModelBuilderContext) error { klog.Infof("Attempting to format and mount device: %s, path: %s", x.Device, x.Path) if err := m.FormatAndMount(x.Device, x.Path, x.Filesystem, x.MountOptions); err != nil { - klog.Errorf("Failed to mount the device: %s on: %s, error: %s", x.Device, x.Path, err) + klog.Errorf("failed to mount the device: %s on: %s, error: %s", x.Device, x.Path, err) return err } diff --git a/pkg/model/components/context.go b/pkg/model/components/context.go index de88dd7ac2..f096918fdd 100644 --- a/pkg/model/components/context.go +++ b/pkg/model/components/context.go @@ -127,7 +127,7 @@ func WellKnownServiceIP(clusterSpec *kops.ClusterSpec, id int) (net.IP, error) { return serviceIP, nil } - return nil, fmt.Errorf("Unexpected IP address type for ServiceClusterIPRange: %s", clusterSpec.ServiceClusterIPRange) + return nil, fmt.Errorf("unexpected IP address type for ServiceClusterIPRange: %s", clusterSpec.ServiceClusterIPRange) } func IsBaseURL(kubernetesVersion string) bool { diff --git a/pkg/nodeidentity/do/identify.go b/pkg/nodeidentity/do/identify.go index 4d78037cb4..85a109c61a 100644 --- a/pkg/nodeidentity/do/identify.go +++ b/pkg/nodeidentity/do/identify.go @@ -169,5 +169,5 @@ func (i *nodeIdentifier) getInstanceGroup(instanceID int) (string, error) { } } - return "", errors.New("Could not find tag 'kops-instancegroup' from instance metadata") + return "", errors.New("could not find tag 'kops-instancegroup' from instance metadata") } diff --git a/pkg/resources/aws/aws.go b/pkg/resources/aws/aws.go index 750c1a00c4..5277c8d0db 100644 --- a/pkg/resources/aws/aws.go +++ b/pkg/resources/aws/aws.go @@ -267,7 +267,7 @@ func FindAutoscalingLaunchConfiguration(cloud awsup.AWSCloud, name string) (*aut return nil, nil } if len(results) != 1 { - return nil, fmt.Errorf("Found multiple LaunchConfigurations with name %q", name) + return nil, fmt.Errorf("found multiple LaunchConfigurations with name %q", name) } return results[0], nil } @@ -362,7 +362,7 @@ func ListCloudFormationStacks(cloud fi.Cloud, clusterName string) ([]*resources. c := cloud.(awsup.AWSCloud) response, err := c.CloudFormation().ListStacks(request) if err != nil { - return nil, fmt.Errorf("Unable to list CloudFormation stacks: %v", err) + return nil, fmt.Errorf("unable to list CloudFormation stacks: %v", err) } for _, stack := range response.StackSummaries { if *stack.StackName == clusterName { diff --git a/pkg/testutils/modelharness.go b/pkg/testutils/modelharness.go index 0930b241ad..0d094d385c 100644 --- a/pkg/testutils/modelharness.go +++ b/pkg/testutils/modelharness.go @@ -71,7 +71,7 @@ func LoadModel(basedir string) (*Model, error) { spec.InstanceGroups = append(spec.InstanceGroups, v) default: - return nil, fmt.Errorf("Unhandled kind %q", gvk) + return nil, fmt.Errorf("unhandled kind %q", gvk) } } diff --git a/pkg/util/subnet/subnet.go b/pkg/util/subnet/subnet.go index 3f425da9e6..5507990eaa 100644 --- a/pkg/util/subnet/subnet.go +++ b/pkg/util/subnet/subnet.go @@ -61,7 +61,7 @@ func SplitInto8(parent *net.IPNet) ([]*net.IPNet, error) { Mask: net.CIDRMask(networkLength, 32), }) } else { - return nil, fmt.Errorf("Unexpected IP address type: %s", parent) + return nil, fmt.Errorf("unexpected IP address type: %s", parent) } }