Skip to content

[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

Closed
wants to merge 10 commits into from

Conversation

maltesander
Copy link
Member

@maltesander maltesander commented Mar 16, 2022

Description

closes #356

Review Checklist

  • Code contains useful comments
  • (Integration-)Test cases added (or not applicable)
  • Documentation added (or not applicable)
  • Changelog updated (or not applicable)
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Once the review is done, comment bors r+ (or bors merge) to merge. Further information

@maltesander maltesander requested a review from a team March 16, 2022 12:40
@maltesander maltesander self-assigned this Mar 16, 2022
src/opa.rs Outdated
///
/// # Arguments
/// * `resource` - The cluster resource.
pub fn package_url<T>(&self, resource: &T) -> String
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Member

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 ...

@maltesander maltesander marked this pull request as ready for review March 16, 2022 15:57
@fhennig
Copy link
Contributor

fhennig commented Mar 16, 2022

looks good to me; tests work, docs are nice etc.

But I'll let razvan get back to this

@fhennig
Copy link
Contributor

fhennig commented Mar 16, 2022

Also we need to wait for github actions to work again 😄

merged package_url and rule_url methods to document_url.
@maltesander
Copy link
Member Author

bors merge

bors bot pushed a commit that referenced this pull request Mar 18, 2022
## Description

closes #356



Co-authored-by: Malte Sander <malte.sander.it@gmail.com>
@bors
Copy link
Contributor

bors bot commented Mar 18, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Added OpaConfig struct [Merged by Bors] - Added OpaConfig struct Mar 18, 2022
@bors bors bot closed this Mar 18, 2022
@bors bors bot deleted the add_opa_config_struct branch March 18, 2022 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: OPA config fragment
4 participants