Skip to content

Commit 00b998a

Browse files
committed
Merge branch 'main' into mrajagopal-nginx-support
2 parents 94cd712 + 48a7660 commit 00b998a

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

cmd/nginx-supportpkg.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ func Execute() {
6363
}
6464

6565
if collector.AllNamespacesExist() {
66+
failedJobs := 0
6667
for _, job := range jobList {
6768
fmt.Printf("Running job %s...", job.Name)
6869
err = job.Collect(collector)
6970
if err != nil {
7071
fmt.Printf(" Error: %s\n", err)
72+
failedJobs++
7173
} else {
7274
fmt.Print(" OK\n")
7375
}
@@ -78,7 +80,13 @@ func Execute() {
7880
fmt.Println(fmt.Errorf("error when wrapping up: %s", err))
7981
os.Exit(1)
8082
} else {
81-
fmt.Printf("Supportpkg successfully generated: %s\n", tarFile)
83+
if failedJobs == 0 {
84+
fmt.Printf("Supportpkg successfully generated: %s\n", tarFile)
85+
} else {
86+
fmt.Printf("WARNING: %d failed job(s)\n", failedJobs)
87+
fmt.Printf("Supportpkg generated with warnings: %s\n", tarFile)
88+
}
89+
8290
}
8391
} else {
8492
fmt.Println(" Error: Some namespaces do not exist")

pkg/jobs/common_job_list.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func CommonJobList() []Job {
5252
},
5353
{
5454
Name: "collect-pods-logs",
55-
Timeout: time.Second * 30,
55+
Timeout: time.Second * 120,
5656
Execute: func(dc *data_collector.DataCollector, ctx context.Context, ch chan JobResult) {
5757
jobResult := JobResult{Files: make(map[string][]byte), Error: nil}
5858
for _, namespace := range dc.Namespaces {

pkg/jobs/job.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (j Job) Collect(dc *data_collector.DataCollector) error {
5050

5151
select {
5252
case <-ctx.Done():
53-
dc.Logger.Printf("\tJob %s has timed out: %s\n", j.Name, ctx.Err())
53+
dc.Logger.Printf("\tJob %s has timed out: %s\n---\n", j.Name, ctx.Err())
5454
return errors.New(fmt.Sprintf("Context cancelled: %v", ctx.Err()))
5555

5656
case jobResults := <-ch:

0 commit comments

Comments
 (0)