Skip to content

Commit

Permalink
Fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrehilbert committed Oct 17, 2023
2 parents 8dfd4ee + 6d907c3 commit c5a7138
Show file tree
Hide file tree
Showing 17 changed files with 416 additions and 260 deletions.
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ source .buildkite/scripts/common.sh

# Override the agent package version using a string with format <major>.<minor>.<patch>
# NOTE: use only after version bump when the new version is not yet available, for example:
# OVERRIDE_AGENT_PACKAGE_VERSION="8.10.3"
OVERRIDE_AGENT_PACKAGE_VERSION="8.10.2"
# OVERRIDE_AGENT_PACKAGE_VERSION="8.10.3" otherwise OVERRIDE_AGENT_PACKAGE_VERSION="".
OVERRIDE_AGENT_PACKAGE_VERSION=""

if [[ -n "$OVERRIDE_AGENT_PACKAGE_VERSION" ]]; then
OVERRIDE_TEST_AGENT_VERSION=${OVERRIDE_AGENT_PACKAGE_VERSION}"-SNAPSHOT"
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.8
1.20.10
8 changes: 4 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ linters-settings:

gosimple:
# Select the Go version to target. The default is '1.13'.
go: "1.20.8"
go: "1.20.10"

nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
Expand All @@ -136,17 +136,17 @@ linters-settings:

staticcheck:
# Select the Go version to target. The default is '1.13'.
go: "1.20.8"
go: "1.20.10"
checks: ["all"]

stylecheck:
# Select the Go version to target. The default is '1.13'.
go: "1.20.8"
go: "1.20.10"
checks: ["all"]

unused:
# Select the Go version to target. The default is '1.13'.
go: "1.20.8"
go: "1.20.10"

gosec:
excludes:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.20.8
ARG GO_VERSION=1.20.10
FROM circleci/golang:${GO_VERSION}


Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.skaffold
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.20.8
ARG GO_VERSION=1.20.10
ARG crossbuild_image="docker.elastic.co/beats-dev/golang-crossbuild"
ARG AGENT_VERSION=8.9.0-SNAPSHOT
ARG AGENT_IMAGE="docker.elastic.co/beats/elastic-agent"
Expand Down
32 changes: 32 additions & 0 deletions changelog/fragments/1697229987-Upgrade-to-Go-1.20.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Kind can be one of:
# - breaking-change: a change to previously-documented behavior
# - deprecation: functionality that is being removed in a later release
# - bug-fix: fixes a problem in a previous version
# - enhancement: extends functionality but does not break or fix existing behavior
# - feature: new functionality
# - known-issue: problems that we are aware of in a given version
# - security: impacts on the security of a product or a user’s deployment.
# - upgrade: important information for someone upgrading from a prior version
# - other: does not fit into any of the other categories
kind: security

# Change summary; a 80ish characters long description of the change.
summary: Upgrade to Go 1.20.10.

# Long description; in case the summary is not enough to describe the change
# this field accommodate a description without length limits.
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
# description:

# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
component: "elastic-agent"

# PR URL; optional; the PR number that added the changeset.
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
# Please provide it if you are adding a fragment for a different PR.
pr: https://github.com/elastic/elastic-agent/pull/3601

# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
# If not present is automatically filled by the tooling with the issue linked to the PR number.
#issue: https://github.com/owner/repo/1234
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ func snapshotConfig(config *artifact.Config, versionOverride *agtversion.ParsedS
}

