Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.1] systemtest: don't use fleet-server IP (backport #7157) #7158

Merged
merged 1 commit into from
Feb 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions systemtest/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ import (

const (
startContainersTimeout = 5 * time.Minute

fleetServerPort = "8220"
)

var (
Expand Down Expand Up @@ -314,17 +312,9 @@ func NewUnstartedElasticAgentContainer() (*ElasticAgentContainer, error) {
return nil, err
}

var fleetServerIPAddress string
var networks []string
for network, settings := range fleetServerContainerDetails.NetworkSettings.Networks {
for network := range fleetServerContainerDetails.NetworkSettings.Networks {
networks = append(networks, network)
if fleetServerIPAddress == "" && settings.IPAddress != "" {
fleetServerIPAddress = settings.IPAddress
}
}
fleetServerURL := &url.URL{
Scheme: "https",
Host: net.JoinHostPort(fleetServerIPAddress, fleetServerPort),
}
containerCACertPath := "/etc/pki/tls/certs/fleet-ca.pem"

Expand Down Expand Up @@ -360,7 +350,7 @@ func NewUnstartedElasticAgentContainer() (*ElasticAgentContainer, error) {
Networks: networks,
BindMounts: map[string]string{hostCACertPath: containerCACertPath},
Env: map[string]string{
"FLEET_URL": fleetServerURL.String(),
"FLEET_URL": "https://fleet-server:8220",
"FLEET_CA": containerCACertPath,
},
SkipReaper: true, // we use our own reaping logic
Expand Down