You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnerrors.Errorf("TargetGroup %v is already bound to following TargetGroupBindings %v. Please enable MultiCluster mode on all TargetGroupBindings referencing %v or choose a different Target Group ARN.", updatedTgb.Spec.TargetGroupARN, duplicateTGBs, updatedTgb.Spec.TargetGroupARN)
wantErr: errors.New("TargetGroup tg-1 is already bound to following TargetGroupBindings [ns1/tgb1]. Please enable MultiCluster mode on all TargetGroupBindings referencing tg-1 or choose a different Target Group ARN."),
1101
+
},
1102
+
{
1103
+
name: "[ok] duplicate target groups with multi cluster support",
1104
+
env: env{
1105
+
existingTGBs: []elbv2api.TargetGroupBinding{
1106
+
{
1107
+
ObjectMeta: metav1.ObjectMeta{
1108
+
Name: "tgb1",
1109
+
Namespace: "ns1",
1110
+
UID: "tgb1",
1111
+
},
1112
+
Spec: elbv2api.TargetGroupBindingSpec{
1113
+
TargetGroupARN: "tg-1",
1114
+
TargetType: nil,
1115
+
MultiClusterTargetGroup: true,
1116
+
},
1117
+
},
1118
+
},
1119
+
},
1120
+
args: args{
1121
+
tgb: &elbv2api.TargetGroupBinding{
1122
+
ObjectMeta: metav1.ObjectMeta{
1123
+
Name: "tgb2",
1124
+
Namespace: "ns1",
1125
+
UID: "tgb2",
1126
+
},
1127
+
Spec: elbv2api.TargetGroupBindingSpec{
1128
+
TargetGroupARN: "tg-1",
1129
+
TargetType: nil,
1130
+
MultiClusterTargetGroup: true,
1131
+
},
1132
+
},
1133
+
},
1134
+
wantErr: nil,
1135
+
},
1136
+
{
1137
+
name: "[err] try to add binding without multicluster support while multiple bindings are using the same tg arn",
1138
+
env: env{
1139
+
existingTGBs: []elbv2api.TargetGroupBinding{
1140
+
{
1141
+
ObjectMeta: metav1.ObjectMeta{
1142
+
Name: "tgb1",
1143
+
Namespace: "ns1",
1144
+
UID: "tgb1",
1145
+
},
1146
+
Spec: elbv2api.TargetGroupBindingSpec{
1147
+
TargetGroupARN: "tg-1",
1148
+
TargetType: nil,
1149
+
MultiClusterTargetGroup: true,
1150
+
},
1151
+
},
1152
+
{
1153
+
ObjectMeta: metav1.ObjectMeta{
1154
+
Name: "tgb3",
1155
+
Namespace: "ns1",
1156
+
UID: "tgb3",
1157
+
},
1158
+
Spec: elbv2api.TargetGroupBindingSpec{
1159
+
TargetGroupARN: "tg-1",
1160
+
TargetType: nil,
1161
+
MultiClusterTargetGroup: true,
1162
+
},
1163
+
},
1164
+
{
1165
+
ObjectMeta: metav1.ObjectMeta{
1166
+
Name: "tgb4",
1167
+
Namespace: "ns1",
1168
+
UID: "tgb4",
1169
+
},
1170
+
Spec: elbv2api.TargetGroupBindingSpec{
1171
+
TargetGroupARN: "tg-1",
1172
+
TargetType: nil,
1173
+
MultiClusterTargetGroup: true,
1174
+
},
1175
+
},
1176
+
},
1177
+
},
1178
+
args: args{
1179
+
tgb: &elbv2api.TargetGroupBinding{
1180
+
ObjectMeta: metav1.ObjectMeta{
1181
+
Name: "tgb2",
1182
+
Namespace: "ns1",
1183
+
UID: "tgb2",
1067
1184
},
1068
1185
Spec: elbv2api.TargetGroupBindingSpec{
1069
1186
TargetGroupARN: "tg-1",
1070
1187
TargetType: nil,
1071
1188
},
1072
1189
},
1073
1190
},
1074
-
wantErr: errors.New("TargetGroup tg-1 is already bound to TargetGroupBinding ns1/tgb1"),
1191
+
wantErr: errors.New("TargetGroup tg-1 is already bound to following TargetGroupBindings [ns1/tgb1 ns1/tgb3 ns1/tgb4]. Please enable MultiCluster mode on all TargetGroupBindings referencing tg-1 or choose a different Target Group ARN."),
1075
1192
},
1076
1193
{
1077
1194
name: "[err] duplicate target groups - one target group binding",
wantErr: errors.New("TargetGroup tg-111 is already bound to TargetGroupBinding ns2/tgb2"),
1245
+
wantErr: errors.New("TargetGroup tg-111 is already bound to following TargetGroupBindings [ns2/tgb2]. Please enable MultiCluster mode on all TargetGroupBindings referencing tg-111 or choose a different Target Group ARN."),
0 commit comments