-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pgadmin4] feat: add possibility to use template-strings inside values.yaml #232
Conversation
for "extraConfigmapMounts.[].configMap" and "extraSecretMounts.[].secret" Signed-off-by: pmoscode <[email protected]>
Signed-off-by: pmoscode <[email protected]>
Signed-off-by: pmoscode <[email protected]>
Thanks for the approval. |
@pmoscode no sorry, extremely busy and forgot that I wanted to merge this but was waiting for the tests. Thank you for your PR. |
Are there any examples of how to migrate previous configs to be compatible with this change? Since after upgrade I'm getting error like
Used extraConfigmapMounts:
- name: pgadmin4-config
subPath: config_local.py
mountPath: "/pgadmin4/config_local.py"
readOnly: true
envVarsFromSecrets:
- pgadmin4-oauth2-secret
extraDeploy:
- apiVersion: v1
kind: Secret
metadata:
name: pgadmin4-oauth2-secret
type: Opaque
stringData:
OAUTH2_CLIENT_ID: ""
OAUTH2_CLIENT_SECRET: ""
- apiVersion: v1
kind: ConfigMap
metadata:
name: pgadmin4-config
data:
config_local.py: |-
import os
UPGRADE_CHECK_ENABLED = False
MFA_SUPPORTED_METHODS = ["authenticator"]
MASTER_PASSWORD_REQUIRED = True
AUTHENTICATION_SOURCES = ['oauth2', 'internal']
OAUTH2_AUTO_CREATE_USER = True
OAUTH2_CONFIG = [
{
'OAUTH2_NAME': 'gitlab',
'OAUTH2_DISPLAY_NAME': 'Gitlab',
'OAUTH2_CLIENT_ID': os.environ['OAUTH2_CLIENT_ID'],
'OAUTH2_CLIENT_SECRET': os.environ['OAUTH2_CLIENT_SECRET'],
'OAUTH2_TOKEN_URL': 'https://gitlab.com/oauth/token',
'OAUTH2_AUTHORIZATION_URL': 'https://gitlab.com/oauth/authorize',
'OAUTH2_API_BASE_URL': 'https://gitlab.com/oauth/',
'OAUTH2_SERVER_METADATA_URL': 'https://gitlab.com/.well-known/openid-configuration',
'OAUTH2_USERINFO_ENDPOINT': 'userinfo',
'OAUTH2_SCOPE': 'openid email profile',
'OAUTH2_ICON': 'fa-gitlab',
'OAUTH2_BUTTON_COLOR': '#fc6d27'
}
] UPD: nevermind, but for whoever else will face the problem in order to fix that add extraConfigmapMounts:
- name: pgadmin4-config
configMap: pgadmin4-config
subPath: config_local.py
mountPath: "/pgadmin4/config_local.py"
readOnly: true |
Hi @SkeLLLa, Because without it, the deployment resource wouldn't know, where to find the ConfigMap resource... - name: {{ .name }}
configMap:
name: {{ .configMap }}
defaultMode: {{ .defaultMode | default 256 }} Correct me, if I'm wrong... |
@pmoscode yep, it worked. I'm not a big expert in helm, but I suspect it worked because the configmap itself contained
But I'm not sure. In any case whoever else may face the issue, the solution would be here. |
What this PR does / why we need it:
This PR adds the possibility to use template strings for "extraConfigmapMounts.[].configMap" and "extraSecretMounts.[].secret" if the ConfigMap / Secret has a dynamic name.
Which issue this PR fixes
(optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged)Special notes for your reviewer:
nothing special
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
[pgadmin4]
)