ocp

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 20 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 collector.
	Collector *Collector
}

Base collection.

func (*BaseCollection) Bind

func (r *BaseCollection) Bind(collector *Collector)

Associate with a collector.

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 collector.
	Bind(*Collector)
	// Get kubernetes resource object.
	Object() runtime.Object
	// Initial reconcile.
	Reconcile(context.Context) error
}

Resource collection.

type Collector added in v0.6.0

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

An OpenShift collector.

func New

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

New collector.

func (*Collector) Client added in v0.6.0

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

Get the Client.

func (*Collector) Create added in v0.6.0

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

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

func (*Collector) DB added in v0.6.0

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

Get the DB.

func (*Collector) Delete added in v0.6.0

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

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

func (*Collector) HasParity added in v0.6.0

func (r *Collector) HasParity() bool

Collector has achieved parity.

func (*Collector) Name added in v0.6.0

func (r *Collector) Name() string

The name.

func (*Collector) Owner added in v0.6.0

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

The owner.

func (*Collector) Reconcile added in v0.6.0

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

Never called.

func (*Collector) Reset added in v0.6.0

func (r *Collector) Reset()

Reset.

func (*Collector) Shutdown added in v0.6.0

func (r *Collector) Shutdown()

Shutdown the collector.

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

func (*Collector) Start added in v0.6.0

func (r *Collector) Start() error

Start the collector.

func (*Collector) Test added in v0.6.0

func (r *Collector) Test() error

Test connection with credentials.

func (*Collector) Update added in v0.6.0

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

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

func (*Collector) UpdateThreshold added in v0.6.0

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

Update the versionThreshold

type ModelEvent

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

Model event. Used with `eventChannel`.

func (*ModelEvent) Apply

func (r *ModelEvent) Apply(rl *Collector) (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.

Jump to

Keyboard shortcuts

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