Skip to content

Commit 21f5cb3

Browse files
committed
fix: resolve controller-runtime SetLogger warning in e2e tests and fix image refs
1 parent 9a4dc0f commit 21f5cb3

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

test/e2e/main_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ import (
1010

1111
configv1 "github.com/openshift/api/config/v1"
1212
olmv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
13+
"go.uber.org/zap/zapcore"
1314
v1 "k8s.io/api/core/v1"
1415
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
16+
ctrl "sigs.k8s.io/controller-runtime"
1517
"sigs.k8s.io/controller-runtime/pkg/client"
1618
"sigs.k8s.io/controller-runtime/pkg/client/config"
19+
"sigs.k8s.io/controller-runtime/pkg/log/zap"
1720

1821
"github.com/rhobs/observability-operator/pkg/operator"
1922
"github.com/rhobs/observability-operator/test/e2e/framework"
@@ -33,6 +36,13 @@ var (
3336
func TestMain(m *testing.M) {
3437
flag.Parse()
3538

39+
// Setup controller-runtime logger to avoid warning messages
40+
opts := zap.Options{
41+
Development: true,
42+
TimeEncoder: zapcore.RFC3339TimeEncoder,
43+
}
44+
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
45+
3646
// Deferred calls are not executed on os.Exit from TestMain.
3747
// As a workaround, we call another function in which we can add deferred calls.
3848
// http://blog.englund.nu/golang,/testing/2017/03/12/using-defer-in-testmain.html

test/e2e/traces_minio.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ spec:
4545
value: tempo
4646
- name: MINIO_SECRET_KEY
4747
value: supersecret
48-
image: minio/minio
48+
image: quay.io/minio/minio:RELEASE.2024-10-02T17-50-41Z
4949
name: minio
5050
ports:
5151
- containerPort: 9000

test/e2e/traces_tempo_readiness.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
restartPolicy: Never
1717
containers:
1818
- name: readiness-checker
19-
image: curlimages/curl:latest
19+
image: ghcr.io/grafana/tempo-operator/test-utils:main
2020
command:
2121
- /bin/sh
2222
- -c

0 commit comments

Comments
 (0)