transform

package
v0.26.3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: MIT Imports: 14 Imported by: 44

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAzureParametersFile

func BuildAzureParametersFile(content string) (string, error)

BuildAzureParametersFile will add the correct schema and contentversion information

func MapValues added in v0.17.0

func MapValues(m map[string]APIModelValue, setFlagValues []string)

MapValues converts an arraw of rwa ApiModel values (like ["masterProfile.count=4","linuxProfile.adminUsername=admin"]) to a map

func MergeValuesWithAPIModel added in v0.17.0

func MergeValuesWithAPIModel(apiModelPath string, m map[string]APIModelValue) (string, error)

MergeValuesWithAPIModel takes the path to an ApiModel JSON file, loads it and merges it with the values in the map to another temp file

func PrettyPrintArmTemplate

func PrettyPrintArmTemplate(template string) (string, error)

PrettyPrintArmTemplate will pretty print the arm template ensuring ordered by params, vars, resources, and outputs

func PrettyPrintJSON

func PrettyPrintJSON(content string) (string, error)

PrettyPrintJSON will pretty print the json into

Types

type APIModelValue added in v0.17.0

type APIModelValue struct {
	// contains filtered or unexported fields
}

APIModelValue represents a value in the APIModel JSON file

type Transformer

type Transformer struct {
	Translator Translator
}

Transformer represents the object that transforms template

func (*Transformer) NormalizeForK8sVMASScalingUp

func (t *Transformer) NormalizeForK8sVMASScalingUp(logger *logrus.Entry, templateMap map[string]interface{}) error

NormalizeForK8sVMASScalingUp takes a template and removes elements that are unwanted in a K8s VMAS scale up/down case

func (*Transformer) NormalizeForOpenShiftVMASScalingUp added in v0.17.0

func (t *Transformer) NormalizeForOpenShiftVMASScalingUp(logger *logrus.Entry, agentPoolName string, templateMap map[string]interface{}) (err error)

NormalizeForOpenShiftVMASScalingUp takes a template and removes elements that are unwanted in a OpenShift VMAS scale up/down case

func (*Transformer) NormalizeForVMSSScaling

func (t *Transformer) NormalizeForVMSSScaling(logger *logrus.Entry, templateMap map[string]interface{}) error

NormalizeForVMSSScaling takes a template and removes elements that are unwanted in a VMSS scale up/down case

func (*Transformer) NormalizeMasterResourcesForScaling

func (t *Transformer) NormalizeMasterResourcesForScaling(logger *logrus.Entry, templateMap map[string]interface{}) error

NormalizeMasterResourcesForScaling takes a template and removes elements that are unwanted in any scale up/down case

func (*Transformer) NormalizeResourcesForK8sAgentUpgrade

func (t *Transformer) NormalizeResourcesForK8sAgentUpgrade(logger *logrus.Entry, templateMap map[string]interface{}, isMasterManagedDisk bool, agentPoolsToPreserve map[string]bool) error

NormalizeResourcesForK8sAgentUpgrade takes a template and removes elements that are unwanted in any scale up/down case

func (*Transformer) NormalizeResourcesForK8sMasterUpgrade

func (t *Transformer) NormalizeResourcesForK8sMasterUpgrade(logger *logrus.Entry, templateMap map[string]interface{}, isMasterManagedDisk bool, agentPoolsToPreserve map[string]bool) error

NormalizeResourcesForK8sMasterUpgrade takes a template and removes elements that are unwanted in any scale up/down case

type Translator

type Translator interface {
	// T translates a text string, based on GNU's gettext library.
	T(msgid string, vars ...interface{}) string
	// NT translates a text string into the appropriate plural form, based on GNU's gettext library.
	NT(msgid, msgidPlural string, n int, vars ...interface{}) string
	// Errorf produces an error with a translated error string.
	Errorf(msgid string, vars ...interface{}) error
	// NErrorf produces an error with a translated error string in the appropriate plural form.
	NErrorf(msgid, msgidPlural string, n int, vars ...interface{}) error
}

Translator defines all required interfaces for i18n.Translator.

Jump to

Keyboard shortcuts

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