Skip to content

Commit 6d723ec

Browse files
committed
tools/kind.sh: split CA bundle into individual certs to silence c_rehash warnings
1 parent 311fa71 commit 6d723ec

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

tools/kind.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,17 @@ function inject_ca_certs {
122122

123123
echo "Injecting CA certificates from $certs into KIND nodes..."
124124
for node in $(kind get nodes); do
125-
docker cp "$certs" "$node:/usr/local/share/ca-certificates/extra-ca-certs.crt"
126-
docker exec "$node" update-ca-certificates
125+
# Pipe the bundle via stdin and split into individual .crt files so that
126+
# update-ca-certificates / c_rehash does not emit
127+
# "skipping ... it does not contain exactly one certificate or CRL".
128+
docker exec -i "$node" bash -c '
129+
awk "/-----BEGIN CERTIFICATE-----/{n++; f=sprintf(\"/usr/local/share/ca-certificates/extra-ca-cert-%d.crt\",n)} f{print > f}"
130+
' < "$certs"
131+
# The ca-certificates.crt bundle always triggers a benign c_rehash warning;
132+
# filter it so only real warnings surface.
133+
local uca_out
134+
uca_out=$(docker exec "$node" update-ca-certificates 2>&1)
135+
echo "$uca_out" | grep -Fv "skipping ca-certificates.crt" || true
127136
docker exec "$node" systemctl restart containerd
128137
echo " $node: done"
129138
done

0 commit comments

Comments
 (0)