transformer

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package transformer provides a mechanism to transform node specification based on node transformation rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenericFuncMap

func GenericFuncMap() map[string]interface{}

GenericFuncMap returns a copy of the basic function map as a map[string]interface{}.

Types

type NodeFeaturesFlagSpec

type NodeFeaturesFlagSpec struct {
	// PublicIPDiscovery try to find public IP on the node
	PublicIPDiscovery bool `yaml:"publicIPDiscovery,omitempty"`
}

NodeFeaturesFlagSpec represents the node features flags.

type NodeSpec

type NodeSpec struct {
	Annotations map[string]string
	Labels      map[string]string
	Features    NodeFeaturesFlagSpec
}

NodeSpec represents the transformed node specifcations.

func TransformNode

func TransformNode(terms []NodeTerm, platformMetadata *runtime.PlatformMetadataSpec) (*NodeSpec, error)

TransformNode transforms the node metadata based on the node transformation rules.

type NodeTerm

type NodeTerm struct {
	Name             string                          `yaml:"name,omitempty"`
	NodeSelector     []nodeselector.NodeSelectorTerm `yaml:"nodeSelector,omitempty"`
	Annotations      map[string]string               `yaml:"annotations,omitempty"`
	Labels           map[string]string               `yaml:"labels,omitempty"`
	PlatformMetadata map[string]string               `yaml:"platformMetadata,omitempty"`
	Features         NodeFeaturesFlagSpec            `yaml:"features,omitempty"`
}

NodeTerm represents expressions and fields to transform node metadata.

Jump to

Keyboard shortcuts

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