func snapshotURI(versionOverride *agtversion.ParsedSemVer, config *artifact.Config) (string, error) {
// Respect a non-default source URI even if the version is a snapshot.
if config.SourceURI != artifact.DefaultSourceURI {
return config.SourceURI, nil
}

// snapshot downloader is used also by the 'localremote' impl in case of agent currently running off a snapshot build:
// the 'localremote' downloader does not pass a specific version, implying that we should update to the latest snapshot
// build of the same <major>.<minor>.<patch>-SNAPSHOT version
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

package snapshot

import (
"testing"

"github.com/stretchr/testify/require"

"github.com/elastic/elastic-agent/internal/pkg/agent/application/upgrade/artifact"
"github.com/elastic/elastic-agent/pkg/version"
)

func TestNonDefaultSourceURI(t *testing.T) {
version, err := version.ParseVersion("8.12.0-SNAPSHOT")
require.NoError(t, err)

config := artifact.Config{
SourceURI: "localhost:1234",
}
sourceURI, err := snapshotURI(version, &config)
require.NoError(t, err)
require.Equal(t, config.SourceURI, sourceURI)

}
15 changes: 15 additions & 0 deletions pkg/testing/ess/create_deployment_csp_configuration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
gcp:
integrations_server_conf_id: "gcp.integrationsserver.n2.68x32x45.2"
elasticsearch_conf_id: "gcp.es.datahot.n2.68x10x45"
elasticsearch_deployment_template_id: "gcp-storage-optimized-v5"
kibana_instance_configuration_id: "gcp.kibana.n2.68x32x45"
azure:
integrations_server_conf_id: "azure.integrationsserver.fsv2.2"
elasticsearch_conf_id: "azure.es.datahot.edsv4"
elasticsearch_deployment_template_id: "azure-storage-optimized-v2"
kibana_instance_configuration_id: "azure.kibana.fsv2"
aws:
integrations_server_conf_id: "aws.integrationsserver.c5d.2.1"
elasticsearch_conf_id: "aws.es.datahot.i3.1.1"
elasticsearch_deployment_template_id: "aws-storage-optimized-v5"
kibana_instance_configuration_id: "aws.kibana.c5d.1.1"
102 changes: 102 additions & 0 deletions pkg/testing/ess/create_deployment_request.tmpl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"resources": {
"integrations_server": [
{
"elasticsearch_cluster_ref_id": "main-elasticsearch",
"region": "{{ .request.Region }}",
"plan": {
"cluster_topology": [
{
"instance_configuration_id": "{{ .integrations_server_conf_id }}",
"zone_count": 1,
"size": {
"resource": "memory",
"value": 1024
}
}
],
"integrations_server": {
"version": "{{ .request.Version }}"
}
},
"ref_id": "main-integrations_server"
}
],
"elasticsearch": [
{
"region": "{{ .request.Region }}",
"settings": {
"dedicated_masters_threshold": 6
},
"plan": {
"cluster_topology": [
{
"zone_count": 1,
"elasticsearch": {
"node_attributes": {
"data": "hot"
}
},
"instance_configuration_id": "{{.elasticsearch_conf_id}}",
"node_roles": [
"master",
"ingest",
"transform",
"data_hot",
"remote_cluster_client",
"data_content"
],
"id": "hot_content",
"size": {
"resource": "memory",
"value": 8192
}
}
],
"elasticsearch": {
"version": "{{ .request.Version }}",
"enabled_built_in_plugins": []
},
"deployment_template": {
"id": "{{ .elasticsearch_deployment_template_id }}"
}
},
"ref_id": "main-elasticsearch"
}
],
"enterprise_search": [],
"kibana": [
{
"elasticsearch_cluster_ref_id": "main-elasticsearch",
"region": "{{ .request.Region }}",
"plan": {
"cluster_topology": [
{
"instance_configuration_id": "{{.kibana_instance_configuration_id}}",
"zone_count": 1,
"size": {
"resource": "memory",
"value": 1024
}
}
],
"kibana": {
"version": "{{ .request.Version }}",
"user_settings_json": {
"xpack.fleet.enableExperimental": ["agentTamperProtectionEnabled"]
}
}
},
"ref_id": "main-kibana"
}
]
},
"settings": {
"autoscaling_enabled": false
},
"name": "{{ .request.Name }}",
"metadata": {
"system_owned": false,
"tags": {{ json .request.Tags }}
}
}
Loading

0 comments on commit c5a7138

Please sign in to comment.