metadata

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 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 (

	// AnnotationKeyTags is the annotation key used to set tags on resources.
	AnnotationKeyTags = annotationPrefix + "/tags"

	// AnnotationKeyPlugins is the annotation key used to attach KongPlugins to resources.
	AnnotationKeyPlugins = annotationPrefix + "/plugins"

	// AnnotationKeyKonnectCPLabels is the annotation key used to set Konnect labels on the
	// KonnectGatewayControlPlane created for a Gateway.
	AnnotationKeyKonnectCPLabels = annotationPrefix + "/konnect-cp-labels"

	// AnnotationKeyKonnectDPLabels is the annotation key used to set Konnect labels on the
	// KonnectExtension (and thus the Konnect DataPlane) created for a Gateway.
	AnnotationKeyKonnectDPLabels = annotationPrefix + "/konnect-dp-labels"
)

Variables

View Source
var ReservedTagPrefixes = []string{
	"k8s-generation:",
	"k8s-group:",
	"k8s-kind:",
	"k8s-name:",
	"k8s-namespace:",
	"k8s-uid:",
	"k8s-version:",
	"managed-by:",
}

ReservedTagPrefixes are the prefixes of the tags the operator attaches to Konnect entities to carry the metadata of the source Kubernetes object (e.g. "k8s-uid:<uid>"). Users must not set tags with these prefixes as the operator relies on them, e.g. to find the Konnect entity owned by a Kubernetes object by its UID.

Functions

func ExtractPlugins

func ExtractPlugins(obj ObjectWithAnnotationsAndNamespace) []string

ExtractPlugins extracts plugin names from the given object's konghq.com/plugins annotation. This function trims the whitespace from the plugin names.

For example, for KongConsumer in namespace default, having the "konghq.com/plugins" annotation set to "p1,p2" this will return []string{"p1", "p2"}.

func ExtractPluginsNamespacedNames

func ExtractPluginsNamespacedNames(obj ObjectWithAnnotationsAndNamespace) []types.NamespacedName

ExtractPluginsNamespacedNames extracts plugin namespaced names from the given object's konghq.com/plugins annotation. Plugins can optionally specify the namespace using the "<namespace>:<plugin-name>" format. This function trims the whitespace from the plugin names.

For example, for an object having the "konghq.com/plugins" annotation set to "default:p1,p2" this will return:

 []types.NamespacedName{
		types.NamespacedName{Namespace: "default", Name: "p1"},
		types.NamespacedName{Namespace: "", Name: "p2"},
	}

func ExtractPluginsWithNamespaces

func ExtractPluginsWithNamespaces(obj ObjectWithAnnotationsAndNamespace) []string

ExtractPluginsWithNamespaces extracts plugin namespaced names from the given object's konghq.com/plugins annotation. This function trims the whitespace from the plugin names.

For example, for KongConsumer in namespace default, having the "konghq.com/plugins" annotation set to "p1,p2" this will return []string{"default/p1", "default/p2"}.

func IsReservedTag added in v2.4.0

func IsReservedTag(tag string) bool

IsReservedTag returns true if the given tag starts with one of the ReservedTagPrefixes.

func ReservedTags added in v2.4.0

func ReservedTags(tags []string) []string

ReservedTags returns the tags from the given list which start with one of the ReservedTagPrefixes.

func WithoutReservedTags added in v2.4.0

func WithoutReservedTags(tags []string) []string

WithoutReservedTags returns the tags from the given list which do not start with any of the ReservedTagPrefixes. It returns nil if no tags are left.

Types

type ObjectWithAnnotations

type ObjectWithAnnotations interface {
	GetAnnotations() map[string]string
}

ObjectWithAnnotations is an interface that provides a method to get annotations.

type ObjectWithAnnotationsAndNamespace

type ObjectWithAnnotationsAndNamespace interface {
	ObjectWithAnnotations
	GetNamespace() string
}

ObjectWithAnnotationsAndNamespace is an interface that provides a method to get annotations and namespace.

Jump to

Keyboard shortcuts

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