config

package
v0.0.1-mvp Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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: multiple registries present with the same name")

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

Functions

func SetLogger

func SetLogger(l logr.Logger)

SetLogger sets the package-level logger.

Types

type ApiObjectStore

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

ApiObjectStore is the database of the configured resources (Projects, Registries and Scanners).

func ReadManifests

func ReadManifests(path string) (*ApiObjectStore, error)

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

func (*ApiObjectStore) ExpectedProvider

func (aos *ApiObjectStore) ExpectedProvider() *ExpectedProvider

ExpectedProvider method turns an ApiObjectStore into an ExpectedProvider.

func (*ApiObjectStore) GetProjects

func (aos *ApiObjectStore) GetProjects() []*api.Project

GetProjects returns the parsed projects as API objects.

func (*ApiObjectStore) GetRegistries

func (aos *ApiObjectStore) GetRegistries() []*api.Registry

GetRegistries returns the parsed registries as API objects.

func (*ApiObjectStore) GetScanners

func (aos *ApiObjectStore) GetScanners() []*api.Scanner

GetScanners returns the parsed scanners as API objects.

func (*ApiObjectStore) RemoveManifest

func (aos *ApiObjectStore) RemoveManifest(filename string) error

RemoveManifest removes the file from the filesystem. The path where the file is removed from is set when the ReadManifests function creates the ApiObjectStore.

func (*ApiObjectStore) WriteManifest

func (aos *ApiObjectStore) WriteManifest(filename string, obj runtime.Object) error

WriteManifest serializes the object specified by the obj parameter. The filename parameter specifies the name of the file to be created. The path where the file is created is set when the ReadManifests function creates the ApiObjectStore.

type ExpectedProvider

type ExpectedProvider ApiObjectStore

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 (*ExpectedProvider) GetRegistries

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

GetRegistries returns the Registries of the resource database.

func (*ExpectedProvider) GetRegistryByName

func (expp *ExpectedProvider) GetRegistryByName(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.

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