Documentation ¶
Index ¶
- Constants
- type Failing
- func (o *Failing) Create(key string, rls *release.Release) error
- func (o *Failing) Delete(key string) (*release.Release, error)
- func (o *Failing) Get(key string) (*release.Release, error)
- func (o *Failing) List(filter func(*release.Release) bool) ([]*release.Release, error)
- func (o *Failing) Name() string
- func (o *Failing) Query(keyvals map[string]string) ([]*release.Release, error)
- func (o *Failing) Update(key string, rls *release.Release) error
- type ObserveFunc
- type Observer
- func (o *Observer) Create(key string, rls *helmrelease.Release) error
- func (o *Observer) Delete(key string) (*helmrelease.Release, error)
- func (o *Observer) Get(key string) (*helmrelease.Release, error)
- func (o *Observer) List(filter func(*helmrelease.Release) bool) ([]*helmrelease.Release, error)
- func (o *Observer) Name() string
- func (o *Observer) Query(keyvals map[string]string) ([]*helmrelease.Release, error)
- func (o *Observer) Update(key string, rls *helmrelease.Release) error
Constants ¶
const (
// FailingDriverName is the name of the failing driver.
FailingDriverName = "failing"
)
const ObserverDriverName = "observer"
ObserverDriverName contains the string representation of Observer.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Failing ¶
type Failing struct { driver.Driver // GetErr is returned by Get if configured. If not set, the embedded driver // result is returned. GetErr error // ListErr is returned by List if configured. If not set, the embedded // driver result is returned. ListErr error // QueryErr is returned by Query if configured. If not set, the embedded // driver result is returned. QueryErr error // CreateErr is returned by Create if configured. If not set, the embedded // driver result is returned. CreateErr error // UpdateErr is returned by Update if configured. If not set, the embedded // driver result is returned. UpdateErr error // DeleteErr is returned by Delete if configured. If not set, the embedded // driver result is returned. DeleteErr error }
Failing is a failing Helm storage driver that returns the configured errors.
type ObserveFunc ¶
type ObserveFunc func(rel *helmrelease.Release)
ObserveFunc observes a release which has been successfully persisted to storage. NOTE: while it takes a pointer, the caller is expected to perform a read-only operation.
type Observer ¶
type Observer struct {
// contains filtered or unexported fields
}
Observer is an observing Helm storage driver.
It can be configured with a list of ObserveFunc functions that are called after a successful persistence operation to the underlying driver.
This allows for observations on persisted state as performed by the driver, and works around the inconsistent behavior of some Helm actions that may return an object that was not actually persisted to the Helm storage (e.g. because a validation error occurred during a Helm upgrade).
func NewObserver ¶
func NewObserver(driver helmdriver.Driver, observers ...ObserveFunc) *Observer
NewObserver creates a new Observer for the given Helm storage driver.
func (*Observer) Create ¶
func (o *Observer) Create(key string, rls *helmrelease.Release) error
Create creates a new release or returns driver.ErrReleaseExists. It observes the release as provided after a successful creation.
func (*Observer) Delete ¶
func (o *Observer) Delete(key string) (*helmrelease.Release, error)
Delete deletes a release or returns driver.ErrReleaseNotFound. After a successful deletion, it observes the release as returned by the embedded driver.Deletor.
func (*Observer) Get ¶
func (o *Observer) Get(key string) (*helmrelease.Release, error)
Get returns the release named by key or returns ErrReleaseNotFound.
func (*Observer) List ¶
func (o *Observer) List(filter func(*helmrelease.Release) bool) ([]*helmrelease.Release, error)
List returns the list of all releases such that filter(release) == true.