Skip to content

Pass FEATURE_FLAG as Docker environment variable#11922

Merged
andsel merged 1 commit intoelastic:masterfrom
andsel:fix/pass_feature_flag_to_docker
Jun 4, 2020
Merged

Pass FEATURE_FLAG as Docker environment variable#11922
andsel merged 1 commit intoelastic:masterfrom
andsel:fix/pass_feature_flag_to_docker

Conversation

@andsel
Copy link
Copy Markdown
Contributor

@andsel andsel commented May 25, 2020

Some QA tests reads the FEATURE_FLAG environment variable, for example to test PQ functionality.
This PR passthrough the environement variable inside the Docker instance.

To run it locally use:

bash> FEATURE_FLAG=persistent_queues ci/docker_integration_tests.sh specs/monitoring_api_spec.rb

@andsel
Copy link
Copy Markdown
Contributor Author

andsel commented May 25, 2020

This PR makes the build fail,it should be merged on master after the fix to the document exposed by HTTP API

Comment on lines +2 to +4
if [ -n "${FEATURE_FLAG}" ]; then
export DOCKER_ENV_OPTS="${DOCKER_ENV_OPTS} --env FEATURE_FLAG=${FEATURE_FLAG}"
fi
Copy link
Copy Markdown
Member

@jsvd jsvd May 25, 2020

Choose a reason for hiding this comment

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

This should be enough, naming only the env var will use its value by default, and we don't need to check if it's set. If it's not then the container wont have it as well

Suggested change
if [ -n "${FEATURE_FLAG}" ]; then
export DOCKER_ENV_OPTS="${DOCKER_ENV_OPTS} --env FEATURE_FLAG=${FEATURE_FLAG}"
fi
# we may pass "persistent_queues" to FEATURE_FLAG to enable PQ in the integration tests
export DOCKER_ENV_OPTS="${DOCKER_ENV_OPTS} -e FEATURE_FLAG"

@andsel andsel force-pushed the fix/pass_feature_flag_to_docker branch from b9beda5 to 6b8fce9 Compare May 26, 2020 07:11
@andsel andsel requested a review from jsvd May 26, 2020 07:12
Copy link
Copy Markdown
Member

@jsvd jsvd 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
Copy link
Copy Markdown
Contributor Author

andsel commented Jun 3, 2020

The fail is due to the changes of the structure of the monitoring doc happened with #10576 and discussed in issue #10120 . PR #11923 is a solution for this. This PR can't be merged untill #11923 is on master, else we broke the tests on master

Some QA tests reads the FEATURE_FLAG environment variable, for example to test PQ functionality.
This PR passthrough the environement variable inside the Docker instance.
@andsel andsel force-pushed the fix/pass_feature_flag_to_docker branch from 6b8fce9 to 65b76cd Compare June 4, 2020 13:23
@andsel andsel merged commit 48eaec7 into elastic:master Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants