deploy

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TestIDLabel is the label key used to identify resources created by the test suite.
	TestIDLabel = "konghq.com/test-id"
)

Variables

View Source
var TestValidCACertPEM = string(testValidCertPEM)

TestValidCACertPEM is a valid CA certificate PEM to be used in tests.

View Source
var TestValidCertKeyPEM = string(testValidCertKeyPEM)

TestValidCertKeyPEM is a valid certificate key PEM to be used in tests.

View Source
var TestValidCertPEM = string(testValidCertPEM)

TestValidCertPEM is a valid certificate PEM to be used in tests.

Functions

func KongCACertificateAttachedToCP

KongCACertificateAttachedToCP deploys a KongCACertificate resource attached to a CP and returns the resource.

func KongCertificateAttachedToCP

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

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

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

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

func WithTestIDLabel(testID string) func(obj client.Object)

WithTestIDLabel returns an ObjOption that sets the test ID label on the object.

Types

type ObjOption added in v1.5.0

type ObjOption func(obj client.Object)

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

func WithAnnotation(key, value string) ObjOption

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

func WithKonnectID(id string) ObjOption

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

func WithLabel(key, value string) ObjOption

WithLabel returns an ObjOption that sets the given key-value pair as an label on the object.

func WithMirrorSource added in v1.6.0

func WithMirrorSource(konnectID string) ObjOption

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

ObjectSupportingKonnectConfiguration defines the interface of types supporting setting `KonnectConfiguration`.

Jump to

Keyboard shortcuts

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