app

package
v0.54.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func NewApp

func NewApp(app v1alpha1.App, hooks Hooks,
	fetchFactory fetch.Factory, templateFactory template.Factory,
	deployFactory deploy.Factory, log logr.Logger, opts Opts, appMetrics *metrics.Metrics, compInfo ComponentInfo) *App

func (*App) ConfigMapRefs added in v0.52.0

func (a *App) ConfigMapRefs() map[reftracker.RefKey]struct{}

Get all ConfigMapRefs from App spec

func (App) HasImageOrImgpkgBundle added in v0.52.0

func (a App) HasImageOrImgpkgBundle() bool

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) Kind added in v0.52.0

func (a *App) Kind() string

Kind return kind of App

func (*App) Name

func (a *App) Name() string

func (*App) Namespace

func (a *App) Namespace() string

func (*App) Reconcile

func (a *App) Reconcile(force bool) (reconcile.Result, error)

Reconcile is not expected to be called concurrently

func (*App) SecretRefs added in v0.52.0

func (a *App) SecretRefs() map[reftracker.RefKey]struct{}

Get all SecretRefs from App spec

func (*App) Status

func (a *App) Status() v1alpha1.AppStatus

func (*App) StatusAsYAMLBytes

func (a *App) StatusAsYAMLBytes() ([]byte, error)

type CRDApp

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

func NewCRDApp

func NewCRDApp(appModel *kcv1alpha1.App, log logr.Logger, appMetrics *metrics.Metrics, appClient kcclient.Interface, fetchFactory fetch.Factory,
	templateFactory template.Factory, deployFactory deploy.Factory,
	compInfo ComponentInfo, opts Opts) *CRDApp

NewCRDApp creates new CRD app

func (*CRDApp) Reconcile

func (a *CRDApp) Reconcile(force bool) (reconcile.Result, error)

func (*CRDApp) ResourceRefs added in v0.52.0

func (a *CRDApp) ResourceRefs() map[reftracker.RefKey]struct{}

Get both secret refs/configmap refs as single map with all ref entries.

type CRDAppFactory added in v0.52.0

type CRDAppFactory struct {
	CoreClient       kubernetes.Interface
	AppClient        kcclient.Interface
	KcConfig         *config.Config
	AppMetrics       *metrics.Metrics
	VendirConfigHook func(vendirconf.Config) vendirconf.Config
	KbldAllowBuild   bool
	CmdRunner        exec.CmdRunner
	Kubeconf         *kubeconfig.Kubeconfig
	CompInfo         ComponentInfo
	DeployFactory    deploy.Factory
	CacheFolder      *memdir.TmpDir
}

CRDAppFactory allows to create CRDApps.

func (*CRDAppFactory) NewCRDApp added in v0.52.0

func (f *CRDAppFactory) NewCRDApp(app *kcv1alpha1.App, log logr.Logger) *CRDApp

NewCRDApp creates a CRDApp injecting necessary dependencies.

type CRDAppWatcher

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

func NewCRDAppWatcher

func NewCRDAppWatcher(app v1alpha1.App, appClient kcclient.Interface) CRDAppWatcher

func (CRDAppWatcher) Watch

func (w CRDAppWatcher) Watch(callback func(v1alpha1.App), cancelCh chan struct{}) error

type ComponentInfo added in v0.52.0

type ComponentInfo interface {
	KappControllerVersion() (semver.Version, error)
	KubernetesVersion(serviceAccountName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta) (semver.Version, error)
	KubernetesAPIs() ([]string, error)
	NamespaceStatus(name string) (v1.NamespaceStatus, error)
}

ComponentInfo provides information about components of the system required by templating stage

type Hooks added in v0.52.0

type Hooks struct {
	BlockDeletion   func() error
	UnblockDeletion func() error
	UpdateStatus    func(string) error
	WatchChanges    func(func(v1alpha1.App), chan struct{}) error
}

type Opts added in v0.52.0

type Opts struct {
	DefaultSyncPeriod time.Duration
	MinimumSyncPeriod time.Duration
}

Opts keeps App reconciliation options

type ReconcileTimer added in v0.52.0

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

ReconcileTimer determines how much time is left until next App reconciliation is necessary.

func NewReconcileTimer added in v0.52.0

func NewReconcileTimer(app v1alpha1.App, opts ReconcileTimerOpts) ReconcileTimer

NewReconcileTimer returns a new ReconcileTimer for a given App.

func (ReconcileTimer) DurationUntilReady added in v0.52.0

func (rt ReconcileTimer) DurationUntilReady(err error) time.Duration

func (ReconcileTimer) IsReadyAt added in v0.52.0

func (rt ReconcileTimer) IsReadyAt(timeAt time.Time) bool

type ReconcileTimerOpts added in v0.52.0

type ReconcileTimerOpts struct {
	DefaultSyncPeriod time.Duration
	MinimumSyncPeriod time.Duration
}

ReconcileTimerOpts keeps duration settings

type Reconciler added in v0.52.0

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

Reconciler is responsible for reconciling Apps.

func NewReconciler added in v0.52.0

func NewReconciler(appClient kcclient.Interface, log logr.Logger, crdAppFactory CRDAppFactory,
	appRefTracker *reftracker.AppRefTracker, appUpdateStatus *reftracker.AppUpdateStatus, componentInfo ComponentInfo) *Reconciler

NewReconciler constructs new Reconciler.

func (*Reconciler) AppRefTracker added in v0.52.0

func (r *Reconciler) AppRefTracker() *reftracker.AppRefTracker

nolint: revive TODO should be removed since AppRefTracker is passed into this object

func (*Reconciler) AttachWatches added in v0.52.0

func (r *Reconciler) AttachWatches(controller controller.Controller, mgr manager.Manager) error

AttachWatches configures watches needed for reconciler to reconcile Apps.

func (*Reconciler) Reconcile added in v0.52.0

func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

nolint: revive

func (*Reconciler) UpdateAppRefs added in v0.52.0

func (r *Reconciler) UpdateAppRefs(refKeys map[reftracker.RefKey]struct{}, app *v1alpha1.App)

nolint: revive TODO should be made private

Jump to

Keyboard shortcuts

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