Skip to content

Commit 0ec34a8

Browse files
committed
Fix indentation errors and warnings.
1 parent 77d5132 commit 0ec34a8

File tree

3 files changed

+42
-40
lines changed

3 files changed

+42
-40
lines changed

conformance/base/manifests.yaml

+32-33
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,9 @@ spec:
740740
selector:
741741
app: backendtlspolicy-test
742742
ports:
743-
- protocol: TCP
744-
port: 443
745-
targetPort: 8443
743+
- protocol: TCP
744+
port: 443
745+
targetPort: 8443
746746
---
747747
apiVersion: apps/v1
748748
kind: Deployment
@@ -762,34 +762,33 @@ spec:
762762
app: backendtlspolicy-test
763763
spec:
764764
containers:
765-
- name: backendtlspolicy-test
766-
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20240412-v1.0.0-394-g40c666fd
767-
volumeMounts:
768-
- name: secret-volume
769-
mountPath: /etc/secret-volume
770-
env:
771-
- name: POD_NAME
772-
valueFrom:
773-
fieldRef:
774-
fieldPath: metadata.name
775-
- name: NAMESPACE
776-
valueFrom:
777-
fieldRef:
778-
fieldPath: metadata.namespace
779-
- name: CA_CERT
780-
value: /etc/secret-volume/crt
781-
- name: CA_CERT_KEY
782-
value: /etc/secret-volume/key
783-
resources:
784-
requests:
785-
cpu: 10m
786-
volumes:
765+
- name: backendtlspolicy-test
766+
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20240412-v1.0.0-394-g40c666fd
767+
volumeMounts:
787768
- name: secret-volume
788-
secret:
789-
secretName: backend-tls-checks-certificate
790-
items:
791-
- key: tls.crt
792-
path: crt
793-
- key: tls.key
794-
path: key
795-
---
769+
mountPath: /etc/secret-volume
770+
env:
771+
- name: POD_NAME
772+
valueFrom:
773+
fieldRef:
774+
fieldPath: metadata.name
775+
- name: NAMESPACE
776+
valueFrom:
777+
fieldRef:
778+
fieldPath: metadata.namespace
779+
- name: CA_CERT
780+
value: /etc/secret-volume/crt
781+
- name: CA_CERT_KEY
782+
value: /etc/secret-volume/key
783+
resources:
784+
requests:
785+
cpu: 10m
786+
volumes:
787+
- name: secret-volume
788+
secret:
789+
secretName: backend-tls-checks-certificate
790+
items:
791+
- key: tls.crt
792+
path: crt
793+
- key: tls.key
794+
path: key

conformance/echo-basic/echo-basic.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ func echoHandler(w http.ResponseWriter, r *http.Request) {
226226
if strings.Contains(r.RequestURI, "backendTLS") {
227227
sni, err = sniffForSNI(r.RemoteAddr)
228228
if err != nil {
229-
// Todo: research if for some test cases there won't be one
229+
// TODO: research if for some test cases there won't be SNI available.
230+
processError(w, err, http.StatusBadRequest)
231+
return
230232
}
231233
}
232234

@@ -340,14 +342,15 @@ func sniffForSNI(addr string) (string, error) {
340342
return "", fmt.Errorf("could not read socket: %v", err)
341343
}
342344
// Take an incoming TLS Client Hello and return the SNI name.
343-
sni, err = parser.GetHostname(data[:])
345+
sni, err = parser.GetHostname(data)
344346
if err != nil {
345347
return "", fmt.Errorf("error getting SNI: %v", err)
346348
}
347349
if sni == "" {
348350
return "", fmt.Errorf("no server name indication found")
351+
} else {
352+
return sni, nil
349353
}
350-
return sni, nil
351354
}
352355
}
353356

conformance/tests/backendtlspolicy-normative.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ metadata:
2323
namespace: gateway-conformance-infra
2424
spec:
2525
targetRefs:
26-
- group: ""
27-
kind: Service
28-
name: "backendtlspolicy-test"
26+
- group: ""
27+
kind: Service
28+
name: "backendtlspolicy-test"
2929
validation:
3030
caCertificateRefs:
3131
group: ""
3232
kind: Secret
3333
name: "backend-tls-checks-certificate"
34-
hostname: "abc.example.com"
34+
hostname: "abc.example.com"

0 commit comments

Comments
 (0)