linkerd

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TrafficSplitGVR represents the GroupVersionResource for SMI TrafficSplit
	TrafficSplitGVR = schema.GroupVersionResource{
		Group:    "split.smi-spec.io",
		Version:  "v1alpha1",
		Resource: "trafficsplits",
	}
)

Functions

func GetAuthorizationPolicy

func GetAuthorizationPolicy(t *testing.T, options *k8s.KubectlOptions, name, namespace string) *linkerdpolicyv1alpha1.AuthorizationPolicy

GetAuthorizationPolicy retrieves a specific Linkerd AuthorizationPolicy resource by name in the specified namespace. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the AuthorizationPolicy to retrieve.
  • namespace: The namespace of the AuthorizationPolicy.

Returns:

  • A pointer to the AuthorizationPolicy object.

func GetHTTPRoute

func GetHTTPRoute(t *testing.T, options *k8s.KubectlOptions, name, namespace string) *linkerdpolicyv1alpha1.HTTPRoute

GetHTTPRoute retrieves a specific Linkerd HTTPRoute resource by name in the specified namespace. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the HTTPRoute to retrieve.
  • namespace: The namespace of the HTTPRoute.

Returns:

  • A pointer to the HTTPRoute object.

func GetMeshTLSAuthentication

func GetMeshTLSAuthentication(t *testing.T, options *k8s.KubectlOptions, name, namespace string) *linkerdpolicyv1alpha1.MeshTLSAuthentication

GetMeshTLSAuthentication retrieves a specific Linkerd MeshTLSAuthentication resource by name in the specified namespace. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the MeshTLSAuthentication to retrieve.
  • namespace: The namespace of the MeshTLSAuthentication.

Returns:

  • A pointer to the MeshTLSAuthentication object.

func GetNetworkAuthentication

func GetNetworkAuthentication(t *testing.T, options *k8s.KubectlOptions, name, namespace string) *linkerdpolicyv1alpha1.NetworkAuthentication

GetNetworkAuthentication retrieves a specific Linkerd NetworkAuthentication resource by name in the specified namespace. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the NetworkAuthentication to retrieve.
  • namespace: The namespace of the NetworkAuthentication.

Returns:

  • A pointer to the NetworkAuthentication object.

func GetServer

func GetServer(t *testing.T, options *k8s.KubectlOptions, name, namespace string) *linkerdserverv1beta1.Server

GetServer retrieves a specific Linkerd Server resource by name in the specified namespace. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the Server to retrieve.
  • namespace: The namespace of the Server.

Returns:

  • A pointer to the Server object.

func GetServerAuthorization

func GetServerAuthorization(t *testing.T, options *k8s.KubectlOptions, name, namespace string) *linkerdserverauthorizationv1beta1.ServerAuthorization

GetServerAuthorization retrieves a specific Linkerd ServerAuthorization resource by name in the specified namespace. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the ServerAuthorization to retrieve.
  • namespace: The namespace of the ServerAuthorization.

Returns:

  • A pointer to the ServerAuthorization object.

func GetServiceProfile

func GetServiceProfile(t *testing.T, options *k8s.KubectlOptions, name, namespace string) *linkerdv1alpha2.ServiceProfile

GetServiceProfile retrieves a specific Linkerd ServiceProfile resource by name in the specified namespace. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the ServiceProfile to retrieve.
  • namespace: The namespace of the ServiceProfile.

Returns:

  • A pointer to the ServiceProfile object.

func GetTrafficSplit

func GetTrafficSplit(t *testing.T, options *k8s.KubectlOptions, name, namespace string) *unstructured.Unstructured

GetTrafficSplit retrieves a specific SMI TrafficSplit resource by name in the specified namespace. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the TrafficSplit to retrieve.
  • namespace: The namespace of the TrafficSplit.

Returns:

  • An unstructured object representing the TrafficSplit resource.

func ListAuthorizationPolicies

