statusutils

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: Apache-2.0 Imports: 7 Imported by: 10

Documentation

Index

Constants

View Source
const PodNamespaceEnvName = "POD_NAMESPACE"

The name of the environment variable used by resource reporters to associate a resource status with the appropriate controller statusReporterNamespace

Variables

This section is empty.

Functions

func GetSingleStatusInNamespacedStatuses

func GetSingleStatusInNamespacedStatuses(resource resources.InputResource) *core.Status

func GetStatusReporterNamespaceFromEnv

func GetStatusReporterNamespaceFromEnv() (string, error)

func SetSingleStatusInNamespacedStatuses

func SetSingleStatusInNamespacedStatuses(resource resources.InputResource, status *core.Status)

func UpdateNamespacedStatuses

func UpdateNamespacedStatuses(resource resources.InputResource, updateFunc func(namespacedStatuses *core.NamespacedStatuses) error) error

func UpdateStatus

func UpdateStatus(resource resources.InputResource, updateFunc func(status *core.Status) error, statusClient resources.StatusClient) error

Types

type NamespacedStatusesClient

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

InputResources support multiple statuses, each set by a particular controller Each controller should only update its own status, so we expose a client with simple Get/Set capabilities. This way, the consumers of this client do not need to be aware of the statusReporterNamespace.

func NewNamespacedStatusesClient

func NewNamespacedStatusesClient(namespace string) *NamespacedStatusesClient

func (*NamespacedStatusesClient) GetStatus

func (*NamespacedStatusesClient) SetStatus

func (s *NamespacedStatusesClient) SetStatus(resource resources.InputResource, status *core.Status)

type NamespacedStatusesUnmarshaler

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

func NewNamespacedStatusesUnmarshaler

func NewNamespacedStatusesUnmarshaler(
	statusReporterNamespace string,
	unmarshalMapToProto func(m map[string]interface{}, into proto.Message) error) *NamespacedStatusesUnmarshaler

func (*NamespacedStatusesUnmarshaler) UnmarshalStatus

func (i *NamespacedStatusesUnmarshaler) UnmarshalStatus(resourceStatus v1.Status, into resources.InputResource) error

type NoOpStatusClient

type NoOpStatusClient struct {
}

func NewNoOpStatusClient

func NewNoOpStatusClient() *NoOpStatusClient

func (*NoOpStatusClient) GetStatus

func (n *NoOpStatusClient) GetStatus(resource resources.InputResource) *core.Status

func (*NoOpStatusClient) SetStatus

func (n *NoOpStatusClient) SetStatus(resource resources.InputResource, status *core.Status)

Jump to

Keyboard shortcuts

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