Documentation ¶
Index ¶
- func FilterResources(inputYAML string) (string, error)
- func NewPackageRepoApp(pkgRepository *pkgingv1alpha1.PackageRepository) (*kcv1alpha1.App, error)
- type App
- type AppFactory
- type CRDApp
- type Hooks
- type ReconcileTimer
- type Reconciler
- func (r *Reconciler) AttachWatches(controller controller.Controller) error
- func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
- func (r *Reconciler) ReconcileFetchPlaceholderSecrets(pkgr pkgv1alpha1.PackageRepository, app *v1alpha1.App) error
- func (r *Reconciler) UpdatePackageRepoRefs(refKeys map[reftracker.RefKey]struct{}, app *v1alpha1.App)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterResources ¶ added in v0.38.0
FilterResources takes a multi-doc yaml of the templated contents of a PKGR, and filters out unexpected fields on each resource by deserializing and re-serializing. This filtering step allows us to use newer CRDs (with new fields) in older versions of kc without triggering a mistmatch in the rebase "is_identical" checker.
func NewPackageRepoApp ¶
func NewPackageRepoApp(pkgRepository *pkgingv1alpha1.PackageRepository) (*kcv1alpha1.App, error)
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (App) HasImageOrImgpkgBundle ¶ added in v0.24.0
HasImageOrImgpkgBundle is used to determine if the App's spec contains a fetch stage for an image or imgpkgbundle. It is mainly used to determine whether to retry a fetch attempt when placeholder secrets are involved with authenticating to private registries. Placeholder secrets are not always populated quick enough for Apps to use the secret, and private auth is only supported for images/bundles, so this helps to narrow down when to retry a fetch attempt.
func (*App) SecretRefs ¶
func (a *App) SecretRefs() map[reftracker.RefKey]struct{}
type AppFactory ¶ added in v0.25.0
type AppFactory struct { CoreClient kubernetes.Interface AppClient kcclient.Interface KcConfig *config.Config }
AppFactory allows to create "hidden" Apps for reconciling PackageRepositories.
func (*AppFactory) NewCRDPackageRepo ¶ added in v0.25.0
func (f *AppFactory) NewCRDPackageRepo(app *kcv1alpha1.App, pkgr *pkgv1alpha1.PackageRepository, log logr.Logger) *CRDApp
NewCRDPackageRepo constructs "hidden" App to reconcile PackageRepository.
type CRDApp ¶
type CRDApp struct {
// contains filtered or unexported fields
}
func NewCRDApp ¶
func NewCRDApp(appModel *kcv1alpha1.App, packageRepo *pkgingv1alpha1.PackageRepository, log logr.Logger, appClient kcclient.Interface, fetchFactory fetch.Factory, templateFactory template.Factory, deployFactory deploy.Factory) *CRDApp
func (*CRDApp) ResourceRefs ¶
func (a *CRDApp) ResourceRefs() map[reftracker.RefKey]struct{}
type ReconcileTimer ¶
type ReconcileTimer struct {
// contains filtered or unexported fields
}
func NewReconcileTimer ¶
func NewReconcileTimer(app v1alpha1.App) ReconcileTimer
func (ReconcileTimer) DurationUntilReady ¶
func (rt ReconcileTimer) DurationUntilReady(err error) time.Duration
type Reconciler ¶ added in v0.25.0
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler is responsible for reconciling PackageRepositories.
func NewReconciler ¶ added in v0.25.0
func NewReconciler(appClient kcclient.Interface, coreClient kubernetes.Interface, log logr.Logger, appFactory AppFactory, appRefTracker *reftracker.AppRefTracker, appUpdateStatus *reftracker.AppUpdateStatus) *Reconciler
NewReconciler is the constructor for the Reconciler struct
func (*Reconciler) AttachWatches ¶ added in v0.25.0
func (r *Reconciler) AttachWatches(controller controller.Controller) error
AttachWatches configures watches needed for reconciler to reconcile PackageRepository.
func (*Reconciler) Reconcile ¶ added in v0.25.0
func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
Reconcile ensures that Packages/PackageMetadatas are imported into the cluster from given PackageRepository.
func (*Reconciler) ReconcileFetchPlaceholderSecrets ¶ added in v0.25.0
func (r *Reconciler) ReconcileFetchPlaceholderSecrets(pkgr pkgv1alpha1.PackageRepository, app *v1alpha1.App) error
ReconcileFetchPlaceholderSecrets helps determine if a placeholder secret needs to be created for the PackageRepository. This placeholder secret is populated by secretgen-controller so PackageRepositories can authenticate to private registries without needing to explicitly declare a secretRef. If no secretRef is specified for the PackageRepository, the placeholder is created and used by the PackageRepository.
func (*Reconciler) UpdatePackageRepoRefs ¶ added in v0.25.0
func (r *Reconciler) UpdatePackageRepoRefs(refKeys map[reftracker.RefKey]struct{}, app *v1alpha1.App)
nolint: revive