Skip to content

Commit 9b78b4f

Browse files
added copilot suggested changes
1 parent d731615 commit 9b78b4f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pkg/k8sutil/configmap.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ func (oc *OperatorContext) ReconcileConfigMap() result.ReconcileResult {
2020
cr := oc.MarklogicGroup
2121

2222
logger.Info("Reconciling MarkLogic ConfigMap")
23-
labels := getCommonLabels(cr.Spec.Name)
24-
annotations := getCommonAnnotations()
23+
labels := oc.GetOperatorLabels(cr.Spec.Name)
24+
annotations := oc.GetOperatorAnnotations()
2525
configMapName := cr.Spec.Name + "-scripts"
2626
objectMeta := generateObjectMeta(configMapName, cr.Namespace, labels, annotations)
2727
nsName := types.NamespacedName{Name: objectMeta.Name, Namespace: objectMeta.Namespace}
@@ -265,14 +265,17 @@ pipeline:
265265
// For YAML list items starting with "-", use 4 spaces base indentation
266266
// For properties under list items, use 6 spaces base indentation
267267
var newIndent int
268+
const yamlListItemIndent = 4
269+
const yamlPropertyIndent = 6
268270
if strings.HasPrefix(content, "- ") {
269-
newIndent = 4 // List items at pipeline outputs level
271+
newIndent = yamlListItemIndent // List items at pipeline outputs level
270272
} else {
271-
newIndent = 6 // Properties under list items
273+
newIndent = yamlPropertyIndent // Properties under list items
272274
}
273275
// Add any additional relative indentation beyond the first level
274-
if leadingSpaces > 2 {
275-
newIndent += leadingSpaces - 2
276+
const baseIndentOffset = 2
277+
if leadingSpaces > baseIndentOffset {
278+
newIndent += leadingSpaces - baseIndentOffset
276279
}
277280
processedLines = append(processedLines, strings.Repeat(" ", newIndent)+content)
278281
}

0 commit comments

Comments
 (0)