Skip to content

Commit

Permalink
test annotation add for new objects when there is other svc not part …
Browse files Browse the repository at this point in the history
…of the cluster (#1992)
  • Loading branch information
racevedoo authored and anyasabo committed Oct 14, 2019
1 parent 6e6118b commit 3c69737
Showing 1 changed file with 10 additions and 16 deletions.
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

0 comments on commit 3c69737

Please sign in to comment.