Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions cmd/gce-pd-csi-driver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,12 @@ func handle() {
if nodeName == nil || *nodeName == "" {
klog.Errorf("Data Cache enabled, but --node-name not passed")
}
if err := setupDataCache(ctx, *nodeName, nodeServer.MetadataService.GetName()); err != nil {
klog.Errorf("DataCache setup failed: %v", err)
if nsArgs.DataCacheEnabledNodePool {
if err := setupDataCache(ctx, *nodeName, nodeServer.MetadataService.GetName()); err != nil {
klog.Errorf("Data Cache setup failed: %v", err)
}
go driver.StartWatcher(*nodeName)
}
go driver.StartWatcher(*nodeName)
}
}

Expand Down Expand Up @@ -346,9 +348,11 @@ func urlFlag(target **url.URL, name string, usage string) {
}

func isDataCacheEnabledNodePool(ctx context.Context, nodeName string) bool {
dataCacheLSSDCount, err := driver.GetDataCacheCountFromNodeLabel(ctx, nodeName)
if err != nil || dataCacheLSSDCount == 0 {
return false
if nodeName != common.TestNode { // disregard logic below when E2E testing.
dataCacheLSSDCount, err := driver.GetDataCacheCountFromNodeLabel(ctx, nodeName)
if err != nil || dataCacheLSSDCount == 0 {
return false
}
}
return true
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/gce-pd-csi-driver/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ func createVg(volumeGroupName string, raidedLocalSsds string) error {
}

func reduceVolumeGroup(volumeGroupName string, force bool) {
if !checkVgExists(volumeGroupName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a log here "Volume group %s not found, no further action needed"

klog.V(2).Infof("Volume group %v not found, no further action needed", volumeGroupName)
return
}
args := []string{
"--removemissing",
volumeGroupName,
Expand Down