postrender

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package postrender provides a way to modify the rendered manifests before they are sent to the Kubernetes cluster.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChain

NewChain creates a new Chain post renderer that runs the given list of post renderers in order.

func NewRewriter

func NewRewriter(options []RewriteOption) postrender.PostRenderer

NewRewriter applies a list of EnhanceOption functions to modify the renderedManifests. It returns a PostRenderer that applies the enhancements to the manifests. The EnhanceOption functions are applied in the order they appear in the options slice. Each EnhanceOption function takes an unstructured.Unstructured object as input and modifies it. The modified manifests are encoded and returned as a *bytes.Buffer. If any error occurs during the enhancement process, it is returned.

Types

type PostRendererFunc

type PostRendererFunc func(renderedManifests *bytes.Buffer) (modifiedManifests *bytes.Buffer, err error)

func (PostRendererFunc) Run

func (f PostRendererFunc) Run(renderedManifests *bytes.Buffer) (modifiedManifests *bytes.Buffer, err error)

type RewriteOption

type RewriteOption func(unstructured.Unstructured)

RewriteOption is a function type that represents an option for enhancing an unstructured object.

func AppendAnnotations

func AppendAnnotations(annotations map[string]string) RewriteOption

func AppendLabels

func AppendLabels(labels map[string]string) RewriteOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL