Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/kubernetes/labels"

Index

Type aliases

ApplicationLabelInput

Input type for the labels function.

KubernetesApplicationLabelInput

KubernetesApplicationLabelInput: Pick<KubernetesResourceRequest, "name" | "sdmFulfiller" | "workspaceId">

MatchLabelInput

MatchLabelInput: Pick<KubernetesResourceRequest, "name" | "workspaceId">

Input type for matchLabels function.

Functions

applicationLabels

labelMatch

  • labelMatch(spec: KubernetesObject, selector?: V1LabelSelector): boolean
  • Determine if labels match selector. If the selector contains no label selector, it is considered a match. If the the matchLabels contain no properties, it is considered matching. If the matchExpressions array is empty, it is considered matching.

    Parameters

    • spec: KubernetesObject

      Kubernetes object spec

    • Optional selector: V1LabelSelector

      Kubernetes label selector

    Returns boolean

    Return true if it is a match, false otherwise

labelSelector

  • Provide label selector string suitable for passing to a Kubernetes API call for the provided req object.

    Parameters

    • req: MatchLabelInput

      A Kubernetes request object containing at least the "name" and "workspaceId" properties

    Returns string

    Kubernetes label selector string

matchLabels

  • Returns the subset of the default set of labels for that should be used in a matchLabels to match a resource.

    Parameters

    • req: MatchLabelInput

      A Kubernetes request object containing at least the "name" and "workspaceId" properties

    Returns object

    Kubernetes object metadata labels object

    • [key: string]: string

safeLabelValue

  • safeLabelValue(value: string): string
  • Remove objectionable characters from a Kubernetes label value. The validation regular expression for a label value is /^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$/.

    Parameters

    • value: string

      The label value

    Returns string

    A valid label value based on the input

Generated using TypeDoc