Skip to content
Open
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
6 changes: 5 additions & 1 deletion provisioner/ibm-s3fs-provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,13 @@ func (p *IBMS3fsProvisioner) Provision(ctx context.Context, options controller.P
sc.UseXattr = pvc.UseXattr
}

if pvc.DebugLevel != "" {
if pvc.DebugLevel != nil && pvc.DebugLevel != "" {
sc.DebugLevel = pvc.DebugLevel
}
if sc.DebugLevel == "" {
// Give a default of 'warn' vs. making s3fs-fuse error out with dbglevel=""
sc.DebugLevel = "warn"
}

if pvc.CurlDebug {
sc.CurlDebug = pvc.CurlDebug
Expand Down
9 changes: 9 additions & 0 deletions provisioner/ibm-s3fs-provisioner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,15 @@ func Test_Provision_PVCAnnotations_DebugLevel(t *testing.T) {
assert.Equal(t, "info", pv.Spec.FlexVolume.Options[optionDebugLevel])
}

func Test_Provision_PVCAnnotations_Preserve_SC_DebugLevel(t *testing.T) {
p := getProvisioner()
v := getVolumeOptions()
v.StorageClass.Parameters["ibm.io/debug-level"] = "info"
pv, _, err := p.Provision(context.Background(), v)
assert.NoError(t, err)
assert.Equal(t, "info", pv.Spec.FlexVolume.Options[optionDebugLevel])
}

func Test_Provision_PVCAnnotations_CurlDebug(t *testing.T) {
p := getProvisioner()
v := getVolumeOptions()
Expand Down