@@ -40,7 +40,6 @@ import (
40
40
"sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/common"
41
41
gce "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/compute"
42
42
"sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/metrics"
43
- "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/nodelabels"
44
43
)
45
44
46
45
type GCEControllerServer struct {
@@ -123,12 +122,10 @@ type GCEControllerServer struct {
123
122
csi.UnimplementedControllerServer
124
123
125
124
EnableDiskTopology bool
126
- LabelVerifier * nodelabels.Verifier
127
125
}
128
126
129
127
type GCEControllerServerArgs struct {
130
128
EnableDiskTopology bool
131
- LabelVerifier * nodelabels.Verifier
132
129
}
133
130
134
131
type MultiZoneVolumeHandleConfig struct {
@@ -2431,14 +2428,7 @@ func (gceCS *GCEControllerServer) generateCreateVolumeResponseWithVolumeId(disk
2431
2428
}
2432
2429
2433
2430
if gceCS .EnableDiskTopology {
2434
- klog .V (4 ).Infof ("Verifying disk support labels on cluster nodes before adding disk support topology" )
2435
- addDiskSupportTopology , err := gceCS .allNodesHaveDiskSupportLabel ()
2436
- if err != nil {
2437
- return nil , fmt .Errorf ("failed to check if all nodes have disk support label: %w" , err )
2438
- }
2439
- if addDiskSupportTopology {
2440
- top .Segments [common .TopologyLabelKey (params .DiskType )] = "true"
2441
- }
2431
+ top .Segments [common .TopologyLabelKey (params .DiskType )] = "true"
2442
2432
}
2443
2433
2444
2434
tops = append (tops , top )
@@ -2498,21 +2488,13 @@ func (gceCS *GCEControllerServer) generateCreateVolumeResponseWithVolumeId(disk
2498
2488
return createResp , nil
2499
2489
}
2500
2490
2501
- func (gceCS * GCEControllerServer ) allNodesHaveDiskSupportLabel () (bool , error ) {
2502
- allNodesHaveDiskSupportLabel , err := gceCS .LabelVerifier .AllNodesHaveDiskSupportLabel ()
2503
- if err != nil {
2504
- return false , fmt .Errorf ("failed to check if all nodes have disk support label: %w" , err )
2505
- }
2506
- return allNodesHaveDiskSupportLabel , nil
2507
- }
2508
-
2509
2491
func getResourceId (resourceLink string ) (string , error ) {
2510
2492
url , err := neturl .Parse (resourceLink )
2511
2493
if err != nil {
2512
- return "" , fmt .Errorf ("Could not parse resource %s: %w" , resourceLink , err )
2494
+ return "" , fmt .Errorf ("could not parse resource %s: %w" , resourceLink , err )
2513
2495
}
2514
2496
if url .Scheme != resourceApiScheme {
2515
- return "" , fmt .Errorf ("Unexpected API scheme for resource %s" , resourceLink )
2497
+ return "" , fmt .Errorf ("unexpected API scheme for resource %s" , resourceLink )
2516
2498
}
2517
2499
2518
2500
// Note that the resource host can basically be anything, if we are running in
@@ -2521,16 +2503,16 @@ func getResourceId(resourceLink string) (string, error) {
2521
2503
// The path should be /compute/VERSION/project/....
2522
2504
elts := strings .Split (url .Path , "/" )
2523
2505
if len (elts ) < 4 {
2524
- return "" , fmt .Errorf ("Short resource path %s" , resourceLink )
2506
+ return "" , fmt .Errorf ("short resource path %s" , resourceLink )
2525
2507
}
2526
2508
if elts [1 ] != resourceApiService {
2527
- return "" , fmt .Errorf ("Bad resource service %s in %s" , elts [1 ], resourceLink )
2509
+ return "" , fmt .Errorf ("bad resource service %s in %s" , elts [1 ], resourceLink )
2528
2510
}
2529
2511
if _ , ok := validResourceApiVersions [elts [2 ]]; ! ok {
2530
- return "" , fmt .Errorf ("Bad version %s in %s" , elts [2 ], resourceLink )
2512
+ return "" , fmt .Errorf ("bad version %s in %s" , elts [2 ], resourceLink )
2531
2513
}
2532
2514
if elts [3 ] != resourceProject {
2533
- return "" , fmt .Errorf ("Expected %v to start with %s in resource %s" , elts [3 :], resourceProject , resourceLink )
2515
+ return "" , fmt .Errorf ("expected %v to start with %s in resource %s" , elts [3 :], resourceProject , resourceLink )
2534
2516
}
2535
2517
return strings .Join (elts [3 :], "/" ), nil
2536
2518
}
0 commit comments