Standardization

- changed variables that was uppercased, that's not OK for linters
- cleanup some documentation
- remove the "/" in label prefix, a function is now used to get the
  complete label (`labelName()`)
- some cleanup in tpl files, and so on...
This commit is contained in:
2024-04-24 13:59:21 +02:00
parent 98c7c6ddc1
commit f73d598bb4
22 changed files with 181 additions and 220 deletions

View File

@@ -4,20 +4,13 @@ import (
"fmt"
)
// LabelType identifies the type of label to generate in objects.
// TODO: is this still needed?
type LabelType uint8
const (
DeploymentLabel LabelType = iota
ServiceLabel
)
var componentLabel = labelName("component")
// GetLabels returns the labels for a service. It uses the appName to replace the __replace__ in the labels.
// This is used to generate the labels in the templates.
func GetLabels(serviceName, appName string) map[string]string {
labels := map[string]string{
KATENARY_PREFIX + "component": serviceName,
componentLabel: serviceName,
}
key := `{{- include "%s.labels" . | nindent __indent__ }}`
@@ -30,7 +23,7 @@ func GetLabels(serviceName, appName string) map[string]string {
// This is used to generate the matchLabels in the templates.
func GetMatchLabels(serviceName, appName string) map[string]string {
labels := map[string]string{
KATENARY_PREFIX + "component": serviceName,
componentLabel: serviceName,
}
key := `{{- include "%s.selectorLabels" . | nindent __indent__ }}`