Skip to content

Commit dd27982

Browse files
committed
e2e code fixes
1 parent d1f2408 commit dd27982

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

example/memcached-operator/memcached_controller.go.tmpl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
corev1 "k8s.io/api/core/v1"
1111
"k8s.io/apimachinery/pkg/api/errors"
1212
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
13-
"k8s.io/apimachinery/pkg/labels"
1413
"k8s.io/apimachinery/pkg/runtime"
1514
"k8s.io/apimachinery/pkg/types"
1615
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -144,7 +143,7 @@ func (r *ReconcileMemcached) Reconcile(request reconcile.Request) (reconcile.Res
144143
podList := &corev1.PodList{}
145144
listOpts := []client.ListOption{
146145
client.InNamespace(memcached.Namespace),
147-
client.MatchingLabels(labelsForApp(memcached.Name)),
146+
client.MatchingLabels(labelsForMemcached(memcached.Name)),
148147
}
149148
if err = r.client.List(context.TODO(), podList, listOpts...); err != nil {
150149
reqLogger.Error(err, "Failed to list pods", "Memcached.Namespace", memcached.Namespace, "Memcached.Name", memcached.Name)

test/e2e/_incluster-test-code/memcached_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ func getMetrics(t *testing.T, f *framework.Framework, labels map[string]string,
427427
client.MatchingLabels(labels),
428428
client.MatchingField("status.phase", "Running"),
429429
}
430-
err = f.Client.List(goctx.TODO(), pods, opts...)
430+
err := f.Client.List(goctx.TODO(), pods, opts...)
431431
if err != nil {
432432
return nil, fmt.Errorf("failed to get pods: (%v)", err)
433433
}

0 commit comments

Comments
 (0)