Skip to content

Commit 733c3d0

Browse files
committed
fix conformance test
1 parent 2368a43 commit 733c3d0

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

internal/controller/gateway_controller.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,15 @@ func (r *GatewayReconciler) SetupWithManager(mgr ctrl.Manager) error {
5252
func (r *GatewayReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
5353
gateway := new(gatewayv1.Gateway)
5454
if err := r.Get(ctx, req.NamespacedName, gateway); err != nil {
55-
return ctrl.Result{}, client.IgnoreNotFound(err)
55+
if client.IgnoreNotFound(err) == nil {
56+
gateway.Namespace = req.Namespace
57+
gateway.Name = req.Name
58+
59+
if err := r.ControlPlaneClient.Delete(ctx, gateway); err != nil {
60+
return ctrl.Result{}, err
61+
}
62+
}
63+
return ctrl.Result{}, nil
5664
}
5765
ns := gateway.GetNamespace()
5866
if !r.checkGatewayClass(gateway) {

internal/controlplane/controlplane.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ func (d *dashboardClient) Delete(ctx context.Context, obj client.Object) error {
109109
return err
110110
}
111111
}
112+
113+
ssls, _ := cluster.SSL().List(ctx)
114+
for _, ssl := range ssls {
115+
if err := cluster.SSL().Delete(ctx, ssl); err != nil {
116+
return err
117+
}
118+
}
112119
}
113120
return nil
114121
}

internal/controlplane/translator/gateway.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ func (t *Translator) translateSecret(tctx *TranslateContext, listener gatewayv1.
4444
sslObj.ID = id.GenID(fmt.Sprintf("%s_%s_%s", ns, gatewayName, listener.Name))
4545
if listener.Hostname != nil && *listener.Hostname != "" {
4646
sslObj.Snis = []string{string(*listener.Hostname)}
47+
} else {
48+
sslObj.Snis = []string{"*"}
4749
}
4850
name := listener.TLS.CertificateRefs[0].Name
4951
secret := tctx.Secrets[types.NamespacedName{Namespace: ns, Name: string(ref.Name)}]

0 commit comments

Comments
 (0)