labelenforcingclient

package
v0.1.89 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 5 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 (
	CacheLabelSelectorKey   = "hypershift.openshift.io/managed"
	CacheLabelSelectorValue = "true"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LabelEnforcingClient

type LabelEnforcingClient struct {
	client.Client
	// contains filtered or unexported fields
}

LabelEnforcingClient enforces that its configured labels are set during a Create or Update call

func New

func New(upstream client.Client, labels map[string]string) *LabelEnforcingClient

func (*LabelEnforcingClient) Create

func (*LabelEnforcingClient) Update

type LabelEnforcingUpsertProvider

type LabelEnforcingUpsertProvider struct {
	Upstream  upsert.CreateOrUpdateProvider
	APIClient client.Client
}

LabelEnforcingUpsertProvider wraps an existing upsert provider who is called with a cache-backed client that has a labelselector configured. If someone unlabels an object, the upserprovider will always get a notfound when trying to Get is, because it is not in the cache. Thus it will subsequently try to Create it, which will fail with an IsAlreadyExists since it exists in the api. To deal with this, the LabelEnforcingUpsertProvider simply re-runs the upsert logic with an api reading client if an IsAlreadyExists happened.

func (*LabelEnforcingUpsertProvider) CreateOrUpdate

Jump to

Keyboard shortcuts

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