Skip to content

Commit 58ed51c

Browse files
committed
Greater than 9.3 stack versions defined elastic-package env uses elastic_agent without setting SSL. With this change, Logstash is also opting out SSL settings for the versions greater than 9.3
1 parent 04baf2a commit 58ed51c

File tree

4 files changed

+55
-4
lines changed

4 files changed

+55
-4
lines changed

.buildkite/scripts/e2e-pipeline/bootstrap.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def __init__(self, stack_version: str, project_type: str) -> None:
3838
Returns:
3939
Validates and sets stack version, project type and resolves elastic package distro based on running OS (sys.platform)
4040
"""
41+
print(f"Stack version: {stack_version}")
4142
self.stack_version = stack_version
4243
self.__validate_and_set_project_type(project_type)
4344
self.__resolve_distro()
@@ -160,9 +161,33 @@ def __reload_container(self) -> None:
160161
"Error occurred while reloading Logstash container, see logs for details.")
161162
time.sleep(20) # give a time Logstash pipeline to fully start
162163

164+
def __is_version_gte(self, version: str, target_major: int, target_minor: int) -> bool:
165+
# Remove -SNAPSHOT suffix if present
166+
clean_version = version.replace("-SNAPSHOT", "")
167+
parts = clean_version.split(".")
168+
if len(parts) < 2:
169+
return False
170+
171+
try:
172+
major = int(parts[0])
173+
minor = int(parts[1])
174+
if major > target_major:
175+
return True
176+
elif major == target_major:
177+
return minor >= target_minor
178+
else:
179+
return False
180+
except ValueError:
181+
return False
182+
163183
def __update_pipeline_config(self) -> None:
164184
local_config_file_path = ".buildkite/scripts/e2e-pipeline/config/"
165-
config_file = "serverless_pipeline.conf" if self.project_type == "serverless" else "pipeline.conf"
185+
if self.__is_version_gte(self.stack_version, 9, 3):
186+
config_file = "pipeline-ea-without-ssl.conf"
187+
elif self.project_type == "serverless":
188+
config_file = "serverless_pipeline.conf"
189+
else:
190+
config_file = "pipeline.conf"
166191
local_config_file = local_config_file_path + config_file
167192
container_config_file_path = "/usr/share/logstash/pipeline/logstash.conf"
168193
# python docker client (internally uses subprocess) requires special TAR header with tar operations
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
input {
2+
elastic_agent {
3+
port => 5044
4+
}
5+
}
6+
7+
8+
filter {
9+
elastic_integration {
10+
remove_field => ['@version']
11+
hosts => ["https://elasticsearch:9200"]
12+
username => "${ELASTIC_USER}"
13+
password => "${ELASTIC_PASSWORD}"
14+
ssl_enabled => true
15+
ssl_verification_mode => "none"
16+
}
17+
}
18+
19+
20+
output {
21+
elasticsearch {
22+
hosts => ["https://elasticsearch:9200"]
23+
user => "${ELASTIC_USER}"
24+
password => "${ELASTIC_PASSWORD}"
25+
ssl_enabled => true
26+
ssl_verification_mode => "none"
27+
}
28+
}

.buildkite/scripts/e2e-pipeline/main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ def main(skip_setup=False, integrations=[]):
4242
working_dir = os.getcwd()
4343
test_plugin = PluginTest()
4444

45-
util.show_containers_logs(["logstash-", "elasticsearch-", "elastic-agent-"])
46-
4745
packages = integrations or INTEGRATION_PACKAGES_TO_TEST
4846
for package in packages:
4947
try:

.buildkite/scripts/e2e-pipeline/plugin_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ def on(self, package: str) -> None:
5858
for result_line in result.stdout.splitlines(): print(f"{result_line}")
5959

6060
# although there was an error, le's check how LS performed and make sure errors weren't because of Logstash
61-
time.sleep(20)
61+
time.sleep(2) # make sure LS processes the event way to downstream ES
6262
self.__analyze_logstash_throughput(package, result)

0 commit comments

Comments
 (0)