Documentation ¶
Index ¶
- Variables
- func ArgIsLikelyBooleanYamlValue(arg string) (bool, error)
- func GetBasePathConfig() (*pathconfig.PathConfig, error)
- func GetValues(arg string) (*map[string][]*LogHelmReport, error)
- func IsBooleanYamlValue(input *map[string]interface{}, path *[]string) (bool, error)
- func PreFixValuesWithItems(sb *strings.Builder, itemField string, pathValues *map[string][]*LogHelmReport)
- func PrintReportItems(reports []*LogHelmReport)
- func RemoveDollarPrefix(sb *strings.Builder)
- type HelmChartClient
- type LogHelmReport
Constants ¶
This section is empty.
Variables ¶
var HelmChartRef string
HelmChartRef is a global variable. This is not ideal, but it is necessary in this case in order to avoid a circular dependency issue. Essentially, the cmd package is originally responsible for determining the HelmChartRef via CLI interactions. This package cannot depend on the "cmd" package, as it would cause a circular dependency. The cmd package depends on our forked "text/template", and our "text/template" depends on the "helm" package. Thus, "helm" cannot depend on "cmd". This is a language limitation, and there may be more elegant ways to solve this in the future, but utilizing a global works for now, although it is ugly. "cmd" is instructed to set this global variable for later use.
Functions ¶
func ArgIsLikelyBooleanYamlValue ¶
A heuristic to determine whether a given input argument is likely a boolean value. This is done through inspecting the charts Values. For example, say we have an arbitrary argument in a conditional "metrics". This function inspects the values file for the "metrics" definition. If metrics looks like the following: metrics: true or metrics: false then metrics is likely a boolean (i.e., its value is a boolean value). Otherwise, it is likely not a boolean.
func GetBasePathConfig ¶
func GetBasePathConfig() (*pathconfig.PathConfig, error)
GetBasePathConfig ....
func GetValues ¶
func GetValues(arg string) (*map[string][]*LogHelmReport, error)
GetValues takes a path that traverses a values that are stores in Values map and returns the value at the end of that path. Given the following data the value at path "chapter.one.title" is "PR Review".
chapter: one: title: "PR Review"
func IsBooleanYamlValue ¶
Determines whether path within the input context refers to a boolean type. Consulting a Helm Chart's values is helpful for determining whether a Helm Chart template conditional is checking for boolean equality v.s. definition.
func PreFixValuesWithItems ¶
func PreFixValuesWithItems(sb *strings.Builder, itemField string, pathValues *map[string][]*LogHelmReport)
PreFixValuesWithItems...For single item list {% for item in hosts %}{{ item.name }}{% endfor %}, This function will prefix the list variables with a loop variable, within the body of the for loop. There is two cases , one with field name that needs to be prefixed with loop variables other condition is dot field name is replaced by loop variable
func PrintReportItems ¶
func PrintReportItems(reports []*LogHelmReport)
LogReports - Printing report struct
func RemoveDollarPrefix ¶
Remove $ from loop variables and body of the loop
Types ¶
type HelmChartClient ¶
type HelmChartClient struct { Chart *chart.Chart ChartName string PathConfig *pathconfig.PathConfig }
HelmChartClient ....
func NewChartClient ¶
func NewChartClient() *HelmChartClient
NewChartClient creates a new chart client
func (*HelmChartClient) LoadChartFrom ¶
func (hc *HelmChartClient) LoadChartFrom(chartPath string) (err error)
LoadChart uses the chart client's values to retrieve the appropriate chart