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
- func APIServiceLabels(gwAdminName string) map[string]string
- func CPClientCASecretName(gw *operatorv1alpha1.GWAdmin) string
- func DataPlaneClientCAFingerprint(caPEM []byte) string
- func DataPlaneServerBundleChecksum(bundle *corev1.Secret) string
- func GatewaysAllowedToUse(ctx context.Context, cl client.Client, gwAdmin types.NamespacedName, ...) ([]eventgatewayv1alpha1.OnPremEventGateway, error)
- func GatewaysOf(ctx context.Context, cl client.Client, gwAdmin types.NamespacedName) ([]eventgatewayv1alpha1.OnPremEventGateway, error)
- func GetSecret(ctx context.Context, cl client.Client, key client.ObjectKey, what string, ...) (*corev1.Secret, error)
- func GroupVersionResources() []schema.GroupVersionResource
- func IndexOptions() []index.Option
- func NamespacesGrantedBy(grant *configurationv1alpha1.KongReferenceGrant) []string
- func NotAllowed(ctx context.Context, cl client.Client, ...) (string, error)
- func OfGrant(ctx context.Context, cl client.Client, grant client.Object) ([]types.NamespacedName, error)
- func OfSecret(obj client.Object) (types.NamespacedName, bool)
- func OperatorClientTLSSecretName(gw *operatorv1alpha1.GWAdmin) string
- func OperatorSecretPrefix(gw *operatorv1alpha1.GWAdmin) string
- func SecretHint(selector string) string
- type NotReadyError
Constants ¶
const IndexFieldOnPremEventGatewayOnGWAdmin = "onPremEventGatewayOnGWAdmin"
IndexFieldOnPremEventGatewayOnGWAdmin is the index field of the OnPremEventGateways by the GWAdmin they reference, as namespace/name.
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 ¶
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 ¶
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 ¶
DataPlaneServerBundleChecksum returns the value of the GWAdminDataPlaneServerBundleAnnotation of a data plane mounting the cp server bundle Secret.
func GatewaysAllowedToUse ¶
func GatewaysAllowedToUse(ctx context.Context, cl client.Client, gwAdmin types.NamespacedName, gateways []eventgatewayv1alpha1.OnPremEventGateway) ([]eventgatewayv1alpha1.OnPremEventGateway, error)
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 ¶
func GatewaysOf(ctx context.Context, cl client.Client, gwAdmin types.NamespacedName) ([]eventgatewayv1alpha1.OnPremEventGateway, error)
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 ¶
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 ¶
func NotAllowed(ctx context.Context, cl client.Client, gateway *eventgatewayv1alpha1.OnPremEventGateway) (string, error)
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 ¶
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. |