Documentation ¶
Index ¶
- Variables
- func AddTransform(newTransform Transform)
- func DownloadFromGCS(manifests []string) (string, error)
- func Write(manifests string, output string, manifestOut io.Writer) error
- type FieldVisitor
- type GroupKindSelector
- type ManifestList
- func (l *ManifestList) Append(buf []byte)
- func (l *ManifestList) CollectNamespaces() ([]string, error)
- func (l *ManifestList) Diff(latest ManifestList) ManifestList
- func (l *ManifestList) Filter(selectors ...GroupKindSelector) (ManifestList, error)
- func (l *ManifestList) GetImages() ([]graph.Artifact, error)
- func (l *ManifestList) Reader() io.Reader
- func (l *ManifestList) ReplaceImages(ctx context.Context, builds []graph.Artifact) (ManifestList, error)
- func (l *ManifestList) ReplaceRemoteManifestImages(ctx context.Context, builds []graph.Artifact) (ManifestList, error)
- func (l *ManifestList) SelectResources(selectors ...GroupKindSelector) ([]unstructured.Unstructured, error)
- func (l *ManifestList) SetLabels(labels map[string]string) (ManifestList, error)
- func (l *ManifestList) String() string
- func (l *ManifestList) Visit(visitor FieldVisitor) (ManifestList, error)
- type Registries
- type Transform
Constants ¶
This section is empty.
Variables ¶
var ConfigConnectorResourceSelector = []GroupKindSelector{ &wildcardGroupKind{Group: regexp.MustCompile(`([[:alpha:]]+\.)+cnrm\.cloud\.google\.com`)}, }
ConfigConnectorResourceSelector provides a resource selector for Google Cloud Config Connector resources See https://cloud.google.com/config-connector/docs/overview
var ManifestTmpDir = filepath.Join(os.TempDir(), manifestsStagingFolder)
Functions ¶
func AddTransform ¶
func AddTransform(newTransform Transform)
AddTransform adds a transform to be applied when deploying.
func DownloadFromGCS ¶
DownloadFromGCS downloads all provided manifests from a remote GCS bucket, and returns a relative path pointing to the GCS temp dir.
Types ¶
type FieldVisitor ¶
type FieldVisitor interface { // Visit is called for each transformable key contained in the object and may apply transformations/aggregations on it. // It should return true to allow recursive traversal or false when the entry was transformed. Visit(object map[string]interface{}, key string, value interface{}) bool }
FieldVisitor represents the aggregation/transformation that should be performed on each traversed field.
type GroupKindSelector ¶ added in v1.34.1
type ManifestList ¶
type ManifestList [][]byte
ManifestList is a list of yaml manifests.
func ApplyTransforms ¶
func ApplyTransforms(manifests ManifestList, builds []graph.Artifact, insecureRegistries map[string]bool, debugHelpersRegistry string) (ManifestList, error)
ApplyTransforms applies all manifests transforms to the provided manifests.
func Load ¶
func Load(in io.Reader) (ManifestList, error)
Load uses the Kubernetes `apimachinery` to split YAML content into a set of YAML documents.
func (*ManifestList) Append ¶
func (l *ManifestList) Append(buf []byte)
Append appends the yaml manifests defined in the given buffer. `buf` can contain concatenated manifests without `---` separators because `kubectl create --dry-run -oyaml` produces such output.
func (*ManifestList) CollectNamespaces ¶
func (l *ManifestList) CollectNamespaces() ([]string, error)
CollectNamespaces returns all the namespaces in the manifests.
func (*ManifestList) Diff ¶
func (l *ManifestList) Diff(latest ManifestList) ManifestList
Diff computes the list of manifests that have changed.
func (*ManifestList) Filter ¶ added in v1.34.1
func (l *ManifestList) Filter(selectors ...GroupKindSelector) (ManifestList, error)
Filter returns the manifest list that match any of the given `GroupKindSelector` items
func (*ManifestList) GetImages ¶
func (l *ManifestList) GetImages() ([]graph.Artifact, error)
GetImages gathers a map of base image names to the image with its tag
func (*ManifestList) Reader ¶
func (l *ManifestList) Reader() io.Reader
Reader returns a reader on the raw yaml descriptors.
func (*ManifestList) ReplaceImages ¶
func (l *ManifestList) ReplaceImages(ctx context.Context, builds []graph.Artifact) (ManifestList, error)
ReplaceImages replaces image names in a list of manifests. It doesn't replace images that are referenced by digest.
func (*ManifestList) ReplaceRemoteManifestImages ¶ added in v1.30.0
func (l *ManifestList) ReplaceRemoteManifestImages(ctx context.Context, builds []graph.Artifact) (ManifestList, error)
ReplaceRemoteManifestImages replaces all image names in a list containing remote manifests. This will even override images referenced by digest or with a different repository
func (*ManifestList) SelectResources ¶ added in v1.34.1
func (l *ManifestList) SelectResources(selectors ...GroupKindSelector) ([]unstructured.Unstructured, error)
SelectResources returns the resources defined in the manifest list that match any of the given `GroupKindSelector` items
func (*ManifestList) SetLabels ¶
func (l *ManifestList) SetLabels(labels map[string]string) (ManifestList, error)
SetLabels add labels to a list of Kubernetes manifests.
func (*ManifestList) String ¶
func (l *ManifestList) String() string
func (*ManifestList) Visit ¶
func (l *ManifestList) Visit(visitor FieldVisitor) (ManifestList, error)
Visit recursively visits all transformable object fields within the manifests and lets the visitor apply transformations/aggregations on them.
type Registries ¶
type Transform ¶
type Transform func(l ManifestList, builds []graph.Artifact, registries Registries) (ManifestList, error)
func GetTransforms ¶
func GetTransforms() []Transform
GetTransforms returns all manifest transforms.