https://www.ory.sh/ logo
f

full-exabyte-24161

11/08/2021, 8:10 AM
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

limited-tent-11422

11/08/2021, 8:24 AM
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

full-exabyte-24161

11/08/2021, 8:25 AM
It's like I want to execute command as post-lifecycle hook to create a client, but it doesn't actually get created.
l

limited-tent-11422

11/08/2021, 8:27 AM
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

full-exabyte-24161

11/08/2021, 8:28 AM
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
6 Views