Skip to content

Commit 65e48f2

Browse files
committed
capacity: reject storage kind if capacity tracking is disabled
The parameter becomes invalid when the driver is not configured to have different storage kinds.
1 parent 95a8291 commit 65e48f2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/hostpath/hostpath.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ func (hp *hostPath) createVolume(volID, name string, cap int64, volAccessType ac
286286
}
287287
}()
288288
kind = actualKind
289+
} else if kind != "" {
290+
return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("capacity tracking disabled, specifying kind %q is invalid", kind))
289291
}
290292

291293
path := getVolumePath(volID)

0 commit comments

Comments
 (0)