Documentation ¶
Index ¶
- Constants
- func ExtractPlugins(obj ObjectWithAnnotationsAndNamespace) []string
- func ExtractPluginsNamespacedNames(obj ObjectWithAnnotationsAndNamespace) []types.NamespacedName
- func ExtractPluginsWithNamespaces(obj ObjectWithAnnotationsAndNamespace) []string
- func ExtractTags(obj ObjectWithAnnotations) []string
- type ObjectWithAnnotations
- type ObjectWithAnnotationsAndNamespace
Constants ¶
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" )
Variables ¶
This section is empty.
Functions ¶
func ExtractPlugins ¶ added in v0.0.38
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 ¶ added in v0.0.42
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 ¶ added in v0.0.38
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 ExtractTags ¶
func ExtractTags(obj ObjectWithAnnotations) []string
ExtractTags extracts a set of tags from a comma-separated string. Copy pasted from: https://github.com/Kong/kubernetes-ingress-controller/blob/eb80ec2c58f4d53f8c6d7c997bcfb1f334b801e1/internal/annotations/annotations.go#L407-L416
Types ¶
type ObjectWithAnnotations ¶
ObjectWithAnnotations is an interface that provides a method to get annotations.
type ObjectWithAnnotationsAndNamespace ¶ added in v0.0.38
type ObjectWithAnnotationsAndNamespace interface { ObjectWithAnnotations GetNamespace() string }
ObjectWithAnnotationsAndNamespace is an interface that provides a method to get annotations and namespace.