Skip to content

Commit

Permalink
Merge pull request noobaa#1263 from dannyzaken/danny-postgres
Browse files Browse the repository at this point in the history
Added preStop hook to DB statefulset
  • Loading branch information
dannyzaken authored Dec 11, 2023
2 parents bbef9b2 + 92e187c commit 8b1e465
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/system/phase2_creating.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,15 @@ func (r *Reconciler) SetDesiredNooBaaDB() error {
if r.NooBaa.Spec.DBResources != nil {
c.Resources = *r.NooBaa.Spec.DBResources
}

c.Lifecycle = &corev1.Lifecycle{
PreStop: &corev1.LifecycleHandler{
Exec: &corev1.ExecAction{
Command: []string{"/bin/sh", "-c", "pg_ctl -D /var/lib/pgsql/data/userdata/ -w -t 60 -m fast stop"},
},
},
}

}
}

Expand Down

0 comments on commit 8b1e465

Please sign in to comment.