mirror of
https://github.com/containers/podman.git
synced 2025-11-29 09:37:38 +08:00
Tremendous amount of changes in here, but all should amount to the same thing: changing Go import paths from v5 to v6. Also bumped go.mod to github.com/containers/podman/v6 and updated version to v6.0.0-dev. Signed-off-by: Matt Heon <mheon@redhat.com>
34 lines
1.0 KiB
Go
34 lines
1.0 KiB
Go
//go:build !remote
|
|
|
|
package infra
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
ientities "github.com/containers/podman/v6/internal/domain/entities"
|
|
"github.com/containers/podman/v6/internal/domain/infra/tunnel"
|
|
"github.com/containers/podman/v6/pkg/bindings"
|
|
"github.com/containers/podman/v6/pkg/domain/entities"
|
|
)
|
|
|
|
// NewTestingEngine factory provides a libpod runtime for testing-specific operations
|
|
func NewTestingEngine(facts *entities.PodmanConfig) (ientities.TestingEngine, error) {
|
|
switch facts.EngineMode {
|
|
case entities.ABIMode:
|
|
r, err := NewLibpodTestingRuntime(facts.FlagSet, facts)
|
|
return r, err
|
|
case entities.TunnelMode:
|
|
ctx, err := bindings.NewConnectionWithOptions(context.Background(), bindings.Options{
|
|
URI: facts.URI,
|
|
Identity: facts.Identity,
|
|
TLSCertFile: facts.TLSCertFile,
|
|
TLSKeyFile: facts.TLSKeyFile,
|
|
TLSCAFile: facts.TLSCAFile,
|
|
Machine: facts.MachineMode,
|
|
})
|
|
return &tunnel.TestingEngine{ClientCtx: ctx}, err
|
|
}
|
|
return nil, fmt.Errorf("runtime mode '%v' is not supported", facts.EngineMode)
|
|
}
|