references

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2025 HAProxy Technologies LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReferencedBy

type ReferencedBy[OwnerKey loggableKey] struct {
	// Owner: Gate Key -> GVK of Owner -> Owner Key
	Owner map[client.ObjectKey]map[schema.GroupVersionKind]map[OwnerKey]struct{}
	Name  string
}

func NewReferencedBy

func NewReferencedBy[OwnerKey loggableKey](name string) ReferencedBy[OwnerKey]

func (*ReferencedBy[OwnerKey]) AddReferencedByUsingKeys

func (r *ReferencedBy[OwnerKey]) AddReferencedByUsingKeys(logger *slog.Logger, ownedKey client.ObjectKey, ownerKey OwnerKey, ownerGVK schema.GroupVersionKind)

func (*ReferencedBy[OwnerKey]) AllReferenced

func (r *ReferencedBy[OwnerKey]) AllReferenced(ownerGVK schema.GroupVersionKind) map[client.ObjectKey]map[OwnerKey]struct{}

AllReferenced returns all owned keys that are referenced by a given ownerGVK, along with the list of owner keys For examples, return all secrets that are referenced by a Gateway, along with the owner Gateway keys map[ownedKey] => map [ownerKey] => struct{}

func (*ReferencedBy[OwnerKey]) AllReferencedByAnyOf added in v1.1.0

func (r *ReferencedBy[OwnerKey]) AllReferencedByAnyOf(ownerGVKs ...schema.GroupVersionKind) map[client.ObjectKey]map[OwnerKey]struct{}

AllReferencedByAnyOf returns every owned key referenced by an owner of any of the given kinds, with the owner keys merged into one set per owned key.

It exists because one owned object can be referenced by owners of different kinds and a consumer may legitimately want all of them: a Secret is referenced by a Gateway listener's certificateRefs and by a ListenerSet entry's, and the certificate builder has to write a PEM for it either way. Asking per kind and merging in the caller would put the union in every consumer, where forgetting one kind produces a listener bound to a port with no certificate -- a failure visible only in a TLS handshake.

The kinds stay a parameter rather than becoming "all kinds": the owner GVK is also what a ReferenceGrant is resolved against, so a consumer that must distinguish them keeps AllReferenced.

func (*ReferencedBy[OwnerKey]) CleanOwners

func (r *ReferencedBy[OwnerKey]) CleanOwners()

func (ReferencedBy[OwnerKey]) DeepCopy

func (r ReferencedBy[OwnerKey]) DeepCopy() ReferencedBy[OwnerKey]

func (*ReferencedBy[OwnerKey]) ReferencedBy

func (r *ReferencedBy[OwnerKey]) ReferencedBy(owned client.Object, ownerGVK schema.GroupVersionKind) map[OwnerKey]struct{}

func (*ReferencedBy[OwnerKey]) ReferencedByUsingKeys

func (r *ReferencedBy[OwnerKey]) ReferencedByUsingKeys(ownedKey client.ObjectKey, ownerGVK schema.GroupVersionKind) map[OwnerKey]struct{}

func (*ReferencedBy[OwnerKey]) RemoveReferencedByUsingKeys

func (r *ReferencedBy[OwnerKey]) RemoveReferencedByUsingKeys(logger *slog.Logger, ownedKey client.ObjectKey, ownerKey OwnerKey, ownerGVK schema.GroupVersionKind)

Jump to

Keyboard shortcuts

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