generic

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 36 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ResourceStatusStabilizingDuration time.Duration = 2 * time.Second

Variables

View Source
var ResourceStatusJSONPathConditions []*ResourceStatusJSONPathCondition

Functions

func NewResourceStatusIndicator

func NewResourceStatusIndicator(object *unstructured.Unstructured) (indicator *indicators.StringEqualConditionIndicator, humanJSONPath string, err error)

func SetWatchErrorHandler added in v0.9.5

func SetWatchErrorHandler(cancelFn context.CancelFunc, resName string, setWatchErrorHandler func(handler cache.WatchErrorHandler) error, opts SetWatchErrorHandlerOptions) error

Types

type ContribResourceStatusRules added in v0.11.0

type ContribResourceStatusRules struct {
	Rules []struct {
		ResourceGroup *string `yaml:"resourceGroup"`
		ResourceKind  *string `yaml:"resourceKind"`
		JSONPath      string  `yaml:"jsonPath"`
		HumanJSONPath string  `yaml:"humanJsonPath"`
		Conditions    struct {
			Ready       []string `yaml:"ready"`
			Progressing []string `yaml:"progressing"`
			Failed      []string `yaml:"failed"`
		} `yaml:"conditions"`
	} `yaml:"rules"`
}

type EventStatus

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

func NewEventStatus

func NewEventStatus(event *corev1.Event) *EventStatus

func (*EventStatus) FailureReason

func (s *EventStatus) FailureReason() string

func (*EventStatus) IsFailure

func (s *EventStatus) IsFailure() bool

type Feed

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

func NewFeed

func NewFeed(tracker *Tracker) *Feed

func (*Feed) OnAdded

func (f *Feed) OnAdded(function func(status *ResourceStatus) error)

func (*Feed) OnEventMsg

func (f *Feed) OnEventMsg(function func(event *corev1.Event) error)

func (*Feed) OnFailed

func (f *Feed) OnFailed(function func(status *ResourceStatus) error)

func (*Feed) OnReady

func (f *Feed) OnReady(function func(status *ResourceStatus) error)

func (*Feed) OnStatus

func (f *Feed) OnStatus(function func(status *ResourceStatus) error)

func (*Feed) Track

func (f *Feed) Track(ctx context.Context, timeout, noActivityTimeout time.Duration) error

type ResourceEventsWatcher

type ResourceEventsWatcher struct {
	ResourceID *resid.ResourceID
	// contains filtered or unexported fields
}

func NewResourceEventsWatcher

func NewResourceEventsWatcher(
	object *unstructured.Unstructured,
	resID *resid.ResourceID,
	client kubernetes.Interface,
) *ResourceEventsWatcher

func (*ResourceEventsWatcher) Run

func (i *ResourceEventsWatcher) Run(ctx context.Context, eventsCh chan<- *corev1.Event) error

type ResourceStateWatcher

type ResourceStateWatcher struct {
	ResourceID *resid.ResourceID
	// contains filtered or unexported fields
}

func NewResourceStateWatcher

func NewResourceStateWatcher(
	resID *resid.ResourceID,
	client kubernetes.Interface,
	dynClient dynamic.Interface,
	mapper meta.RESTMapper,
) *ResourceStateWatcher

func (*ResourceStateWatcher) Run

func (w *ResourceStateWatcher) Run(ctx context.Context, resourceAddedCh, resourceModifiedCh, resourceDeletedCh chan<- *unstructured.Unstructured) error

type ResourceStatus

type ResourceStatus struct {
	Indicator *indicators.StringEqualConditionIndicator
	// contains filtered or unexported fields
}

func NewDeletedResourceStatus

func NewDeletedResourceStatus() *ResourceStatus

func NewFailedResourceStatus

func NewFailedResourceStatus(failureReason string) *ResourceStatus

func NewResourceStatus

func NewResourceStatus(object *unstructured.Unstructured) (*ResourceStatus, error)

func NewSucceededResourceStatus added in v0.9.5

func NewSucceededResourceStatus() *ResourceStatus

func (*ResourceStatus) DiffersFrom

func (s *ResourceStatus) DiffersFrom(newStatus *ResourceStatus) bool

func (*ResourceStatus) FailureReason

func (s *ResourceStatus) FailureReason() string

func (*ResourceStatus) HumanConditionPath

func (s *ResourceStatus) HumanConditionPath() string

func (*ResourceStatus) IsDeleted

func (s *ResourceStatus) IsDeleted() bool

func (*ResourceStatus) IsFailed

func (s *ResourceStatus) IsFailed() bool

func (*ResourceStatus) IsReady

func (s *ResourceStatus) IsReady() bool

type ResourceStatusJSONPathCondition added in v0.11.0

type ResourceStatusJSONPathCondition struct {
	GroupKind     *schema.GroupKind
	JSONPath      string
	HumanPath     string
	ReadyValues   []string
	PendingValues []string
	FailedValues  []string

	CurrentValue string
}

type SetWatchErrorHandlerOptions added in v0.9.5

type SetWatchErrorHandlerOptions struct {
	FatalWatchErr *UnrecoverableWatchError // If unrecoverable watch error occurred it will be saved here.
}

type Tracker

type Tracker struct {
	ResourceID *resid.ResourceID
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker(
	resID *resid.ResourceID,
	client kubernetes.Interface,
	dynClient dynamic.Interface,
	discClient discovery.CachedDiscoveryInterface,
	mapper meta.RESTMapper,
) *Tracker

func (*Tracker) Track

func (t *Tracker) Track(ctx context.Context, noActivityTimeout time.Duration, addedCh, succeededCh, failedCh, regularCh chan<- *ResourceStatus, eventCh chan<- *corev1.Event) error

type TrackerState

type TrackerState string
const (
	TrackerStateInitial           TrackerState = "TrackerStateInitial"
	TrackerStateStatusStabilizing TrackerState = "TrackerStateStatusStabilizing"
	TrackerStateStarted           TrackerState = "TrackerStateStarted"
	TrackerStateResourceAdded     TrackerState = "TrackerStateResourceAdded"
	TrackerStateResourceSucceeded TrackerState = "TrackerStateResourceSucceeded"
	TrackerStateResourceFailed    TrackerState = "TrackerStateResourceFailed"
	TrackerStateResourceDeleted   TrackerState = "TrackerStateResourceDeleted"
)

type UnrecoverableWatchError added in v0.9.5

type UnrecoverableWatchError struct {
	ResName string
	Err     error
}

func (UnrecoverableWatchError) Error added in v0.9.5

func (e UnrecoverableWatchError) Error() string

func (UnrecoverableWatchError) Unwrap added in v0.9.5

func (e UnrecoverableWatchError) Unwrap() error

Jump to

Keyboard shortcuts

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