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

Enable users to be able to provide their own config.toml #1171

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

arewm
Copy link
Member

@arewm arewm commented Jul 17, 2024

This removes the default configuration (which also removes a default user and password from being injected into all images), instead deferring to the config.toml which is present in the source repository.

Before you complete this pull request ...

Look for any open pull requests in the repository with the title "e2e-tests update" and
see if there are recent e2e-tests updates that will be applicable to your change.

@arewm arewm requested review from ralphbean, scoheb and brianwcook July 17, 2024 15:32
@arewm arewm force-pushed the enable-config-toml-customization branch from 032df1a to 9a09a89 Compare July 17, 2024 15:41
@arewm arewm enabled auto-merge July 19, 2024 15:03
@arewm arewm force-pushed the enable-config-toml-customization branch from 34a6685 to 7025adb Compare July 19, 2024 15:23
@@ -148,6 +154,23 @@ spec:
echo "$BUILD_DIR"
ssh -v $SSH_ARGS "$SSH_HOST" mkdir -p "$BUILD_DIR/workspaces" "$BUILD_DIR/scripts" "$BUILD_DIR/tmp" "$BUILD_DIR/tekton-results" "$BUILD_DIR/entitlement"

if [! -n "${CONFIG_TOML_FILE}" ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if [! -n "${CONFIG_TOML_FILE}" ]
if [! -n "${CONFIG_TOML_FILE}" ]; then

Comment on lines 157 to 169
if [! -n "${CONFIG_TOML_FILE}" ]
echo "No CONFIG_TOML_FILE specified"
if [ -f /var/workdir/source/config.toml ]; then
echo "Using the config.toml file found in the repository root!"
echo " Remove the config.toml file or set params.CONFIG_TOML_FILE to an invalid path to prevent its use."
else
echo "No config.toml file found. Set params.CONFIG_TOML_FILE to use one in the repository."
export CONFIG_TOML_FILE=config.toml
fi
fi
# ensure that a config toml file is present in case one is not provided or the path is invalid
mkdir -p /var/workdir/source/$(dirname $CONFIG_TOML_FILE)
echo "Using the following config.toml file:"
cat /var/workdir/source/$CONFIG_TOML_FILE
Copy link
Contributor

Choose a reason for hiding this comment

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

Desired behavior:

config path not specified (defaults to config.toml) specified
exists config.toml used specified path used
does not exist empty conf used error

Current behavior:

config path not specified (defaults to config.toml) specified
exists config.toml used ✔️ specified path used ✔️
does not exist error ❗ error ✔️

Copy link
Contributor

@chmeliik chmeliik left a comment

Choose a reason for hiding this comment

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

LGTM apart from one bash error and some log output details

Would be nice to squash the commits into logical units (probably just one commit)

task/build-vm-image/0.1/build-vm-image.yaml Outdated Show resolved Hide resolved
task/build-vm-image/0.1/build-vm-image.yaml Outdated Show resolved Hide resolved
task/build-vm-image/0.1/build-vm-image.yaml Outdated Show resolved Hide resolved
@arewm arewm force-pushed the enable-config-toml-customization branch 2 times, most recently from 83745c2 to 5c30601 Compare July 22, 2024 15:13
This removes the default configuration (which also removes a default
user and password from being injected into all images), instead
deferring to the config.toml which is present in the source repository.

If an invalid config file is provided, the build will fail. Otherwise,
the task will use a config.toml file if it is present in the repository
root or it will create an empty config file to use.

Signed-off-by: arewm <[email protected]>
@arewm arewm force-pushed the enable-config-toml-customization branch from 5c30601 to c8f32df Compare July 22, 2024 15:21
@chmeliik
Copy link
Contributor

/retest

@arewm arewm added this pull request to the merge queue Jul 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 23, 2024
@arewm arewm added this pull request to the merge queue Jul 23, 2024
Merged via the queue into konflux-ci:main with commit e5ac710 Jul 23, 2024
7 checks passed
@MartinBasti
Copy link
Contributor

MartinBasti commented Jul 24, 2024

https://github.com/konflux-ci/build-definitions/pull/1165/checks?check_run_id=2785204219

I thinks that this PR causes that all PRs are failing on linter error ^, I don't know why this one passed the test though

IMO this is the faulty line and linter makes it as false positive report
https://github.com/arewm/build-definitions/blob/c8f32dff3fa102786d30175e10f66eaa9260f29a/task/build-vm-image/0.1/build-vm-image.yaml#L162

@arewm
Copy link
Member Author

arewm commented Jul 24, 2024

@chmeliik has a fix for that in #1189.

@arewm arewm deleted the enable-config-toml-customization branch July 24, 2024 12:06
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.

4 participants