Skip to content

Commit 0df7a8c

Browse files
fix(ci): increase wait kubeconfig and user-authz ready (#2336)
Description Increase the waiting window for nested cluster kubeconfig validation and make the validation diagnostics non-fatal inside the retry loop. The generated kubeconfig check now captures the kubectl get nodes error output, prints additional authorization diagnostics, and retries for longer while user-authz materializes the ClusterAuthorizationRule into RBAC bindings. The Deckhouse readiness helper also waits for the user-authz module in addition to user-authn. --------------- Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
1 parent eb8b3b3 commit 0df7a8c

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

test/dvp-static-cluster/scripts/deckhouse-queue.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ d8_ready() {
128128
log_success "Deckhouse is Ready!"
129129
log_info "Checking module user-authn"
130130
module_ready user-authn
131+
log_info "Checking module user-authz"
132+
module_ready user-authz
131133
log_info "Checking queues"
132134
d8_queue
133135
else

test/dvp-static-cluster/scripts/gen-kubeconfig.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,17 @@ kubeconfig_set_current_context() {
189189
}
190190

191191
check_kubeconfig() {
192-
if kubectl --kubeconfig "${FILE_NAME}" get no >/dev/null 2>&1; then
192+
local output
193+
194+
if output=$(kubectl --kubeconfig "${FILE_NAME}" get no 2>&1); then
193195
return 0
194196
fi
195197

196-
log_error "Failed to get resources via generated kubeconfig"
198+
log_warning "Generated kubeconfig is not ready yet"
199+
echo "${output}"
200+
kubectl --kubeconfig "${FILE_NAME}" auth can-i get nodes 2>&1 || true
201+
kubectl get clusterrolebinding "user-authz:${SA_CAR_NAME}:super-admin" -o wide 2>&1 || true
202+
197203
if [[ -f "${FILE_NAME}" ]]; then
198204
cat "${FILE_NAME}"
199205
fi
@@ -203,8 +209,8 @@ check_kubeconfig() {
203209
generate_kubeconfig() {
204210
log_info "Create kubeconfig"
205211

206-
local max_attempts=10
207-
local retry_wait_seconds=5
212+
local max_attempts=60
213+
local retry_wait_seconds=10
208214
local attempt_number
209215

210216
for ((attempt_number = 1; attempt_number <= max_attempts; attempt_number++)); do

0 commit comments

Comments
 (0)