Skip to content

Commit d4d3bcb

Browse files
authored
Merge pull request #1393 from robscott/cherry-pick-0.5.1
Cherry picking several more PRs before 0.5.1 release
2 parents b35ec56 + f0100ce commit d4d3bcb

11 files changed

+145
-39
lines changed

apis/v1alpha2/object_reference_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ type BackendObjectReference struct {
123123
Namespace *Namespace `json:"namespace,omitempty"`
124124

125125
// Port specifies the destination port number to use for this resource.
126-
// Port is required when the referent is a Kubernetes Service.
126+
// Port is required when the referent is a Kubernetes Service. In this
127+
// case, the port number is the service port number, not the target port.
127128
// For other resources, destination port might be derived from the referent
128129
// resource or this field.
129130
//

apis/v1alpha2/shared_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ const (
231231
// Possible reasons for this condition to be false are:
232232
//
233233
// * "RefNotPermitted"
234+
// * "InvalidKind"
235+
// * "BackendNotFound"
234236
//
235237
// Controllers may raise this condition with other reasons,
236238
// but should prefer to use the reasons listed above to improve

apis/v1beta1/object_reference_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ type BackendObjectReference struct {
123123
Namespace *Namespace `json:"namespace,omitempty"`
124124

125125
// Port specifies the destination port number to use for this resource.
126-
// Port is required when the referent is a Kubernetes Service.
126+
// Port is required when the referent is a Kubernetes Service. In this
127+
// case, the port number is the service port number, not the target port.
127128
// For other resources, destination port might be derived from the referent
128129
// resource or this field.
129130
//

apis/v1beta1/shared_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ const (
231231
// Possible reasons for this condition to be false are:
232232
//
233233
// * "RefNotPermitted"
234+
// * "InvalidKind"
235+
// * "BackendNotFound"
234236
//
235237
// Controllers may raise this condition with other reasons,
236238
// but should prefer to use the reasons listed above to improve

config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml

Lines changed: 24 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/experimental/gateway.networking.k8s.io_tcproutes.yaml

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/experimental/gateway.networking.k8s.io_tlsroutes.yaml

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/experimental/gateway.networking.k8s.io_udproutes.yaml

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/standard/gateway.networking.k8s.io_httproutes.yaml

Lines changed: 24 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
Copyright 2022 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package tests
18+
19+
import (
20+
"testing"
21+
22+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23+
"k8s.io/apimachinery/pkg/types"
24+
25+
"sigs.k8s.io/gateway-api/apis/v1alpha2"
26+
"sigs.k8s.io/gateway-api/conformance/utils/kubernetes"
27+
"sigs.k8s.io/gateway-api/conformance/utils/suite"
28+
)
29+
30+
func init() {
31+
ConformanceTests = append(ConformanceTests, GatewaySecretMissingReferencedSecret)
32+
}
33+
34+
var GatewaySecretMissingReferencedSecret = suite.ConformanceTest{
35+
ShortName: "GatewaySecretMissingReferencedSecret",
36+
Description: "A Gateway should fail to become ready if the Gateway has a certificateRef for a nonexistent Secret",
37+
Manifests: []string{"tests/gateway-secret-missing-referenced-secret.yaml"},
38+
Test: func(t *testing.T, s *suite.ConformanceTestSuite) {
39+
gwNN := types.NamespacedName{Name: "gateway-secret-missing-referenced-secret", Namespace: "gateway-conformance-infra"}
40+
41+
t.Run("Gateway listener should have a false ResolvedRefs condition with reason InvalidCertificateRef", func(t *testing.T) {
42+
listeners := []v1alpha2.ListenerStatus{{
43+
Name: v1alpha2.SectionName("https"),
44+
SupportedKinds: []v1alpha2.RouteGroupKind{{
45+
Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group),
46+
Kind: v1alpha2.Kind("HTTPRoute"),
47+
}},
48+
Conditions: []metav1.Condition{{
49+
Type: string(v1alpha2.ListenerConditionResolvedRefs),
50+
Status: metav1.ConditionFalse,
51+
Reason: string(v1alpha2.ListenerReasonInvalidCertificateRef),
52+
}},
53+
}}
54+
55+
kubernetes.GatewayStatusMustHaveListeners(t, s.Client, gwNN, listeners, 60)
56+
})
57+
},
58+
}

0 commit comments

Comments
 (0)