manifest

package
v0.0.0-...-adce201 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

README

Internal Manifest Library

This package contains internal reference coding that is used for translating and implementing the Manifest Reconciler parts that are not generically solved by the declarative library.

It contains various aspects to:

  1. Translate the Manifest CR into a declarative specification in a custom specification resolver. Use the layer parsing methods to download and resolve OCI image layers from the Manifest to make them accessible to the declarative library.
  2. Look up the correct Client for Single or Dual Cluster Mode based on the SKR Client Lookup and ClusterClient to read Secret Data as if they were a kubeconfig.
  3. Look up the correct Keychain to access image layers contained in private registries through a Keychain.
  4. Interact with the Default Data supplied to the Manifest CR to initialize a module with Pre/Post-Hooks.
  5. Check for Module Readiness based on the applied resources. For more information, see custom StateCheck.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMoreThanOneSecretFound = errors.New("more than one secret found")
View Source
var ErrRenderModeInvalid = errors.New("render mode is invalid")

Functions

func GenerateCacheKey

func GenerateCacheKey(values ...string) string

func PostRunCreateCR

func PostRunCreateCR(
	ctx context.Context, skr declarativev2.Client, kcp client.Client, obj declarativev2.Object,
) error

PostRunCreateCR is a hook for creating the manifest default custom resource if not available in the cluster It is used to provide the controller with default data in the Runtime.

func PreDeleteDeleteCR

func PreDeleteDeleteCR(
	ctx context.Context, skr declarativev2.Client, kcp client.Client, obj declarativev2.Object,
) error

PreDeleteDeleteCR is a hook for deleting the module CR if available in the cluster. It uses DeletePropagationBackground to delete module CR. Only if module CR is not found (indicated by NotFound error), it continues to remove Manifest finalizer, and we consider the CR removal successful.

Types

type ClusterClient

type ClusterClient struct {
	DefaultClient client.Client
}

func (*ClusterClient) GetRESTConfig

func (cc *ClusterClient) GetRESTConfig(
	ctx context.Context, kymaOwner, kymaNameLabel, namespace string,
) (*rest.Config, error)

type KeyChainLookup

type KeyChainLookup interface {
	Get(ctx context.Context, imageSpec v1beta2.ImageSpec) (authn.Keychain, error)
}

type KeyChainProvider

type KeyChainProvider struct {
	// contains filtered or unexported fields
}

func NewKeyChainProvider

func NewKeyChainProvider(kcpClient client.Client) *KeyChainProvider

func (*KeyChainProvider) Get

type PathExtractor

type PathExtractor interface {
	GetPathFromRawManifest(ctx context.Context, imageSpec v1beta2.ImageSpec, keyChain authn.Keychain) (string, error)
}

type RESTConfigGetter

type RESTConfigGetter func() (*rest.Config, error)

type RemoteClusterLookup

type RemoteClusterLookup struct {
	KCP          *declarativev2.ClusterInfo
	ConfigGetter RESTConfigGetter
}

func (*RemoteClusterLookup) ConfigResolver

type SpecResolver

type SpecResolver struct {
	// contains filtered or unexported fields
}

func NewSpecResolver

func NewSpecResolver(kcLookup KeyChainLookup, extractor PathExtractor) *SpecResolver

func (*SpecResolver) GetSpec

func (s *SpecResolver) GetSpec(ctx context.Context, manifest *v1beta2.Manifest) (*declarativev2.Spec, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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