Add a new generic container registry client via a new `container` package. Use this to create a command line utility as well as a new upload target for container registries. The code uses the github.com/containers/* project and packages to interact with container registires that is also used by skopeo, podman et al. One if the dependencies is `proglottis/gpgme` that is using cgo to bind libgpgme, so we have to add the corresponding devel package to the BuildRequires as well as installing it on CI. Checks will follow later via an integration test.
18 lines
527 B
Go
18 lines
527 B
Go
// +build !windows
|
|
|
|
package gpgme
|
|
|
|
// #include <stdlib.h>
|
|
import "C"
|
|
import (
|
|
"unsafe"
|
|
)
|
|
|
|
// This is somewhat of a horrible hack. We need to unset GPG_AGENT_INFO so that gpgme does not pass --use-agent to GPG.
|
|
// os.Unsetenv should be enough, but that only calls the underlying C library (which gpgme uses) if cgo is involved
|
|
// - and cgo can't be used in tests. So, provide this helper for test initialization.
|
|
func unsetenvGPGAgentInfo() {
|
|
v := C.CString("GPG_AGENT_INFO")
|
|
defer C.free(unsafe.Pointer(v))
|
|
C.unsetenv(v)
|
|
}
|