-
Notifications
You must be signed in to change notification settings - Fork 13
ROX-12556: Always initialize from scratch #941
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
Conversation
Images are ready for the commit at 1cb2f0a. To use the images, use the tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest a different approach which would be to rm -rf
the database path and let it start from scratch. Wdyt? I worry that if we're initializing and get turned off then the database would be in a half state and it would be better to just be completely fresh
Good idea. We usually assume we start from scratch anyway, so we should now enforce it for correctness |
@@ -24,6 +24,8 @@ spec: | |||
env: | |||
- name: POSTGRES_PASSWORD_FILE | |||
value: "/run/secrets/stackrox.io/secrets/password" | |||
command: ["docker-entrypoint.sh"] | |||
args: ["init", "postgres", "-c", "config_file=/etc/postgresql.conf"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does stackrox repo do?
Sometimes people choose to restart the nodes, which keeps the volumes but causes pods to restart. When this happens, scanner-db initialization does not work properly, as it expects to start from scratch every time. Let's enforce starting from scratch every time by deleting any data which may already exist prior to startup.