@@ -132,7 +132,7 @@ func (v *versionChecker) Act(ctx context.Context, cluster *resource.Cluster, log
132132 log .Error (err , "failed to reconcile job" )
133133 return err
134134 }
135- log .Error (err , "failed to reconcile job only err: " , err . Error () )
135+ log .Error (err , "failed to reconcile job only error" )
136136 return err
137137 }
138138
@@ -184,11 +184,15 @@ func (v *versionChecker) Act(ctx context.Context, cluster *resource.Cluster, log
184184 }
185185 return errors .Wrapf (err , "failed to check the version of the crdb" )
186186 }
187+
188+ // Tail only last two lines as one line contains version info and one line has newline character. It is much faster.
189+ podLines := int64 (2 )
187190 podLogOpts := corev1.PodLogOptions {
188191 Container : resource .JobContainerName ,
192+ TailLines : & podLines ,
189193 }
190- //get pod for the job we created
191194
195+ //get pod for the job we created
192196 pods , err := v .clientset .CoreV1 ().Pods (job .Namespace ).List (ctx , metav1.ListOptions {
193197 LabelSelector : labels .Set (job .Spec .Selector .MatchLabels ).AsSelector ().String (),
194198 })
@@ -231,11 +235,12 @@ func (v *versionChecker) Act(ctx context.Context, cluster *resource.Cluster, log
231235 }
232236 output := buf .String ()
233237
238+ log .Info ("Logs of version checker pod" , "log" , output )
234239 // This is the value from Build Tag taken from the container
235240 calVersion = strings .Replace (output , "\n " , "" , - 1 )
236- // if no image is retrieved we exit
241+ // if no logs are found we will retry later to fetch the logs
237242 if calVersion == "" {
238- err := PermanentErr {Err : errors .New ("failed to check the version of the cluster" )}
243+ err := NotReadyErr {Err : errors .New ("failed to check the version of the cluster" )}
239244 log .Error (err , "crdb version not found" )
240245 return err
241246 }
0 commit comments