Documentation
¶
Index ¶
- Constants
- Variables
- func KongCACertificateAttachedToCP(t *testing.T, ctx context.Context, cl client.Client, ...) *configurationv1alpha1.KongCACertificate
- func KongCertificateAttachedToCP(t *testing.T, ctx context.Context, cl client.Client, ...) *configurationv1alpha1.KongCertificate
- func KongConsumer(t *testing.T, ctx context.Context, cl client.Client, username string, ...) *configurationv1.KongConsumer
- func KongConsumerGroupAttachedToCP(t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption) *configurationv1beta1.KongConsumerGroup
- func KongConsumerWithProgrammed(t *testing.T, ctx context.Context, cl client.Client, ...) *configurationv1.KongConsumer
- func KongCredentialACL(t *testing.T, ctx context.Context, cl client.Client, consumerName string, ...) *configurationv1alpha1.KongCredentialACL
- func KongCredentialAPIKey(t *testing.T, ctx context.Context, cl client.Client, consumerName string) *configurationv1alpha1.KongCredentialAPIKey
- func KongCredentialBasicAuth(t *testing.T, ctx context.Context, cl client.Client, consumerName string, ...) *configurationv1alpha1.KongCredentialBasicAuth
- func KongCredentialHMAC(t *testing.T, ctx context.Context, cl client.Client, consumerName string) *configurationv1alpha1.KongCredentialHMAC
- func KongCredentialJWT(t *testing.T, ctx context.Context, cl client.Client, consumerName string) *configurationv1alpha1.KongCredentialJWT
- func KongDataPlaneClientCertificateAttachedToCP(t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption) *configurationv1alpha1.KongDataPlaneClientCertificate
- func KongKey(t *testing.T, ctx context.Context, cl client.Client, kid, name string, ...) *configurationv1alpha1.KongKey
- func KongKeySet(t *testing.T, ctx context.Context, cl client.Client, name string, ...) *configurationv1alpha1.KongKeySet
- func KongPluginBinding(t *testing.T, ctx context.Context, cl client.Client, ...) *configurationv1alpha1.KongPluginBinding
- func KongRoute(t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption) *configurationv1alpha1.KongRoute
- func KongSNIAttachedToCertificate(t *testing.T, ctx context.Context, cl client.Client, ...) *configurationv1alpha1.KongSNI
- func KongService(t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption) *configurationv1alpha1.KongService
- func KongServiceWithID(t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption) *configurationv1alpha1.KongService
- func KongTargetAttachedToUpstream(t *testing.T, ctx context.Context, cl client.Client, ...) *configurationv1alpha1.KongTarget
- func KongUpstream(t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption) *configurationv1alpha1.KongUpstream
- func KongVaultAttachedToCP(t *testing.T, ctx context.Context, cl client.Client, backend string, ...) *configurationv1alpha1.KongVault
- func KonnectAPIAuthConfiguration(t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption) *konnectv1alpha1.KonnectAPIAuthConfiguration
- func KonnectAPIAuthConfigurationWithProgrammed(t *testing.T, ctx context.Context, cl client.Client) *konnectv1alpha1.KonnectAPIAuthConfiguration
- func KonnectCloudGatewayDataPlaneGroupConfiguration(t *testing.T, ctx context.Context, cl client.Client, ...) *konnectv1alpha1.KonnectCloudGatewayDataPlaneGroupConfiguration
- func KonnectCloudGatewayNetwork(t *testing.T, ctx context.Context, cl client.Client, ...) *konnectv1alpha1.KonnectCloudGatewayNetwork
- func KonnectCloudGatewayNetworkWithProgrammed(t *testing.T, ctx context.Context, cl client.Client, ...) *konnectv1alpha1.KonnectCloudGatewayNetwork
- func KonnectExtension(t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption) *konnectv1alpha1.KonnectExtension
- func KonnectExtensionReferencingKonnectGatewayControlPlane(t *testing.T, ctx context.Context, cl client.Client, ...) *konnectv1alpha1.KonnectExtension
- func KonnectGatewayControlPlane(t *testing.T, ctx context.Context, cl client.Client, ...) *konnectv1alpha1.KonnectGatewayControlPlane
- func KonnectGatewayControlPlaneWithID(t *testing.T, ctx context.Context, cl client.Client, ...) *konnectv1alpha1.KonnectGatewayControlPlane
- func ProxyCachePlugin(t *testing.T, ctx context.Context, cl client.Client) *configurationv1.KongPlugin
- func RateLimitingPlugin(t *testing.T, ctx context.Context, cl client.Client) *configurationv1.KongPlugin
- func Secret(t *testing.T, ctx context.Context, cl client.Client, data map[string][]byte, ...) *corev1.Secret
- func WithTestIDLabel(testID string) func(obj client.Object)
- type ObjOption
- func KonnectGatewayControlPlaneType(typ sdkkonnectcomp.CreateControlPlaneRequestClusterType) ObjOption
- func KonnectGatewayControlPlaneTypeWithCloudGatewaysEnabled() ObjOption
- func WithAnnotation(key, value string) ObjOption
- func WithKonnectConfiguration[T ObjectSupportingKonnectConfiguration](konnectConfiguration konnectv1alpha1.KonnectConfiguration) ObjOption
- func WithKonnectID(id string) ObjOption
- func WithKonnectIDControlPlaneRef(cp *konnectv1alpha1.KonnectGatewayControlPlane) ObjOption
- func WithKonnectNamespacedRefControlPlaneRef(cp *konnectv1alpha1.KonnectGatewayControlPlane) ObjOption
- func WithLabel(key, value string) ObjOption
- func WithMirrorSource(konnectID string) ObjOption
- func WithNamespacedKongServiceRef(svc *configurationv1alpha1.KongService) ObjOption
- type ObjectSupportingKonnectConfiguration
Constants ¶
const (
// TestIDLabel is the label key used to identify resources created by the test suite.
TestIDLabel = "konghq.com/test-id"
)
Variables ¶
var TestValidCACertPEM = string(testValidCertPEM)
TestValidCACertPEM is a valid CA certificate PEM to be used in tests.
var TestValidCertKeyPEM = string(testValidCertKeyPEM)
TestValidCertKeyPEM is a valid certificate key PEM to be used in tests.
var TestValidCertPEM = string(testValidCertPEM)
TestValidCertPEM is a valid certificate PEM to be used in tests.
Functions ¶
func KongCACertificateAttachedToCP ¶
func KongCACertificateAttachedToCP( t *testing.T, ctx context.Context, cl client.Client, cp *konnectv1alpha1.KonnectGatewayControlPlane, opts ...ObjOption, ) *configurationv1alpha1.KongCACertificate
KongCACertificateAttachedToCP deploys a KongCACertificate resource attached to a CP and returns the resource.
func KongCertificateAttachedToCP ¶
func KongCertificateAttachedToCP( t *testing.T, ctx context.Context, cl client.Client, cp *konnectv1alpha1.KonnectGatewayControlPlane, opts ...ObjOption, ) *configurationv1alpha1.KongCertificate
KongCertificateAttachedToCP deploys a KongCertificate resource attached to a CP and returns the resource.
func KongConsumer ¶ added in v1.5.0
func KongConsumer( t *testing.T, ctx context.Context, cl client.Client, username string, opts ...ObjOption, ) *configurationv1.KongConsumer
KongConsumer deploys a KongConsumer resource and returns it.
func KongConsumerGroupAttachedToCP ¶
func KongConsumerGroupAttachedToCP( t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption, ) *configurationv1beta1.KongConsumerGroup
KongConsumerGroupAttachedToCP deploys a KongConsumerGroup resource attached to a Control Plane and returns the resource.
func KongConsumerWithProgrammed ¶
func KongConsumerWithProgrammed( t *testing.T, ctx context.Context, cl client.Client, consumer *configurationv1.KongConsumer, ) *configurationv1.KongConsumer
KongConsumerWithProgrammed deploys a KongConsumer resource and returns the resource.
func KongCredentialACL ¶
func KongCredentialACL( t *testing.T, ctx context.Context, cl client.Client, consumerName string, groupName string, ) *configurationv1alpha1.KongCredentialACL
KongCredentialACL deploys a KongCredentialACL resource and returns the resource.
func KongCredentialAPIKey ¶
func KongCredentialAPIKey( t *testing.T, ctx context.Context, cl client.Client, consumerName string, ) *configurationv1alpha1.KongCredentialAPIKey
KongCredentialAPIKey deploys a KongCredentialAPIKey resource and returns the resource.
func KongCredentialBasicAuth ¶
func KongCredentialBasicAuth( t *testing.T, ctx context.Context, cl client.Client, consumerName string, username string, password string, ) *configurationv1alpha1.KongCredentialBasicAuth
KongCredentialBasicAuth deploys a KongCredentialBasicAuth resource and returns the resource.
func KongCredentialHMAC ¶
func KongCredentialHMAC( t *testing.T, ctx context.Context, cl client.Client, consumerName string, ) *configurationv1alpha1.KongCredentialHMAC
KongCredentialHMAC deploys a KongCredentialHMAC resource and returns the resource.
func KongCredentialJWT ¶
func KongCredentialJWT( t *testing.T, ctx context.Context, cl client.Client, consumerName string, ) *configurationv1alpha1.KongCredentialJWT
KongCredentialJWT deploys a KongCredentialJWT resource and returns the resource.
func KongDataPlaneClientCertificateAttachedToCP ¶
func KongDataPlaneClientCertificateAttachedToCP( t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption, ) *configurationv1alpha1.KongDataPlaneClientCertificate
KongDataPlaneClientCertificateAttachedToCP deploys a KongDataPlaneClientCertificate resource and returns the resource.
func KongKey ¶ added in v1.5.0
func KongKey( t *testing.T, ctx context.Context, cl client.Client, kid, name string, opts ...ObjOption, ) *configurationv1alpha1.KongKey
KongKey deploys a KongKey resource and returns the resource.
func KongKeySet ¶ added in v1.5.0
func KongKeySet( t *testing.T, ctx context.Context, cl client.Client, name string, opts ...ObjOption, ) *configurationv1alpha1.KongKeySet
KongKeySet deploys a KongKeySet resource and returns the resource.
func KongPluginBinding ¶
func KongPluginBinding( t *testing.T, ctx context.Context, cl client.Client, kpb *configurationv1alpha1.KongPluginBinding, opts ...ObjOption, ) *configurationv1alpha1.KongPluginBinding
KongPluginBinding deploys a KongPluginBinding resource and returns the resource.
func KongRoute ¶ added in v1.6.0
func KongRoute( t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption, ) *configurationv1alpha1.KongRoute
KongRoute deploys a KongRoute resource and returns the resource.
func KongSNIAttachedToCertificate ¶
func KongSNIAttachedToCertificate( t *testing.T, ctx context.Context, cl client.Client, cert *configurationv1alpha1.KongCertificate, opts ...ObjOption, ) *configurationv1alpha1.KongSNI
KongSNIAttachedToCertificate deploys a KongSNI resource attached to a KongCertificate and returns the resource.
func KongService ¶ added in v1.5.0
func KongService( t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption, ) *configurationv1alpha1.KongService
KongService deploys a KongService resource and returns the resource.
func KongServiceWithID ¶ added in v1.5.0
func KongServiceWithID( t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption, ) *configurationv1alpha1.KongService
KongServiceWithID deploys a KongService resource and returns the resource. The Status ID and Programmed condition are set on the Service using status Update() call. It can be useful where the reconciler for KonnectGatewayControlPlane is not started and hence the status has to be filled manually.
func KongTargetAttachedToUpstream ¶
func KongTargetAttachedToUpstream( t *testing.T, ctx context.Context, cl client.Client, upstream *configurationv1alpha1.KongUpstream, opts ...ObjOption, ) *configurationv1alpha1.KongTarget
KongTargetAttachedToUpstream deploys a KongTarget resource attached to a Control Plane and returns the resource.
func KongUpstream ¶ added in v1.5.0
func KongUpstream( t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption, ) *configurationv1alpha1.KongUpstream
KongUpstream deploys a KongUpstream resource and returns it.
func KongVaultAttachedToCP ¶
func KongVaultAttachedToCP( t *testing.T, ctx context.Context, cl client.Client, backend string, prefix string, rawConfig []byte, cp *konnectv1alpha1.KonnectGatewayControlPlane, opts ...ObjOption, ) *configurationv1alpha1.KongVault
KongVaultAttachedToCP deploys a KongVault resource attached to a CP and returns the resource.
func KonnectAPIAuthConfiguration ¶
func KonnectAPIAuthConfiguration( t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption, ) *konnectv1alpha1.KonnectAPIAuthConfiguration
KonnectAPIAuthConfiguration deploys a KonnectAPIAuthConfiguration resource and returns the resource.
func KonnectAPIAuthConfigurationWithProgrammed ¶
func KonnectAPIAuthConfigurationWithProgrammed( t *testing.T, ctx context.Context, cl client.Client, ) *konnectv1alpha1.KonnectAPIAuthConfiguration
KonnectAPIAuthConfigurationWithProgrammed deploys a KonnectAPIAuthConfiguration resource and returns the resource. The Programmed condition is set on the returned resource using status Update() call. It can be useful where the reconciler for KonnectAPIAuthConfiguration is not started and hence the status has to be filled manually.
func KonnectCloudGatewayDataPlaneGroupConfiguration ¶ added in v1.5.0
func KonnectCloudGatewayDataPlaneGroupConfiguration( t *testing.T, ctx context.Context, cl client.Client, dataplaneGroups []konnectv1alpha1.KonnectConfigurationDataPlaneGroup, opts ...ObjOption, ) *konnectv1alpha1.KonnectCloudGatewayDataPlaneGroupConfiguration
KonnectCloudGatewayDataPlaneGroupConfiguration deploys a KonnectCloudGatewayDataPlaneGroupConfiguration resource and returns the resource.
func KonnectCloudGatewayNetwork ¶ added in v1.5.1
func KonnectCloudGatewayNetwork( t *testing.T, ctx context.Context, cl client.Client, apiAuth *konnectv1alpha1.KonnectAPIAuthConfiguration, opts ...ObjOption, ) *konnectv1alpha1.KonnectCloudGatewayNetwork
KonnectCloudGatewayNetwork deploys a KonnectCloudGatewayNetwork resource and returns it.
func KonnectCloudGatewayNetworkWithProgrammed ¶ added in v1.5.1
func KonnectCloudGatewayNetworkWithProgrammed( t *testing.T, ctx context.Context, cl client.Client, apiAuth *konnectv1alpha1.KonnectAPIAuthConfiguration, opts ...ObjOption, ) *konnectv1alpha1.KonnectCloudGatewayNetwork
KonnectCloudGatewayNetworkWithProgrammed deploys a KonnectNetwork resource and returns it. The Programmed condition is set on the returned resource using status Update() call. It can be useful where the reconciler for KonnectNetwork is not started and hence the status has to be filled manually.
func KonnectExtension ¶ added in v1.5.0
func KonnectExtension( t *testing.T, ctx context.Context, cl client.Client, opts ...ObjOption, ) *konnectv1alpha1.KonnectExtension
KonnectExtension deploys a KonnectExtension.
func KonnectExtensionReferencingKonnectGatewayControlPlane ¶ added in v1.5.0
func KonnectExtensionReferencingKonnectGatewayControlPlane( t *testing.T, ctx context.Context, cl client.Client, cp *konnectv1alpha1.KonnectGatewayControlPlane, ) *konnectv1alpha1.KonnectExtension
KonnectExtensionReferencingKonnectGatewayControlPlane deploys a KonnectExtension attached to a Konnect CP represented by the given KonnectGatewayControlPlane.
func KonnectGatewayControlPlane ¶
func KonnectGatewayControlPlane( t *testing.T, ctx context.Context, cl client.Client, apiAuth *konnectv1alpha1.KonnectAPIAuthConfiguration, opts ...ObjOption, ) *konnectv1alpha1.KonnectGatewayControlPlane
KonnectGatewayControlPlane deploys a KonnectGatewayControlPlane resource and returns the resource.
func KonnectGatewayControlPlaneWithID ¶
func KonnectGatewayControlPlaneWithID( t *testing.T, ctx context.Context, cl client.Client, apiAuth *konnectv1alpha1.KonnectAPIAuthConfiguration, opts ...ObjOption, ) *konnectv1alpha1.KonnectGatewayControlPlane
KonnectGatewayControlPlaneWithID deploys a KonnectGatewayControlPlane resource and returns the resource. The Status ID and Programmed condition are set on the CP using status Update() call. It can be useful where the reconciler for KonnectGatewayControlPlane is not started and hence the status has to be filled manually.
func ProxyCachePlugin ¶
func ProxyCachePlugin( t *testing.T, ctx context.Context, cl client.Client, ) *configurationv1.KongPlugin
ProxyCachePlugin deploys the proxy-cache KongPlugin resource and returns the resource. The provided client should be namespaced, i.e. created with `client.NewNamespacedClient(client, ns)`
func RateLimitingPlugin ¶
func RateLimitingPlugin( t *testing.T, ctx context.Context, cl client.Client, ) *configurationv1.KongPlugin
RateLimitingPlugin deploys the rate-limiting KongPlugin resource and returns the resource. The provided client should be namespaced, i.e. created with `client.NewNamespacedClient(client, ns)`
func Secret ¶ added in v1.5.0
func Secret( t *testing.T, ctx context.Context, cl client.Client, data map[string][]byte, opts ...ObjOption, ) *corev1.Secret
Secret deploys a Secret.
func WithTestIDLabel ¶
WithTestIDLabel returns an ObjOption that sets the test ID label on the object.
Types ¶
type ObjOption ¶ added in v1.5.0
ObjOption is a function that modifies a client.Object.
func KonnectGatewayControlPlaneType ¶ added in v1.5.0
func KonnectGatewayControlPlaneType(typ sdkkonnectcomp.CreateControlPlaneRequestClusterType) ObjOption
KonnectGatewayControlPlaneType returns an ObjOption that sets the cluster type on the CP.
func KonnectGatewayControlPlaneTypeWithCloudGatewaysEnabled ¶ added in v1.5.0
func KonnectGatewayControlPlaneTypeWithCloudGatewaysEnabled() ObjOption
KonnectGatewayControlPlaneTypeWithCloudGatewaysEnabled returns an ObjOption that enabled cloud gateways on the CP.
func WithAnnotation ¶
WithAnnotation returns an ObjOption that sets the given key-value pair as an annotation on the object.
func WithKonnectConfiguration ¶ added in v1.5.0
func WithKonnectConfiguration[T ObjectSupportingKonnectConfiguration]( konnectConfiguration konnectv1alpha1.KonnectConfiguration, ) ObjOption
WithKonnectConfiguration returns an option function that sets the `KonnectConfiguration` in the object.
func WithKonnectID ¶ added in v1.5.1
WithKonnectID returns an ObjOption that sets the Konnect ID on the object.
func WithKonnectIDControlPlaneRef ¶ added in v1.5.0
func WithKonnectIDControlPlaneRef(cp *konnectv1alpha1.KonnectGatewayControlPlane) ObjOption
WithKonnectIDControlPlaneRef returns an ObjOption that sets the ControlPlaneRef on the object to a KonnectID.
func WithKonnectNamespacedRefControlPlaneRef ¶ added in v1.5.0
func WithKonnectNamespacedRefControlPlaneRef(cp *konnectv1alpha1.KonnectGatewayControlPlane) ObjOption
WithKonnectNamespacedRefControlPlaneRef returns an ObjOption that sets the ControlPlaneRef on the object to a namespaced ref.
NOTE: This only works with namespaced resources. Using it with cluster-scoped resources requires additional handling ( to only set the namespace when the resource is cluster-scoped).
func WithLabel ¶ added in v1.5.0
WithLabel returns an ObjOption that sets the given key-value pair as an label on the object.
func WithMirrorSource ¶ added in v1.6.0
WithMirrorSource returns an ObjOption that sets the Source as Mirror and Mirror fields on the object.
func WithNamespacedKongServiceRef ¶ added in v1.6.0
func WithNamespacedKongServiceRef(svc *configurationv1alpha1.KongService) ObjOption
WithNamespacedKongServiceRef returns an ObjOption that sets the ServiceRef on the object to a namespaced ref.
type ObjectSupportingKonnectConfiguration ¶ added in v1.5.0
type ObjectSupportingKonnectConfiguration interface { *konnectv1alpha1.KonnectGatewayControlPlane | *konnectv1alpha1.KonnectExtension | *konnectv1alpha1.KonnectCloudGatewayNetwork }
ObjectSupportingKonnectConfiguration defines the interface of types supporting setting `KonnectConfiguration`.