Skip to content

Commit

Permalink
[PoC] Run online-data-migrations as a postStart hook
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Tantsur <[email protected]>
  • Loading branch information
dtantsur committed Mar 5, 2025
1 parent 07e8e33 commit a61104d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/ironic/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,13 @@ func newIronicPodTemplate(cctx ControllerContext, ironic *metal3api.Ironic, db *
Ports: ironicPorts,
LivenessProbe: newProbe(ironicHandler),
ReadinessProbe: newProbe(ironicHandler),
Lifecycle: &corev1.Lifecycle{
PostStart: &corev1.LifecycleHandler{
Exec: &corev1.ExecAction{
Command: []string{"ironic-dbsync", "--config-file", "/etc/ironic/ironic.conf", "online_data_migrations"},
},
},
},
},
{
Name: "httpd",
Expand Down
1 change: 1 addition & 0 deletions pkg/ironic/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func mergeContainers(target, source []corev1.Container) []corev1.Container {
} else {
dest.ReadinessProbe = nil
}
dest.Lifecycle = src.Lifecycle
}

return target
Expand Down

0 comments on commit a61104d

Please sign in to comment.