-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade to latest dependencies (#14661)
bumping knative.dev/pkg 23f3ee2...ea6ea84: > ea6ea84 upgrade to latest dependencies (# 2901) bumping knative.dev/caching ebc94e6...a65bf6e: > a65bf6e upgrade to latest dependencies (# 810) bumping knative.dev/networking 25da91b...bb18aab: > bb18aab Add additional encryption config flags + labels (# 891) > a509117 upgrade to latest dependencies (# 895) Signed-off-by: Knative Automation <[email protected]>
- Loading branch information
1 parent
636dfad
commit 9b0d185
Showing
6 changed files
with
85 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
vendor/knative.dev/networking/pkg/apis/networking/v1alpha1/ingress_helpers.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
Copyright 2023 The Knative Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
"slices" | ||
) | ||
|
||
// GetIngressTLSForVisibility returns a list of `Spec.TLS` where each host in the `Rules.Hosts` field is | ||
// present in `Spec.TLS.Hosts` and where the Rules have the defined ingress visibility. | ||
// This method can be used in net-* implementations to select the correct `IngressTLS` entries | ||
// for cluster-local and cluster-external gateways/listeners. | ||
func (i *Ingress) GetIngressTLSForVisibility(visibility IngressVisibility) []IngressTLS { | ||
ingressTLS := make([]IngressTLS, 0, len(i.Spec.TLS)) | ||
|
||
if i.Spec.TLS == nil || len(i.Spec.TLS) == 0 { | ||
return ingressTLS | ||
} | ||
|
||
for _, rule := range i.Spec.Rules { | ||
if rule.Visibility == visibility { | ||
if rule.Hosts == nil || len(rule.Hosts) == 0 { | ||
return ingressTLS | ||
} | ||
|
||
for _, tls := range i.Spec.TLS { | ||
containsAllRuleHosts := true | ||
for _, h := range rule.Hosts { | ||
if !slices.Contains(tls.Hosts, h) { | ||
containsAllRuleHosts = false | ||
} | ||
} | ||
if containsAllRuleHosts { | ||
ingressTLS = append(ingressTLS, tls) | ||
} | ||
} | ||
} | ||
} | ||
|
||
return ingressTLS | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters