Skip to content

Only ignore parsing errors when used with no-interpolate#613

Merged
ndeloof merged 1 commit intocompose-spec:mainfrom
ndeloof:ignoreParseError
Apr 5, 2024
Merged

Only ignore parsing errors when used with no-interpolate#613
ndeloof merged 1 commit intocompose-spec:mainfrom
ndeloof:ignoreParseError

Conversation

@ndeloof
Copy link
Copy Markdown
Collaborator

@ndeloof ndeloof commented Apr 2, 2024

Parsing error must be ignored when interpolation is disabled so we don't try to parse ${PORT} as an IP address or port number, but when interpolation is enabled (loading into Project) we must not ignore errors, otherwise the final error is a very generic one

closes docker/compose#11676

@ndeloof ndeloof force-pushed the ignoreParseError branch 2 times, most recently from 8f490e8 to 14de3f2 Compare April 2, 2024 10:05
@ndeloof ndeloof requested review from glours, jhrotko and milas April 2, 2024 13:44
Copy link
Copy Markdown
Collaborator

@glours glours left a comment

Choose a reason for hiding this comment

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

LGTM

tests := []struct {
name string
yaml any
want any
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not add ignoreParseError bool here and a test to check we don't generate error when set to true?

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof force-pushed the ignoreParseError branch from 14de3f2 to 5fcb219 Compare April 3, 2024 09:26
@ndeloof ndeloof merged commit facef9f into compose-spec:main Apr 5, 2024
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.

[BUG] Error when binding port with host IP

2 participants