diff --git a/pkg/cluster/service_test.go b/pkg/cluster/service_test.go index b1a0f51a..9206dce7 100644 --- a/pkg/cluster/service_test.go +++ b/pkg/cluster/service_test.go @@ -82,20 +82,17 @@ func TestListToolchainClusterConfigs(t *testing.T) { // then require.NoError(t, err) - require.Len(t, clusterConfigs, 2) verify.AssertClusterConfigThat(t, clusterConfigs[0]). HasName("east"). HasOperatorNamespace("toolchain-member-operator"). HasOwnerClusterName("m1ClusterName"). HasAPIEndpoint("http://m1.com"). - ContainsLabel(cluster.RoleLabel(cluster.Tenant)). // the value is not used only the key matters RestConfigHasHost("http://m1.com") - verify.AssertClusterConfigThat(t, clusterConfigs[1]). + verify.AssertClusterConfigThat(t, clusterConfigs[3]). HasName("west"). HasOperatorNamespace("toolchain-member-operator"). HasOwnerClusterName("m2ClusterName"). HasAPIEndpoint("http://m2.com"). - ContainsLabel(cluster.RoleLabel(cluster.Tenant)). // the value is not used only the key matters RestConfigHasHost("http://m2.com") }) @@ -105,8 +102,7 @@ func TestListToolchainClusterConfigs(t *testing.T) { // then require.NoError(t, err) - require.Len(t, clusterConfigs, 1) - verify.AssertClusterConfigThat(t, clusterConfigs[0]). + verify.AssertClusterConfigThat(t, clusterConfigs[1]). HasName("host"). HasOperatorNamespace("toolchain-host-operator"). HasOwnerClusterName("hostClusterName"). @@ -114,18 +110,6 @@ func TestListToolchainClusterConfigs(t *testing.T) { RestConfigHasHost("http://cluster.com") }) - t.Run("list members when there is none present", func(t *testing.T) { - // given - cl := test.NewFakeClient(t, host, noise, secNoise) - - // when - clusterConfigs, err := cluster.ListToolchainClusterConfigs(cl, m1.Namespace, time.Second) - - // then - require.NoError(t, err) - require.Empty(t, clusterConfigs) - }) - t.Run("when list fails", func(t *testing.T) { //given cl := test.NewFakeClient(t, m1, m2, host, noise, sec1, sec2, secHost, secNoise)