Documentation ¶
Index ¶
- Constants
- Variables
- func CRDNotFoundErr(err error) bool
- func ContainsLatestVersion(crdFromRuntime *apiextensionsv1.CustomResourceDefinition, latestVersion string) bool
- func DeleteRemotelySyncedKyma(ctx context.Context, remoteSyncNamespace string) error
- func InitializeSyncContext(ctx context.Context, kyma *v1beta2.Kyma, syncNamespace string, kcp Client, ...) (context.Context, error)
- func PatchCRD(ctx context.Context, clnt client.Client, ...) error
- func RemoveFinalizersFromRemoteKyma(ctx context.Context, remoteSyncNamespace string) error
- func ReplaceModules(controlPlaneKyma *v1beta2.Kyma, remoteKyma *v1beta2.Kyma)
- func ShouldPatchRemoteCRD(runtimeCrd *apiextensionsv1.CustomResourceDefinition, ...) bool
- type Catalog
- type Client
- type ClientCache
- type ClientFunc
- type ClientLookup
- type ClusterClient
- type ConfigAndClient
- type CrdType
- type KymaSynchronizationContext
- func (c *KymaSynchronizationContext) CreateOrFetchRemoteKyma(ctx context.Context, kyma *v1beta2.Kyma, remoteSyncNamespace string) (*v1beta2.Kyma, error)
- func (c *KymaSynchronizationContext) CreateOrUpdateCRD(ctx context.Context, plural string) error
- func (c *KymaSynchronizationContext) GetRemotelySyncedKyma(ctx context.Context, remoteSyncNamespace string) (*v1beta2.Kyma, error)
- func (c *KymaSynchronizationContext) SyncWatcherLabelsAnnotations(controlPlaneKyma, remoteKyma *v1beta2.Kyma)
- func (c *KymaSynchronizationContext) SynchronizeRemoteKyma(ctx context.Context, controlPlaneKyma, remoteKyma *v1beta2.Kyma) error
- type RemoteCatalog
- type Settings
- type SyncCrdsUseCase
Constants ¶
const KubeConfigKey = "config"
Variables ¶
var ErrAccessSecretNotFound = errors.New("access secret not found")
var ErrIsNoSyncContext = errors.New("the given value is not a pointer to a kyma synchronization context")
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 InitializeSyncContext ¶
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 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 ClientFunc ¶
var ( //nolint:gochecknoglobals // used for testing LocalClient ClientFunc ErrNotFoundAndKCPKymaUnderDeleting = errors.New("not found and kcp kyma under deleting") )
type ClientLookup ¶
type ClientLookup struct {
// contains filtered or unexported fields
}
func NewClientLookup ¶
func NewClientLookup(kcp Client, cache *ClientCache, strategy v1beta2.SyncStrategy) *ClientLookup
type ClusterClient ¶
func (*ClusterClient) GetRestConfigFromSecret ¶
type ConfigAndClient ¶
func NewClientWithConfig ¶
func NewClientWithConfig(clnt client.Client, cfg *rest.Config) *ConfigAndClient
func (*ConfigAndClient) Config ¶
func (c *ConfigAndClient) Config() *rest.Config
type KymaSynchronizationContext ¶
func InitializeKymaSynchronizationContext ¶
func InitializeKymaSynchronizationContext(ctx context.Context, kcp Client, cache *ClientCache, kyma *v1beta2.Kyma, syncNamespace string, ) (*KymaSynchronizationContext, error)
func SyncContextFromContext ¶
func SyncContextFromContext(ctx context.Context) (*KymaSynchronizationContext, error)
func (*KymaSynchronizationContext) CreateOrFetchRemoteKyma ¶
func (*KymaSynchronizationContext) CreateOrUpdateCRD ¶
func (c *KymaSynchronizationContext) CreateOrUpdateCRD(ctx context.Context, plural string) error
func (*KymaSynchronizationContext) GetRemotelySyncedKyma ¶
func (*KymaSynchronizationContext) SyncWatcherLabelsAnnotations ¶
func (c *KymaSynchronizationContext) SyncWatcherLabelsAnnotations(controlPlaneKyma, remoteKyma *v1beta2.Kyma)
SyncWatcherLabelsAnnotations inserts labels into the given KymaCR, which are needed to ensure a working e2e-flow for the runtime-watcher.
func (*KymaSynchronizationContext) SynchronizeRemoteKyma ¶
type RemoteCatalog ¶
type RemoteCatalog struct {
// contains filtered or unexported fields
}
func NewRemoteCatalog ¶
func NewRemoteCatalog( settings Settings, ) *RemoteCatalog
NewRemoteCatalog uses 2 Clients from a Sync Context to create a Catalog in a remote Cluster.
func NewRemoteCatalogFromKyma ¶
func NewRemoteCatalogFromKyma(remoteSyncNamespace string) *RemoteCatalog
func (*RemoteCatalog) CreateModuleTemplateCRDInRuntime ¶
func (c *RemoteCatalog) CreateModuleTemplateCRDInRuntime(ctx context.Context, plural string) error
func (*RemoteCatalog) CreateOrUpdate ¶
func (c *RemoteCatalog) CreateOrUpdate( ctx context.Context, 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.
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 SyncCrdsUseCase ¶
type SyncCrdsUseCase struct {
// contains filtered or unexported fields
}
func NewSyncCrdsUseCase ¶
func NewSyncCrdsUseCase(cache *crd.Cache) SyncCrdsUseCase