@@ -81,7 +81,7 @@ func (c *CollectLogs) CollectWithClient(progressChan chan<- interface{}, client
81
81
}
82
82
83
83
for _ , containerName := range containerNames {
84
- podLogs , err := savePodLogs (ctx , c .BundlePath , client , & pod , c .Collector .Name , containerName , c .Collector .Limits , false , true )
84
+ podLogs , err := savePodLogs (ctx , c .BundlePath , client , & pod , c .Collector .Name , containerName , c .Collector .Limits , false , true , c . Collector . Timestamps )
85
85
if err != nil {
86
86
if errors .Is (err , context .DeadlineExceeded ) {
87
87
klog .Errorf ("Pod logs timed out for pod %s and container %s: %v" , pod .Name , containerName , err )
@@ -100,7 +100,7 @@ func (c *CollectLogs) CollectWithClient(progressChan chan<- interface{}, client
100
100
}
101
101
} else {
102
102
for _ , containerName := range c .Collector .ContainerNames {
103
- containerLogs , err := savePodLogs (ctx , c .BundlePath , client , & pod , c .Collector .Name , containerName , c .Collector .Limits , false , true )
103
+ containerLogs , err := savePodLogs (ctx , c .BundlePath , client , & pod , c .Collector .Name , containerName , c .Collector .Limits , false , true , c . Collector . Timestamps )
104
104
if err != nil {
105
105
if errors .Is (err , context .DeadlineExceeded ) {
106
106
klog .Errorf ("Pod logs timed out for pod %s and container %s: %v" , pod .Name , containerName , err )
@@ -144,10 +144,12 @@ func savePodLogs(
144
144
limits * troubleshootv1beta2.LogLimits ,
145
145
follow bool ,
146
146
createSymLinks bool ,
147
+ timestamps bool ,
147
148
) (CollectorResult , error ) {
148
149
podLogOpts := corev1.PodLogOptions {
149
- Follow : follow ,
150
- Container : container ,
150
+ Follow : follow ,
151
+ Container : container ,
152
+ Timestamps : timestamps ,
151
153
}
152
154
153
155
result := NewResult ()
0 commit comments