Skip to content

Commit

Permalink
Merge pull request #7663 from rifelpet/staticcheck-bugfixes
Browse files Browse the repository at this point in the history
Fix some bugs reported by staticcheck
  • Loading branch information
k8s-ci-robot authored Sep 25, 2019
2 parents badef04 + c8d424d commit ba69006
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 3 additions & 0 deletions nodeup/pkg/model/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,9 @@ func EvaluateHostnameOverride(hostnameOverride string) (string, error) {
result, err := svc.DescribeInstances(&ec2.DescribeInstancesInput{
InstanceIds: []*string{&instanceID},
})
if err != nil {
return "", fmt.Errorf("error describing instances: %v", err)
}

if len(result.Reservations) != 1 {
return "", fmt.Errorf("Too many reservations returned for the single instance-id")
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/kops/validation/gce.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ func gceValidateCluster(c *kops.Cluster) field.ErrorList {
allErrs = append(allErrs, field.Invalid(fieldSpec.Child("Subnets"), strings.Join(regions.List(), ","), "clusters cannot span GCE regions"))
}

return nil
return allErrs
}
8 changes: 0 additions & 8 deletions protokube/cmd/protokube/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,6 @@ func run() error {
if clusterID == "" {
clusterID = osVolumes.ClusterID()
}
} else if cloud == "alicloud" {
klog.Info("Initializing AliCloud volumes")
aliVolumes, err := protokube.NewALIVolumes()
if err != nil {
klog.Errorf("Error initializing Aliyun: %q", err)
os.Exit(1)
}
volumes = aliVolumes
} else if cloud == "alicloud" {
klog.Info("Initializing AliCloud volumes")
aliVolumes, err := protokube.NewALIVolumes()
Expand Down

0 comments on commit ba69006

Please sign in to comment.