Skip to content

Commit 77203e8

Browse files
committed
cmd/initContainer: Remove the initialization stamp file when exiting
#114
1 parent 369cc79 commit 77203e8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cmd/initContainer.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,12 @@ func initContainer(cmd *cobra.Command, args []string) error {
396396
for {
397397
select {
398398
case <-done:
399+
logrus.Debugf("Removing initialization stamp %s", initializedStamp)
400+
if err := os.Remove(initializedStamp); err != nil {
401+
logrus.Debugf("Removing initialization stamp %s failed: %s", initializedStamp, err)
402+
return errors.New("failed to remove initialization stamp")
403+
}
404+
399405
cause := context.Cause(waitForExitCtx)
400406
logrus.Debugf("Exiting entry point: %s", cause)
401407
return nil

0 commit comments

Comments
 (0)