profiles

package
v0.5.1-0...-8987e2d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const Template = `` /* 3509-byte string literal not displayed */

Template provides the base template for the `linkerd profile --template` command.

Variables

View Source
var (
	// ServiceProfileMeta is the TypeMeta for the ServiceProfile custom resource.
	ServiceProfileMeta = metav1.TypeMeta{
		APIVersion: k8s.ServiceProfileAPIVersion,
		Kind:       k8s.ServiceProfileKind,
	}
)

Functions

func FuzzProfilesValidate

func FuzzProfilesValidate(data []byte) int

FuzzProfilesValidate fuzzes the ProfilesValidate function.

func FuzzRenderProto

func FuzzRenderProto(data []byte) int

FuzzRenderProto fuzzes the RenderProto function.

func GenServiceProfile

func GenServiceProfile(service, namespace, clusterDomain string) v1alpha2.ServiceProfile

GenServiceProfile generates a mock ServiceProfile.

func MkRouteSpec

func MkRouteSpec(path, pathRegex string, method string, operation *spec.Operation) *sp.RouteSpec

MkRouteSpec makes a service profile route from an OpenAPI operation.

func PathToRegex

func PathToRegex(path string) string

PathToRegex converts a path into a regex.

func RenderOpenAPI

func RenderOpenAPI(fileName, namespace, name, clusterDomain string) (*sp.ServiceProfile, error)

RenderOpenAPI reads an OpenAPI spec file and renders the corresponding ServiceProfile to a buffer, given a namespace, service, and control plane namespace.

func RenderProfileTemplate

func RenderProfileTemplate(namespace, service, clusterDomain string, w io.Writer, format string) error

RenderProfileTemplate renders a ServiceProfile template to a buffer, given a namespace, service, and control plane namespace.

func RenderProto

func RenderProto(fileName, namespace, name, clusterDomain string) (*sp.ServiceProfile, error)

RenderProto reads a protobuf definition file and renders the corresponding ServiceProfile to a buffer, given a namespace, service, and control plane namespace.

func ServiceProfileYamlEquals

func ServiceProfileYamlEquals(actual, expected v1alpha2.ServiceProfile) error

ServiceProfileYamlEquals validates whether two ServiceProfiles are equal.

func Validate

func Validate(data []byte) error

Validate validates the structure of a ServiceProfile. This code is a superset of the validation provided by the `openAPIV3Schema`, defined in the ServiceProfile CRD. openAPIV3Schema validates: - types of non-recursive fields - presence of required fields This function validates: - types of all fields - presence of required fields - presence of unknown fields - recursive fields

func ValidateRequestMatch

func ValidateRequestMatch(reqMatch *sp.RequestMatch) error

ValidateRequestMatch validates whether a ServiceProfile RequestMatch has at least one field set.

func ValidateResponseMatch

func ValidateResponseMatch(rspMatch *sp.ResponseMatch) error

ValidateResponseMatch validates whether a ServiceProfile ResponseMatch has at least one field set, and sanity checks the Status Range.

Types

This section is empty.

Jump to

Keyboard shortcuts

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