feat: expose logs method on container interface (#17526)

This commit is contained in:
Poonam Jadhav 2023-05-31 13:18:00 -04:00 committed by GitHub
parent 1fc4bea448
commit 67be774707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

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

View File

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