Skip to content
Open
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
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ aliases:
* FEATURE: [vmprobe](https://docs.victoriametrics.com/operator/resources/vmprobe/): added `spec.targets.kubernetes` property, that allows to configure probe for `ingress`, `pod` and `service` roles. See [#1078](https://github.com/VictoriaMetrics/operator/issues/1078) and [#1716](https://github.com/VictoriaMetrics/operator/issues/1716).
* FEATURE: [vmscrapeconfig](https://docs.victoriametrics.com/operator/resources/vmscrapeconfig/): added nomad_sd_config support. See [#1809](https://github.com/VictoriaMetrics/operator/issues/1809).
* FEATURE: [vmoperator](https://docs.victoriametrics.com/operator/): support VPA for vmcluster, vtcluster, vlcluster and vmauth. See [#1795](https://github.com/VictoriaMetrics/operator/issues/1795). Thanks to the @dctrwatson for the pull request [#1803](https://github.com/VictoriaMetrics/operator/pull/1803).
* FEATURE: [vmoperator](https://docs.victoriametrics.com/operator/): perform statefulset pods deletion instead of eviction when maxUnavailable set to 100%, which is important for [minimum downtime strategy](https://docs.victoriametrics.com/victoriametrics/cluster-victoriametrics/#minimum-downtime-strategy). See [#1706](https://github.com/VictoriaMetrics/operator/issues/1706).

* BUGFIX: [vmagent](https://docs.victoriametrics.com/operator/resources/vmagent/): previously the operator requested `nodes/proxy` RBAC permissions even though vmagent did not use them; now this permission is no longer required, reducing the default privilege footprint for users running vmagent. See [#1753](https://github.com/VictoriaMetrics/operator/issues/1753).
* BUGFIX: [vmalert](https://docs.victoriametrics.com/operator/resources/vmalert/): throw error if no notifiers found. See [#1757](https://github.com/VictoriaMetrics/operator/issues/1757).
Expand All @@ -43,7 +44,6 @@ aliases:
* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): previously, recreating a resource after deletion could hang and block updates; now resource recreation completes normally. See [#1707](https://github.com/VictoriaMetrics/operator/issues/1707).
* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): use global image registry unless image.repository is defined. See [#1813](https://github.com/VictoriaMetrics/operator/issues/1813).
* BUGFIX: [vmalertmanagerconfig](https://docs.victoriametrics.com/operator/resources/vmalertmanagerconfig/): previously spec.route and spec.receivers were required; now both parameters are optional to align with prometheus operator. VMAlertmanager now can be used to set just the global inhibition rules. See [#1800](https://github.com/VictoriaMetrics/operator/issues/1800).
* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): use global image registry unless image.repository is defined. See [#1813](https://github.com/VictoriaMetrics/operator/issues/1813).

## [v0.67.0](https://github.com/VictoriaMetrics/operator/releases/tag/v0.67.0)
**Release date:** 23 January 2026
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ require (
github.com/cespare/xxhash/v2 v2.3.0
github.com/fsnotify/fsnotify v1.9.0
github.com/go-logr/logr v1.4.3
github.com/go-test/deep v1.1.1
github.com/google/go-cmp v0.7.0
github.com/google/uuid v1.6.0
github.com/onsi/ginkgo/v2 v2.28.1
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6
github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U=
github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand Down
10 changes: 2 additions & 8 deletions internal/controller/operator/converter/v1alpha1/apis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package v1alpha1
import (
"testing"

"github.com/google/go-cmp/cmp"
promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
promv1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1"
"github.com/stretchr/testify/assert"
Expand All @@ -23,9 +22,7 @@ func TestConvertAlertmanagerConfig(t *testing.T) {
f := func(o opts) {
t.Helper()
converted, err := ConvertAlertmanagerConfig(o.promCfg, &config.BaseOperatorConf{})
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
assert.NoError(t, err)
o.validate(converted)
}

Expand Down Expand Up @@ -97,10 +94,7 @@ func TestConvertScrapeConfig(t *testing.T) {
f := func(opts opts) {
t.Helper()
got := ConvertScrapeConfig(opts.scrapeConfig, &config.BaseOperatorConf{EnabledPrometheusConverterOwnerReferences: opts.ownerRef})
if !cmp.Equal(*got, opts.want) {
diff := cmp.Diff(*got, opts.want)
t.Fatal("not expected output with diff: ", diff)
}
assert.Equal(t, *got, opts.want)
}

// with static config
Expand Down
13 changes: 5 additions & 8 deletions internal/controller/operator/factory/build/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ func Test_buildProbe(t *testing.T) {
type opts struct {
container corev1.Container
cr testBuildProbeCR
validate func(corev1.Container) error
validate func(corev1.Container)
}
f := func(o opts) {
t.Helper()
got := Probe(o.container, o.cr)
assert.NoError(t, o.validate(got))
o.validate(got)
}

// build default probe with empty ep
Expand All @@ -67,11 +67,10 @@ func Test_buildProbe(t *testing.T) {
scheme: "HTTP",
},
container: corev1.Container{},
validate: func(container corev1.Container) error {
validate: func(container corev1.Container) {
assert.NotNil(t, container.LivenessProbe)
assert.NotNil(t, container.ReadinessProbe)
assert.Equal(t, corev1.URIScheme("HTTP"), container.ReadinessProbe.HTTPGet.Scheme)
return nil
},
})

Expand All @@ -86,12 +85,11 @@ func Test_buildProbe(t *testing.T) {
scheme: "HTTPS",
},
container: corev1.Container{},
validate: func(container corev1.Container) error {
validate: func(container corev1.Container) {
assert.NotNil(t, container.LivenessProbe)
assert.Equal(t, corev1.URIScheme("HTTPS"), container.LivenessProbe.HTTPGet.Scheme)
assert.NotNil(t, container.ReadinessProbe)
assert.Equal(t, corev1.URIScheme("HTTPS"), container.ReadinessProbe.HTTPGet.Scheme)
return nil
},
})

Expand Down Expand Up @@ -130,7 +128,7 @@ func Test_buildProbe(t *testing.T) {
},
},
container: corev1.Container{},
validate: func(container corev1.Container) error {
validate: func(container corev1.Container) {
assert.NotNil(t, container.LivenessProbe)
assert.Equal(t, "/live1", container.LivenessProbe.HTTPGet.Path)
assert.Equal(t, int32(20), container.LivenessProbe.InitialDelaySeconds)
Expand All @@ -139,7 +137,6 @@ func Test_buildProbe(t *testing.T) {
assert.Len(t, container.ReadinessProbe.Exec.Command, 2)
assert.NotNil(t, container.StartupProbe)
assert.Equal(t, "some", container.StartupProbe.HTTPGet.Host)
return nil
},
})
}
Expand Down
13 changes: 5 additions & 8 deletions internal/controller/operator/factory/build/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ func Test_mergeServiceSpec(t *testing.T) {
type opts struct {
svc *corev1.Service
svcSpec *vmv1beta1.AdditionalServiceSpec
validate func(svc *corev1.Service) error
validate func(svc *corev1.Service)
}

f := func(o opts) {
t.Helper()
additionalSvc := AdditionalServiceFromDefault(o.svc, o.svcSpec)
assert.NoError(t, o.validate(additionalSvc))
o.validate(additionalSvc)
}

// override ports
Expand All @@ -42,11 +42,10 @@ func Test_mergeServiceSpec(t *testing.T) {
},
},
},
validate: func(svc *corev1.Service) error {
validate: func(svc *corev1.Service) {
assert.Equal(t, "some-name-additional-service", svc.Name)
assert.Len(t, svc.Spec.Ports, 1)
assert.Equal(t, "metrics", svc.Spec.Ports[0].Name)
return nil
},
})

Expand All @@ -67,11 +66,10 @@ func Test_mergeServiceSpec(t *testing.T) {
Type: corev1.ServiceTypeNodePort,
},
},
validate: func(svc *corev1.Service) error {
validate: func(svc *corev1.Service) {
assert.Equal(t, corev1.ServiceTypeNodePort, svc.Spec.Type)
assert.Len(t, svc.Spec.Ports, 1)
assert.Equal(t, "metrics", svc.Spec.Ports[0].Name)
return nil
},
})

Expand Down Expand Up @@ -99,11 +97,10 @@ func Test_mergeServiceSpec(t *testing.T) {
},
},
},
validate: func(svc *corev1.Service) error {
validate: func(svc *corev1.Service) {
assert.Equal(t, map[string]string{"app-2": "value-3"}, svc.Spec.Selector)
assert.Len(t, svc.Spec.Ports, 1)
assert.Equal(t, "metrics", svc.Spec.Ports[0].Name)
return nil
},
})
}
29 changes: 10 additions & 19 deletions internal/controller/operator/factory/k8stools/selectors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import (
"context"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand All @@ -23,12 +22,8 @@ func Test_discoverNamespacesOk(t *testing.T) {
t.Helper()
fclient := GetTestClientWithObjects(opts.predefinedObjects)
got, err := discoverNamespaces(context.TODO(), fclient, &opts.selectorOpts)
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
if d := cmp.Diff(got, opts.want, cmp.AllowUnexported(discoverNamespacesResponse{})); len(d) > 0 {
t.Fatalf("unexpected diff: %s", d)
}
assert.NoError(t, err)
assert.Equal(t, got, opts.want)
}

// match nothing on namespace selector mismatch
Expand Down Expand Up @@ -101,8 +96,6 @@ func TestVisitSelected(t *testing.T) {
},
}
}
ignoreDiffOpts := cmpopts.IgnoreFields(metav1.ObjectMeta{}, "ResourceVersion")

f := func(opts opts) {
cfg := config.MustGetBaseConfig()
if len(opts.watchNamespaces) > 0 {
Expand All @@ -116,15 +109,13 @@ func TestVisitSelected(t *testing.T) {
ctx := context.Background()
fclient := GetTestClientWithObjects(opts.predefinedObjects)
var gotPods []corev1.Pod
err := VisitSelected(ctx, fclient, opts.so, func(pl *corev1.PodList) {
gotPods = append(gotPods, pl.Items...)
})
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
if d := cmp.Diff(opts.wantPods, gotPods, ignoreDiffOpts); len(d) > 0 {
t.Fatalf("unexpected diff: %s", d)
}
assert.NoError(t, VisitSelected(ctx, fclient, opts.so, func(pl *corev1.PodList) {
for _, p := range pl.Items {
p.ResourceVersion = ""
gotPods = append(gotPods, p)
}
}))
assert.Equal(t, opts.wantPods, gotPods)
}
// empty objects
o := opts{
Expand Down
Loading
Loading