Skip to content

Commit 6fcc69a

Browse files
hasbro17fracappa
authored andcommitted
ci(pki): Fix etcd-metric-signer secret name and improve failure diagnostics (openshift#82191)
The etcd metrics signer secret is named "etcd-metric-signer" in the cluster-etcd-operator (pkg/tlshelpers/tlshelpers.go:40), not "etcd-metrics-signer". The name mismatch caused the PKI verification step to fail with "Could not find certificate from <stdin>". Also surface expected-vs-actual mismatch details in the summary table for failed checks instead of only showing the secret path, so failures can be diagnosed from the summary without scrolling through the full log. Assisted-by: Claude Code (Opus 4.6)
1 parent e108500 commit 6fcc69a

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

ci-operator/step-registry/openshift/installer/pki/verify/openshift-installer-pki-verify-commands.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ declare -a SIGNERS=(
1818
"kube-control-plane-signer|kube-control-plane-signer|openshift-kube-apiserver-operator|tls.crt"
1919
"aggregator-signer|aggregator-client-signer|openshift-kube-apiserver-operator|tls.crt"
2020
"etcd-signer|etcd-signer|openshift-etcd|tls.crt"
21-
"etcd-metrics-signer|etcd-metrics-signer|openshift-etcd|tls.crt"
21+
"etcd-metrics-signer|etcd-metric-signer|openshift-etcd|tls.crt"
2222
)
2323

2424
# Map expected algorithm to openssl output strings
@@ -50,6 +50,7 @@ for signer in "${SIGNERS[@]}"; do
5050
IFS='|' read -r description secret_name namespace cert_key <<< "${signer}"
5151
total=$((total + 1))
5252
status="PASS"
53+
fail_details=""
5354

5455
echo "--- Checking: ${description} (${namespace}/${secret_name}) ---" | tee -a "${ARTIFACT_LOG}"
5556

@@ -85,6 +86,7 @@ for signer in "${SIGNERS[@]}"; do
8586
actual_algo=$(echo "${cert_text}" | grep -F "Public Key Algorithm:" | head -1 | xargs) || true
8687
echo " FAIL: Expected algorithm '${expected_algo_str}', got '${actual_algo}'" | tee -a "${ARTIFACT_LOG}"
8788
status="FAIL"
89+
fail_details="algo: expected ${expected_algo_str}, got ${actual_algo:-unknown}"
8890
fi
8991

9092
# Check key parameter
@@ -102,12 +104,17 @@ for signer in "${SIGNERS[@]}"; do
102104
fi
103105
echo " FAIL: Expected '${expected_param_str}', got '${actual_param:-not found}'" | tee -a "${ARTIFACT_LOG}"
104106
status="FAIL"
107+
fail_details="${fail_details:+${fail_details}; }key: expected ${expected_param_str}, got ${actual_param:-unknown}"
105108
fi
106109

107110
if [[ "${status}" == "FAIL" ]]; then
108111
failures=$((failures + 1))
109112
fi
110-
results+=("${status}|${description}|${namespace}/${secret_name}")
113+
if [[ "${status}" == "PASS" ]]; then
114+
results+=("${status}|${description}|${namespace}/${secret_name}")
115+
else
116+
results+=("${status}|${description}|${fail_details}")
117+
fi
111118
done
112119

113120
# Verify PKI CR
@@ -138,7 +145,11 @@ else
138145
if [[ "${pki_status}" == "FAIL" ]]; then
139146
failures=$((failures + 1))
140147
fi
141-
results+=("${pki_status}|PKI CR|mode=${mode:-unknown}")
148+
if [[ "${pki_status}" == "PASS" ]]; then
149+
results+=("${pki_status}|PKI CR|mode=${mode}")
150+
else
151+
results+=("${pki_status}|PKI CR|expected mode ${EXPECTED_PKI_MODE}, got ${mode:-not set}")
152+
fi
142153
fi
143154

144155
# Print summary table

0 commit comments

Comments
 (0)