Skip to content

Conversation

@andsel
Copy link
Contributor

@andsel andsel commented Sep 10, 2021

What does this PR do?

With Elasticsearch 8 the xpack.security is enabled by default, so updates the CI run with SECURE_INTEGRATION.

This PR contains some fixes to expose the value of ELASTIC_STACK_VERSION in the Ruby's ENV and fixes for nil checks when String versions are empty

How to test

  • export some environment variables:
export SECURE_INTEGRATION=true && \
export INTEGRATION=true && \
export ELASTIC_STACK_VERSION=8.x && \
export SNAPSHOT=true
.ci/docker-setup.sh && .ci/docker-run.sh

@andsel andsel changed the title Disable security on Elasticsearch cluster Disable xpack.security on Elasticsearch for integration testing Sep 10, 2021
@andsel andsel changed the title Disable xpack.security on Elasticsearch for integration testing Disable xpack.security setting on Elasticsearch for integration tests Sep 10, 2021
@andsel andsel force-pushed the fix/disable_security_to_test_against_ES_8 branch from 750b68f to 66184d6 Compare September 10, 2021 13:58
@andsel andsel changed the title Disable xpack.security setting on Elasticsearch for integration tests Adapt CI to run with security enabled when testing with Elasticsearch > 8 Sep 13, 2021
environment:
- INTEGRATION=${INTEGRATION:-false}
- SECURE_INTEGRATION=${SECURE_INTEGRATION:-false}
- ELASTIC_STACK_VERSION=$ELASTIC_STACK_VERSION
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewer: without this the ENV['ELASTIC_STACK_VERSION'] in Ruby code sees an empty String


def self.es_version_satisfies?(*requirement)
es_version = RSpec.configuration.filter[:es_version] || ENV['ES_VERSION'] || ENV['ELASTIC_STACK_VERSION']
es_version = nilify(RSpec.configuration.filter[:es_version]) || nilify(ENV['ES_VERSION']) || nilify(ENV['ELASTIC_STACK_VERSION'])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewer: if the single part of the concatenated || operator is an empty string then the result is that empty string. So if in the ENV there is a ES_VERSION but it's empty and the same for the first particle then the es_version assume the "" instead of the version of ELASTIC_STACK_VERSION

@andsel andsel marked this pull request as ready for review September 13, 2021 14:36
Copy link
Member

@robbavey robbavey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@andsel andsel merged commit 7f1099e into logstash-plugins:master Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants