gwadminref

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: 19 Imported by: 0 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

Overview

Package gwadminref follows the reference of an OnPremEventGateway to its GWAdmin: it finds the gateways of a GWAdmin, tells whether a gateway is allowed to use a GWAdmin in another namespace, and names the API Service, the operator Secrets the GWAdmin controller provisions, and the values the data planes carry to tell which certificate authorities they were rolled out with.

Index

Constants

View Source
const IndexFieldOnPremEventGatewayOnGWAdmin = "onPremEventGatewayOnGWAdmin"

IndexFieldOnPremEventGatewayOnGWAdmin is the index field of the OnPremEventGateways by the GWAdmin they reference, as namespace/name.

View Source
const PreviousCAKey = "previous-ca.crt"

PreviousCAKey is the key, on the Secret of a certificate authority the GWAdmin controller owns, holding the certificate authorities its domain moves off. On the published cp client CA, they are those published before it, which the gw-admin pods keep trusting until every data plane runs a certificate from the published one.

Variables

This section is empty.

Functions

func APIServiceLabels

func APIServiceLabels(gwAdminName string) map[string]string

APIServiceLabels returns the labels of the API Service of the named GWAdmin. Its EndpointSlices carry them too, as the EndpointSlice controller copies the labels of a Service onto its EndpointSlices: they tell the gw-admin pods of a GWAdmin, by its name.

func CPClientCASecretName

func CPClientCASecretName(gw *operatorv1alpha1.GWAdmin) string

CPClientCASecretName returns the name of the Secret, in the operator namespace, the cp client CA of the GWAdmin is published in: tls.crt and tls.key hold the certificate authority the controller managing the data planes issues their client certificates from. It only ever holds one the gw-admin pods trust.

func DataPlaneClientCAFingerprint

func DataPlaneClientCAFingerprint(caPEM []byte) string

DataPlaneClientCAFingerprint returns the value of the GWAdminDataPlaneClientCAAnnotation of a data plane whose client certificate is issued from the cp client CA in caPEM: the published Secret's tls.crt. It returns "" when caPEM holds no certificate.

func DataPlaneServerBundleChecksum

func DataPlaneServerBundleChecksum(bundle *corev1.Secret) string

DataPlaneServerBundleChecksum returns the value of the GWAdminDataPlaneServerBundleAnnotation of a data plane mounting the cp server bundle Secret.

func GatewaysAllowedToUse

GatewaysAllowedToUse returns the gateways of the list allowed to use the GWAdmin: those of its namespace, and those of the namespaces a KongReferenceGrant in its namespace allows.

func GatewaysOf

GatewaysOf returns the OnPremEventGateways that reference the GWAdmin, in any namespace, whether they are allowed to or not.

func GetSecret

func GetSecret(
	ctx context.Context, cl client.Client, key client.ObjectKey, what string, ownedBy *operatorv1alpha1.GWAdmin, selector string,
) (*corev1.Secret, error)

GetSecret returns a Secret of the GWAdmin. what names it in messages, e.g. "API CA bundle". A Secret the GWAdmin publishes in the operator namespace is named after the UID of the GWAdmin, and labelled with it: when ownedBy is set, the label must match. The message of a Secret that isn't found tells how to make it visible under the label selector of the operator's Secret cache (see SecretHint).

func GroupVersionResources

func GroupVersionResources() []schema.GroupVersionResource

GroupVersionResources returns the resources a controller following the GWAdmin of an OnPremEventGateway needs: the gateways, the GWAdmins serving them, and the KongReferenceGrants allowing a gateway to use a GWAdmin in another namespace.

func IndexOptions

func IndexOptions() []index.Option

IndexOptions returns the index of the OnPremEventGateways by the GWAdmin they reference, in any namespace.

func NamespacesGrantedBy

func NamespacesGrantedBy(grant *configurationv1alpha1.KongReferenceGrant) []string

NamespacesGrantedBy returns the namespaces whose OnPremEventGateways the KongReferenceGrant allows to reference GWAdmins of its namespace, some or all of them, other than its own namespace.

func NotAllowed

NotAllowed returns why the gateway can't use the GWAdmin it references, or "": a GWAdmin in another namespace needs a KongReferenceGrant in its namespace allowing the OnPremEventGateways of the namespace of the gateway to reference it.

func OfGrant

func OfGrant(ctx context.Context, cl client.Client, grant client.Object) ([]types.NamespacedName, error)

OfGrant returns the GWAdmins a KongReferenceGrant may allow objects of other namespaces to reference: those of its namespace.

func OfSecret

func OfSecret(obj client.Object) (types.NamespacedName, bool)

OfSecret returns the GWAdmin a Secret belongs to: its labels name the GWAdmin, and, for the Secrets kept in the operator namespace, its namespace.

func OperatorClientTLSSecretName

func OperatorClientTLSSecretName(gw *operatorv1alpha1.GWAdmin) string

OperatorClientTLSSecretName returns the name of the Secret, in the operator namespace, holding the client certificate Kong Operator authenticates to the API listener of the GWAdmin with.

func OperatorSecretPrefix

func OperatorSecretPrefix(gw *operatorv1alpha1.GWAdmin) string

OperatorSecretPrefix returns the prefix of the names of the Secrets the GWAdmin keeps in the operator namespace.

func SecretHint

func SecretHint(selector string) string

SecretHint tells how to make a Secret visible to the operator when its Secret cache is filtered by the label selector, or "" when it isn't.

Types

type NotReadyError

type NotReadyError struct {
	Message string
}

NotReadyError tells what the GWAdmin of a gateway doesn't provide yet. Callers shouldn't retry it: a change to the GWAdmin or to its Secrets triggers the controllers following it again.

func (NotReadyError) Error

func (e NotReadyError) Error() string

Directories

Path Synopsis
Package gwadminreftest builds the objects the tests of the references to a GWAdmin need.
Package gwadminreftest builds the objects the tests of the references to a GWAdmin need.

Jump to

Keyboard shortcuts

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