Skip to content

Commit b0d099a

Browse files
committed
agent: provide minimal install-config for runtime cert generation
The TLS refactor added InstallConfig as a dependency to signer certificates for configurable PKI support. This broke the `agent create certificates` command when run without an install-config, as happens in `set-node-zero.sh` during UI-based agent installations. Provide a minimal dummy install-config in set-node-zero.sh and the tls_assets integration test to satisfy the dependency. The signer certs don't use any cluster-specific data from the config — they only read the PKI field which defaults to RSA-2048 when absent. Assisted-by: Claude Code (Opus 4.6)
1 parent 68341be commit b0d099a

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

cmd/openshift-install/testdata/agent/image/assets/tls_assets.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,12 @@ exists $WORK/tls/admin-kubeconfig-signer.key
1010
exists $WORK/tls/kube-apiserver-lb-signer.key
1111
exists $WORK/tls/kube-apiserver-localhost-signer.key
1212
exists $WORK/tls/kube-apiserver-service-network-signer.key
13+
14+
-- install-config.yaml --
15+
apiVersion: v1
16+
baseDomain: localhost
17+
metadata:
18+
name: agent-certs
19+
platform:
20+
none: {}
21+
pullSecret: '{"auths":{"unused":{"auth":"dW51c2VkCg=="}}}'

data/data/agent/files/usr/local/bin/set-node-zero.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,20 @@ if [ "${IS_NODE_ZERO}" = "true" ]; then
5252
# shellcheck disable=SC1091
5353
. /usr/local/bin/release-image.sh
5454
IMAGE=$(image_for installer)
55+
# The installer's cert generation requires an install-config dependency
56+
# even though signer certs don't use any cluster-specific data.
57+
# Provide a minimal config to satisfy the dependency.
58+
cat > /tmp/install-config.yaml <<'ICEOF'
59+
apiVersion: v1
60+
baseDomain: localhost
61+
metadata:
62+
name: agent-certs
63+
platform:
64+
none: {}
65+
pullSecret: '{"auths":{"unused":{"auth":"dW51c2VkCg=="}}}'
66+
ICEOF
5567
/usr/bin/podman run --privileged -v /tmp:/assets --rm "${IMAGE}" agent create certificates --dir=/assets
68+
rm -f /tmp/install-config.yaml
5669
cp /tmp/tls/* $AGENT_TLS_DIR
5770
fi
5871

0 commit comments

Comments
 (0)