bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
8.66k stars 9.01k forks source link

keycloak keycloakConfigCli.command default value causing container to fail #9170

Closed markdbuck closed 2 years ago

markdbuck commented 2 years ago

Name and Version

bitnami/keycloak 16.1.1

What steps will reproduce the bug?

If you enable the keycloakConfigCli in the 16.1.1 version of the Keycloak helm chart, you will encounter the problem that the config-cli job will fail with the following error in the logs: Error: Unable to access jarfile /opt/bitnami/keycloak-config-cli/keycloak-config-cli-16.1.1.jar

Are you using any custom parameters or values?

helm upgrade --install \
--set ingress.enabled=true \
--set ingress.hostname=keycloak.127.0.0.1.nip.io \
--set ingress.ingressClassName=nginx \
--set postgresql.postgresqlPassword=password \
--set auth.adminPassword=password \
--set resources.limits.memory=1Gi \
--set keycloakConfigCli.enabled=true \
--set keycloakConfigCli.command="{java,-jar,/opt/bitnami/keycloak-config-cli/keycloak-config-cli-15.1.1.jar}" \
-f keycloak.yaml my-keycloak bitnami/keycloak

keycloak.yaml:

keycloakConfigCli:
  configuration:
    cmecf-paygov-inf.json: |
      {
        "id": "cmecf-paygov-inf",
        "realm": "cmecf-paygov-inf",
<snipped content>

What is the expected behavior?

As can be seen from the command line I provided above, setting keycloakConfigCli.command="{java,-jar,/opt/bitnami/keycloak-config-cli/keycloak-config-cli-15.1.1.jar}" is a work-around to make the container startup. The default command line is:

          command:
            - java
            - -jar
            - {{ printf "/opt/bitnami/keycloak-config-cli/keycloak-config-cli-%s.jar" .Chart.AppVersion }}

which ends up looking for keycloak-config-cli-16.1.1.jar which doesn't exist in the container as can be seen below:

$ docker run --rm -it --user 0 --entrypoint /bin/bash docker.io/bitnami/keycloak-config-cli:4.5.0-debian-10-r8
root@98e5a3c4a7b3:/opt/bitnami/keycloak-config-cli# ls -l
total 84364
-rw-r--r-- 1 1001 1001 21582780 Dec 22 17:05 keycloak-config-cli-13.0.1.jar
-rw-r--r-- 1 1001 1001 21588902 Dec 22 17:05 keycloak-config-cli-14.0.0.jar
-rw-r--r-- 1 1001 1001 21599817 Dec 22 17:05 keycloak-config-cli-15.1.1.jar
-rw-r--r-- 1 1001 1001 21599810 Dec 22 17:06 keycloak-config-cli-16.0.0.jar
lrwxrwxrwx 1 1001 1001       63 Dec 22 17:06 keycloak-config-cli.jar -> /opt/bitnami/keycloak-config-cli/keycloak-config-cli-15.1.1.jar
drwxr-xr-x 2 1001 1001     4096 Dec 22 17:14 licenses

What do you see instead?

$ kubectl logs my-keycloak-keycloak-config-cli-wwsqn
Error: Unable to access jarfile /opt/bitnami/keycloak-config-cli/keycloak-config-cli-16.1.1.jar

Additional information

No response

javsalgar commented 2 years ago

Hi,

Thanks for letting us know. I will force a new release of the keycloak chart so the keycloak-config-cli gets updated:

 1 ❯ docker run --rm -ti --entrypoint /bin/bash docker.io/bitnami/keycloak-config-cli
I have no name!@00f3b8e99348:/opt/bitnami/keycloak-config-cli$
I have no name!@00f3b8e99348:/opt/bitnami/keycloak-config-cli$
I have no name!@00f3b8e99348:/opt/bitnami/keycloak-config-cli$ ls
keycloak-config-cli-14.0.0.jar  keycloak-config-cli-16.1.1.jar  keycloak-config-cli.jar
keycloak-config-cli-15.1.1.jar  keycloak-config-cli-17.0.0.jar  licenses

As you can see, the latest one includes the cli.

github-actions[bot] commented 2 years ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 2 years ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.