Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ aliases:
* BUGFIX: [converter](https://docs.victoriametrics.com/operator/integrations/prometheus/#objects-conversion): disable all prometheus controllers if CRD group was not found. See [#2838](https://github.com/VictoriaMetrics/helm-charts/issues/2838).
* BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): change default load balancing policy for write requests from `first_available` to `least_loaded`. This should allow to evenly distribute write load across all VMAgents.
* BUGFIX: [vmalertmanagerconfig](https://docs.victoriametrics.com/operator/resources/vmalertmanagerconfig/): fix previously ignored negative values in VMAlertmanagerConfig. See [#2132](https://github.com/VictoriaMetrics/operator/issues/2132).
* BUGFIX: [vmalertmanager](https://docs.victoriametrics.com/operator/resources/vmalertmanager/): fixed ignored alertmanager template if it has no discovered VMAlertmanagerconfig CRs or tracing config defined. See [#2121](https://github.com/VictoriaMetrics/operator/issues/2121).

## [v0.69.0](https://github.com/VictoriaMetrics/operator/releases/tag/v0.69.0)
**Release date:** 22 April 2026
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ type parsedObjects struct {
}

func (pos *parsedObjects) buildConfig(cr *vmv1beta1.VMAlertmanager, data []byte, ac *build.AssetsCache) ([]byte, error) {
if len(pos.configs.All()) == 0 && cr.Spec.TracingConfig == nil {
if len(pos.configs.All()) == 0 && cr.Spec.TracingConfig == nil && len(cr.Spec.Templates) == 0 {
return data, nil
}
var baseCfg amConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,48 @@ func TestBuildConfig(t *testing.T) {
assert.Equal(t, o.want, string(data))
}

// templates only
f(opts{
cr: &vmv1beta1.VMAlertmanager{
ObjectMeta: metav1.ObjectMeta{
Name: "test",
Namespace: "default",
},
Spec: vmv1beta1.VMAlertmanagerSpec{
EnforcedNamespaceLabel: "alert-namespace",
ConfigNamespaceSelector: &metav1.LabelSelector{},
Templates: []vmv1beta1.ConfigMapKeyReference{
{LocalObjectReference: corev1.LocalObjectReference{Name: "test-am"}, Key: "test_1.tmpl"},
},
},
},
baseCfg: []byte(`global:
time_out: 1min
smtp_smarthost: some:443
`),
predefinedObjects: []runtime.Object{
&corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: "ca",
Namespace: "default",
},
Data: map[string][]byte{
"key": []byte("value"),
},
},
},
want: `global:
smtp_smarthost: some:443
time_out: 1min
route:
receiver: blackhole
receivers:
- name: blackhole
templates:
- /etc/vm/templates/test-am/test_1.tmpl
`,
})

// tracing without discovered objects
f(opts{
cr: &vmv1beta1.VMAlertmanager{
Expand Down
Loading