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

import should not fail when snippet has already been imported #6539

Open
polarathene opened this issue Aug 23, 2024 · 0 comments
Open

import should not fail when snippet has already been imported #6539

polarathene opened this issue Aug 23, 2024 · 0 comments

Comments

@polarathene
Copy link

Raising an issue from this community discussion.

The problem config used import several times where the same snippet was imported and caused a conflict error. However while the snippet name was the source of conflict, the contents of the snippet was identical (same import source too), thus it's not really a conflict.

This would also occur without import (which I understand is effectively equivalent to copy/paste), by declaring the same snippet twice in a single Caddyfile.

Solution proposed was for such an error to compare the two snippets via a content hash. If they're the exact same snippet then instead of an error, the subsequent imports could be ignored (or if the error happens at a later stage of validation, deduped).

Workaround suggested was to avoid the named snippet syntax and just use import on individual files without the snippet syntax wrapping it.

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

No branches or pull requests

1 participant