Skip to content

Add postStart lifecycle handler support#114

Draft
Copilot wants to merge 4 commits intofeature/prestop-lifecyclefrom
copilot/sub-pr-112
Draft

Add postStart lifecycle handler support#114
Copilot wants to merge 4 commits intofeature/prestop-lifecyclefrom
copilot/sub-pr-112

Conversation

Copy link

Copilot AI commented Jan 28, 2026

Extends lifecycle handler support from preStop-only to include postStart handlers, enabling initialization tasks after container startup.

Changes

  • Configuration: Added EnablePostStart (bool) and PostStartTimeoutSeconds (int) config flags, both default disabled for backwards compatibility
  • Types: Added PostStartCommand struct and postStartCommands field to ContainerCommand
  • Translation: Implemented translateKubernetesPostStarts() to parse exec and httpGet handlers from pod specs (TCP not supported)
  • Script generation: Generate per-container postStart shell functions that execute synchronously after runCtn starts each container
  • Bug fix: PreStop HTTP handlers now use config.PreStopTimeoutSeconds instead of hardcoded 5s timeout

Usage

# SlurmConfig.yaml
EnablePostStart: true
PostStartTimeoutSeconds: 10
# Pod spec
lifecycle:
  postStart:
    exec:
      command: ["/bin/sh", "-c", "echo 'init complete' > /tmp/ready"]

Handlers execute after container process starts but before normal operation begins. Individual handler timeouts apply; no outer timeout wrapper to avoid nested timeout issues.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 28, 2026 09:00
Co-authored-by: dciangot <4144326+dciangot@users.noreply.github.com>
Co-authored-by: dciangot <4144326+dciangot@users.noreply.github.com>
Co-authored-by: dciangot <4144326+dciangot@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 28, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • al.essio.dev
    • Triggering command: /update-job-proxy /update-job-proxy DROP ine test -e pem ine /usr/bin/test 387163d.0 /usr/sbin/iptablreset ps test -e CA_v1.pem ps (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP 5099927d test -e f225814414e9ca2d-n1 /usr/sbin/iptabl--format=format:%H %ct %D ps -t nat 1.0 ps -e c-models readlink e/git --dport 53 /usr/bin/readlingo_modules e/git (dns block)
  • go.googlesource.com
    • Triggering command: /update-job-proxy /update-job-proxy ci --proxy-cert /home/REDACTED/work/_temp/runtime-logs/mkcert/rootCA.pem --updater-env NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/dbot-ca.crt o ux_amd64/compile-importcfg acity.go k8s.io/client-gorev-parse -lang=go1.24 ux_amd64/compile/home/REDACTED/go/pkg/mod/k8s.io/client-go@v0.33.1/applyconfigurations/policy/v1/poddisruptionbudget.go push�� cetaint.go go ux_amd64/compile -c=4 -nolocalimports -importcfg ux_amd64/compile (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP ine test -e pem ine /usr/bin/test 387163d.0 /usr/sbin/iptablreset ps test -e CA_v1.pem ps (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP 5099927d test -e f225814414e9ca2d-n1 /usr/sbin/iptabl--format=format:%H %ct %D ps -t nat 1.0 ps -e c-models readlink e/git --dport 53 /usr/bin/readlingo_modules e/git (dns block)
  • go.opentelemetry.io
    • Triggering command: /update-job-proxy /update-job-proxy ci --proxy-cert /home/REDACTED/work/_temp/runtime-logs/mkcert/rootCA.pem --updater-env NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/dbot-ca.crt o ux_amd64/compile-importcfg acity.go k8s.io/client-gorev-parse -lang=go1.24 ux_amd64/compile/home/REDACTED/go/pkg/mod/k8s.io/client-go@v0.33.1/applyconfigurations/policy/v1/poddisruptionbudget.go push�� cetaint.go go ux_amd64/compile -c=4 -nolocalimports -importcfg ux_amd64/compile (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP ine test -e pem ine /usr/bin/test 387163d.0 /usr/sbin/iptablreset ps test -e CA_v1.pem ps (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP 5099927d test -e f225814414e9ca2d-n1 /usr/sbin/iptabl--format=format:%H %ct %D ps -t nat 1.0 ps -e c-models readlink e/git --dport 53 /usr/bin/readlingo_modules e/git (dns block)
  • google.golang.org
    • Triggering command: /update-job-proxy /update-job-proxy ci --proxy-cert /home/REDACTED/work/_temp/runtime-logs/mkcert/rootCA.pem --updater-env NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/dbot-ca.crt o ux_amd64/compile-importcfg acity.go k8s.io/client-gorev-parse -lang=go1.24 ux_amd64/compile/home/REDACTED/go/pkg/mod/k8s.io/client-go@v0.33.1/applyconfigurations/policy/v1/poddisruptionbudget.go push�� cetaint.go go ux_amd64/compile -c=4 -nolocalimports -importcfg ux_amd64/compile (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP ine test -e pem ine /usr/bin/test 387163d.0 /usr/sbin/iptablreset ps test -e CA_v1.pem ps (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP 5099927d test -e f225814414e9ca2d-n1 /usr/sbin/iptabl--format=format:%H %ct %D ps -t nat 1.0 ps -e c-models readlink e/git --dport 53 /usr/bin/readlingo_modules e/git (dns block)
  • gopkg.in
    • Triggering command: /update-job-proxy /update-job-proxy DROP ine test -e pem ine /usr/bin/test 387163d.0 /usr/sbin/iptablreset ps test -e CA_v1.pem ps (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP 5099927d test -e f225814414e9ca2d-n1 /usr/sbin/iptabl--format=format:%H %ct %D ps -t nat 1.0 ps -e c-models readlink e/git --dport 53 /usr/bin/readlingo_modules e/git (dns block)
  • k8s.io
    • Triggering command: /update-job-proxy /update-job-proxy DROP ine test -e pem ine /usr/bin/test 387163d.0 /usr/sbin/iptablreset ps test -e CA_v1.pem ps (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP 5099927d test -e f225814414e9ca2d-n1 /usr/sbin/iptabl--format=format:%H %ct %D ps -t nat 1.0 ps -e c-models readlink e/git --dport 53 /usr/bin/readlingo_modules e/git (dns block)
  • sigs.k8s.io
    • Triggering command: /update-job-proxy /update-job-proxy DROP ine test -e pem ine /usr/bin/test 387163d.0 /usr/sbin/iptablreset ps test -e CA_v1.pem ps (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy DROP 5099927d test -e f225814414e9ca2d-n1 /usr/sbin/iptabl--format=format:%H %ct %D ps -t nat 1.0 ps -e c-models readlink e/git --dport 53 /usr/bin/readlingo_modules e/git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add preStop lifecycle support and config flags for SIGTERM Add postStart lifecycle handler support Jan 28, 2026
Copilot AI requested a review from dciangot January 28, 2026 09:07
Copy link
Member

@dciangot dciangot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants