Skip to content

fix(docker): support valid YAML variations in standalone mode#12949

Merged
Baoyuantop merged 10 commits intoapache:masterfrom
janiussyafiq:fix/standalone-config-check-12427
Feb 4, 2026
Merged

fix(docker): support valid YAML variations in standalone mode#12949
Baoyuantop merged 10 commits intoapache:masterfrom
janiussyafiq:fix/standalone-config-check-12427

Conversation

@janiussyafiq
Copy link
Contributor

Description

This PR fixes a bug in the Docker standalone configuration check script (check_standalone_config.sh) where valid YAML configurations would fail validation due to rigid pattern matching. and the case where APISIX_PROFILE does not respected. This PR also included necessary test cases.

Which issue(s) this PR fixes:

Fixes #12427

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jan 29, 2026
@janiussyafiq janiussyafiq changed the title fix(docker): support valid YAML variations in standalone mode (#12427) fix(docker): support valid YAML variations in standalone mode Jan 29, 2026
if ! grep -q 'config_provider: yaml' "${PREFIX}/conf/config.yaml"; then
echo "Error: ${PREFIX}/conf/config.yaml does not contain 'config_provider: yaml'. Config provider must be set to 'yaml' for standalone mode."
if ! grep -E -q '["'\'']?config_provider["'\'']?:\s*["'\'']?yaml["'\'']?' "$CONF_FILE"; then
echo "Error: $CONF_FILE does not contain 'config_provider: yaml'. Config provider must be set to 'yaml' for standalone mode."
Copy link
Contributor

Choose a reason for hiding this comment

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

please add tests that cover the changes you made in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

could you provide more context on what tests are needed since i've written a few? do you mean the $CONF_FILE returning the correct file name?

Copy link
Member

@nic-6443 nic-6443 left a comment

Choose a reason for hiding this comment

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

@janiussyafiq The toolchain used for releasing apisix docker image is in the https://github.com/apache/apisix-docker repository. Therefore, after you complete this fix, you also need to adjust https://github.com/apache/apisix-docker/blob/9b3c3d367ab5c73f95e27ee37e82d25b79dd846b/debian/Dockerfile#L67 too.

@janiussyafiq janiussyafiq marked this pull request as draft February 1, 2026 17:24
@janiussyafiq janiussyafiq marked this pull request as ready for review February 3, 2026 06:34
Copy link
Contributor

Choose a reason for hiding this comment

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

Image

you have changed the mode of this file, why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

might've changed it when i did local testing, will revert it back

DOCKER_IMAGE="${DOCKER_IMAGE:-apache/apisix:master-debian-dev}"
trap standalone EXIT

make build-on-debian-dev
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to significantly increase the duration of the CI. We can take one of the following actions to avoid this:

  • use prebuilt image (image built from previous push) instead of building image while running the test.
  • run this test only on master branch
    • but this will require further more changes (e.g: a separate GitHub actions workflow)
    • and we won't be able to detect regressions before commit
  • run this test on a different GitHub actions workflow and only run them if any of the files related to this feature (ops.lua, docker-entrypoint.sh, etc) change.

Copy link
Contributor

Choose a reason for hiding this comment

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

3rd option sounds good to me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

opt 1: won't work, i've discussed with @nic-6443, since the older image still rely on the script that is decided to be removed check_standalone_config.sh, so test will fail
as for opt 2 and 3, can try those solution, i'm more leaning towards opt 3 wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will try implementing 3rd option thanks!

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Feb 3, 2026
@janiussyafiq janiussyafiq requested a review from nic-6443 February 4, 2026 04:49
@Baoyuantop Baoyuantop merged commit 31148aa into apache:master Feb 4, 2026
20 checks passed
@janiussyafiq janiussyafiq deleted the fix/standalone-config-check-12427 branch February 4, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: docker image standalone check fails on valid config files

4 participants

Comments