oci: Add a created flag and getter/setter for container
@@ -36,6 +36,7 @@ type Container struct {
stdinOnce bool
privileged bool
trusted bool
+ created bool
state *ContainerState
metadata *pb.ContainerMetadata
opLock sync.Locker
@@ -292,3 +293,13 @@ func (c *Container) IDMappings() *idtools.IDMappings {
func (c *Container) SetState(state *ContainerState) {
c.state = state
}
+
+// SetCreated sets the created flag to true once container is created
+func (c *Container) SetCreated() {
+ c.created = true
+}
+
+// Created returns whether the container was created successfully
+func (c *Container) Created() bool {
+ return c.created
+}
