File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -60,11 +60,13 @@ func Execute() {
60
60
}
61
61
62
62
if collector .AllNamespacesExist () {
63
+ failedJobs := 0
63
64
for _ , job := range jobList {
64
65
fmt .Printf ("Running job %s..." , job .Name )
65
66
err = job .Collect (collector )
66
67
if err != nil {
67
68
fmt .Printf (" Error: %s\n " , err )
69
+ failedJobs ++
68
70
} else {
69
71
fmt .Print (" OK\n " )
70
72
}
@@ -75,7 +77,13 @@ func Execute() {
75
77
fmt .Println (fmt .Errorf ("error when wrapping up: %s" , err ))
76
78
os .Exit (1 )
77
79
} else {
78
- fmt .Printf ("Supportpkg successfully generated: %s\n " , tarFile )
80
+ if failedJobs == 0 {
81
+ fmt .Printf ("Supportpkg successfully generated: %s\n " , tarFile )
82
+ } else {
83
+ fmt .Printf ("WARNING: %d failed job(s)\n " , failedJobs )
84
+ fmt .Printf ("Supportpkg generated with warnings: %s\n " , tarFile )
85
+ }
86
+
79
87
}
80
88
} else {
81
89
fmt .Println (" Error: Some namespaces do not exist" )
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ func CommonJobList() []Job {
52
52
},
53
53
{
54
54
Name : "collect-pods-logs" ,
55
- Timeout : time .Second * 30 ,
55
+ Timeout : time .Second * 120 ,
56
56
Execute : func (dc * data_collector.DataCollector , ctx context.Context , ch chan JobResult ) {
57
57
jobResult := JobResult {Files : make (map [string ][]byte ), Error : nil }
58
58
for _ , namespace := range dc .Namespaces {
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ func (j Job) Collect(dc *data_collector.DataCollector) error {
50
50
51
51
select {
52
52
case <- ctx .Done ():
53
- dc .Logger .Printf ("\t Job %s has timed out: %s\n " , j .Name , ctx .Err ())
53
+ dc .Logger .Printf ("\t Job %s has timed out: %s\n --- \n " , j .Name , ctx .Err ())
54
54
return errors .New (fmt .Sprintf ("Context cancelled: %v" , ctx .Err ()))
55
55
56
56
case jobResults := <- ch :
You can’t perform that action at this time.
0 commit comments