summaryrefslogtreecommitdiff
path: root/libpod/sql_state_internal.go
Commit message (Collapse)AuthorAge
* Add location in DB for saving files to bind mount inMatthew Heon2018-03-08
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #462 Approved by: baude
* Fix SQL syntax errorMatthew Heon2018-03-02
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #440 Approved by: baude
* Update DB to hold CNI network informationMatthew Heon2018-03-02
| | | | | | | | | | | Replace our old IP and Subnet fields in state with CNI types that contain a lot more information. Retrieve these structs from the CNI plugins themselves. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #440 Approved by: baude
* Convert exec session tracking to use a dedicated structMatthew Heon2018-03-01
| | | | | | | | | | | This will behave better if we need to add anything to it at a later date - we can add fields to the struct without breaking existing BoltDB databases. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #412 Approved by: baude
* Add tracking for container exec sessions to DBMatthew Heon2018-03-01
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #412 Approved by: baude
* Remove No New Privs from DB as it's already in the specMatthew Heon2018-02-22
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #383 Approved by: rhatdan
* Squash logged errors from failed SQL rollbacksMatthew Heon2018-02-15
| | | | | | | | | | | | | | | | Currently we unconditionally roll back transactions after error, even if a commit has already been attempted. Commit is guaranteed to end a transaction, though, whether by successfully committing or by rolling back if that fails. As such, we attempt a double rollback if a transaction fails at commit (for example, for a constraint violation), which doesn't error but does log angry warning messages. Ensure we don't try rolling back after commit runs to prevent this. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #327 Approved by: rhatdan
* Address review commentv0.2Matthew Heon2018-02-12
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #184 Approved by: baude
* Containers in a pod can only join namespaces in that podMatthew Heon2018-02-12
| | | | | | | | | | | | | | This solves some dependency problems in the state, and makes sense from a design standpoint. Containers not in a pod can still depend on the namespaces of containers joined to a pod, which we might also want to change in the future. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #184 Approved by: baude
* Refactor Pod to use a Config structMatthew Heon2018-02-12
| | | | | | | | | | | | This allows us to JSON it and stuff it in the DB - previously, all pod fields were private, so JSON couldn't encode them. This allows us to keep all pod fields private by having a substruct with public fields. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #184 Approved by: baude
* Fix further style issuesMatthew Heon2018-02-09
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #268 Approved by: rhatdan
* Fix gofmt and lintMatthew Heon2018-02-09
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #268 Approved by: rhatdan
* Fix bugs identified by unit testsMatthew Heon2018-02-09
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #268 Approved by: rhatdan
* Rework state tests to avoid boilerplate. Begin adding pod tests.Matthew Heon2018-02-09
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #268 Approved by: rhatdan
* Remove read-only from DB, it's in the specMatthew Heon2018-02-09
| | | | | | | | | Don't need to store it separately Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #268 Approved by: rhatdan
* Implement pod operations in SQL stateMatthew Heon2018-02-09
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #268 Approved by: rhatdan
* Allow users to specify logpathDaniel J Walsh2018-02-03
| | | | | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #135 Approved by: mheon
* Rename containerRuntimeInfo to containerState for clarityMatthew Heon2018-01-18
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Rename ContainerState to ContainerStatusMatthew Heon2018-01-18
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Add DNS and security fields to DBMatthew Heon2018-01-15
| | | | | | | | | | | | | | | | | Also moves port mappings out of the SQL DB and into a file on disk. These could get very sizable (hundred to thousands of ports) so moving them out to a file will keep the DB small and fast. Finally, add a foreign key reference from container ID to container state ID. This ensures we never get into an inconsistent state where we have data in one table but not the other. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #225 Approved by: baude
* Update DB to add new fields required for planned featuresMatthew Heon2018-01-10
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #209 Approved by: rhatdan
* Save ContainerConfig.User to databaseMatthew Heon2018-01-08
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #194 Approved by: rhatdan
* Plumb through the --stop-timeout signal handlingDaniel J Walsh2017-12-20
| | | | | | | | | | | | | podman run/create have the ability to set the stop timeout flag. We need to stop it in the database. Also Allowing negative time for stop timeout makes no sense, so switching to timeout of uint, allows user to specify huge timeout values. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #158 Approved by: TomSweeneyRedHat
* Add network namespaces to SQL stateMatthew Heon2017-12-14
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #109 Approved by: mheon
* Add networking configuration to the libpod DBMatthew Heon2017-12-14
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #109 Approved by: mheon
* Update pods to use file locksMatthew Heon2017-12-14
| | | | | | | | | Also includes misc other fixes - adding labels, fixing pod names Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #138 Approved by: rhatdan
* Remove check for existance of lockfile when retrieving containersMatthew Heon2017-12-05
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Remove SQL state locking and rely on sqlite lockingMatthew Heon2017-12-04
| | | | | | | Also renames some parameters from locksDir -> lockDir for consistency. Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Move containers to file locks from c/storageMatthew Heon2017-12-04
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Add NetMode, UTSMode and IPCModeDaniel J Walsh2017-12-02
| | | | | | | | | | | | | | Allow kpod create/run to create contianers in different network namespaces, uts namespaces and IPC Namespaces. This patch just handles the simple join the host, or another containers namespaces. Lots more work needed to full integrate --net Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #64 Approved by: mheon
* Add schema validation to DBMatthew Heon2017-11-30
| | | | | | | | | | This ensures we don't open a DB with an earlier schema or a config that differs from ours Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #86 Approved by: rhatdan
* Order containers returned from state and make container config publicMatthew Heon2017-11-22
| | | | | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #63 Approved by: baude
* Add ability to update container status from runcMatthew Heon2017-11-21
| | | | | | | | | | | | Wire this in to all state-bound container operations to ensure syncronization of container state. Also exposes PID of running containers via API. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #56 Approved by: rhatdan
* Fix lint errorsMatthew Heon2017-11-18
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* StopSignal is allowed to be 0Matthew Heon2017-11-18
| | | | | | If StopSignal is 0, it is assumed that the default signal will be used. Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Fix lingering SQL errorMatthew Heon2017-11-18
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Address review comments, fix gofmt and lintMatthew Heon2017-11-18
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Compile-tested implementation of SQL-backed stateMatthew Heon2017-11-18
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>