Skip to content

Commit 0da5949

Browse files
committed
cmd/run: Shuffle some code around
A subsequent commit will use this to stop the Toolbx container once the last 'enter' or 'run' session finishes. #114
1 parent 0907287 commit 0da5949

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/cmd/run.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,12 @@ func runCommand(container string,
335335
logrus.Debugf("Waiting for container %s to finish initializing", container)
336336
}
337337

338-
if err := ensureContainerIsInitialized(container, entryPointPID, startContainerTimestamp); err != nil {
338+
initializedStamp, err := utils.GetInitializedStamp(entryPointPID, currentUser)
339+
if err != nil {
340+
return err
341+
}
342+
343+
if err := ensureContainerIsInitialized(container, initializedStamp, startContainerTimestamp); err != nil {
339344
return err
340345
}
341346

@@ -598,12 +603,7 @@ func constructExecArgs(container, preserveFDs string,
598603
return execArgs
599604
}
600605

601-
func ensureContainerIsInitialized(container string, entryPointPID int, timestamp time.Time) error {
602-
initializedStamp, err := utils.GetInitializedStamp(entryPointPID, currentUser)
603-
if err != nil {
604-
return err
605-
}
606-
606+
func ensureContainerIsInitialized(container, initializedStamp string, timestamp time.Time) error {
607607
logrus.Debugf("Checking if initialization stamp %s exists", initializedStamp)
608608

609609
shouldUsePolling := isUsePollingSet()

0 commit comments

Comments
 (0)