backport of commit 65d5aeaaac (#17531)

Co-authored-by: Poonam Jadhav <poonam.jadhav@hashicorp.com>
pull/17532/head^2
hc-github-team-consul-core 2023-05-31 13:48:52 -04:00 committed by GitHub
parent fe5a963c62
commit d991db50fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package cluster
import (
"context"
"io"
"github.com/testcontainers/testcontainers-go"
@ -19,6 +20,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

@ -64,6 +64,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",