Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

[updatecli] update elastic stack version for testing 8.10.0-c5be8c13 #3638

Closed
wants to merge 10 commits into from
4 changes: 2 additions & 2 deletions .ci/scripts/install-helm-test-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ HOME=${HOME:?$MSG}

HELM_VERSION="${HELM_VERSION:-"3.9.0"}"
HELM_TAR_GZ_FILE="helm-v${HELM_VERSION}-linux-${GOARCH}.tar.gz"
KIND_VERSION="v${KIND_VERSION:-"0.17.0"}"
KUBERNETES_VERSION="${KUBERNETES_VERSION:-"1.26.0"}"
KIND_VERSION="v${KIND_VERSION:-"0.20.0"}"
KUBERNETES_VERSION="${KUBERNETES_VERSION:-"1.27.3"}"

HELM_CMD="${HOME}/bin/helm"
KBC_CMD="${HOME}/bin/kubectl"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ set -euxo pipefail
MSG="parameter missing."
HOME=${HOME:?$MSG}

KIND_VERSION="v${KIND_VERSION:-"0.17.0"}"
KUBERNETES_VERSION="${KUBERNETES_VERSION:-"1.26.0"}"
KIND_VERSION="v${KIND_VERSION:-"0.20.0"}"
KUBERNETES_VERSION="${KUBERNETES_VERSION:-"1.27.3"}"

