File tree 3 files changed +11
-3
lines changed
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,13 @@ func Execute() {
63
63
}
64
64
65
65
if collector .AllNamespacesExist () {
66
+ failedJobs := 0
66
67
for _ , job := range jobList {
67
68
fmt .Printf ("Running job %s..." , job .Name )
68
69
err = job .Collect (collector )
69
70
if err != nil {
70
71
fmt .Printf (" Error: %s\n " , err )
72
+ failedJobs ++
71
73
} else {
72
74
fmt .Print (" OK\n " )
73
75
}
@@ -78,7 +80,13 @@ func Execute() {
78
80
fmt .Println (fmt .Errorf ("error when wrapping up: %s" , err ))
79
81
os .Exit (1 )
80
82
} 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
+
82
90
}
83
91
} else {
84
92
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