Documentation ¶
Index ¶
- Variables
- func CRDNotFoundErr(err error) bool
- func ContainsLatestVersion(crdFromRuntime *apiextensionsv1.CustomResourceDefinition, latestVersion string) bool
- func PatchCRD(ctx context.Context, clnt client.Client, ...) error
- func ReplaceModules(controlPlaneKyma *v1beta2.Kyma, remoteKyma *v1beta2.Kyma)
- func ShouldPatchRemoteCRD(runtimeCrd *apiextensionsv1.CustomResourceDefinition, ...) bool
- type Catalog
- type Client
- type ClientCache
- type ConfigAndClient
- type CrdType
- type KymaSkrContextProvider
- type RemoteCatalog
- 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) SynchronizeKyma(ctx context.Context, kcpKyma, remoteKyma *v1beta2.Kyma) error
- type SkrContextProvider
- type SyncCrdsUseCase
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAccessSecretNotFound = errors.New("access secret not found") ErrSkrClientContextNotFound = errors.New("skr client context not found") )
View Source
var ErrNotFoundAndKCPKymaUnderDeleting = errors.New("not found and kcp kyma under deleting")
View Source
var ErrTemplateCRDNotReady = errors.New("module template crd for catalog sync is not ready")
Functions ¶
func CRDNotFoundErr ¶
func ContainsLatestVersion ¶
func ContainsLatestVersion(crdFromRuntime *apiextensionsv1.CustomResourceDefinition, latestVersion string) bool
func PatchCRD ¶
func PatchCRD(ctx context.Context, clnt client.Client, crd *apiextensionsv1.CustomResourceDefinition) error
func ReplaceModules ¶
ReplaceModules replaces modules specification from control plane Kyma with Remote Kyma specifications.
func ShouldPatchRemoteCRD ¶
func ShouldPatchRemoteCRD( runtimeCrd *apiextensionsv1.CustomResourceDefinition, kcpCrd *apiextensionsv1.CustomResourceDefinition, kyma *v1beta2.Kyma, ) bool
Types ¶
type Catalog ¶
type Catalog interface { CreateOrUpdate(ctx context.Context, kyma types.NamespacedName, moduleTemplates *v1beta2.ModuleTemplateList) error Delete(ctx context.Context) error }
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 ConfigAndClient ¶
func NewClientWithConfig ¶
func NewClientWithConfig(clnt client.Client, cfg *rest.Config) *ConfigAndClient
func (*ConfigAndClient) Config ¶
func (c *ConfigAndClient) Config() *rest.Config
type KymaSkrContextProvider ¶
type KymaSkrContextProvider struct {
// contains filtered or unexported fields
}
func NewKymaSkrContextProvider ¶
func NewKymaSkrContextProvider(kcpClient Client, clientCache *ClientCache, event event.Event) *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 NewRemoteCatalog ¶
func NewRemoteCatalog(kcpClient client.Client, skrContextFactory SkrContextProvider, settings Settings) *RemoteCatalog
func NewRemoteCatalogFromKyma ¶
func NewRemoteCatalogFromKyma(kcpClient client.Client, skrContextFactory SkrContextProvider, remoteSyncNamespace string) *RemoteCatalog
func (*RemoteCatalog) CreateOrUpdate ¶
func (c *RemoteCatalog) CreateOrUpdate( ctx context.Context, kyma types.NamespacedName, kcpModules []v1beta2.ModuleTemplate, ) error
CreateOrUpdate first lists all currently available moduleTemplates in the Runtime. If there is a NoMatchError, it will attempt to install the CRD but only if there are available crs to copy. It will use a 2 stage process: 1. All ModuleTemplates that either have to be created based on the given Control Plane Templates 2. All ModuleTemplates that have to be removed as they were deleted form the Control Plane Templates It uses Server-Side-Apply Patches to optimize the turnaround required.
func (*RemoteCatalog) Delete ¶
func (c *RemoteCatalog) Delete( ctx context.Context, kyma types.NamespacedName, ) error
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 ¶
type SkrContext struct { Client // contains filtered or unexported fields }
func NewSkrContext ¶
func NewSkrContext(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) SynchronizeKyma ¶
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
Click to show internal directories.
Click to hide internal directories.