Skip to content

Commit

Permalink
Merge branch '8.0' into mergify/bp/8.0/pr-6700
Browse files Browse the repository at this point in the history
  • Loading branch information
simitt authored Feb 2, 2022
2 parents 36bf332 + 75dd713 commit 4a2032b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
8 changes: 1 addition & 7 deletions .ci/scripts/update-beats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ make update-beats
COMMIT_MESSAGE="Update to elastic/beats@$(go list -m -f {{.Version}} github.com/elastic/beats/... | cut -d- -f3)"

git checkout -b "update-beats-$(date "+%Y%m%d%H%M%S")"
<<<<<<< HEAD
git add go.mod go.sum NOTICE.txt \
.go-version docs/version.asciidoc \
docs/fields.asciidoc include/fields.go x-pack/apm-server/include/fields.go
=======
git add --ignore-errors go.mod go.sum NOTICE.txt \
.go-version docs/version.asciidoc
.go-version docs/version.asciidoc

>>>>>>> ea46964f (update beats: fix new file location (#6700))
find . -maxdepth 2 -name Dockerfile -exec git add {} \;

git diff --staged --quiet || git commit -m "$COMMIT_MESSAGE"
Expand Down
26 changes: 4 additions & 22 deletions systemtest/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,9 @@ func NewUnstartedElasticAgentContainer() (*ElasticAgentContainer, error) {
systemtestDir := filepath.Dir(filename)
hostCACertPath := filepath.Join(systemtestDir, "../testing/docker/fleet-server/ca.pem")

// Use the same stack version as used for fleet-server.
// Use the same elastic-agent image as used for fleet-server.
agentImageVersion := fleetServerContainer.Image[strings.LastIndex(fleetServerContainer.Image, ":")+1:]
agentImage := "docker.elastic.co/beats/elastic-agent:" + agentImageVersion
if err := pullDockerImage(context.Background(), docker, agentImage); err != nil {
return nil, err
}
agentImageDetails, _, err := docker.ImageInspectWithRaw(context.Background(), agentImage)
if err != nil {
return nil, err
Expand All @@ -356,10 +353,9 @@ func NewUnstartedElasticAgentContainer() (*ElasticAgentContainer, error) {
SkipReaper: true, // we use our own reaping logic
}
return &ElasticAgentContainer{
request: req,
exited: make(chan struct{}),
Reap: true,
StackVersion: agentImageVersion,
request: req,
exited: make(chan struct{}),
Reap: true,
}, nil
}

Expand All @@ -375,10 +371,6 @@ type ElasticAgentContainer struct {
// from being stoped and removed.
Reap bool

// StackVersion holds the stack version of the container image,
// e.g. 8.0.0-SNAPSHOT.
StackVersion string

// ExposedPorts holds an optional list of ports to expose to the host.
ExposedPorts []string

Expand Down Expand Up @@ -570,16 +562,6 @@ func (c *ElasticAgentContainer) Exec(ctx context.Context, cmd ...string) (stdout
return stdoutBuf.Bytes(), stderrBuf.Bytes(), nil
}

func pullDockerImage(ctx context.Context, docker *client.Client, imageRef string) error {
rc, err := docker.ImagePull(context.Background(), imageRef, types.ImagePullOptions{})
if err != nil {
return err
}
defer rc.Close()
_, err = io.Copy(ioutil.Discard, rc)
return err
}

func matchFleetServerAPIStatusHealthy(r io.Reader) bool {
var status struct {
Name string `json:"name"`
Expand Down

0 comments on commit 4a2032b

Please sign in to comment.