Skip to content

Commit

Permalink
Fix init command tombstone functionality (#769)
Browse files Browse the repository at this point in the history
* experimental

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* debugging tombstone data

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* fix tombstone

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* typo fix

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

* manifest update

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>

---------

Signed-off-by: Volkan Özçelik <ovolkan@vmware.com>
  • Loading branch information
v0lkan authored Apr 1, 2024
1 parent c40afc1 commit b150113
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions app/sentinel/busywait/initialization/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ dance:
if err != nil {
log.InfoLn(
cid,
"RunInitCommands: no initialization file found... skipping custom initialization.",
"RunInitCommands: no tombstone file found... skipping custom initialization.",
)
return
}
Expand All @@ -156,10 +156,12 @@ dance:

data, err := os.ReadFile(tombstonePath)

if strings.TrimSpace(string(data)) == "exit" {
log.InfoLn(cid, "tombstone data '", string(data), "'")

if strings.TrimSpace(string(data)) == "complete" {
log.InfoLn(
cid,
"RunInitCommands: Initialization already exit... skipping custom initialization.",
"RunInitCommands: Already initialized. Skipping custom initialization.",
)
return
}
Expand Down
2 changes: 1 addition & 1 deletion core/log/std/envinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func printFormattedInfo(id *string, info map[string]string) {

for _, key := range infoKeys {
padding := strings.Repeat(" ", maxLength-len(key))
fmt.Printf("%s%s%s: %s\n", idp, padding, toCustomCase(key), info[key])
fmt.Printf("%s %s%s: %s\n", idp, padding, toCustomCase(key), info[key])
}
}

Expand Down

0 comments on commit b150113

Please sign in to comment.