KUBECTL_CMD="${HOME}/bin/kubectl"

Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20
1.20.5
2 changes: 1 addition & 1 deletion .stack-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.9.0-473a43eb-SNAPSHOT
8.10.0-c5be8c13-SNAPSHOT
4 changes: 2 additions & 2 deletions e2e/_suites/kubernetes-autodiscover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ This is an example of the optional configuration:
export BEAT_VERSION=7.12.0 # version of beats to use
export ELASTIC_AGENT_VERSION=7.12.0 # version of Elastic Agent to use
export GITHUB_CHECK_SHA1=0123456789 # to select snapshots built by beats-ci
export KIND_VERSION="0.17.0" # version of kind
export KUBERNETES_VERSION="1.26.0" # version of the cluster to be passed to kind
export KIND_VERSION="0.20.0" # version of kind
export KUBERNETES_VERSION="1.27.3" # version of the cluster to be passed to kind
```

3. Install dependencies.
Expand Down
2 changes: 1 addition & 1 deletion internal/common/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const FleetProfileName = "fleet"
const FleetServerAgentServiceName = "fleet-server"

// BeatVersionBase is the base version of the Beat to use
var BeatVersionBase = "8.9.0-473a43eb-SNAPSHOT"
var BeatVersionBase = "8.10.0-c5be8c13-SNAPSHOT"

// BeatVersion is the version of the Beat to use
// It can be overriden by BEAT_VERSION env var
Expand Down
4 changes: 2 additions & 2 deletions internal/config/compose/profiles/fleet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
- xpack.security.authc.token.timeout=60m
- ELASTIC_USERNAME=admin
- ELASTIC_PASSWORD=changeme
image: "docker.elastic.co/elasticsearch/elasticsearch:${stackVersion:-8.9.0-473a43eb-SNAPSHOT}"
image: "docker.elastic.co/elasticsearch/elasticsearch:${stackVersion:-8.10.0-c5be8c13-SNAPSHOT}"
platform: ${stackPlatform:-linux/amd64}
ports:
- "9200:9200"
Expand All @@ -34,7 +34,7 @@ services:
test: ["CMD-SHELL", "curl -u admin:changeme -s http://localhost:5601/api/status | grep -q 'All services are available'"]
retries: 60
interval: 10s
image: "docker.elastic.co/${kibanaDockerNamespace:-kibana}/kibana:${kibanaVersion:-8.9.0-473a43eb-SNAPSHOT}"
image: "docker.elastic.co/${kibanaDockerNamespace:-kibana}/kibana:${kibanaVersion:-8.10.0-c5be8c13-SNAPSHOT}"
platform: ${stackPlatform:-linux/amd64}
ports:
- "5601:5601"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2.4'
services:
elastic-agent:
image: "docker.elastic.co/${elasticAgentDockerNamespace:-beats}/elastic-agent${elasticAgentDockerImageSuffix}:${elasticAgentTag:-8.9.0-473a43eb-SNAPSHOT}"
image: "docker.elastic.co/${elasticAgentDockerNamespace:-beats}/elastic-agent${elasticAgentDockerImageSuffix}:${elasticAgentTag:-8.10.0-c5be8c13-SNAPSHOT}"
depends_on:
elasticsearch:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2.4'
services:
elastic-agent:
image: "docker.elastic.co/${elasticAgentDockerNamespace:-beats}/elastic-agent${elasticAgentDockerImageSuffix}:${elasticAgentTag:-8.9.0-473a43eb-SNAPSHOT}"
image: "docker.elastic.co/${elasticAgentDockerNamespace:-beats}/elastic-agent${elasticAgentDockerImageSuffix}:${elasticAgentTag:-8.10.0-c5be8c13-SNAPSHOT}"
depends_on:
elasticsearch:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2.4'
services:
fleet-server:
image: "docker.elastic.co/${elasticAgentDockerNamespace:-beats}/elastic-agent${elasticAgentDockerImageSuffix}:${elasticAgentTag:-8.9.0-473a43eb-SNAPSHOT}"
image: "docker.elastic.co/${elasticAgentDockerNamespace:-beats}/elastic-agent${elasticAgentDockerImageSuffix}:${elasticAgentTag:-8.10.0-c5be8c13-SNAPSHOT}"
depends_on:
elasticsearch:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- xpack.monitoring.collection.enabled=true
- ELASTIC_USERNAME=elastic
- ELASTIC_PASSWORD=changeme
image: "docker.elastic.co/observability-ci/elasticsearch:${elasticsearchTag:-8.9.0-473a43eb-SNAPSHOT}"
image: "docker.elastic.co/observability-ci/elasticsearch:${elasticsearchTag:-8.10.0-c5be8c13-SNAPSHOT}"
healthcheck:
interval: 10s
retries: 100
Expand Down
2 changes: 1 addition & 1 deletion internal/config/compose/services/kibana/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ services:
test: ["CMD-SHELL", "curl -u admin:changeme -s http://localhost:5601/api/status | grep -q 'All services are available'"]
retries: 60
interval: 10s
image: "docker.elastic.co/kibana/kibana:${kibanaTag:-8.9.0-473a43eb-SNAPSHOT}"
image: "docker.elastic.co/kibana/kibana:${kibanaTag:-8.10.0-c5be8c13-SNAPSHOT}"
ports:
- "5601:5601"
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
]
environment:
- BEAT_STRICT_PERMS=${beatStricPerms:-false}
image: "docker.elastic.co/${metricbeatDockerNamespace:-beats}/metricbeat:${metricbeatTag:-8.9.0-473a43eb-SNAPSHOT}"
image: "docker.elastic.co/${metricbeatDockerNamespace:-beats}/metricbeat:${metricbeatTag:-8.10.0-c5be8c13-SNAPSHOT}"
labels:
co.elastic.logs/module: "${serviceName}"
platform: ${stackPlatform:-linux/amd64}
Expand Down
4 changes: 2 additions & 2 deletions internal/config/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Requirements

- docker
- kind (>= 0.17.0)
- kubectl (>= 1.26.0)
- kind (>= 0.20.0)
- kubectl (>= 1.27.3)

## Deployment

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:8.9.0-473a43eb-SNAPSHOT
image: docker.elastic.co/elasticsearch/elasticsearch:8.10.0-c5be8c13-SNAPSHOT
envFrom:
- configMapRef:
name: elasticsearch-config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: fleet-server
image: docker.elastic.co/beats/elastic-agent:8.9.0-473a43eb-SNAPSHOT
image: docker.elastic.co/beats/elastic-agent:8.10.0-c5be8c13-SNAPSHOT
env:
- name: FLEET_SERVER_ENABLE
value: "1"
Expand Down
2 changes: 1 addition & 1 deletion internal/config/kubernetes/base/kibana/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
spec:
containers:
- name: kibana
image: docker.elastic.co/kibana/kibana:8.9.0-473a43eb-SNAPSHOT
image: docker.elastic.co/kibana/kibana:8.10.0-c5be8c13-SNAPSHOT
env:
- name: ELASTICSEARCH_URL
value: http://elasticsearch:9200
Expand Down
46 changes: 8 additions & 38 deletions internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package utils

import (
"fmt"
"io"
"math/rand"
"net/http"
Expand Down Expand Up @@ -53,11 +54,7 @@ func DownloadFile(downloadRequest *DownloadRequest) error {
tempParentDir := filepath.Join(os.TempDir(), uuid.NewString())
err := internalio.MkdirAll(tempParentDir)
if err != nil {
log.WithFields(log.Fields{
"error": err,
"path": tempParentDir,
}).Error("Error creating directory")
return err
return fmt.Errorf("creating directory: %w", err)
}
filePath = filepath.Join(tempParentDir, uuid.NewString())
downloadRequest.DownloadPath = filePath
Expand All @@ -67,11 +64,7 @@ func DownloadFile(downloadRequest *DownloadRequest) error {

tempFile, err := os.Create(filePath)
if err != nil {
log.WithFields(log.Fields{
"error": err,
"url": downloadRequest.URL,
}).Error("Error creating file")
return err
return fmt.Errorf("creating file: %w", err)
}
defer tempFile.Close()

Expand All @@ -83,36 +76,19 @@ func DownloadFile(downloadRequest *DownloadRequest) error {
download := func() error {
resp, err := http.Get(downloadRequest.URL)
if err != nil {
log.WithFields(log.Fields{
"elapsedTime": exp.GetElapsedTime(),
"error": err,
"path": downloadRequest.UnsanitizedFilePath,
"retry": retryCount,
"url": downloadRequest.URL,
}).Warn("Could not download the file")

retryCount++

return err
return fmt.Errorf("downloading file %s: %w", downloadRequest.URL, err)
}

log.WithFields(log.Fields{
"elapsedTime": exp.GetElapsedTime(),
"retries": retryCount,
"path": downloadRequest.UnsanitizedFilePath,
"url": downloadRequest.URL,
}).Trace("File downloaded")
if resp != nil && resp.StatusCode == http.StatusNotFound {
return backoff.Permanent(fmt.Errorf("%s not found", downloadRequest.URL))
}

fileReader = resp.Body

return nil
}

log.WithFields(log.Fields{
"url": downloadRequest.URL,
"path": downloadRequest.UnsanitizedFilePath,
}).Trace("Downloading file")

err = backoff.Retry(download, exp)
if err != nil {
return err
Expand All @@ -121,13 +97,7 @@ func DownloadFile(downloadRequest *DownloadRequest) error {

_, err = io.Copy(tempFile, fileReader)
if err != nil {
log.WithFields(log.Fields{
"error": err,
"url": downloadRequest.URL,
"path": downloadRequest.UnsanitizedFilePath,
}).Error("Could not write file")

return err
return fmt.Errorf("writing file %s: %w", tempFile.Name(), err)
}

_ = os.Chmod(tempFile.Name(), 0666)
Expand Down
Loading
Loading