Skip to content

Commit

Permalink
Replace k8s-keystone-auth args with env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess committed Nov 3, 2023
1 parent 2d64416 commit 5835594
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions get-addon-templates
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,34 @@ def patch_keystone_deployment(repo, file):
+ version,
content,
)
content = content.replace(
" - --keystone-url",
"""{% if keystone_server_ca %}
- --keystone-ca-file
- /etc/pki/ca.crt
{% endif %}
- --keystone-url""",
# https://github.com/kubernetes/cloud-provider-openstack/issues/2464
# Replace command line arguments with environment variables
remove_args = (
" - --tls-cert-file\n"
" - /etc/pki/tls.crt\n"
" - --tls-private-key-file\n"
" - /etc/pki/tls.key\n"
" - --policy-configmap-name\n"
" - k8s-auth-policy\n"
" - --keystone-url\n"
" - {{ keystone_server_url }}\n"
)
add_env = (
" env:\n"
" - name: OS_AUTH_URL\n"
" value: {{ keystone_server_url }}\n"
" - name: TLS_CERT_FILE\n"
" value: /etc/pki/tls.crt\n"
" - name: TLS_PRIVATE_KEY_FILE\n"
" value: /etc/pki/tls.key\n"
" - name: KEYSTONE_POLICY_CONFIGMAP_NAME\n"
" value: k8s-auth-policy\n"
"{% if keystone_server_ca %}\n"
" - name: KEYSTONE_CA_FILE\n"
" value: /etc/pki/ca.crt\n"
"{% endif %}\n"
)
content = content.replace(remove_args, add_env)
with open(source, "w") as f:
f.write(content)

Expand Down

0 comments on commit 5835594

Please sign in to comment.