plugins

package
v2.18.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AllowListedFields = []RemoverPlugin{

		{
			Gvk:  gvk.Deployment,
			Path: []string{"spec", "template", "spec", "containers", "*", "resources"},
		},

		{
			Gvk:  gvk.Deployment,
			Path: []string{"spec", "replicas"},
		},
	}
)

Functions

func CreateAddLabelsPlugin added in v2.14.0

func CreateAddLabelsPlugin(componentName string) *builtins.LabelTransformerPlugin

CreateAddLabelsPlugin creates a label transformer plugin that ensures resources to which this plugin is applied will have the Open Data Hub common labels included.

It has a following characteristics:

  • It adds labels to the "metadata/labels" path for all resource kinds.
  • It adds labels to the "spec/template/metadata/labels" and "spec/selector/matchLabels" paths for resources of kind "Deployment".

func CreateNamespaceApplierPlugin added in v2.14.0

func CreateNamespaceApplierPlugin(targetNamespace string) *builtins.NamespaceTransformerPlugin

CreateNamespaceApplierPlugin creates a plugin to ensure resources have the specified target namespace.

Types

type RemoverFilter added in v2.16.0

type RemoverFilter struct {
	Gvk  schema.GroupVersionKind
	Path []string
}

func (RemoverFilter) Filter added in v2.16.0

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

type RemoverPlugin added in v2.16.0

type RemoverPlugin struct {
	Gvk  schema.GroupVersionKind
	Path []string
}

Removes the field from the resources of ResMap if they match GVK.

func (*RemoverPlugin) Transform added in v2.16.0

func (p *RemoverPlugin) Transform(m resmap.ResMap) error

Transform removes the field from ResMap if they match filter.

func (*RemoverPlugin) TransformResource added in v2.16.0

func (p *RemoverPlugin) TransformResource(r *resource.Resource) error

TransformResource works only on one resource, not on the whole ResMap.

Jump to

Keyboard shortcuts

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