@@ -299,24 +299,26 @@ func urlFlag(target **url.URL, name string, usage string) {
299
299
}
300
300
301
301
func setupDataCache (ctx context.Context , nodeName string ) error {
302
- cfg , err := rest .InClusterConfig ()
303
- if err != nil {
304
- return err
305
- }
306
- kubeClient , err := kubernetes .NewForConfig (cfg )
307
- if err != nil {
308
- return err
309
- }
310
- node , err := kubeClient .CoreV1 ().Nodes ().Get (ctx , nodeName , metav1.GetOptions {})
311
- if err != nil {
312
- // We could retry, but this error will also crashloop the driver which may be as good a way to retry as any.
313
- return err
314
- }
315
- if val , found := node .GetLabels ()[dataCacheLabel ]; ! found || val != dataCacheLabelValue {
316
- klog .V (2 ).Infof ("Datacache not enabled for node %s; node label %s=%s and not %s" , nodeName , dataCacheLabel , val , dataCacheLabelValue )
317
- return nil
302
+ klog .V (2 ).Infof ("Seting up data cache for node %s" , nodeName )
303
+ if nodeName != common .TestNode {
304
+ cfg , err := rest .InClusterConfig ()
305
+ if err != nil {
306
+ return err
307
+ }
308
+ kubeClient , err := kubernetes .NewForConfig (cfg )
309
+ if err != nil {
310
+ return err
311
+ }
312
+ node , err := kubeClient .CoreV1 ().Nodes ().Get (ctx , nodeName , metav1.GetOptions {})
313
+ if err != nil {
314
+ // We could retry, but this error will also crashloop the driver which may be as good a way to retry as any.
315
+ return err
316
+ }
317
+ if val , found := node .GetLabels ()[dataCacheLabel ]; ! found || val != dataCacheLabelValue {
318
+ klog .V (2 ).Infof ("Datacache not enabled for node %s; node label %s=%s and not %s" , nodeName , dataCacheLabel , val , dataCacheLabelValue )
319
+ return nil
320
+ }
318
321
}
319
- // Setup data cache only if enabled fro nodes
320
322
klog .V (2 ).Info ("Raiding local ssds to setup data cache" )
321
323
if err := driver .RaidLocalSsds (); err != nil {
322
324
return fmt .Errorf ("Failed to Raid local SSDs, unable to setup data caching, got error %v" , err )
0 commit comments