-
Notifications
You must be signed in to change notification settings - Fork 1.3k
policysession: dynamic source policy support #6276
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
Conversation
8c20682 to
375cc87
Compare
|
What use-cases were you look at for this? |
Yes, that is one of the cases. |
15a9abd to
c0565f7
Compare
|
Bringing this out of draft. I think we could mark this experimental for the next release while we test this out with more use cases. |
Add support for dynamic source policies via client session. Client session can allow or deny specific source or ask additional metadata information via sourcemetaresolver if that is needed to make the decision. Signed-off-by: Tonis Tiigi <[email protected]>
c0565f7 to
931fcb6
Compare
| max := 0 | ||
| for { | ||
| max++ | ||
| if max > 10 { // TODO: better loop detection | ||
| return false, errors.Errorf("too many policy requests") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is to avoid badly written policies that could hang builds? I wonder if we could show policy evaluation during image resolution in build logs to make it obvious?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resolve request does go to the build logs. Yes, this can be improved with better detection if things have changed. E.g., when the client sends requests for the same op they already received, then we can just error out right away instead of waiting for a fixed limit.
Signed-off-by: Tonis Tiigi <[email protected]>
Signed-off-by: Tonis Tiigi <[email protected]>
931fcb6 to
bab17af
Compare
Add support for dynamic source policies via client session.
Client session can allow or deny specific source or ask additional metadata information via sourcemetaresolver if that is needed to make the decision.
Still lots of things to complete. Opening draft for early feedback. cc @cpuguy83