-
-
Notifications
You must be signed in to change notification settings - Fork 15
[Merged by Bors] - Added OpaConfig struct #357
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
src/opa.rs
Outdated
/// | ||
/// # Arguments | ||
/// * `resource` - The cluster resource. | ||
pub fn package_url<T>(&self, resource: &T) -> String |
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.
Personally I'm not a big fan of this: having a (potentially) complex resource as a dependency (parameter) just to read one field from it is usually an anti pattern. Maybe we can introduce a ClusterName
type or something like that.
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.
Its just something of type ResourceExt
for the name() and namespace() methods. It defines the behavior as in the doc that we default to the resource name. That would not be true if we have a parameter cluster_name
.
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.
yep, T
is ResourceExt
, I'd be fine with this
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.
Ah, I missed that. Well then ...
looks good to me; tests work, docs are nice etc. But I'll let razvan get back to this |
Also we need to wait for github actions to work again 😄 |
merged package_url and rule_url methods to document_url.
bors merge |
## Description closes #356 Co-authored-by: Malte Sander <malte.sander.it@gmail.com>
Pull request successfully merged into main. Build succeeded: |
Description
closes #356
Review Checklist
Once the review is done, comment
bors r+
(orbors merge
) to merge. Further information