Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "pack/k8s/kubernetes/name"

Index

Variables

Functions

Variables

Const defaultValidName

defaultValidName: "valid-name" = "valid-name"

If removing invalid characters from the name results in an empty string, this value is used as the name. You do not want more than one application per namespace to end up using this.

Functions

nameMatch

  • nameMatch(value: string, matcher?: string | RegExp): boolean
  • Determine if the value matches the matcher. The matching rules are as follows:

    • If the matcher is a string, value and matcher must be equal (===).
    • If matcher is a regular expression, value must match the regular expression according to RegExp.test().
    • If no matcher is provided, any value matches.

    Parameters

    • value: string

      String to match

    • Optional matcher: string | RegExp

      String or RegExp to match against

    Returns boolean

    true if it is a match, false otherwise

validName

  • validName(name: string): string
  • Ensure the provided name is a valid Kubernetes resouce name. The validation regular expression for a resource is /^[a-z]([-a-z0-9]*[a-z0-9])?$/ and it must be between 1 and 63 characters long.

    Parameters

    • name: string

      The resource name

    Returns string

    A valid resource name based on the input

Generated using TypeDoc