Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions tools/kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,17 @@ function inject_ca_certs {

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