ocp

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RetryDelay = time.Second * 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseCollection

type BaseCollection struct {
	// Associated data reconciler.
	Reconciler *Reconciler
}

Base collection.

func (*BaseCollection) Bind

func (r *BaseCollection) Bind(reconciler *Reconciler)

Associate with a reconciler.

type Cluster

type Cluster interface {
	meta.Object
	// Build the REST configuration
	// for the remote cluster.
	RestCfg(*core.Secret) *rest.Config
}

Cluster.

type Collection

type Collection interface {
	predicate.Predicate
	// Bind to a reconciler.
	Bind(*Reconciler)
	// Get kubernetes resource object.
	Object() runtime.Object
	// Initial reconcile.
	Reconcile(context.Context) error
}

Resource collection.

type ModelEvent

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

Model event. Used with `eventChannel`.

func (*ModelEvent) Apply

func (r *ModelEvent) Apply(rl *Reconciler) (err error)

Apply the change to the DB.

func (ModelEvent) Create

func (r ModelEvent) Create(m libmodel.Model) ModelEvent

Set the event model and action.

func (ModelEvent) Delete

func (r ModelEvent) Delete(m libmodel.Model) ModelEvent

Set the event model and action.

func (ModelEvent) Update

func (r ModelEvent) Update(m libmodel.Model) ModelEvent

Set the event model and action.

type Reconciler

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

An OpenShift reconciler.

func New

func New(
	db libmodel.DB,
	cluster Cluster,
	secret *core.Secret,
	collections ...Collection) *Reconciler

New reconciler.

func (*Reconciler) Client

func (r *Reconciler) Client() client.Client

Get the Client.

func (*Reconciler) Create

func (r *Reconciler) Create(m libmodel.Model)

Enqueue create model event. Used by watch predicates. Swallow panic: send on closed channel.

func (*Reconciler) DB

func (r *Reconciler) DB() libmodel.DB

Get the DB.

func (*Reconciler) Delete

func (r *Reconciler) Delete(m libmodel.Model)

Enqueue delete model event. Used by watch predicates. Swallow panic: send on closed channel.

func (*Reconciler) HasParity added in v0.2.9

func (r *Reconciler) HasParity() bool

Reconciler has achieved parity.

func (*Reconciler) Name

func (r *Reconciler) Name() string

The name.

func (*Reconciler) Owner

func (r *Reconciler) Owner() meta.Object

The owner.

func (*Reconciler) Reconcile

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

Never called.

func (*Reconciler) Reset

func (r *Reconciler) Reset()

Reset.

func (*Reconciler) Shutdown

func (r *Reconciler) Shutdown()

Shutdown the reconciler.

  1. Close manager stop channel.
  2. Close watch event coroutine channel.
  3. Cancel the context.

func (*Reconciler) Start

func (r *Reconciler) Start() error

Start the reconciler.

func (*Reconciler) Test added in v0.2.8

func (r *Reconciler) Test() error

Test connection with credentials.

func (*Reconciler) Update

func (r *Reconciler) Update(m libmodel.Model)

Enqueue update model event. Used by watch predicates. Swallow panic: send on closed channel.

func (*Reconciler) UpdateThreshold

func (r *Reconciler) UpdateThreshold(m libmodel.Model)

Update the versionThreshold

Jump to

Keyboard shortcuts

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