templatelookup

package
v0.0.0-...-67aceb4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidModuleInSpec   = errors.New("invalid configuration in Kyma spec.modules")
	ErrInvalidModuleInStatus = errors.New("invalid module entry in Kyma status")
)
View Source
var (
	ErrChannelNotFound = errors.New("no versions found for channel")
	ErrNoChannelsFound = errors.New("no channels found for module")
)
View Source
var (
	ErrTemplateNotIdentified     = errors.New("no unique template could be identified")
	ErrNotDefaultChannelAllowed  = errors.New("specifying no default channel is not allowed")
	ErrNoTemplatesInListResult   = errors.New("no templates were found")
	ErrTemplateMarkedAsMandatory = errors.New("template marked as mandatory")
	ErrTemplateNotAllowed        = errors.New("module template not allowed")
	ErrTemplateUpdateNotAllowed  = errors.New("module template update not allowed")
)

Functions

func GetChannelVersionForModule

func GetChannelVersionForModule(moduleReleaseMeta *v1beta2.ModuleReleaseMeta, desiredChannel string) (string, error)

func GetModuleName

func GetModuleName(moduleTemplate *v1beta2.ModuleTemplate) string

func GetModuleReleaseMeta

func GetModuleReleaseMeta(ctx context.Context, clnt client.Reader, moduleName string,
	namespace string) (*v1beta2.ModuleReleaseMeta,
	error,
)

func GetModuleSemverVersion

func GetModuleSemverVersion(moduleTemplate *v1beta2.ModuleTemplate) (*semver.Version, error)

func GetModuleTemplateWithHigherVersion

func GetModuleTemplateWithHigherVersion(firstModuleTemplate, secondModuleTemplate *v1beta2.ModuleTemplate) (*v1beta2.ModuleTemplate,
	error,
)

func NewMoreThanOneTemplateCandidateErr

func NewMoreThanOneTemplateCandidateErr(moduleName string,
	candidateTemplates []v1beta2.ModuleTemplate,
) error

func TemplateNameMatch

func TemplateNameMatch(template *v1beta2.ModuleTemplate, name string) bool

Types

type ModuleInfo

type ModuleInfo struct {
	v1beta2.Module
	Enabled         bool
	ValidationError error
	Unmanaged       bool
}

func FetchModuleInfo

func FetchModuleInfo(kyma *v1beta2.Kyma) []ModuleInfo

FetchModuleInfo returns a list of ModuleInfo objects containing information about modules referenced by the Kyma CR. This includes modules that are enabled in `.spec.modules[]` and modules that are not enabled in `.spec.modules[]` but still contain an entry in `.status.modules[]`.

func (ModuleInfo) IsInstalledByVersion

func (a ModuleInfo) IsInstalledByVersion() bool

type ModuleTemplateInfo

type ModuleTemplateInfo struct {
	*v1beta2.ModuleTemplate
	Err            error
	DesiredChannel string
}

func ValidateTemplateMode

func ValidateTemplateMode(template ModuleTemplateInfo,
	kyma *v1beta2.Kyma,
	moduleReleaseMeta *v1beta2.ModuleReleaseMeta,
) ModuleTemplateInfo

type ModuleTemplatesByModuleName

type ModuleTemplatesByModuleName map[string]*ModuleTemplateInfo

func GetMandatory

func GetMandatory(ctx context.Context, kymaClient client.Reader) (ModuleTemplatesByModuleName,
	error,
)

GetMandatory returns ModuleTemplates TOs (Transfer Objects) which are marked are mandatory modules.

type TemplateLookup

type TemplateLookup struct {
	client.Reader
	// contains filtered or unexported fields
}

func NewTemplateLookup

func NewTemplateLookup(reader client.Reader, descriptorProvider *provider.CachedDescriptorProvider) *TemplateLookup

func (*TemplateLookup) GetAndValidateByChannel

func (t *TemplateLookup) GetAndValidateByChannel(ctx context.Context,
	name, channel, defaultChannel string,
) ModuleTemplateInfo

func (*TemplateLookup) GetAndValidateByVersion

func (t *TemplateLookup) GetAndValidateByVersion(ctx context.Context, name, version string) ModuleTemplateInfo

func (*TemplateLookup) GetRegularTemplates

func (t *TemplateLookup) GetRegularTemplates(ctx context.Context, kyma *v1beta2.Kyma) ModuleTemplatesByModuleName

func (*TemplateLookup) PopulateModuleTemplateInfo

func (t *TemplateLookup) PopulateModuleTemplateInfo(ctx context.Context,
	module ModuleInfo, namespace, kymaChannel string, moduleReleaseMeta *v1beta2.ModuleReleaseMeta,
) ModuleTemplateInfo

Jump to

Keyboard shortcuts

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