...

Package nameref

import "sigs.k8s.io/kustomize/api/filters/nameref"
Overview
Index

Overview ▾

Package nameref contains a kio.Filter implementation of the kustomize name reference transformer.

type Filter

Filter updates a name references.

type Filter struct {
    // Referrer refers to another resource X by X's name.
    // E.g. A Deployment can refer to a ConfigMap.
    // The Deployment is the Referrer,
    // the ConfigMap is the ReferralTarget.
    // This filter seeks to repair the reference in Deployment, given
    // that the ConfigMap's name may have changed.
    Referrer *resource.Resource

    // NameFieldToUpdate is the field in the Referrer
    // that holds the name requiring an update.
    // This is the field to write.
    NameFieldToUpdate types.FieldSpec

    // ReferralTarget is the source of the new value for
    // the name, always in the 'metadata/name' field.
    // This is the field to read.
    ReferralTarget resid.Gvk

    // Set of resources to scan to find the ReferralTarget.
    ReferralCandidates resmap.ResMap
}

func (Filter) Filter

func (f Filter) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error)

At time of writing, in practice this is called with a slice with only one entry, the node also referred to be the resource in the Referrer field.