From 6c038ec460931fba3e7f175d089743aef464029b Mon Sep 17 00:00:00 2001 From: Vladislav Klimenko Date: Thu, 28 Mar 2024 19:37:34 +0300 Subject: [PATCH] dev: clarification --- pkg/apis/clickhouse.altinity.com/v1/types.go | 4 ++++ pkg/model/chi/normalizer/templates/chi.go | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/apis/clickhouse.altinity.com/v1/types.go b/pkg/apis/clickhouse.altinity.com/v1/types.go index fb9630f42..d890ff4d3 100644 --- a/pkg/apis/clickhouse.altinity.com/v1/types.go +++ b/pkg/apis/clickhouse.altinity.com/v1/types.go @@ -144,6 +144,10 @@ func (s CHISelector) Matches(labels map[string]string) bool { // Labels have the key specified in selector, but selector value is not the same as labels value // Selector does not match the labels return false + } else { + // Selector value and label value are equal + // So far label matches selector + // Continue iteration to next value } } diff --git a/pkg/model/chi/normalizer/templates/chi.go b/pkg/model/chi/normalizer/templates/chi.go index 085c1953f..01eaf36c9 100644 --- a/pkg/model/chi/normalizer/templates/chi.go +++ b/pkg/model/chi/normalizer/templates/chi.go @@ -73,8 +73,7 @@ func ApplyCHITemplates(target, chi *api.ClickHouseInstallation) (appliedTemplate templates := prepareListOfTemplates(chi) // Apply templates from the list and count applied templates - just to make nice log entry - for i := range templates { - template := templates[i] + for _, template := range templates { if applyTemplate(target, template, chi) { appliedTemplates = append(appliedTemplates, template) }