Why executing hydra command post-starting of pod d...
# talk-hydra
f
Why executing hydra command post-starting of pod doesn't work?
Copy code
lifecycle:
            postStart:
              exec:
                  command: ["hydra", "clients","create","--id", "{{ .Values.hydra.config.secrets.oauthclientid }}", "--secret", "{{ .Values.hydra.config.secrets.oauthsecret }}", "--grant-types","authorization_code,refresh_token,client_credentials,implicit",	"--response-types", "token,code,id_token", "--scope","openid,offline,offline_access", "--callbacks","{{ .Values.hydra.config.secrets.devserverbaseurl }}/callback"]
l
Please provide more details. “Doesn’t work” is too generic.
If you are running this command on every pod start it will fail after the first time you created a client as you’ll get conflict.
f
It's like I want to execute command as post-lifecycle hook to create a client, but it doesn't actually get created.
l
You probably need to set
--endpoint
to point to Hydra running in a current pod (or set
HYDRA_ADMIN_URL
environment variable). I am not sure what’s a default there.
f
aah, thanks. Let me give that a try. 😸
Thanks Stepan, it worked. and also thanks for that conflict thing(I'll keep that in mind)
👍 1