Documentation ¶
Index ¶
- Constants
- Variables
- func FuzzProfilesValidate(data []byte) int
- func FuzzRenderProto(data []byte) int
- func GenServiceProfile(service, namespace, clusterDomain string) v1alpha2.ServiceProfile
- func MkRouteSpec(path, pathRegex string, method string, operation *spec.Operation) *sp.RouteSpec
- func PathToRegex(path string) string
- func RenderOpenAPI(fileName, namespace, name, clusterDomain string) (*sp.ServiceProfile, error)
- func RenderProfileTemplate(namespace, service, clusterDomain string, w io.Writer, format string) error
- func RenderProto(fileName, namespace, name, clusterDomain string) (*sp.ServiceProfile, error)
- func ServiceProfileYamlEquals(actual, expected v1alpha2.ServiceProfile) error
- func Validate(data []byte) error
- func ValidateRequestMatch(reqMatch *sp.RequestMatch) error
- func ValidateResponseMatch(rspMatch *sp.ResponseMatch) error
Constants ¶
const Template = `` /* 3509-byte string literal not displayed */
Template provides the base template for the `linkerd profile --template` command.
Variables ¶
var ( // ServiceProfileMeta is the TypeMeta for the ServiceProfile custom resource. ServiceProfileMeta = metav1.TypeMeta{ APIVersion: k8s.ServiceProfileAPIVersion, Kind: k8s.ServiceProfileKind, } )
Functions ¶
func FuzzProfilesValidate ¶
FuzzProfilesValidate fuzzes the ProfilesValidate function.
func FuzzRenderProto ¶
FuzzRenderProto fuzzes the RenderProto function.
func GenServiceProfile ¶
func GenServiceProfile(service, namespace, clusterDomain string) v1alpha2.ServiceProfile
GenServiceProfile generates a mock ServiceProfile.
func MkRouteSpec ¶
MkRouteSpec makes a service profile route from an OpenAPI operation.
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 ¶
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.