Skip to content

Commit 7403e39

Browse files
Merge pull request #703 from replicatedhq/xav/gofmt
run make fmt across repo
2 parents 91c387b + 92382e6 commit 7403e39

File tree

14 files changed

+63
-65
lines changed

14 files changed

+63
-65
lines changed

pkg/analyze/common_status.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package analyzer
22

33
import (
4-
"strconv"
5-
"strings"
64
"fmt"
75
"github.com/pkg/errors"
86
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
7+
"strconv"
8+
"strings"
99
)
1010

1111
func commonStatus(outcomes []*troubleshootv1beta2.Outcome, name string, iconKey string, iconURI string, readyReplicas int, exists bool, resourceType string) (*AnalyzeResult, error) {
@@ -36,7 +36,7 @@ func commonStatus(outcomes []*troubleshootv1beta2.Outcome, name string, iconKey
3636
return result, nil
3737
}
3838

39-
if outcome.Fail.When == "absent" {
39+
if outcome.Fail.When == "absent" {
4040
if exists == false {
4141
result.IsFail = true
4242
result.Message = outcome.Fail.Message

pkg/analyze/deployment_status_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func Test_deploymentStatus(t *testing.T) {
2121
Outcomes: []*troubleshootv1beta2.Outcome{
2222
{
2323
Fail: &troubleshootv1beta2.SingleOutcome{
24-
When: "absent",
24+
When: "absent",
2525
Message: "fail",
2626
},
2727
},
@@ -33,14 +33,14 @@ func Test_deploymentStatus(t *testing.T) {
3333
},
3434
},
3535
Namespace: "default",
36-
Name: "nonexistant-deployment",
36+
Name: "nonexistant-deployment",
3737
},
3838
expectResult: []*AnalyzeResult{
3939
{
40-
IsPass: false,
41-
IsWarn: false,
42-
IsFail: true,
43-
Title: "nonexistant-deployment Status",
40+
IsPass: false,
41+
IsWarn: false,
42+
IsFail: true,
43+
Title: "nonexistant-deployment Status",
4444
Message: "fail",
4545
IconKey: "kubernetes_deployment_status",
4646
IconURI: "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17",
@@ -58,7 +58,7 @@ func Test_deploymentStatus(t *testing.T) {
5858
Outcomes: []*troubleshootv1beta2.Outcome{
5959
{
6060
Fail: &troubleshootv1beta2.SingleOutcome{
61-
When: "absent",
61+
When: "absent",
6262
Message: "fail",
6363
},
6464
},
@@ -100,7 +100,7 @@ func Test_deploymentStatus(t *testing.T) {
100100
Outcomes: []*troubleshootv1beta2.Outcome{
101101
{
102102
Fail: &troubleshootv1beta2.SingleOutcome{
103-
When: "absent",
103+
When: "absent",
104104
Message: "fail",
105105
},
106106
},
@@ -142,7 +142,7 @@ func Test_deploymentStatus(t *testing.T) {
142142
Outcomes: []*troubleshootv1beta2.Outcome{
143143
{
144144
Fail: &troubleshootv1beta2.SingleOutcome{
145-
When: "absent",
145+
When: "absent",
146146
Message: "fail",
147147
},
148148
},

pkg/analyze/host_kernel_modules.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ func (a *AnalyzeHostKernelModules) IsExcluded() (bool, error) {
4040
// - a default fail will only trigger if there are no matching non-default pass outcomes.
4141
// - a default warn will only trigger if there are no matching non-default pass or fail outcomes.
4242
// - a default pass will only trigger if there are no matching non-default fail outcomes.
43-
//
4443
func (a *AnalyzeHostKernelModules) Analyze(getCollectedFileContents func(string) ([]byte, error)) ([]*AnalyzeResult, error) {
4544
hostAnalyzer := a.hostAnalyzer
4645
contents, err := getCollectedFileContents(collect.HostKernelModulesPath)

pkg/analyze/longhorn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ func longhorn(analyzer *troubleshootv1beta2.LonghornAnalyze, getCollectedFileCon
133133
// Check Volume replicas
134134
if volume.Spec.NumberOfReplicas < 2 {
135135
result := &AnalyzeResult{
136-
Title: "Longhorn volume with low replicas",
137-
IsWarn: true,
136+
Title: "Longhorn volume with low replicas",
137+
IsWarn: true,
138138
Message: fmt.Sprintf("Longhorn volume %s has less than two replicas, this could lead to issues with volume availability", volume.Name),
139139
}
140140
results = append(results, result)

pkg/analyze/statefulset_status_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func Test_analyzeStatefulsetStatus(t *testing.T) {
2121
Outcomes: []*troubleshootv1beta2.Outcome{
2222
{
2323
Fail: &troubleshootv1beta2.SingleOutcome{
24-
When: "absent",
24+
When: "absent",
2525
Message: "fail",
2626
},
2727
},
@@ -33,21 +33,21 @@ func Test_analyzeStatefulsetStatus(t *testing.T) {
3333
},
3434
},
3535
Namespace: "default",
36-
Name: "nonexistant",
36+
Name: "nonexistant",
3737
},
3838
expectResult: []*AnalyzeResult{
3939
{
40-
IsPass: false,
41-
IsWarn: false,
42-
IsFail: true,
43-
Title: "nonexistant Status",
40+
IsPass: false,
41+
IsWarn: false,
42+
IsFail: true,
43+
Title: "nonexistant Status",
4444
Message: "fail",
4545
IconKey: "kubernetes_statefulset_status",
4646
IconURI: "https://troubleshoot.sh/images/analyzer-icons/statefulset-status.svg?w=23&h=14",
4747
},
4848
},
4949
files: map[string][]byte{
50-
"cluster-resources/statefulsets/default.json": []byte(defaultStatefulSets),
50+
"cluster-resources/statefulsets/default.json": []byte(defaultStatefulSets),
5151
},
5252
},
5353
{

pkg/client/troubleshootclientset/fake/register.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/troubleshootclientset/scheme/register.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/collect/cluster_resources.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ func ClusterResources(c *Collector, clusterResourcesCollector *troubleshootv1bet
185185
}
186186
output.SaveResult(c.BundlePath, "cluster-resources/network-policy-errors.json", marshalErrors(networkPolicyErrors))
187187

188-
189188
// storage classes
190189
storageClasses, storageErrors := storageClasses(ctx, client)
191190
output.SaveResult(c.BundlePath, "cluster-resources/storage-classes.json", bytes.NewBuffer(storageClasses))

pkg/collect/copy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"k8s.io/client-go/tools/remotecommand"
2020
)
2121

22-
//Copy function gets a file or folder from a container specified in the specs.
22+
// Copy function gets a file or folder from a container specified in the specs.
2323
func Copy(c *Collector, copyCollector *troubleshootv1beta2.Copy) (CollectorResult, error) {
2424
client, err := kubernetes.NewForConfig(c.ClientConfig)
2525
if err != nil {

pkg/collect/host_kernel_modules.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ func (c *CollectHostKernelModules) IsExcluded() (bool, error) {
6060
// Collect the kernel module status from the host. Modules are returned as a
6161
// map keyed on the module name used by the kernel, e.g:
6262
//
63-
// {
64-
// "system/kernel_modules.json": {
65-
// ...
66-
// "dm_snapshot": {
67-
// "instances": 8,
68-
// "size": 45056,
69-
// "status": "loaded"
70-
// },
71-
// ...
72-
// },
73-
// }
63+
// {
64+
// "system/kernel_modules.json": {
65+
// ...
66+
// "dm_snapshot": {
67+
// "instances": 8,
68+
// "size": 45056,
69+
// "status": "loaded"
70+
// },
71+
// ...
72+
// },
73+
// }
7474
//
7575
// Module status may be: loaded, loadable, loading, unloading or unknown. When
7676
// a module is loaded, it may have one or more instances. The size represents

0 commit comments

Comments
 (0)