Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: user data tracing flag #517

Merged
merged 4 commits into from
Dec 24, 2022
Merged

fix: user data tracing flag #517

merged 4 commits into from
Dec 24, 2022

Conversation

ravenolf
Copy link
Contributor

Description

This commit fixes the tracing flag for bash in the user data.

Currently if you set the enable_runner_user_data_trace_log flag to false expecting to disable the tracing in bash it will actually trace the user data script.

The reason is that the flag will be translated to user_data_trace_log == false. Once the condition is evaluated in the script you get if [[ $(echo ${user_data_trace_log}) == false ]] -> false == false which is true and ends up enabling set -x.

This small change should fix it.

Migrations required

NO

Verification

Tested by running the script locally and setting the value in the current version to true and saw the opposite result

@kayman-mk
Copy link
Collaborator

Sounds reasonable to me.

@kayman-mk
Copy link
Collaborator

@ravenolf I think it would be good to mention this change in the Migrations required section. As the guys using this flag have to invert it in order to get the same results.

Copy link
Collaborator

@npalm npalm left a comment

Choose a reason for hiding this comment

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

@ravenolf thx, looks good. Would suggest also tw swap the default value https://github.com/npalm/terraform-aws-gitlab-runner/blob/d3912b0666d2fb0eb97bd53c66702153543261d4/variables.tf#L616 to true, so the behavior remains the same

@npalm npalm requested a review from kayman-mk as a code owner December 11, 2022 15:22
kayman-mk
kayman-mk previously approved these changes Dec 12, 2022
Copy link
Collaborator

@kayman-mk kayman-mk left a comment

Choose a reason for hiding this comment

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

Added the change @npalm requested.

@kayman-mk kayman-mk changed the base branch from develop to main December 12, 2022 19:16
@kayman-mk kayman-mk dismissed their stale review December 12, 2022 19:16

The base branch was changed.

@npalm npalm changed the title fix: fix user data tracing flag fix: user data tracing flag Dec 12, 2022
@kayman-mk
Copy link
Collaborator

#604 fixes the TF Docs problem. Can be ignored.

@kayman-mk kayman-mk merged commit 61c7805 into cattle-ops:main Dec 24, 2022
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