Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateCacheKey(values ...string) string
- func HandleState(manifest *v1beta2.Manifest, moduleCR *unstructured.Unstructured) (declarativev2.StateInfo, error)
- func PostRunCreateCR(ctx context.Context, skr declarativev2.Client, kcp client.Client, ...) error
- func PreDeleteDeleteCR(ctx context.Context, skr declarativev2.Client, kcp client.Client, ...) error
- func WithClientCacheKey() declarativev2.WithClientCacheKeyOption
- type ClusterClient
- type CustomResourceReadyCheck
- type ModuleCRDeletionCheck
- type PathExtractor
- type RESTConfigGetter
- type RawManifestInfo
- type RemoteClusterLookup
- type SpecResolver
Constants ¶
const ( ToWarningDuration = 5 * time.Minute ModuleCRWithCustomCheckWarning = "module CR state not found or given customStateCheck.jsonPath is not exists" ModuleCRWithNoCustomCheckWarning = "module CR state not found" )
Variables ¶
var ( ErrNotSupportedState = errors.New("module CR state not support") ErrRequiredStateMissing = errors.New("required Ready and Error state mapping are missing") )
var ( ErrRenderModeInvalid = errors.New("render mode is invalid") ErrInvalidObjectPassedToSpecResolution = errors.New("invalid object passed to spec resolution") )
var ErrImageLayerPull = errors.New("failed to pull layer")
var ErrMoreThanOneSecretFound = errors.New("more than one secret found")
Functions ¶
func GenerateCacheKey ¶
func HandleState ¶
func HandleState(manifest *v1beta2.Manifest, moduleCR *unstructured.Unstructured) (declarativev2.StateInfo, error)
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.
func WithClientCacheKey ¶
func WithClientCacheKey() declarativev2.WithClientCacheKeyOption
Types ¶
type ClusterClient ¶
func (*ClusterClient) GetRESTConfig ¶
type CustomResourceReadyCheck ¶
type CustomResourceReadyCheck struct{}
func NewCustomResourceReadyCheck ¶
func NewCustomResourceReadyCheck() *CustomResourceReadyCheck
NewCustomResourceReadyCheck creates a readiness check that verifies that the Resource in the Manifest returns the ready state, if not it returns not ready.
func (*CustomResourceReadyCheck) Run ¶
func (c *CustomResourceReadyCheck) Run(ctx context.Context, clnt declarativev2.Client, obj declarativev2.Object, resources []*resource.Info, ) (declarativev2.StateInfo, error)
type ModuleCRDeletionCheck ¶
type ModuleCRDeletionCheck struct{}
func NewModuleCRDeletionCheck ¶
func NewModuleCRDeletionCheck() *ModuleCRDeletionCheck
NewModuleCRDeletionCheck creates a check that verifies that the Resource CR in the remote cluster is deleted.
type PathExtractor ¶
type PathExtractor struct {
// contains filtered or unexported fields
}
func NewPathExtractor ¶
func NewPathExtractor(cache *filemutex.MutexCache) *PathExtractor
type RESTConfigGetter ¶
type RawManifestInfo ¶
RawManifestInfo defines raw manifest information.
type RemoteClusterLookup ¶
type RemoteClusterLookup struct { KCP *declarativev2.ClusterInfo ConfigGetter RESTConfigGetter }
func (*RemoteClusterLookup) ConfigResolver ¶
func (r *RemoteClusterLookup) ConfigResolver( ctx context.Context, obj declarativev2.Object, ) (*declarativev2.ClusterInfo, error)
type SpecResolver ¶
type SpecResolver struct { KCP *declarativev2.ClusterInfo ChartCache string // contains filtered or unexported fields }
func NewSpecResolver ¶
func NewSpecResolver(kcp *declarativev2.ClusterInfo, extractor *PathExtractor) *SpecResolver
func (*SpecResolver) Spec ¶
func (s *SpecResolver) Spec(ctx context.Context, obj declarativev2.Object) (*declarativev2.Spec, error)