diff --git a/src/runtime/cmd/kata-runtime/network.go b/src/runtime/cmd/kata-runtime/network.go index c6a871b56f02..653671e661d1 100644 --- a/src/runtime/cmd/kata-runtime/network.go +++ b/src/runtime/cmd/kata-runtime/network.go @@ -11,7 +11,7 @@ import ( "fmt" "os" - vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" + pbTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types" "github.com/sirupsen/logrus" "github.com/urfave/cli" @@ -152,7 +152,7 @@ func networkModifyCommand(ctx context.Context, containerID, input string, opType } switch opType { case interfaceType: - var inf, resultingInf *vcTypes.Interface + var inf, resultingInf *pbTypes.Interface if err = json.NewDecoder(f).Decode(&inf); err != nil { return err } @@ -171,7 +171,7 @@ func networkModifyCommand(ctx context.Context, containerID, input string, opType } json.NewEncoder(output).Encode(resultingInf) case routeType: - var routes, resultingRoutes []*vcTypes.Route + var routes, resultingRoutes []*pbTypes.Route if err = json.NewDecoder(f).Decode(&routes); err != nil { return err } @@ -209,7 +209,7 @@ func networkListCommand(ctx context.Context, containerID string, opType networkT switch opType { case interfaceType: - var interfaces []*vcTypes.Interface + var interfaces []*pbTypes.Interface interfaces, err = vci.ListInterfaces(ctx, sandboxID) if err != nil { kataLog.WithField("existing-interfaces", fmt.Sprintf("%+v", interfaces)). @@ -217,7 +217,7 @@ func networkListCommand(ctx context.Context, containerID string, opType networkT } json.NewEncoder(file).Encode(interfaces) case routeType: - var routes []*vcTypes.Route + var routes []*pbTypes.Route routes, err = vci.ListRoutes(ctx, sandboxID) if err != nil { kataLog.WithField("resulting-routes", fmt.Sprintf("%+v", routes)). diff --git a/src/runtime/virtcontainers/implementation.go b/src/runtime/virtcontainers/implementation.go index 12107bfa7a19..14ec013bdb08 100644 --- a/src/runtime/virtcontainers/implementation.go +++ b/src/runtime/virtcontainers/implementation.go @@ -15,7 +15,7 @@ import ( "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/device/api" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/device/config" - vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" + pbTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types" specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/sirupsen/logrus" @@ -148,27 +148,27 @@ func (impl *VCImpl) AddDevice(ctx context.Context, sandboxID string, info config } // AddInterface implements the VC function of the same name. -func (impl *VCImpl) AddInterface(ctx context.Context, sandboxID string, inf *vcTypes.Interface) (*vcTypes.Interface, error) { +func (impl *VCImpl) AddInterface(ctx context.Context, sandboxID string, inf *pbTypes.Interface) (*pbTypes.Interface, error) { return AddInterface(ctx, sandboxID, inf) } // RemoveInterface implements the VC function of the same name. -func (impl *VCImpl) RemoveInterface(ctx context.Context, sandboxID string, inf *vcTypes.Interface) (*vcTypes.Interface, error) { +func (impl *VCImpl) RemoveInterface(ctx context.Context, sandboxID string, inf *pbTypes.Interface) (*pbTypes.Interface, error) { return RemoveInterface(ctx, sandboxID, inf) } // ListInterfaces implements the VC function of the same name. -func (impl *VCImpl) ListInterfaces(ctx context.Context, sandboxID string) ([]*vcTypes.Interface, error) { +func (impl *VCImpl) ListInterfaces(ctx context.Context, sandboxID string) ([]*pbTypes.Interface, error) { return ListInterfaces(ctx, sandboxID) } // UpdateRoutes implements the VC function of the same name. -func (impl *VCImpl) UpdateRoutes(ctx context.Context, sandboxID string, routes []*vcTypes.Route) ([]*vcTypes.Route, error) { +func (impl *VCImpl) UpdateRoutes(ctx context.Context, sandboxID string, routes []*pbTypes.Route) ([]*pbTypes.Route, error) { return UpdateRoutes(ctx, sandboxID, routes) } // ListRoutes implements the VC function of the same name. -func (impl *VCImpl) ListRoutes(ctx context.Context, sandboxID string) ([]*vcTypes.Route, error) { +func (impl *VCImpl) ListRoutes(ctx context.Context, sandboxID string) ([]*pbTypes.Route, error) { return ListRoutes(ctx, sandboxID) } diff --git a/src/runtime/virtcontainers/interfaces.go b/src/runtime/virtcontainers/interfaces.go index 149014667906..e0aef372b7e8 100644 --- a/src/runtime/virtcontainers/interfaces.go +++ b/src/runtime/virtcontainers/interfaces.go @@ -48,11 +48,11 @@ type VC interface { AddDevice(ctx context.Context, sandboxID string, info config.DeviceInfo) (api.Device, error) - AddInterface(ctx context.Context, sandboxID string, inf *vcTypes.Interface) (*vcTypes.Interface, error) - RemoveInterface(ctx context.Context, sandboxID string, inf *vcTypes.Interface) (*vcTypes.Interface, error) - ListInterfaces(ctx context.Context, sandboxID string) ([]*vcTypes.Interface, error) - UpdateRoutes(ctx context.Context, sandboxID string, routes []*vcTypes.Route) ([]*vcTypes.Route, error) - ListRoutes(ctx context.Context, sandboxID string) ([]*vcTypes.Route, error) + AddInterface(ctx context.Context, sandboxID string, inf *pbTypes.Interface) (*pbTypes.Interface, error) + RemoveInterface(ctx context.Context, sandboxID string, inf *pbTypes.Interface) (*pbTypes.Interface, error) + ListInterfaces(ctx context.Context, sandboxID string) ([]*pbTypes.Interface, error) + UpdateRoutes(ctx context.Context, sandboxID string, routes []*pbTypes.Route) ([]*pbTypes.Route, error) + ListRoutes(ctx context.Context, sandboxID string) ([]*pbTypes.Route, error) CleanupContainer(ctx context.Context, sandboxID, containerID string, force bool) error }