Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrValidationArtifactoryAnnotations error = errors.New("validation error: wrong artifactory annotations")
ErrValidationArtifactoryAnnotations error indicates that the annotations are wrongly set.
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.
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.
var ErrValidationMultipleGlobalRegistries error = errors.New("validation error: multiple global registries found")
ErrValidationMultipleGlobalRegistries error indicates that there are multiple global registries configured.
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.
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.
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.
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 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.
func ConnectToKube ¶
func ConnectToKube(options globalregistry.RegistryOptions, ns string) (ApiObjectStore, *rest.Config, error)
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.