Split up create config handling of namespaces and security

As it stands, createconfig is a huge struct. This works fine when the only caller is when we create a container with a fully created config. However, if we wish to share code for security and namespace configuration, a single large struct becomes unweildy, as well as difficult to configure with the single createConfigToOCISpec function.

This PR breaks up namespace and security configuration into their own structs, with the eventual goal of allowing the namespace/security fields to be configured by the pod create cli, and allow the infra container to share this with the pod's containers.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
This commit is contained in:
Peter Hunt
2019-09-11 16:50:02 -04:00
parent 3463a7194c
commit dcf3c742b1
12 changed files with 909 additions and 712 deletions

View File

@ -21,9 +21,9 @@ var (
func makeTestCreateConfig() *CreateConfig {
cc := new(CreateConfig)
cc.Resources = CreateResourceConfig{}
cc.IDMappings = new(storage.IDMappingOptions)
cc.IDMappings.UIDMap = []idtools.IDMap{}
cc.IDMappings.GIDMap = []idtools.IDMap{}
cc.User.IDMappings = new(storage.IDMappingOptions)
cc.User.IDMappings.UIDMap = []idtools.IDMap{}
cc.User.IDMappings.GIDMap = []idtools.IDMap{}
return cc
}