Documentation
¶
Index ¶
- Constants
- func CopyRequest(req *http.Request) (*http.Request, error)
- func CopySecret(corev1Input clientcorev1.CoreV1Interface, srcNS string, srcSecretName string, ...) (*corev1.Secret, error)
- func CopySecretWithName(corev1Input clientcorev1.CoreV1Interface, ...) (*corev1.Secret, error)
- func GenerateFixedName(owner metav1.Object, prefix string) string
- func GetLoggingConfig(ctx context.Context, namespace, loggingConfigMapName string) (*logging.Config, error)
- func ObjectRef(obj metav1.Object, gvk schema.GroupVersionKind) corev1.ObjectReference
- func PassThroughHeaders(headers http.Header) http.Header
- func SetKlogVerbosity(level string) (bool, error)
- func SetKlogVerbosityFromConfigMap(data map[string]string) (bool, error)
- func ToDNS1123Subdomain(name string) string
- func UpdateKlogVerbosityFromConfigMap(logger *zap.SugaredLogger) func(*corev1.ConfigMap)
Constants ¶
const KlogVerbosityKey = "klog-verbosity"
KlogVerbosityKey is the key in config-logging ConfigMap for klog verbosity level.
Variables ¶
This section is empty.
Functions ¶
func CopyRequest ¶ added in v0.45.4
CopyRequest makes a copy of the http request which can be consumed as needed, leaving the original request able to be consumed as well.
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 CopySecretWithName ¶ added in v0.37.2
func CopySecretWithName(corev1Input clientcorev1.CoreV1Interface, srcNS, srcSecretName, tgtNS, tgtSecretName, svcAccount string) (*corev1.Secret, error)
CopySecretWithName will copy a secret from one namespace into another. Allows for specifying target secret name.
func GenerateFixedName ¶ added in v0.8.0
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.
Deprecated, use knative.dev/pkg/kmeta.ChildName instead.
func GetLoggingConfig ¶ added in v0.49.0
func GetLoggingConfig(ctx context.Context, namespace, loggingConfigMapName string) (*logging.Config, error)
GetLoggingConfig fetches the logging ConfigMap from the given namespace and parses it into a *logging.Config. If the ConfigMap is not found, it returns the default logging config.
func ObjectRef ¶ added in v0.6.0
func ObjectRef(obj metav1.Object, gvk schema.GroupVersionKind) corev1.ObjectReference
func PassThroughHeaders ¶ added in v0.10.0
PassThroughHeaders extracts the headers from headers that are in the `forwardHeaders` set or has any of the prefixes in `forwardPrefixes`.
func SetKlogVerbosity ¶ added in v0.50.0
SetKlogVerbosity applies the given verbosity level string directly to klog. An empty string is a no-op and returns (false, nil). "0" resets verbosity and levels 1–9 raise it; both return (true, nil).
func SetKlogVerbosityFromConfigMap ¶ added in v0.50.0
SetKlogVerbosityFromConfigMap reads klog-verbosity from the ConfigMap data and applies it to klog. Missing or empty values are no-ops and return (false, nil). "0" resets verbosity and levels 1–9 raise it; both return (true, nil).
func ToDNS1123Subdomain ¶ added in v0.6.0
ToDNS1123Subdomain converts 'name' to a valid DNS1123 subdomain, required for object names in K8s.
func UpdateKlogVerbosityFromConfigMap ¶ added in v0.50.0
func UpdateKlogVerbosityFromConfigMap(logger *zap.SugaredLogger) func(*corev1.ConfigMap)
UpdateKlogVerbosityFromConfigMap returns a ConfigMap watch handler that updates klog verbosity when the config-logging ConfigMap changes.
Types ¶
This section is empty.