diff --git a/pkg/processor/pod/pod.go b/pkg/processor/pod/pod.go index 1199c5f..fece146 100644 --- a/pkg/processor/pod/pod.go +++ b/pkg/processor/pod/pod.go @@ -16,17 +16,8 @@ import ( const imagePullPolicyTemplate = "{{ .Values.%[1]s.%[2]s.imagePullPolicy }}" const envValue = "{{ quote .Values.%[1]s.%[2]s.%[3]s.%[4]s }}" -func CalculateBaseIndent(resourceType string) int { - switch resourceType { - case "CronJob", "Job": - return 4 // Adjusting for the deeper nesting within a JobTemplate - default: - return 0 // Regular Template - } -} - func ProcessSpec(objName string, appMeta helmify.AppMetadata, spec corev1.PodSpec, kind string) (map[string]interface{}, helmify.Values, error) { - baseIndent := CalculateBaseIndent(kind) + baseIndent := calculateBaseIndent(kind) values, err := processPodSpec(objName, appMeta, &spec) if err != nil { @@ -108,6 +99,15 @@ func processNestedContainers(specMap map[string]interface{}, objName string, val return specMap, values, nil } +func calculateBaseIndent(resourceType string) int { + switch resourceType { + case "CronJob", "Job": + return 4 // Adjusting for the deeper nesting within a JobTemplate + default: + return 0 // Regular Template + } +} + func processContainers(objName string, values helmify.Values, containerType string, containers []interface{}, baseIndent int) ([]interface{}, helmify.Values, error) { for i := range containers { containerName := strcase.ToLowerCamel((containers[i].(map[string]interface{})["name"]).(string))