utils

package
v0.13.7 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopySecret added in v0.12.0

func CopySecret(corev1Input clientcorev1.CoreV1Interface, srcNS string, srcSecretName string, tgtNS string, svcAccount string) (*corev1.Secret, error)

CopySecret will copy a secret from one namespace into another. If a ServiceAccount name is provided then it'll add it as a PullSecret to it. It'll either return a pointer to the new Secret or and error indicating why it couldn't do it.

func GenerateFixedName added in v0.8.0

func GenerateFixedName(owner metav1.Object, prefix string) string

GenerateFixedName generates a fixed name for the given owning resource and human readable prefix. The name's length will be short enough to be valid for K8s Services.

func GetClusterDomainName

func GetClusterDomainName() string

GetClusterDomainName returns cluster's domain name or an error Closes issue: https://github.com/knative/eventing/issues/714

func ObjectRef added in v0.6.0

func PassThroughHeaders added in v0.10.0

func PassThroughHeaders(headers http.Header) http.Header

PassThroughHeaders extracts the headers from headers that are in the `forwardHeaders` set or has any of the prefixes in `forwardPrefixes`.

func ReceivingContextFrom added in v0.13.0

func ReceivingContextFrom(ctx context.Context) context.Context

ReceivingContextFrom filters the transport context headers using PassThroughHeaders after receiving an event using cloudevents.Client

func SendingContextFrom added in v0.13.0

func SendingContextFrom(ctx context.Context, tctx cloudevents.HTTPTransportContext, targetURI *url.URL) context.Context

SendingContextFrom creates the context to use when sending a Cloud Event with cloudevents.Client. It sets the target if specified, and attaches a filtered set of headers from the initial request.

func ToDNS1123Subdomain added in v0.6.0

func ToDNS1123Subdomain(name string) string

ToDNS1123Subdomain converts 'name' to a valid DNS1123 subdomain, required for object names in K8s.

Types

This section is empty.

Jump to

Keyboard shortcuts

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