config

package
v0.0.1-alpha.ns-handli... Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrValidationArtifactoryAnnotations error = errors.New("validation error: wrong artifactory annotations")

ErrValidationArtifactoryAnnotations error indicates that the annotations are wrongly set.

View Source
var ErrValidationGroupWithoutDN error = errors.New("validation error: project group member with missing DN field")

ErrValidationScannerNameReference error indicates that a project refers to a non-existing Scanner.

View Source
var ErrValidationInvalidLocalRegistryInProject error = errors.New("validation error: project contains invalid registry name")

ErrValidationInvalidLocalRegistryInProject error indicates that a local project refers to a non-existing registry.

View Source
var ErrValidationMultipleGlobalRegistries error = errors.New("validation error: multiple global registries found")

ErrValidationMultipleGlobalRegistries error indicates that there are multiple global registries configured.

View Source
var ErrValidationProjectNameNotUnique error = errors.New("validation error: multiple projects present with the same name")

ErrValidationProjectNameNotUnique error indicates that there are multiple projects configured with the same name.

View Source
var ErrValidationRegistryNameNotUnique error = errors.New("validation error: multiple registries present with the same name")

ErrValidationRegistryNameNotUnique error indicates that there are multiple registries configured with the same name.

View Source
var ErrValidationScannerNameNotUnique error = errors.New("validation error: multiple scanners present with the same name")

ErrValidationScannerNameNotUnique error indicates that there are multiple scanners configured with the same name.

View Source
var ErrValidationScannerNameReference error = errors.New("validation error: project refers to a non-existing scanner")

ErrValidationScannerNameReference error indicates that a project refers to a non-existing Scanner.

Functions

func ReadLocalManifests

func ReadLocalManifests(path string, options globalregistry.RegistryOptions) (*localFileApiObjectStore, error)

ReadLocalManifests creates a new ApiObjectStore. It reads all files under path. The files are deserialized and validated.

func SetLogger

func SetLogger(l logr.Logger)

SetLogger sets the package-level logger.

func ValidateConsistency

func ValidateConsistency(aos ApiObjectStore) error

ValidateConsistency performs all validations that require the full context, i.e. all resources parsed. If there is a consistency issue, an error is returned.

Types

type ApiObjectStore

type ApiObjectStore interface {
	// WriteResource serializes the object specified by the obj parameter.
	WriteResource(ctx context.Context, obj runtime.Object) error

	// RemoveResource removes the file from the filesystem.
	RemoveResource(ctx context.Context, obj runtime.Object) error

	// GetRegistries returns the parsed registries as API objects.
	GetRegistries(context.Context) []*api.Registry

	// GetProjects returns the parsed projects as API objects.
	GetProjects(context.Context) []*api.Project

	// GetScanners returns the parsed scanners as API objects.
	GetScanners(context.Context) []*api.Scanner

	// GetGlobalRegistryOptions returns the ApiObjectStore related CLI options of an
	// apply.
	GetGlobalRegistryOptions() globalregistry.RegistryOptions

	// GetLogger returns the logr.Logger interface that the ApiObjectStore is using
	// for logging.
	GetLogger() logr.Logger
}

ApiObjectStore interface is an abstract interface that hides the difference between the local file and Kubernetes resource based config management.

type ExpectedProvider

type ExpectedProvider struct {
	registry.ApiObjectProvider
}

ExpectedProvider is a database of the resources which implement the interfaces defines in the globalregistry package.

The resources in the database usually show the expected state of the resources.

func NewExpectedProvider

func NewExpectedProvider(aop registry.ApiObjectProvider) *ExpectedProvider

NewExpectedProvider method turns an ApiObjectStore into an ExpectedProvider.

func (ExpectedProvider) GetRegistries

func (expp ExpectedProvider) GetRegistries(ctx context.Context) []*registry.Registry

GetRegistries returns the Registries of the resource database.

func (*ExpectedProvider) GetRegistryByName

func (expp *ExpectedProvider) GetRegistryByName(ctx context.Context, name string) *registry.Registry

GetRegistryByName returns a Registry with the given name from the database. If no Registry if found with the specified name, nil is returned.

type ProjectOfRegistry

type ProjectOfRegistry struct {
	Registry globalregistry.Registry
	Project  globalregistry.Project
}

ProjectOfRegistry struct describes a connection between a globalregistry.Registry and globalregistry.Project object.

func GetProjectByName

func GetProjectByName(ctx context.Context, aos ApiObjectStore, projectName string) (*ProjectOfRegistry, error)

GetProjectByName returns a Project struct for a matching project name.

func (*ProjectOfRegistry) GenerateProjectRepoName

func (p *ProjectOfRegistry) GenerateProjectRepoName() (string, error)

GenerateProjectRepoName generates a project-level repository URL for a given project.

Directories

Path Synopsis
package registry implements the globalregistry.Registry interface based on the registryman.kubermatic.com/v1alpha1 API objects.
package registry implements the globalregistry.Registry interface based on the registryman.kubermatic.com/v1alpha1 API objects.

Jump to

Keyboard shortcuts

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