Skip to content

Commit

Permalink
wip: set internal certs on clusterlocal domains when internal encrypt…
Browse files Browse the repository at this point in the history
…ion enabled
  • Loading branch information
KauzClay committed Jan 30, 2023
1 parent 656e485 commit a790854
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/reconciler/route/resources/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (

"knative.dev/networking/pkg/apis/networking"
netv1alpha1 "knative.dev/networking/pkg/apis/networking/v1alpha1"
netcfg "knative.dev/networking/pkg/config"
netheader "knative.dev/networking/pkg/http/header"
ingress "knative.dev/networking/pkg/ingress"
"knative.dev/pkg/kmeta"
Expand Down Expand Up @@ -183,6 +184,18 @@ func makeIngressSpec(
rule.HTTP.Paths[0].AppendHeaders[netheader.RouteTagKey] = name
}
}

// if this is a private rule, and internal encryption is on, we need to stick the certs in the tls seciton
if visibility == netv1alpha1.IngressVisibilityClusterLocal && networkConfig.InternalEncryption {
for domain := range domains {
tls = append(tls, netv1alpha1.IngressTLS{
Hosts: []string{domain},
SecretName: netcfg.ServingInternalCertName,
SecretNamespace: r.Namespace,
})
}

}
// If this is a public rule, we need to configure ACME challenge paths.
if visibility == netv1alpha1.IngressVisibilityExternalIP {
paths, hosts := MakeACMEIngressPaths(acmeChallenges, domains)
Expand Down

0 comments on commit a790854

Please sign in to comment.