Merge pull request #79851 from jparklab/master

Fix nil pointer dereference error in volume_stat_calculator
This commit is contained in:
Kubernetes Prow Robot
2019-07-25 14:33:58 -07:00
committed by GitHub
3 changed files with 57 additions and 2 deletions

View File

@@ -35,7 +35,16 @@ func NewNotSupportedError() *MetricsError {
}
}
// NewNoPathDefined creates a new MetricsError with code NoPathDefined.
// NewNotSupportedErrorWithDriverName creates a new MetricsError with code NotSupported.
// driver name is added to the error message.
func NewNotSupportedErrorWithDriverName(name string) *MetricsError {
return &MetricsError{
Code: ErrCodeNotSupported,
Msg: fmt.Sprintf("metrics are not supported for %s volumes", name),
}
}
// NewNoPathDefinedError creates a new MetricsError with code NoPathDefined.
func NewNoPathDefinedError() *MetricsError {
return &MetricsError{
Code: ErrCodeNoPathDefined,