Skip to content

Commit

Permalink
capacity: reject storage kind if capacity tracking is disabled
Browse files Browse the repository at this point in the history
The parameter becomes invalid when the driver is not configured
to have different storage kinds.
  • Loading branch information
pohly committed Feb 22, 2021
1 parent d4005cf commit 86b2ad1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/hostpath/hostpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ func (hp *hostPath) createVolume(volID, name string, cap int64, volAccessType ac
}
}()
kind = actualKind
} else if kind != "" {
return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("capacity tracking disabled, specifying kind %q is invalid", kind))
}

path := getVolumePath(volID)
Expand Down

0 comments on commit 86b2ad1

Please sign in to comment.