diff --git a/apis/opts/diskquota.go b/apis/opts/diskquota.go index 99bd61987..929d54994 100644 --- a/apis/opts/diskquota.go +++ b/apis/opts/diskquota.go @@ -11,7 +11,7 @@ func ParseDiskQuota(quotas []string) (map[string]string, error) { for _, quota := range quotas { if quota == "" { - return nil, fmt.Errorf("invalid format for disk quota: %s", quota) + return nil, fmt.Errorf("invalid format for disk quota: quota cannot be empty string") } parts := strings.Split(quota, "=") diff --git a/apis/opts/diskquota_test.go b/apis/opts/diskquota_test.go index 500fa8753..873bd4e7e 100644 --- a/apis/opts/diskquota_test.go +++ b/apis/opts/diskquota_test.go @@ -19,7 +19,8 @@ func TestParseDiskQuota(t *testing.T) { {name: "test1", args: args{diskquota: []string{""}}, want: nil, wantErr: true}, {name: "test2", args: args{diskquota: []string{"foo=foo=foo"}}, want: nil, wantErr: true}, {name: "test3", args: args{diskquota: []string{"foo"}}, want: map[string]string{"/": "foo"}, wantErr: false}, - {name: "test3", args: args{diskquota: []string{"foo=foo"}}, want: map[string]string{"foo": "foo"}, wantErr: false}, + {name: "test4", args: args{diskquota: []string{"foo=foo"}}, want: map[string]string{"foo": "foo"}, wantErr: false}, + {name: "test5", args: args{diskquota: []string{"foo=foo", "bar=bar"}}, want: map[string]string{"foo": "foo", "bar": "bar"}, wantErr: false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {