Skip to content

Commit

Permalink
PR review feedbacks
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Lavacca <lavacca.mattia@gmail.com>
  • Loading branch information
mlavacca committed Nov 4, 2022
1 parent c50a620 commit fa67946
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions conformance/tests/gateway-invalid-tls-certificateref.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ var GatewayInvalidTLSConfiguration = suite.ConformanceTest{
gatewayNamespacedName types.NamespacedName
}{
{
name: "Inexistent secret referenced as CertificateRef in a Gateway listener",
gatewayNamespacedName: types.NamespacedName{Name: "gateway-certificate-inexistent-secret", Namespace: "gateway-conformance-infra"},
name: "Nonexistent secret referenced as CertificateRef in a Gateway listener",
gatewayNamespacedName: types.NamespacedName{Name: "gateway-certificate-nonexistent-secret", Namespace: "gateway-conformance-infra"},
},
{
name: "Unsupported group resource referenced as CertificateRef in a Gateway listener",
Expand Down
10 changes: 6 additions & 4 deletions conformance/tests/gateway-invalid-tls-certificateref.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: gateway-certificate-inexistent-secret
name: gateway-certificate-nonexistent-secret
namespace: gateway-conformance-infra
spec:
gatewayClassName: "{GATEWAY_CLASS_NAME}"
Expand All @@ -16,7 +16,7 @@ spec:
certificateRefs:
- group: ""
kind: Secret
name: inexistent-certificate
name: nonexistent-certificate
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
Expand All @@ -36,7 +36,7 @@ spec:
certificateRefs:
- group: wrong.group.company.io
kind: Secret
name: valid-certificate
name: tls-validity-checks-certificate
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
Expand All @@ -56,7 +56,7 @@ spec:
certificateRefs:
- group: ""
kind: WrongKind
name: valid-certificate
name: tls-validity-checks-certificate
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
Expand Down Expand Up @@ -84,6 +84,8 @@ metadata:
name: malformed-certificate
namespace: gateway-conformance-infra
data:
# this certificate is invalid because contains an invalid pem (base64 of "Hello world"),
# and the certificate and the key are identical
tls.crt: SGVsbG8gd29ybGQK
tls.key: SGVsbG8gd29ybGQK
type: kubernetes.io/tls
2 changes: 1 addition & 1 deletion conformance/utils/suite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (suite *ConformanceTestSuite) Setup(t *testing.T) {
t.Logf("Test Setup: Applying programmatic resources")
secret := kubernetes.MustCreateSelfSignedCertSecret(t, "gateway-conformance-web-backend", "certificate", []string{"*"})
suite.Applier.MustApplyObjectsWithCleanup(t, suite.Client, suite.TimeoutConfig, []client.Object{secret}, suite.Cleanup)
secret = kubernetes.MustCreateSelfSignedCertSecret(t, "gateway-conformance-infra", "valid-certificate", []string{"*"})
secret = kubernetes.MustCreateSelfSignedCertSecret(t, "gateway-conformance-infra", "tls-validity-checks-certificate", []string{"*"})
suite.Applier.MustApplyObjectsWithCleanup(t, suite.Client, suite.TimeoutConfig, []client.Object{secret}, suite.Cleanup)

t.Logf("Test Setup: Ensuring Gateways and Pods from base manifests are ready")
Expand Down

0 comments on commit fa67946

Please sign in to comment.