feat: expose logs method on container interface

pull/17526/head
Poonam Jadhav 2023-05-31 12:04:25 -04:00
parent a065eef3ef
commit 65d5aeaaac
2 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,7 @@ package cluster
import (
"context"
"io"
"github.com/testcontainers/testcontainers-go"
@ -22,6 +23,7 @@ type Agent interface {
GetAgentName() string
GetPartition() string
GetPod() testcontainers.Container
Logs(context.Context) (io.ReadCloser, error)
ClaimAdminPort() (int, error)
GetConfig() Config
GetInfo() AgentInfo

View File

@ -68,6 +68,10 @@ func (c *consulContainerNode) GetPod() testcontainers.Container {
return c.pod
}
func (c *consulContainerNode) Logs(context context.Context) (io.ReadCloser, error) {
return c.container.Logs(context)
}
func (c *consulContainerNode) ClaimAdminPort() (int, error) {
if c.nextAdminPortOffset >= MaxEnvoyOnNode {
return 0, fmt.Errorf("running out of envoy admin port, max %d, already claimed %d",