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

[Task] Manage the from in the copy string syntax #344

Open
taorepoara opened this issue Jan 22, 2025 · 0 comments
Open

[Task] Manage the from in the copy string syntax #344

taorepoara opened this issue Jan 22, 2025 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@taorepoara
Copy link
Member

What should be done

The copy manage a simplified string syntax, but it does not manage the from fields.

Add the possibility to define the origin of the copy in string syntax.

Technical recommandation

Current syntax:
(path )+target

Desired syntax:
((builder|image)?@context-name )?(path )+target

This would let define the next values:

  • file.txt target/: copies file.txt into the target/ directory
  • @my-context file.txt target/ copies file.txt from the context my-context (equivalent to fromContext) into the target/ directory
  • builder@builder file.txt target/ copies file.txt from the builder my-builder (equivalent to fromBuilder) into the target/ directory
  • image@my-image:tag file.txt target/ copies file.txt from the image my-image:tag (equivalent to fromImage) into the target/ directory

Ecological concerns

Since the context separator is the space, just like the files one, first split and then check the context regex on the first element, only if there is at least 3 elements.
This would avoid checking the regex when not needed and check it on a smaller string.

Let the image parsing from string by the image struct.

Is this task linked with any other ?

@taorepoara taorepoara added enhancement New feature or request good first issue Good for newcomers labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant