Post Lifecycle Hook in a DeploymentConfig not working
Issue
- Based on this documentation https://docs.openshift.com/enterprise/3.0/dev_guide/deployments.html#lifecycle-hooks, I am trying to set up a post lifecycle hook in a DeploymentConfig. I do not fully understand the documentation how it should work, or maybe, there is also some bug with this. Please advice what to do.
I attached a template that creates the DeploymentConfig. You will see that the command to be executed is "/var/lib/mysql/db_init.sh".
The db_init.sh contains:
#!/bin/bash
echo "starting db_init script..."
mysql -u root auditing < /var/lib/mysql/db_init.sql
echo "finished db_init script"
The command "mysql -u root auditing < /var/lib/mysql/db_init.sql" works if executed within the pod.
The scripts are built into the image that is deployed.
When I deploy using this DeploymentConfig, the pod comes up and is running, however, this lifecycle hook (and scripts) is never executed. I see no error, nothing.
Am I doing something wrong? Or is this an issue?
Environment
- Openshift Enterprise 3.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
