WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 316a0d8

Browse files
committed
diagnostics: gofmt -s
1 parent 0a299bf commit 316a0d8

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

pkg/diagnostics/client/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
var Diagnostics = map[string]types.Diagnostic{
14-
"NodeDefinitions": types.Diagnostic{
14+
"NodeDefinitions": {
1515
Description: "Check node records on master",
1616
Condition: func(env *types.Environment) (skip bool, reason string) {
1717
if env.ClusterAdminFactory == nil {
@@ -72,7 +72,7 @@ and any existing scheduled pods will be considered failed and removed.
7272
}
7373
},
7474
},
75-
"ConfigContexts": types.Diagnostic{
75+
"ConfigContexts": {
7676
Description: "Test that client config contexts have no undefined references",
7777
Condition: func(env *types.Environment) (skip bool, reason string) {
7878
if env.ClientConfigRaw == nil {
@@ -85,7 +85,7 @@ and any existing scheduled pods will be considered failed and removed.
8585
current := cc.CurrentContext
8686
ccSuccess := false
8787
var ccResult log.Msg //nil
88-
for context, _ := range cc.Contexts {
88+
for context := range cc.Contexts {
8989
result, success := TestContext(context, cc)
9090
msg := log.Msg{"tmpl": "For client config context '{{.context}}':{{.result}}", "context": context, "result": result}
9191
if context == current {

pkg/diagnostics/run/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
func Diagnose(fl *types.Flags, f *osclientcmd.Factory) {
1515
if env, ok := discovery.Run(fl, f); ok { // discovery result can veto continuing
1616
allDiags := make(map[string]map[string]types.Diagnostic)
17-
for area, _ := range env.WillCheck {
17+
for area := range env.WillCheck {
1818
switch area {
1919
case types.ClientTarget:
2020
allDiags["client"] = client.Diagnostics

pkg/diagnostics/systemd/systemd.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,18 @@ var tlsClientErrorSeen map[string]bool
5757

5858
// Specify what units we can check and what to look for and say about it
5959
var unitLogSpecs = []*unitSpec{
60-
&unitSpec{
60+
{
6161
Name: "openshift-master",
6262
StartMatch: regexp.MustCompile("Starting an OpenShift master"),
6363
LogMatchers: []logMatcher{
6464
badImageTemplate,
65-
logMatcher{
65+
{
6666
Regexp: regexp.MustCompile("Unable to decode an event from the watch stream: local error: unexpected message"),
6767
Level: log.InfoLevel,
6868
Id: "sdLogOMIgnore",
6969
Interpretation: "You can safely ignore this message.",
7070
},
71-
logMatcher{
71+
{
7272
Regexp: regexp.MustCompile("HTTP probe error: Get .*/healthz: dial tcp .*:10250: connection refused"),
7373
Level: log.InfoLevel,
7474
Id: "sdLogOMhzRef",
@@ -79,7 +79,7 @@ Since the master records are typically created before the node is
7979
available, this is not usually a problem, unless it continues in the
8080
logs after the node is actually available.`,
8181
},
82-
logMatcher{
82+
{
8383
// TODO: don't rely on ipv4 format, should be ipv6 "soon"
8484
Regexp: regexp.MustCompile("http: TLS handshake error from ([\\d.]+):\\d+: remote error: bad certificate"),
8585
Level: log.WarnLevel,
@@ -136,7 +136,7 @@ log message:
136136
return true // show once for every client failing to connect, not just the first
137137
},
138138
},
139-
logMatcher{
139+
{
140140
// user &{system:anonymous [system:unauthenticated]} -> /api/v1beta1/services?namespace="
141141
Regexp: regexp.MustCompile("system:anonymous\\W*system:unauthenticated\\W*/api/v1beta1/services\\?namespace="),
142142
Level: log.WarnLevel,
@@ -158,17 +158,17 @@ message for any node with this problem.
158158
},
159159
},
160160
},
161-
&unitSpec{
161+
{
162162
Name: "openshift-sdn-master",
163163
StartMatch: regexp.MustCompile("Starting OpenShift SDN Master"),
164164
LogMatchers: []logMatcher{},
165165
},
166-
&unitSpec{
166+
{
167167
Name: "openshift-node",
168168
StartMatch: regexp.MustCompile("Starting an OpenShift node"),
169169
LogMatchers: []logMatcher{
170170
badImageTemplate,
171-
logMatcher{
171+
{
172172
Regexp: regexp.MustCompile(`error updating node status, will retry:.*system:(\S+) cannot get on minions with name "(\S+)" in default|Failed to list .*Forbidden: "\S+" system:node-\S+ cannot list on (pods|services) in`),
173173
Level: log.ErrorLevel,
174174
Id: "sdLogONnodePerm",
@@ -202,7 +202,7 @@ have been put in place and are blocking this request; check the error
202202
message to see whether the node is attempting to use the wrong node name.
203203
`,
204204
},
205-
logMatcher{
205+
{
206206
Regexp: regexp.MustCompile("Unable to load services: Get (http\\S+/api/v1beta1/services\\?namespace=): (.+)"), // e.g. x509: certificate signed by unknown authority
207207
Level: log.ErrorLevel,
208208
Id: "sdLogONconnMaster",
@@ -212,7 +212,7 @@ to determine its responsibilities. This host will not function as a node
212212
until this is resolved. Pods scheduled for this node will remain in
213213
pending or unknown state forever.`,
214214
},
215-
logMatcher{
215+
{
216216
Regexp: regexp.MustCompile(`Unable to load services: request.*403 Forbidden: Forbidden: "/api/v1beta1/services\?namespace=" denied by default`),
217217
Level: log.ErrorLevel,
218218
Id: "sdLogONMasterForbids",
@@ -230,11 +230,11 @@ scheduled for this node will remain in pending or unknown state forever.`,
230230
},
231231
},
232232
},
233-
&unitSpec{
233+
{
234234
Name: "openshift-sdn-node",
235235
StartMatch: regexp.MustCompile("Starting OpenShift SDN node"),
236236
LogMatchers: []logMatcher{
237-
logMatcher{
237+
{
238238
Regexp: regexp.MustCompile("Could not find an allocated subnet for this minion.*Waiting.."),
239239
Level: log.WarnLevel,
240240
Id: "sdLogOSNnoSubnet",
@@ -261,11 +261,11 @@ Check MASTER_URL in /etc/sysconfig/openshift-sdn-node:
261261
},
262262
},
263263
},
264-
&unitSpec{
264+
{
265265
Name: "docker",
266266
StartMatch: regexp.MustCompile(`Starting Docker Application Container Engine.`), // RHEL Docker at least
267267
LogMatchers: []logMatcher{
268-
logMatcher{
268+
{
269269
Regexp: regexp.MustCompile(`Usage: docker \\[OPTIONS\\] COMMAND`),
270270
Level: log.ErrorLevel,
271271
Id: "sdLogDbadOpt",
@@ -278,7 +278,7 @@ so check there for problems.
278278
279279
The OpenShift node will not work on this host until this is resolved.`,
280280
},
281-
logMatcher{
281+
{
282282
Regexp: regexp.MustCompile(`^Unable to open the database file: unable to open database file$`),
283283
Level: log.ErrorLevel,
284284
Id: "sdLogDopenDB",
@@ -296,7 +296,7 @@ containers will not be deleted):
296296
Whatever the reason, docker will not function in this state.
297297
The OpenShift node will not work on this host until this is resolved.`,
298298
},
299-
logMatcher{
299+
{
300300
Regexp: regexp.MustCompile(`no space left on device$`),
301301
Level: log.ErrorLevel,
302302
Id: "sdLogDfull",
@@ -314,7 +314,7 @@ containers will not be deleted):
314314
315315
The OpenShift node will not work on this host until this is resolved.`,
316316
},
317-
logMatcher{ // generic error seen - do this last
317+
{ // generic error seen - do this last
318318
Regexp: regexp.MustCompile(`\\slevel="fatal"\\s`),
319319
Level: log.ErrorLevel,
320320
Id: "sdLogDfatal",
@@ -324,7 +324,7 @@ so the OpenShift node will not work on this host until it is resolved.`,
324324
},
325325
},
326326
},
327-
&unitSpec{
327+
{
328328
Name: "openvswitch",
329329
StartMatch: regexp.MustCompile("Starting Open vSwitch"),
330330
LogMatchers: []logMatcher{},
@@ -344,7 +344,7 @@ var systemdRelevant = func(env *types.Environment) (skip bool, reason string) {
344344

345345
var Diagnostics = map[string]types.Diagnostic{
346346

347-
"AnalyzeLogs": types.Diagnostic{
347+
"AnalyzeLogs": {
348348
Description: "Check for problems in systemd service logs since each service last started",
349349
Condition: systemdRelevant,
350350
Run: func(env *types.Environment) {
@@ -357,7 +357,7 @@ var Diagnostics = map[string]types.Diagnostic{
357357
},
358358
},
359359

360-
"UnitStatus": types.Diagnostic{
360+
"UnitStatus": {
361361
Description: "Check status for OpenShift-related systemd units",
362362
Condition: systemdRelevant,
363363
Run: func(env *types.Environment) {

0 commit comments

Comments
 (0)