mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Return MetricsError with ErrCodeNotSupported code
GetMetrics function expects MetricsError error with ErrCodeNotSupported code when driver for the volume does not support metrics Updated csi_metrics to return error when underlying csi driver does not have GET_VOLUME_STATS capability
This commit is contained in:
		@@ -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,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user