2017-02-11 00:48:15 +08:00
|
|
|
package buildah
|
|
|
|
|
|
|
|
import (
|
2017-05-09 23:56:44 +08:00
|
|
|
"io"
|
|
|
|
|
2017-06-05 21:42:30 +08:00
|
|
|
cp "github.com/containers/image/copy"
|
2017-02-11 00:48:15 +08:00
|
|
|
"github.com/containers/image/types"
|
|
|
|
)
|
|
|
|
|
2017-07-21 08:02:11 +08:00
|
|
|
func getCopyOptions(reportWriter io.Writer, sourceSystemContext *types.SystemContext, destinationSystemContext *types.SystemContext) *cp.Options {
|
2017-06-05 21:42:30 +08:00
|
|
|
return &cp.Options{
|
2017-07-21 08:02:11 +08:00
|
|
|
ReportWriter: reportWriter,
|
|
|
|
SourceCtx: sourceSystemContext,
|
|
|
|
DestinationCtx: destinationSystemContext,
|
2017-05-09 23:56:44 +08:00
|
|
|
}
|
2017-02-11 00:48:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func getSystemContext(signaturePolicyPath string) *types.SystemContext {
|
|
|
|
sc := &types.SystemContext{}
|
|
|
|
if signaturePolicyPath != "" {
|
|
|
|
sc.SignaturePolicyPath = signaturePolicyPath
|
|
|
|
}
|
|
|
|
return sc
|
|
|
|
}
|