func ListAuthorizationPolicies(t *testing.T, options *k8s.KubectlOptions, namespace string) []*linkerdpolicyv1alpha1.AuthorizationPolicy

ListAuthorizationPolicies retrieves all Linkerd AuthorizationPolicy resources in the specified namespace using the provided KubectlOptions. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • namespace: The namespace to list AuthorizationPolicies from.

Returns:

  • A slice of pointers to AuthorizationPolicy objects found in the namespace.

func ListHTTPRoutes

func ListHTTPRoutes(t *testing.T, options *k8s.KubectlOptions, namespace string) []*linkerdpolicyv1alpha1.HTTPRoute

ListHTTPRoutes retrieves all Linkerd HTTPRoute resources in the specified namespace using the provided KubectlOptions. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • namespace: The namespace to list HTTPRoutes from.

Returns:

  • A slice of pointers to HTTPRoute objects found in the namespace.

func ListMeshTLSAuthentications

func ListMeshTLSAuthentications(t *testing.T, options *k8s.KubectlOptions, namespace string) []*linkerdpolicyv1alpha1.MeshTLSAuthentication

ListMeshTLSAuthentications retrieves all Linkerd MeshTLSAuthentication resources in the specified namespace using the provided KubectlOptions. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • namespace: The namespace to list MeshTLSAuthentications from.

Returns:

  • A slice of pointers to MeshTLSAuthentication objects found in the namespace.

func ListNetworkAuthentications

func ListNetworkAuthentications(t *testing.T, options *k8s.KubectlOptions, namespace string) []*linkerdpolicyv1alpha1.NetworkAuthentication

ListNetworkAuthentications retrieves all Linkerd NetworkAuthentication resources in the specified namespace using the provided KubectlOptions. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • namespace: The namespace to list NetworkAuthentications from.

Returns:

  • A slice of pointers to NetworkAuthentication objects found in the namespace.

func ListServerAuthorizations

func ListServerAuthorizations(t *testing.T, options *k8s.KubectlOptions, namespace string) []*linkerdserverauthorizationv1beta1.ServerAuthorization

ListServerAuthorizations retrieves all Linkerd ServerAuthorization resources in the specified namespace using the provided KubectlOptions. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • namespace: The namespace to list ServerAuthorizations from.

Returns:

  • A slice of pointers to ServerAuthorization objects found in the namespace.

func ListServers

func ListServers(t *testing.T, options *k8s.KubectlOptions, namespace string) []*linkerdserverv1beta1.Server

ListServers retrieves all Linkerd Server resources in the specified namespace using the provided KubectlOptions. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • namespace: The namespace to list Servers from.

Returns:

  • A slice of pointers to Server objects found in the namespace.

func ListServiceProfiles

func ListServiceProfiles(t *testing.T, options *k8s.KubectlOptions, namespace string) []*linkerdv1alpha2.ServiceProfile

ListServiceProfiles retrieves all Linkerd ServiceProfile resources in the specified namespace using the provided KubectlOptions. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • namespace: The namespace to list ServiceProfiles from.

Returns:

  • A slice of pointers to ServiceProfile objects found in the namespace.

func ListTrafficSplits

func ListTrafficSplits(t *testing.T, options *k8s.KubectlOptions, namespace string) []*unstructured.Unstructured

ListTrafficSplits retrieves all SMI TrafficSplit resources in the specified namespace using the provided KubectlOptions. It fails the test if an error occurs.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • namespace: The namespace to list TrafficSplits from.

Returns:

  • A slice of pointers to unstructured objects representing TrafficSplit resources found in the namespace.

func NewClient

func NewClient(t *testing.T, options *k8s.KubectlOptions) *linkerdclientset.Clientset

NewClient creates and returns a new Linkerd Client for use in tests. It initializes the Kubernetes REST configuration and the Linkerd clientset, failing the test if any errors occur during setup.

Parameters:

  • t: The testing context used for logging and error handling.
  • options: The kubectl options specifying the context and namespace.

