update prometheus dependencies (#5520)
Signed-off-by: junot <junotxiang@kubesphere.io>
This commit is contained in:
34
vendor/github.com/prometheus/alertmanager/api/v2/models/silence.go
generated
vendored
34
vendor/github.com/prometheus/alertmanager/api/v2/models/silence.go
generated
vendored
@@ -20,14 +20,16 @@ package models
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// Silence silence
|
||||
//
|
||||
// swagger:model silence
|
||||
type Silence struct {
|
||||
|
||||
@@ -124,6 +126,8 @@ func (m *Silence) validateMatchers(formats strfmt.Registry) error {
|
||||
if err := m.Matchers.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("matchers")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("matchers")
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -144,6 +148,34 @@ func (m *Silence) validateStartsAt(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this silence based on the context it is used
|
||||
func (m *Silence) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateMatchers(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Silence) contextValidateMatchers(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if err := m.Matchers.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("matchers")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("matchers")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Silence) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
||||
Reference in New Issue
Block a user