diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-02-09 17:13:07 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-02-12 14:28:07 +0000 |
commit | 4f225b47c9be6f9d72997cea83c029275c3530db (patch) | |
tree | 5b9092449ca27777657e7baf1a880bb1c313ed5b /libpod/sql_state.go | |
parent | aa85ae212e4cc23df7a6bafe8992dc76770bac87 (diff) | |
download | podman-4f225b47c9be6f9d72997cea83c029275c3530db.tar.gz podman-4f225b47c9be6f9d72997cea83c029275c3530db.tar.bz2 podman-4f225b47c9be6f9d72997cea83c029275c3530db.zip |
Refactor Pod to use a Config struct
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
Diffstat (limited to 'libpod/sql_state.go')
-rw-r--r-- | libpod/sql_state.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/sql_state.go b/libpod/sql_state.go index d69a3b58e..a1830c468 100644 --- a/libpod/sql_state.go +++ b/libpod/sql_state.go @@ -764,7 +764,7 @@ func (s *SQLState) AddPod(pod *Pod) (err error) { return ErrPodRemoved } - labelsJSON, err := json.Marshal(pod.labels) + labelsJSON, err := json.Marshal(pod.config.Labels) if err != nil { return errors.Wrapf(err, "error marshaling pod %s labels to JSON", pod.ID()) } |