fae1ec2668
breaking_change_check 결과 breaking=false — custom-values.yaml이 실제로 쓰는 키 (image, http.relativePath, command, ingress, proxy, resources, database, extraEnv) 중 어느 것도 diff에 걸리지 않았다. 유일한 템플릿 변경(probe 경로가 managementRelativePath를 coalesce로 우선하도록 바뀜)도 relativePath: "/" 를 그대로 쓰므로 동작 영향이 없다. CRD·의존성 변경 없음. appVersion은 26.6.4→26.7.2로 오르지만 custom-values.yaml이 자체 빌드 이미지 태그(26.7.1-bci15.7-hardened)를 명시적으로 고정하므로 이 업그레이드로 실제 배포 버전이 바뀌지는 않는다 — 26.7.2로 올리려면 hardened-containers에서 별도로 자체 빌드해야 한다. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
68 lines
2.4 KiB
YAML
68 lines
2.4 KiB
YAML
{{- if .Values.test.enabled }}
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: {{ include "keycloak.fullname" . }}-test
|
|
namespace: {{ include "keycloak.namespace" . }}
|
|
labels:
|
|
{{- include "keycloak.labels" . | nindent 4 }}
|
|
annotations:
|
|
helm.sh/hook: test
|
|
helm.sh/hook-delete-policy: hook-succeeded
|
|
data:
|
|
test.sh: |
|
|
#!/usr/bin/env bash
|
|
set -eu
|
|
|
|
if ! python3 -c 'import selenium' &> /dev/null; then
|
|
echo 'Installing selenium module...'
|
|
python3 -m venv /tmp/test-venv
|
|
/tmp/test-venv/bin/pip install -q selenium
|
|
exec /tmp/test-venv/bin/python "$(dirname "$0")/test.py"
|
|
fi
|
|
|
|
python3 "$(dirname "$0")/test.py"
|
|
test.py: |
|
|
import os
|
|
from selenium import webdriver
|
|
from selenium.webdriver.common.by import By
|
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
from selenium.webdriver.chrome.options import Options
|
|
from selenium.webdriver.support import expected_conditions
|
|
|
|
print('Creating chrome driver in headless mode')
|
|
chrome_options = Options()
|
|
chrome_options.add_argument("--headless")
|
|
chrome_options.add_argument('--no-sandbox')
|
|
chrome_options.add_argument('--disable-dev-shm-usage')
|
|
driver = webdriver.Chrome(options=chrome_options)
|
|
|
|
base_url = 'http://{{ include "keycloak.fullname" . }}-http{{ if ne 80 (int .Values.service.httpPort) }}:{{ .Values.service.httpPort }}{{ end }}'
|
|
|
|
print('Opening Keycloak...')
|
|
driver.get('{0}{{ tpl .Values.http.relativePath . | trimSuffix "/" }}/admin/'.format(base_url))
|
|
|
|
username = os.environ['KEYCLOAK_USER']
|
|
password = os.environ['KEYCLOAK_PASSWORD']
|
|
|
|
username_input = WebDriverWait(driver, 30).until(expected_conditions.presence_of_element_located((By.ID, "username")))
|
|
password_input = WebDriverWait(driver, 30).until(expected_conditions.presence_of_element_located((By.ID, "password")))
|
|
login_button = WebDriverWait(driver, 30).until(expected_conditions.presence_of_element_located((By.ID, "kc-login")))
|
|
|
|
print('Entering username...')
|
|
username_input.send_keys(username)
|
|
|
|
print('Entering password...')
|
|
password_input.send_keys(password)
|
|
|
|
print('Clicking login button...')
|
|
login_button.click()
|
|
|
|
WebDriverWait(driver, 30).until(lambda driver: '{{ tpl .Values.http.relativePath . | trimSuffix "/" }}/admin/master/console/' in driver.current_url)
|
|
|
|
print('Admin console visible. Login successful.')
|
|
|
|
driver.quit()
|
|
|
|
{{- end }}
|