Skip to content

Commit a854b14

Browse files
committed
Resolve Code Rabbit comments.
1 parent a4a9c33 commit a854b14

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

test/extended/apiserver/kubeconfigs.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,18 @@ func testKubeApiserverContainer(oc *exutil.CLI, kubeconfig, masterName string) e
119119
// (e.g., RHCOS 10 with glibc 2.38) has a newer glibc than the container.
120120
out, err := oc.AsAdmin().Run("exec").Args("-n", "openshift-kube-apiserver", "kube-apiserver-"+masterName, "--", "/bin/bash", "-euxo", "pipefail", "-c",
121121
fmt.Sprintf(`for k in server client-certificate client-key certificate-authority; do
122-
count=$(grep -Ec "^\s*${k}:\s+" "%[1]s")
122+
count=$(grep -Ec "^[[:space:]]*${k}:[[:space:]]+" "%[1]s")
123123
[ "$count" -eq 1 ] || { echo "expected exactly one ${k} in %[1]s, got $count" >&2; exit 1; }
124124
done
125-
server=$(grep '^\s*server:' "%[1]s" | head -1 | awk '{print $2}')
126-
cert=$(grep '^\s*client-certificate:' "%[1]s" | head -1 | awk '{print $2}')
127-
key=$(grep '^\s*client-key:' "%[1]s" | head -1 | awk '{print $2}')
128-
ca=$(grep '^\s*certificate-authority:' "%[1]s" | head -1 | awk '{print $2}')
125+
server=$(grep '^[[:space:]]*server:' "%[1]s" | head -1 | awk '{print $2}')
126+
cert=$(grep '^[[:space:]]*client-certificate:' "%[1]s" | head -1 | awk '{print $2}')
127+
key=$(grep '^[[:space:]]*client-key:' "%[1]s" | head -1 | awk '{print $2}')
128+
ca=$(grep '^[[:space:]]*certificate-authority:' "%[1]s" | head -1 | awk '{print $2}')
129129
for v in server cert key ca; do
130130
eval "val=\$$v"
131131
[ -n "$val" ] || { echo "${v} field extraction failed from %[1]s" >&2; exit 1; }
132132
done
133-
curl -Ssf --cert "$cert" --key "$key" --cacert "$ca" "${server}/api?timeout=32s"`, kubeconfigPath)).Output()
133+
curl -Ssf --connect-timeout 10 --max-time 45 --cert "$cert" --key "$key" --cacert "$ca" "${server}/api?timeout=32s"`, kubeconfigPath)).Output()
134134
framework.Logf("%s", out)
135135
if err != nil {
136136
return fmt.Errorf("%s", out)

0 commit comments

Comments
 (0)