-
Notifications
You must be signed in to change notification settings - Fork 395
Add signature.DefaultPolicy() #49
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
|
(I have also considered using At the moment, a simple explicit override for that one path is easier to use; we may consider the |
signature/policy_config.go
Outdated
| if err != nil { | ||
| policy = &Policy{Default: PolicyRequirements{NewPRReject()}} | ||
| } | ||
| return policy, err |
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.
return policy, nil? (or am I missing something?)
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.
alright, got it but it's pretty confusing.
User of this function at https://github.com/projectatomic/skopeo/pull/157/files#diff-c6c318da062a6b9637745a480d10434eR88 bail out on error so why setting in line 56 a default policy if we're stil going to return the error here?
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'm not saying it's wrong, perhaps could be rewritten to be more obvious?
|
just nitpicking after reviewing related PRs |
This is the API most applications should use to get the policy for the current host. Also adds a types.SystemContext per discussions in containers#41 and elsewhere, to make the functions testable and usable in special situations like chroots. (Though, signature.DefaultPolicy() with an override is not that different from signature.NewPolicyFromFile().) Signed-off-by: Miloslav Trmač <[email protected]>
|
Updated to move the compiled-in path to |
|
LGTM |
This is the API most applications should use to get the policy for the current host.
Also adds a
types.SystemContextper discussions in #41 and elsewhere, to make the functions testable and usable in special situations like chroots.(Though,
signature.DefaultPolicy()with an override is not that different fromsignature.NewPolicyFromFile().)