Skip to content

Commit 04cf36c

Browse files
committed
make frontproxy tests work
On-behalf-of: SAP <[email protected]> Signed-off-by: Simon Bein <[email protected]>
1 parent 3b98e30 commit 04cf36c

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

test/e2e/frontproxies/frontproxies_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func TestCreateFrontProxy(t *testing.T) {
7272
},
7373
Groups: []string{"system:masters"},
7474
}
75+
7576
t.Log("Creating kubeconfig for FrontProxy…")
7677
if err := client.Create(ctx, &fpConfig); err != nil {
7778
t.Fatal(err)

test/utils/deploy.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ func DeployFrontProxy(ctx context.Context, t *testing.T, client ctrlruntimeclien
169169
Name: rootShardName,
170170
},
171171
},
172+
ExternalHostname: fmt.Sprintf("%s.%s.svc.cluster.local", frontProxy.Name, frontProxy.Namespace),
173+
Auth: &operatorv1alpha1.AuthSpec{
174+
// we need to remove the default system:masters group in order to do our testing
175+
DropGroups: []string{""},
176+
},
172177
}
173178

174179
for _, patch := range patches {

test/utils/utils.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ func ConnectWithKubeconfig(
182182
parts := strings.Split(hostname, ".")
183183
serviceName := parts[0]
184184

185+
// for frontproxies add required suffix
186+
if config.Spec.Target.FrontProxyRef != nil {
187+
serviceName += "-front-proxy"
188+
}
189+
185190
portNum, err := strconv.ParseInt(portString, 10, 32)
186191
if err != nil {
187192
t.Fatalf("Failed to parse kubeconfig's port %q: %v", portString, err)

0 commit comments

Comments
 (0)