resources

package
v0.0.0-...-6dac9e7 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package resources contains the Manager interface for reconciling arbitrary resources with a Kubernetes API server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// Reconcile will reconcile the provided manifest of one or more objects with
	// the API server. The snapshot provided must match the manifest.
	Reconcile(ctx context.Context, snapshot *konfigurationv1.Snapshot, manifest []byte) (changeSet string, err error)
	// Prune will attempt to garbage-collect resources represented in the lastSnapshot that
	// were not created in the newSnapshot.
	Prune(ctx context.Context, lastSnapshot, newSnapshot *konfigurationv1.Snapshot) (changeSet string, success bool)
}

Manager is the main interface for reconciling resources from built manifests.

func NewResourceManager

func NewResourceManager(cl client.Client, parent ReconcileeWithTimeout) Manager

NewKonfigurationManager creates a new resource manager for the given konfiguration using the given client.

type ReconcileeWithTimeout

type ReconcileeWithTimeout interface {
	client.Object
	// GetTimeout should return the timeout for reconciliation options
	GetTimeout() time.Duration
	// ShouldValidate should return whether objects should be validated with a dry-run
	// before creation or updating.
	// TODO: This just triggers a dry-run first, should be more intelligent
	ShouldValidate() bool
}

ReconcileeWithTimeout is an interface extending client.Object that includes a method for retrieving a reconciliation timeout.

Jump to

Keyboard shortcuts

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