validator

package
v2.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 20 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ImagePullErr        = "ErrImagePull"
	ImagePullBackOff    = "ImagePullBackOff"
	ErrImagePullBackOff = "ErrImagePullBackOff"

	ReplicaFailureAdmissionErr = "ReplicaFailureAdmissionErr"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigConnectorValidator

type ConfigConnectorValidator struct {
	// contains filtered or unexported fields
}

ConfigConnectorValidator implements the Validator interface for Config Connector resources

func NewConfigConnectorValidator

NewConfigConnectorValidator initializes a ConfigConnectorValidator

func (*ConfigConnectorValidator) Validate

func (ccv *ConfigConnectorValidator) Validate(ctx context.Context, ns string, opts metav1.ListOptions) ([]Resource, error)

Validate implements the Validate method for Validator interface

type CustomResourceSelector

type CustomResourceSelector struct {
	// contains filtered or unexported fields
}

func NewCustomResourceSelector

func NewCustomResourceSelector(client kubernetes.Interface, dynClient dynamic.Interface, gvk schema.GroupVersionKind) *CustomResourceSelector

func (*CustomResourceSelector) Select

Select returns the updated list of custom resources for the given GroupVersionKind deployed by skaffold

type CustomValidator added in v2.7.0

type CustomValidator struct {
	// contains filtered or unexported fields
}

func NewCustomValidator added in v2.7.0

NewCustomValidator initializes a CustomValidator

func (CustomValidator) Validate added in v2.7.0

func (c CustomValidator) Validate(ctx context.Context, ns string, opts metav1.ListOptions) ([]Resource, error)

type PodSelector

type PodSelector interface {
	Select(ctx context.Context, namespace string, opts metav1.ListOptions) ([]v1.Pod, error)
}

PodSelector defines how to filter to targeted pods for running validation

func NewDeploymentPodsSelector

func NewDeploymentPodsSelector(k kubernetes.Interface, d appsv1.Deployment) PodSelector

func NewStandalonePodsSelector

func NewStandalonePodsSelector(k kubernetes.Interface) PodSelector

func NewStatefulSetPodsSelector

func NewStatefulSetPodsSelector(k kubernetes.Interface, d appsv1.StatefulSet) PodSelector

type PodValidator

type PodValidator struct {
	// contains filtered or unexported fields
}

PodValidator implements the Validator interface for Pods

func NewPodValidator

func NewPodValidator(k kubernetes.Interface, s PodSelector) *PodValidator

NewPodValidator initializes a PodValidator

func (*PodValidator) Validate

func (p *PodValidator) Validate(ctx context.Context, ns string, opts metav1.ListOptions) ([]Resource, error)

Validate implements the Validate method for Validator interface

type Recommender

type Recommender interface {
	// Makes one or more recommendations for the ErrorCode in err and updates the err with suggestions
	Make(errCode proto.StatusCode) *proto.Suggestion
}

Recommender makes recommendations based on err in the actionable error

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

func NewResource

func NewResource(namespace, kind, name string, status Status, ae *proto.ActionableErr, logs []string) Resource

NewResource creates new Resource of kind

func NewResourceFromObject

func NewResourceFromObject(object objectWithMetadata, status Status, ae *proto.ActionableErr, logs []string) Resource

NewResourceFromObject creates new Resource with fields populated from object metadata.

func (Resource) ActionableError

func (r Resource) ActionableError() *proto.ActionableErr

func (Resource) Kind

func (r Resource) Kind() string

func (Resource) Logs

func (r Resource) Logs() []string

func (Resource) Name

func (r Resource) Name() string

func (Resource) Namespace

func (r Resource) Namespace() string

func (Resource) Status

func (r Resource) Status() Status

func (Resource) StatusUpdated

func (r Resource) StatusUpdated(another Resource) bool

func (Resource) String

func (r Resource) String() string

type Status

type Status string

type Validator

type Validator interface {
	// Validate runs the validator and returns the list of resources with status.
	Validate(ctx context.Context, ns string, opts metav1.ListOptions) ([]Resource, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL