mirror of
https://github.com/containers/skopeo.git
synced 2026-02-02 07:19:35 +00:00
Maintain the container configuration in multiple formats in the Buildah object, initializing one based on the other, depending on which format the source image used for its configuration. Replace directly manipulated fields in the Buildah object (Annotations, CreatedBy, OS, Architecture, Maintainer, User, Workdir, Env, Cmd, Entrypoint, Expose, Labels, and Volumes) with accessor functions which update both configurations and which read from whichever one we consider to be authoritative. Drop Args because we weren't using them. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> Closes: #102 Approved by: rhatdan
27 lines
517 B
Go
27 lines
517 B
Go
package buildah
|
|
|
|
import (
|
|
"github.com/containers/storage/pkg/reexec"
|
|
)
|
|
|
|
// InitReexec is a wrapper for reexec.Init(). It should be called at
|
|
// the start of main(), and if it returns true, main() should return
|
|
// immediately.
|
|
func InitReexec() bool {
|
|
return reexec.Init()
|
|
}
|
|
|
|
func copyStringStringMap(m map[string]string) map[string]string {
|
|
n := map[string]string{}
|
|
for k, v := range m {
|
|
n[k] = v
|
|
}
|
|
return n
|
|
}
|
|
|
|
func copyStringSlice(s []string) []string {
|
|
t := make([]string, len(s))
|
|
copy(t, s)
|
|
return t
|
|
}
|