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 ¶
LabelEnforcingClient enforces that its configured labels are set during a Create or Update call
func (*LabelEnforcingClient) Create ¶
func (l *LabelEnforcingClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
func (*LabelEnforcingClient) Update ¶
func (l *LabelEnforcingClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
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 subsquently 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 ¶
func (l *LabelEnforcingUpsertProvider) CreateOrUpdate(ctx context.Context, c client.Client, obj client.Object, f controllerutil.MutateFn) (controllerutil.OperationResult, error)
Click to show internal directories.
Click to hide internal directories.