Skip to content
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

Multiple files are imported even if imported in a previous run #1015

Open
StephanSchrader opened this issue May 3, 2024 · 0 comments · May be fixed by #1017
Open

Multiple files are imported even if imported in a previous run #1015

StephanSchrader opened this issue May 3, 2024 · 0 comments · May be fixed by #1017
Labels

Comments

@StephanSchrader
Copy link

StephanSchrader commented May 3, 2024

Current Behavior

Assuming there are at least two import files. Each time the application is started, all import files are read in and the changes from all files are executed.

Expected Behavior

If only one import file exists, it is ignored if its checksum is the same as the saved one. I would expect the same behavior even if multiple import files exist. keycloak-config-cli stores a checksum for each imported file. If more than two import files exist, the checksum stored in the realm is overwritten.

Steps To Reproduce

1. Create two import files
2. Run application

2024-05-03 16:55:10.071  INFO 1 --- [           main] d.a.k.config.KeycloakConfigApplication   : Starting KeycloakConfigApplication v5.12.0 using Java 17.0.10 on 1f638ca1c32c with PID 1 (/app/keycloak-config-cli.jar started by nobody in /)
2024-05-03 16:55:10.072  INFO 1 --- [           main] d.a.k.config.KeycloakConfigApplication   : No active profile set, falling back to 1 default profile: "default"
2024-05-03 16:55:10.403  INFO 1 --- [           main] d.a.k.config.KeycloakConfigApplication   : Started KeycloakConfigApplication in 0.615 seconds (JVM running for 0.872)
2024-05-03 16:55:10.868  INFO 1 --- [           main] d.a.k.config.KeycloakConfigRunner        : Importing file 'file:/config/00_initial.yaml'
2024-05-03 16:55:10.870  INFO 1 --- [           main] d.a.k.config.provider.KeycloakProvider   : Wait 120 seconds until http://host.docker.internal:9080/auth is available ...
2024-05-03 16:55:11.223 DEBUG 1 --- [           main] d.a.k.config.service.RealmImportService  : Updating realm 'dragon'...
2024-05-03 16:55:11.415 DEBUG 1 --- [           main] d.a.k.config.service.state.StateService  : Updated states of realm 'dragon'
2024-05-03 16:55:11.466 DEBUG 1 --- [           main] d.a.k.c.s.checksum.ChecksumService       : Updated import checksum of realm 'dragon' to 'f2ba0ffcfc482f5590e7d1f4451d744775955060d18d1f7267db6632c06d374f'
2024-05-03 16:55:11.466  INFO 1 --- [           main] d.a.k.config.KeycloakConfigRunner        : Importing file 'file:/config/01_rememberme.yaml'
2024-05-03 16:55:11.500 DEBUG 1 --- [           main] d.a.k.config.service.RealmImportService  : Updating realm 'dragon'...
2024-05-03 16:55:11.626 DEBUG 1 --- [           main] d.a.k.config.service.state.StateService  : Updated states of realm 'dragon'
2024-05-03 16:55:11.671 DEBUG 1 --- [           main] d.a.k.c.s.checksum.ChecksumService       : Updated import checksum of realm 'dragon' to '94b8e304346afb8973904679e0075029b6015ce4e3498faef902bb2c5ddc727d'
2024-05-03 16:55:11.671  INFO 1 --- [           main] d.a.k.config.KeycloakConfigRunner        : keycloak-config-cli running in 00:00.896.
  1. Run application again
2024-05-03 16:57:38.596  INFO 1 --- [           main] d.a.k.config.KeycloakConfigApplication   : Starting KeycloakConfigApplication v5.12.0 using Java 17.0.10 on 1f638ca1c32c with PID 1 (/app/keycloak-config-cli.jar started by nobody in /)
2024-05-03 16:57:38.597  INFO 1 --- [           main] d.a.k.config.KeycloakConfigApplication   : No active profile set, falling back to 1 default profile: "default"
2024-05-03 16:57:38.896  INFO 1 --- [           main] d.a.k.config.KeycloakConfigApplication   : Started KeycloakConfigApplication in 0.636 seconds (JVM running for 0.88)
2024-05-03 16:57:39.359  INFO 1 --- [           main] d.a.k.config.KeycloakConfigRunner        : Importing file 'file:/config/00_initial.yaml'
2024-05-03 16:57:39.361  INFO 1 --- [           main] d.a.k.config.provider.KeycloakProvider   : Wait 120 seconds until http://host.docker.internal:9080/auth is available ...
2024-05-03 16:57:39.704 DEBUG 1 --- [           main] d.a.k.config.service.RealmImportService  : Updating realm 'dragon'...
2024-05-03 16:57:39.886 DEBUG 1 --- [           main] d.a.k.config.service.state.StateService  : Updated states of realm 'dragon'
2024-05-03 16:57:39.936 DEBUG 1 --- [           main] d.a.k.c.s.checksum.ChecksumService       : Updated import checksum of realm 'dragon' to 'f2ba0ffcfc482f5590e7d1f4451d744775955060d18d1f7267db6632c06d374f'
2024-05-03 16:57:39.936  INFO 1 --- [           main] d.a.k.config.KeycloakConfigRunner        : Importing file 'file:/config/01_rememberme.yaml'
2024-05-03 16:57:39.970 DEBUG 1 --- [           main] d.a.k.config.service.RealmImportService  : Updating realm 'dragon'...
2024-05-03 16:57:40.102 DEBUG 1 --- [           main] d.a.k.config.service.state.StateService  : Updated states of realm 'dragon'
2024-05-03 16:57:40.142 DEBUG 1 --- [           main] d.a.k.c.s.checksum.ChecksumService       : Updated import checksum of realm 'dragon' to '94b8e304346afb8973904679e0075029b6015ce4e3498faef902bb2c5ddc727d'
2024-05-03 16:57:40.143  INFO 1 --- [           main] d.a.k.config.KeycloakConfigRunner        : keycloak-config-cli running in 00:00.875.

Environment

  • Keycloak Version: 24.0.1
  • keycloak-config-cli Version: 5.12.0-24.0.1
  • Java Version: 17

Anything else?

No response

@StephanSchrader StephanSchrader changed the title Multiple are imported even if imported in a previous run Multiple files are imported even if imported in a previous run May 7, 2024
StephanSchrader pushed a commit to StephanSchrader/keycloak-config-cli that referenced this issue May 10, 2024
StephanSchrader pushed a commit to StephanSchrader/keycloak-config-cli that referenced this issue May 10, 2024
StephanSchrader pushed a commit to StephanSchrader/keycloak-config-cli that referenced this issue May 10, 2024
StephanSchrader pushed a commit to StephanSchrader/keycloak-config-cli that referenced this issue May 10, 2024
StephanSchrader pushed a commit to StephanSchrader/keycloak-config-cli that referenced this issue May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant