label

package module
v0.0.0-...-5c159d4 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: 0BSD Imports: 3 Imported by: 0

README

KRM Filter - Annotate

Add top-level labels to all resources.

Sometimes labels contain only meta information and, for example, a pod restart is not desired. This function labels only the top level metadata of each resource, in order to avoid pod restarts and problems with immutable fields.

Examples

The function config is a simple configmap-like object where each data key-value pair is one label.

apiVersion: v1
kind: ConfigMap
metadata:
  name: label
data:
  app.kubernetes.io/name: nginx
  app.kubernetes.io/component: ingress-controller

Run the function as standalone providing the function config and resources.

label fn-config.yaml - < resources.yaml

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type FunctionConfig

type FunctionConfig struct {
	Data map[string]string
}

type TopLevelLabeler

type TopLevelLabeler struct {
	Labels map[string]string
}

func (*TopLevelLabeler) Each

func (a *TopLevelLabeler) Each(r []*yaml.RNode) ([]*yaml.RNode, error)

func (*TopLevelLabeler) Filter

func (a *TopLevelLabeler) Filter(object *yaml.RNode) (*yaml.RNode, error)

Directories

Path Synopsis
cmd
Code generated by "mdtogo"; DO NOT EDIT.
Code generated by "mdtogo"; DO NOT EDIT.

Jump to

Keyboard shortcuts

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