Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "pack/k8s/sync/change"

Index

Type aliases

ChangeType

ChangeType: "apply" | "delete"

Whether a spec should be applied or deleted.

Functions

calculateChanges

  • calculateChanges(before: KubernetesObject[], after: KubernetesObject[] | undefined, change: ChangeType): SyncChanges[]
  • Inspect before and after specs to determine actions.

    If the action is "delete", return delete actions for all specs in before that do not have an ignore annotation for the current SDM, as the "delete" action implies there are no after specs.

    If the action is "apply", return apply actions for all specs in after and delete actions for all specs in before that are not in after that do not have an ignore annotation for the current SDM. If a before spec contains a sync ignore annotation for the current SDM and the after annotation does not, the after spec with an "apply" action is included in the returned changes. If an after spec contains a sync ignore annotation for the current SDM, then it is omitted from the returned changes, regardless of whether it appears in the before specs or not.

    Parameters

    • before: KubernetesObject[]

      The specs before the change

    • after: KubernetesObject[] | undefined

      The specs after the change

    • change: ChangeType

      The type of change

    Returns SyncChanges[]

    Array containing the type of change for each spec

changeResource

  • Delete/apply resources in change. The spec file provided by the change.path may contain multiple specs. The requested change is applied to each.

    Parameters

    Returns Promise<void>

filterIgnoredSpecs

  • filterIgnoredSpecs(specs: KubernetesObject[] | undefined): KubernetesObject[]
  • Returned array of specs with those that should be ignored filtered out.

    Parameters

    • specs: KubernetesObject[] | undefined

      Array of specs to check

    Returns KubernetesObject[]

    Array of not ignored specs.

hasMetadataAnnotation

  • hasMetadataAnnotation(spec: KubernetesObject, annotationKey: string, annotationValue: string): boolean
  • Check if the Kubernetes Object has an annotation that is relevant to the current SDM

    Parameters

    • spec: KubernetesObject

      the spec to inspect

    • annotationKey: string

      the key to validate for

    • annotationValue: string

      the value validate for

    Returns boolean

    the result of the annotation inspection

Generated using TypeDoc