validate

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotaryDefaultTrustDir = "/tmp/.notary"
)

Variables

This section is empty.

Functions

func IsValidationEnabledForNS

func IsValidationEnabledForNS(ns *corev1.Namespace) bool

func ParseAllowedRegistries

func ParseAllowedRegistries(registries string) []string

Types

type ImageValidatorService

type ImageValidatorService interface {
	Validate(ctx context.Context, image string) error
}

func NewImageValidator

func NewImageValidator(sc *ServiceConfig, notaryClientFactory RepoFactory) ImageValidatorService

type NamespaceChecker

type NamespaceChecker interface {
	IsValidationEnabledForNS(namespace string) bool
}

type NotaryConfig

type NotaryConfig struct {
	Url string `json:"url"`
}

type NotaryRepoClient

type NotaryRepoClient interface {
	client.Repository
}

type NotaryRepoFactory

type NotaryRepoFactory struct {
	Timeout time.Duration
}

func (NotaryRepoFactory) NewRepoClient

func (f NotaryRepoFactory) NewRepoClient(img string, c NotaryConfig) (NotaryRepoClient, error)

type NotaryValidator

type NotaryValidator struct {
}

type PodValidator

type PodValidator interface {
	ValidatePod(ctx context.Context, pod *corev1.Pod, ns *corev1.Namespace) (ValidationResult, error)
}

func NewPodValidator

func NewPodValidator(imageValidator ImageValidatorService) PodValidator

type RepoFactory

type RepoFactory interface {
	NewRepoClient(string, NotaryConfig) (NotaryRepoClient, error)
}

type ServiceConfig

type ServiceConfig struct {
	NotaryConfig      NotaryConfig
	AllowedRegistries []string
}

type ValidationResult

type ValidationResult string
const (
	Invalid            ValidationResult = "Invalid"
	ServiceUnavailable ValidationResult = "ServiceUnavailable"
	Valid              ValidationResult = "Valid"
	NoAction           ValidationResult = "NoAction"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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