transform

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: MIT Imports: 14 Imported by: 28

Documentation

Overview

Package transform provides helper methods to introspect and modify existing ARM templates.

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

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

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

func RemoveNsgDependency added in v0.41.0

func RemoveNsgDependency(logger *logrus.Entry, resourceName string, resourceMap map[string]interface{})

RemoveNsgDependency Removes the nsg dependency from the resource

Types

type APIModelValue

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) NormalizeForK8sAddVMASPool added in v0.48.0

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

NormalizeForK8sAddVMASPool takes a template and removes elements that are unwanted in a K8s VMAS add pool case

func (*Transformer) NormalizeForK8sSLBScalingOrUpgrade added in v0.39.0

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

NormalizeForK8sSLBScalingOrUpgrade takes a template and removes elements that are unwanted in a K8s Standard LB cluster scale up/down case

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) 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/upgrade 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

func (*Transformer) RemoveImmutableResourceProperties added in v0.44.0

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

func (*Transformer) RemoveJumpboxResourcesFromTemplate added in v0.46.3

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

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