Documentation
¶
Index ¶
- Variables
- func CRDNotFoundErr(err error) bool
- func ContainsLatestVersion(crdFromRuntime *apiextensionsv1.CustomResourceDefinition, latestVersion string) bool
- func FilterAllowedModuleTemplates(moduleTemplates []v1beta2.ModuleTemplate, ...) []v1beta2.ModuleTemplate
- func IsAllowedModuleVersion(kyma *v1beta2.Kyma, moduleTemplateList *v1beta2.ModuleTemplateList, ...) bool
- func PatchCRD(ctx context.Context, clnt client.Client, ...) error
- func ReplaceSpec(controlPlaneKyma *v1beta2.Kyma, remoteKyma *v1beta2.Kyma)
- func ShouldPatchRemoteCRD(runtimeCrd *apiextensionsv1.CustomResourceDefinition, ...) bool
- type ClientCache
- type CrdType
- type KymaSkrContextProvider
- type RemoteCatalog
- func (c *RemoteCatalog) Delete(ctx context.Context, kyma types.NamespacedName) error
- func (c *RemoteCatalog) GetModuleReleaseMetasToSync(ctx context.Context, kyma *v1beta2.Kyma, ...) ([]v1beta2.ModuleReleaseMeta, error)
- func (c *RemoteCatalog) GetModuleTemplatesToSync(moduleReleaseMetas []v1beta2.ModuleReleaseMeta, kyma *v1beta2.Kyma, ...) ([]v1beta2.ModuleTemplate, error)
- func (c *RemoteCatalog) SyncModuleCatalog(ctx context.Context, kyma *v1beta2.Kyma) error
- type Settings
- type SkrContext
- func (s *SkrContext) CreateKymaNamespace(ctx context.Context) error
- func (s *SkrContext) CreateOrFetchKyma(ctx context.Context, kcpClient client.Client, kyma *v1beta2.Kyma) (*v1beta2.Kyma, error)
- func (s *SkrContext) DeleteKyma(ctx context.Context) error
- func (s *SkrContext) RemoveFinalizersFromKyma(ctx context.Context) error
- func (s *SkrContext) SynchronizeKymaMetadata(ctx context.Context, kcpKyma, skrKyma *v1beta2.Kyma) error
- func (s *SkrContext) SynchronizeKymaStatus(ctx context.Context, kcpKyma, skrKyma *v1beta2.Kyma) error
- type SkrContextProvider
- type SyncCrdsUseCase
Constants ¶
This section is empty.
Variables ¶
var ErrNotFoundAndKCPKymaUnderDeleting = errors.New("not found and kcp kyma under deleting")
var ErrSkrClientContextNotFound = errors.New("skr client context not found")
Functions ¶
func CRDNotFoundErr ¶
func ContainsLatestVersion ¶
func ContainsLatestVersion(crdFromRuntime *apiextensionsv1.CustomResourceDefinition, latestVersion string) bool
func FilterAllowedModuleTemplates ¶
func FilterAllowedModuleTemplates( moduleTemplates []v1beta2.ModuleTemplate, moduleReleaseMetas []v1beta2.ModuleReleaseMeta, kyma *v1beta2.Kyma, ) []v1beta2.ModuleTemplate
FilterAllowedModuleTemplates filters out ModuleTemplates that are not allowed. A ModuleTemplate is allowed if it is not mandatory, does not have sync disabled, and if it is referenced by a ModuleReleaseMeta that is synced.
func IsAllowedModuleVersion ¶
func PatchCRD ¶
func PatchCRD(ctx context.Context, clnt client.Client, crd *apiextensionsv1.CustomResourceDefinition) error
func ReplaceSpec ¶
ReplaceSpec replaces 'spec' attributes in control plane Kyma with values from Remote Kyma.
func ShouldPatchRemoteCRD ¶
func ShouldPatchRemoteCRD( runtimeCrd *apiextensionsv1.CustomResourceDefinition, kcpCrd *apiextensionsv1.CustomResourceDefinition, kyma *v1beta2.Kyma, ) bool
Types ¶
type ClientCache ¶
type ClientCache struct {
// contains filtered or unexported fields
}
func NewClientCache ¶
func NewClientCache() *ClientCache
func (*ClientCache) Delete ¶
func (c *ClientCache) Delete(key client.ObjectKey)
func (*ClientCache) Size ¶
func (c *ClientCache) Size() int
type KymaSkrContextProvider ¶
type KymaSkrContextProvider struct {
// contains filtered or unexported fields
}
func NewKymaSkrContextProvider ¶
func NewKymaSkrContextProvider(kcpClient client.Client, clientCache *ClientCache, event event.Event, accessManagerService *accessmanager.Service, skrQps int, skrBurst int, ) *KymaSkrContextProvider
func (*KymaSkrContextProvider) Get ¶
func (k *KymaSkrContextProvider) Get(kyma types.NamespacedName) (*SkrContext, error)
func (*KymaSkrContextProvider) Init ¶
func (k *KymaSkrContextProvider) Init(ctx context.Context, kyma types.NamespacedName) error
func (*KymaSkrContextProvider) InvalidateCache ¶
func (k *KymaSkrContextProvider) InvalidateCache(kyma types.NamespacedName)
type RemoteCatalog ¶
type RemoteCatalog struct {
// contains filtered or unexported fields
}
func NewRemoteCatalogFromKyma ¶
func NewRemoteCatalogFromKyma(kcpClient client.Client, skrContextFactory SkrContextProvider, remoteSyncNamespace string, restrictedModules []string, ) *RemoteCatalog
func (*RemoteCatalog) Delete ¶
func (c *RemoteCatalog) Delete( ctx context.Context, kyma types.NamespacedName, ) error
func (*RemoteCatalog) GetModuleReleaseMetasToSync ¶
func (c *RemoteCatalog) GetModuleReleaseMetasToSync( ctx context.Context, kyma *v1beta2.Kyma, moduleTemplateList *v1beta2.ModuleTemplateList, ) ([]v1beta2.ModuleReleaseMeta, error)
GetModuleReleaseMetasToSync returns a list of ModuleReleaseMetas that should be synced to the SKR. A ModuleReleaseMeta is synced if it has at least one channel-version pair whose ModuleTemplate is allowed to be synced. Restricted modules (in the restrictedModules list) are only synced if the MRM's kymaSelector matches the Kyma. Non-restricted modules with a kymaSelector are skipped.
func (*RemoteCatalog) GetModuleTemplatesToSync ¶
func (c *RemoteCatalog) GetModuleTemplatesToSync( moduleReleaseMetas []v1beta2.ModuleReleaseMeta, kyma *v1beta2.Kyma, moduleTemplateList *v1beta2.ModuleTemplateList, ) ([]v1beta2.ModuleTemplate, error)
GetModuleTemplatesToSync returns a list of ModuleTemplates that should be synced to the SKR. A ModuleTemplate is synced if it is not mandatory and does not have sync disabled, and if it is referenced by a ModuleReleaseMeta that is synced.
func (*RemoteCatalog) SyncModuleCatalog ¶
type Settings ¶
type Settings struct {
// this namespace flag can be used to override the namespace in which all ModuleTemplates should be applied.
Namespace string
SSAPatchOptions *client.PatchOptions
}
type SkrContext ¶
func NewSkrContext ¶
func NewSkrContext(client client.Client, event event.Event) *SkrContext
func (*SkrContext) CreateKymaNamespace ¶
func (s *SkrContext) CreateKymaNamespace(ctx context.Context) error
func (*SkrContext) CreateOrFetchKyma ¶
func (*SkrContext) DeleteKyma ¶
func (s *SkrContext) DeleteKyma(ctx context.Context) error
func (*SkrContext) RemoveFinalizersFromKyma ¶
func (s *SkrContext) RemoveFinalizersFromKyma(ctx context.Context) error
func (*SkrContext) SynchronizeKymaMetadata ¶
func (s *SkrContext) SynchronizeKymaMetadata(ctx context.Context, kcpKyma, skrKyma *v1beta2.Kyma) error
SynchronizeKymaMetadata synchronizes the metadata to the SKR Kyma CR . It sets the required labels and annotations.
func (*SkrContext) SynchronizeKymaStatus ¶
func (s *SkrContext) SynchronizeKymaStatus(ctx context.Context, kcpKyma, skrKyma *v1beta2.Kyma) error
SynchronizeKymaStatus synchronizes the status to the SKR Kyma CR.
type SkrContextProvider ¶
type SkrContextProvider interface {
Get(kyma types.NamespacedName) (*SkrContext, error)
Init(ctx context.Context, kyma types.NamespacedName) error
InvalidateCache(kyma types.NamespacedName)
}
type SyncCrdsUseCase ¶
type SyncCrdsUseCase struct {
// contains filtered or unexported fields
}
func NewSyncCrdsUseCase ¶
func NewSyncCrdsUseCase(kcpClient client.Client, skrContextFactory SkrContextProvider, cache *crd.Cache, ) SyncCrdsUseCase