1
0
mirror of https://github.com/moby/buildkit.git synced 2025-11-27 04:01:46 +03:00
Commit Graph

9 Commits

Author SHA1 Message Date
Brian Goff
c40f30e45b sourcepolicy: fix policy so last rule wins
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-12-13 13:02:15 -08:00
Brian Goff
6d061b9a3a sourcepolicy: Change field names and collapse type
Updates the field names for source policies to be a little less
confusing: `Source` -> `Selector`, `Destination` -> `Updates`.

Also collapse `Type` into the `Identifier` which matches how the rest of
buildkit works and greatly simplifies matching.. and generally makes it
so the policy engine doesn't need to care about schemes.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-12-13 13:02:15 -08:00
Brian Goff
b6db53addf sourcepolicy: remove evalState
This makes it so a deny is always a deny regardless of if it was allowed
in a prior rule.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-12-13 13:02:14 -08:00
Brian Goff
3e93b541fd sourcepolicy: Do not pass state between policies
Per our discussion on github, each policy should be evaluated on it's
own.
ie. an "allow" in one policy should be able to change to a "deny" in
another policy.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-12-13 13:02:14 -08:00
Brian Goff
c7a54c7453 sourcepolicy: cleanup uneccessary interfaces
These were just there while figuring out how things would work and are
not needed now.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-12-13 13:02:14 -08:00
Brian Goff
7a08c9dbdf sourcepolicy: Add support for frontend policies
Allows frontends to pass in a list of policies in the solve request.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-12-13 13:02:12 -08:00
Brian Goff
6e89b21e21 sourcepolicy: split dest type from identifier
This makes destination more symetrical with sources.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-12-13 13:01:54 -08:00
Brian Goff
51ad0c7d7f sourcepolicy: add wildcard match type
This defines a better type for wildcard matching as well as a more
appropritate package (contributed by Akihiro) for doing wildcard
matching.

Also some improvements to caching state such as compiled regexes.

Co-authored-by: Akihiro Suda <suda.kyoto@gmail.com>
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-12-13 13:01:54 -08:00
Brian Goff
7526659ab0 Update source pinning to use proposed policy
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2022-12-13 13:01:54 -08:00