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) }