Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test annotation add for new objects when there is other svc not part of the cluster #1992

Merged
Merged
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
26 changes: 10 additions & 16 deletions pkg/controller/common/annotation/controller_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,18 @@ func TestMissingAnnotationNewObject(t *testing.T) {
Name: "es",
},
}
// TODO this is currently broken due to an upstream bug in the fake client. when we upgrade controller runtime
// to a version that contains this PR we can uncomment this and add the service to the client

// add existing svc that is not part of cluster to make sure we have label selectors correct
// https://github.com/kubernetes-sigs/controller-runtime/pull/311
// svc := &corev1.Service{
// ObjectMeta: metav1.ObjectMeta{
// Namespace: "ns",
// Name: "svc",
// Labels: map[string]string{
// label.ClusterNameLabelName: "literallyanything",
// },
// },
// }
svc := &corev1.Service{
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns",
Name: "svc",
Labels: map[string]string{
label.ClusterNameLabelName: "literallyanything",
},
},
}

sc := setupScheme(t)
// client := k8s.WrapClient(fake.NewFakeClientWithScheme(sc, es, svc))
client := k8s.WrapClient(fake.NewFakeClientWithScheme(sc, es))
client := k8s.WrapClient(fake.NewFakeClientWithScheme(sc, es, svc))
selector := getElasticsearchSelector(es)
compat, err := ReconcileCompatibility(client, es, selector, MinCompatibleControllerVersion)
require.NoError(t, err)
Expand Down