@@ -481,7 +481,7 @@ func TestAddFuseMountOptions(t *testing.T) {
481481 expectErr bool
482482 }{
483483 {
484- name : "validate fuse mount options for host network workloads" ,
484+ name : "identity provider is added in fuse mount options for host network workloads" ,
485485 enableSidecarBucketAccessCheckForVersion : false ,
486486 hostNetworkEnabled : true ,
487487 identityProvider : sampleIdentityProvider ,
@@ -493,7 +493,7 @@ func TestAddFuseMountOptions(t *testing.T) {
493493 },
494494 },
495495 {
496- name : "validate sidecar bucket access check is disabled when host network is enabled " ,
496+ name : "fuse mount options related to sidecar bucket access check are not set for host network" ,
497497 enableSidecarBucketAccessCheckForVersion : true ,
498498 hostNetworkEnabled : true ,
499499 identityProvider : sampleIdentityProvider ,
@@ -505,7 +505,7 @@ func TestAddFuseMountOptions(t *testing.T) {
505505 },
506506 },
507507 {
508- name : "enable sidecar bucket access check on non-host network and validate fuse mount options are correctly set " ,
508+ name : "validate respective fuse mount options for sidecar bucket access check are set when host network is disabled " ,
509509 volumeContextParams : vc ,
510510 enableSidecarBucketAccessCheckForVersion : true ,
511511 identityProvider : sampleIdentityProvider ,
@@ -520,7 +520,7 @@ func TestAddFuseMountOptions(t *testing.T) {
520520 },
521521 },
522522 {
523- name : "verify sidecar bucket access disabled does not set fuse mount options " ,
523+ name : "validate no fuse mount options are added when host network and sidecar bucket check is disabled " ,
524524 volumeContextParams : vc ,
525525 enableSidecarBucketAccessCheckForVersion : false ,
526526 identityProvider : sampleIdentityProvider ,
@@ -529,15 +529,15 @@ func TestAddFuseMountOptions(t *testing.T) {
529529 expectedFuseMountOptions : []string {},
530530 },
531531 {
532- name : "validate cloud profiler flag is correctly set" ,
532+ name : "validate cloud profiler fuse mount option is set when cloud profiler is enabled " ,
533533 enableCloudProfilerForVersion : true ,
534534 inputFuseMountOptions : []string {},
535535 expectedFuseMountOptions : []string {
536536 util .EnableCloudProfilerForSidecarConst + "=true" ,
537537 },
538538 },
539539 {
540- name : "validate sidecar bucket access check when identity provider is not set " ,
540+ name : "missing identity provider should fail when sidecar bucket access check is enabled " ,
541541 volumeContextParams : vc ,
542542 enableSidecarBucketAccessCheckForVersion : true ,
543543 identityProvider : "" ,
@@ -546,7 +546,7 @@ func TestAddFuseMountOptions(t *testing.T) {
546546 expectErr : true ,
547547 },
548548 {
549- name : "validate sidecar bucket access check when identity pool is not set " ,
549+ name : "missing identity pool should fail when sidecar bucket access check is enabled " ,
550550 volumeContextParams : vc ,
551551 enableSidecarBucketAccessCheckForVersion : true ,
552552 identityProvider : sampleIdentityProvider ,
@@ -555,7 +555,7 @@ func TestAddFuseMountOptions(t *testing.T) {
555555 expectErr : true ,
556556 },
557557 {
558- name : "validate cloud profiler with host network " ,
558+ name : "verify fuse mount options are not overwritten when multiple features are enabled " ,
559559 hostNetworkEnabled : true ,
560560 enableCloudProfilerForVersion : true ,
561561 identityProvider : sampleIdentityProvider ,
@@ -565,6 +565,18 @@ func TestAddFuseMountOptions(t *testing.T) {
565565 util .TokenServerIdentityProviderConst + "=" + sampleIdentityProvider ,
566566 },
567567 },
568+ {
569+ name : "verify new mount options are appended to existing fuse mount options" ,
570+ hostNetworkEnabled : true ,
571+ enableCloudProfilerForVersion : true ,
572+ identityProvider : sampleIdentityProvider ,
573+ inputFuseMountOptions : []string {util .EnableCloudProfilerForSidecarConst + "=true" },
574+ expectedFuseMountOptions : []string {
575+ util .EnableCloudProfilerForSidecarConst + "=true" ,
576+ util .OptInHnw + "=true" ,
577+ util .TokenServerIdentityProviderConst + "=" + sampleIdentityProvider ,
578+ },
579+ },
568580 }
569581
570582 for _ , tc := range cases {
0 commit comments