Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #979 from dev-gaur/error_capitalization
Browse files Browse the repository at this point in the history
fixed error capitalization
  • Loading branch information
knrt10 authored Sep 17, 2020
2 parents 5f77d53 + 9526a88 commit 9fde1e9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cli/cmd/cluster-apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func runClusterApply(cmd *cobra.Command, args []string) {
}

if err := p.Apply(ex); err != nil {
contextLogger.Fatalf("error applying cluster: %v", err)
contextLogger.Fatalf("Error applying cluster: %v", err)
}

fmt.Printf("\nYour configurations are stored in %s\n", assetDir)
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/cluster-destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func runClusterDestroy(cmd *cobra.Command, args []string) {
}

if err := p.Destroy(ex); err != nil {
contextLogger.Fatalf("error destroying cluster: %v", err)
contextLogger.Fatalf("Error destroying cluster: %v", err)
}

contextLogger.Println("Cluster destroyed successfully")
Expand Down
12 changes: 6 additions & 6 deletions pkg/terraform/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,31 +516,31 @@ func (ex *Executor) logPath(id int) string {
func (ex *Executor) checkVersion() error {
vOutput, err := ex.executeSync("--version")
if err != nil {
return fmt.Errorf("Error checking Terraform version: %w", err)
return fmt.Errorf("checking Terraform version: %w", err)
}

var vStr string
n, err := fmt.Sscanf(string(vOutput), "Terraform v%s\n", &vStr)
if err != nil {
return fmt.Errorf("Error checking Terraform version: %w", err)
return fmt.Errorf("checking Terraform version: %w", err)
}

if n != 1 {
return fmt.Errorf("Parsing Terraform version failed")
return fmt.Errorf("error parsing Terraform version")
}

v, err := version.NewVersion(vStr)
if err != nil {
return fmt.Errorf("Error checking Terraform version: %w", err)
return fmt.Errorf("checking Terraform version: %w", err)
}

constraints, err := version.NewConstraint(requiredVersion)
if err != nil {
return fmt.Errorf("Error checking Terraform version: %w", err)
return fmt.Errorf("checking Terraform version: %w", err)
}

if !constraints.Check(v) {
return fmt.Errorf("Version '%s' of Terraform not supported. Needed %s", v, constraints)
return fmt.Errorf("version '%s' of Terraform not supported. Needed %s", v, constraints)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion test/ingress/packet_test/match_host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func checkIngressHost(client kubernetes.Interface, tc componentTestCase) wait.Co
addr, err := net.LookupIP(ingHost)

if err != nil {
return false, fmt.Errorf("Unknown host: %v", err)
return false, fmt.Errorf("unknown host: %v", err)
}

for _, v := range addr {
Expand Down
2 changes: 1 addition & 1 deletion test/monitoring/components_alerts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func getComponentAlertRetryFunc(t *testing.T, v1api v1.API, tc alertTestCase) wa
}

if !reflect.DeepEqual(rules, tc.Alerts) {
return false, fmt.Errorf("Rules don't match. Expected: %#v and \ngot %#v", tc.Alerts, rules)
return false, fmt.Errorf("rules don't match. Expected: %#v and \ngot %#v", tc.Alerts, rules)
}

return true, nil
Expand Down

0 comments on commit 9fde1e9

Please sign in to comment.