Returns:

  • *linkerdclientset.Clientset: A pointer to the initialized Linkerd client.

func NewDynamicClient

func NewDynamicClient(t *testing.T, options *k8s.KubectlOptions) dynamic.Interface

NewDynamicClient creates and returns a new dynamic Kubernetes client for use with custom resources. It initializes the Kubernetes REST configuration and the dynamic client, failing the test if any errors occur during setup.

Parameters:

  • t: The testing context used for logging and error handling.
  • options: The kubectl options specifying the context and namespace.

Returns:

  • dynamic.Interface: A dynamic client for interacting with custom resources.

func WaitForAuthorizationPolicyExists

func WaitForAuthorizationPolicyExists(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForAuthorizationPolicyExists waits until the specified AuthorizationPolicy exists in the given namespace or the timeout is reached. It polls the AuthorizationPolicy every 2 seconds until it exists.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the AuthorizationPolicy to check.
  • namespace: The namespace of the AuthorizationPolicy.
  • timeout: The maximum duration to wait for the resource to exist.

func WaitForHTTPRouteExists

func WaitForHTTPRouteExists(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForHTTPRouteExists waits until the specified HTTPRoute exists in the given namespace or the timeout is reached. It polls the HTTPRoute every 2 seconds until it exists.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the HTTPRoute to check.
  • namespace: The namespace of the HTTPRoute.
  • timeout: The maximum duration to wait for the resource to exist.

func WaitForMeshTLSAuthenticationExists

func WaitForMeshTLSAuthenticationExists(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForMeshTLSAuthenticationExists waits until the specified MeshTLSAuthentication exists in the given namespace or the timeout is reached. It polls the MeshTLSAuthentication every 2 seconds until it exists.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the MeshTLSAuthentication to check.
  • namespace: The namespace of the MeshTLSAuthentication.
  • timeout: The maximum duration to wait for the resource to exist.

func WaitForNetworkAuthenticationExists

func WaitForNetworkAuthenticationExists(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForNetworkAuthenticationExists waits until the specified NetworkAuthentication exists in the given namespace or the timeout is reached. It polls the NetworkAuthentication every 2 seconds until it exists.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the NetworkAuthentication to check.
  • namespace: The namespace of the NetworkAuthentication.
  • timeout: The maximum duration to wait for the resource to exist.

func WaitForServerAuthorizationExists

func WaitForServerAuthorizationExists(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForServerAuthorizationExists waits until the specified ServerAuthorization exists in the given namespace or the timeout is reached. It polls the ServerAuthorization every 2 seconds until it exists.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the ServerAuthorization to check.
  • namespace: The namespace of the ServerAuthorization.
  • timeout: The maximum duration to wait for the resource to exist.

func WaitForServerExists

func WaitForServerExists(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForServerExists waits until the specified Server exists in the given namespace or the timeout is reached. It polls the Server every 2 seconds until it exists.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the Server to check.
  • namespace: The namespace of the Server.
  • timeout: The maximum duration to wait for the resource to exist.

func WaitForServiceProfileExists

func WaitForServiceProfileExists(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForServiceProfileExists waits until the specified ServiceProfile exists in the given namespace or the timeout is reached. It polls the ServiceProfile every 2 seconds until it exists.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the ServiceProfile to check.
  • namespace: The namespace of the ServiceProfile.
  • timeout: The maximum duration to wait for the resource to exist.

func WaitForTrafficSplitExists

func WaitForTrafficSplitExists(t *testing.T, options *k8s.KubectlOptions, name, namespace string, timeout time.Duration)

WaitForTrafficSplitExists waits until the specified TrafficSplit exists in the given namespace or the timeout is reached. It polls the TrafficSplit every 2 seconds until it exists.

Parameters:

  • t: The testing context.
  • options: The kubectl options specifying the context and namespace.
  • name: The name of the TrafficSplit to check.
  • namespace: The namespace of the TrafficSplit.
  • timeout: The maximum duration to wait for the resource to exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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