mirror of
https://github.com/containers/podman.git
synced 2025-05-20 16:47:39 +08:00
sqlite: exit code: allow -1
The value of -1 is used when we do not _yet_ know the exit code of the container. Otherwise, the DB checks would error. There's probably a smarter than allowing -1 but for now, that will do the trick and let the tests progress. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -856,7 +856,7 @@ func (s *SQLiteState) AddContainerExitCode(id string, exitCode int32) (defErr er
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
if _, err := tx.Exec("INSERT INTO ContainerExitCode VALUES (?, ?, ?);", id, time.Now().Unix(), exitCode); err != nil {
|
if _, err := tx.Exec("INSERT INTO ContainerExitCode VALUES (?, ?, ?);", id, time.Now().Unix(), exitCode); err != nil {
|
||||||
return fmt.Errorf("adding container %s exit code: %w", id, err)
|
return fmt.Errorf("adding container %s exit code %d: %w", id, exitCode, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := tx.Commit(); err != nil {
|
if err := tx.Commit(); err != nil {
|
||||||
|
@ -86,7 +86,7 @@ func sqliteInitTables(conn *sql.DB) (defErr error) {
|
|||||||
ExitCode INTEGER,
|
ExitCode INTEGER,
|
||||||
JSON TEXT NOT NULL,
|
JSON TEXT NOT NULL,
|
||||||
FOREIGN KEY (ID) REFERENCES ContainerConfig(ID) DEFERRABLE INITIALLY DEFERRED,
|
FOREIGN KEY (ID) REFERENCES ContainerConfig(ID) DEFERRABLE INITIALLY DEFERRED,
|
||||||
CHECK (ExitCode BETWEEN 0 AND 255)
|
CHECK (ExitCode BETWEEN -1 AND 255)
|
||||||
);`
|
);`
|
||||||
|
|
||||||
const containerExecSession = `
|
const containerExecSession = `
|
||||||
@ -120,7 +120,7 @@ func sqliteInitTables(conn *sql.DB) (defErr error) {
|
|||||||
ID TEXT PRIMARY KEY NOT NULL,
|
ID TEXT PRIMARY KEY NOT NULL,
|
||||||
Timestamp INTEGER NOT NULL,
|
Timestamp INTEGER NOT NULL,
|
||||||
ExitCode INTEGER NOT NULL,
|
ExitCode INTEGER NOT NULL,
|
||||||
CHECK (ExitCode BETWEEN 0 AND 255)
|
CHECK (ExitCode BETWEEN -1 AND 255)
|
||||||
);`
|
);`
|
||||||
|
|
||||||
const podConfig = `
|
const podConfig = `
|
||||||
|
Reference in New Issue
Block a user