Skip to content
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

Added common traits to discovery structs. #103

Merged
merged 3 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- Added PartialEq trait to `OpaReference` ([#103]).

### Changed

- Renamed crd/util to crd::discovery and added deprecated reexport for backwards compatibility ([#103]).

[#103]: https://github.com/stackabletech/opa-operator/pull/103

## [0.4.0] - 2021-09-21


Expand Down
120 changes: 70 additions & 50 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rust/crd/src/util.rs → rust/crd/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub enum TicketReferences {
/// This has the benefit of keeping references to OPA consistent
/// throughout the entire stack.
// TODO: move to operator-rs as NamespaceName
#[derive(Clone, Debug, Default, Deserialize, JsonSchema, Serialize)]
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
pub struct OpaReference {
pub namespace: String,
pub name: String,
Expand Down Expand Up @@ -192,7 +192,7 @@ pub async fn get_opa_connection_info(
/// # Examples
///
/// ```
/// use stackable_opa_crd::util::clean_url;
/// use stackable_opa_crd::discovery::clean_url;
/// assert_eq!(clean_url("//a/b//c".to_string()), "/a/b/c".to_string());
/// assert_eq!(clean_url("//a/b//c"), "/a/b/c".to_string());
/// assert_eq!(clean_url("https:///a/b//c"), "https:///a/b/c".to_string());
Expand Down
5 changes: 4 additions & 1 deletion rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
pub mod discovery;
pub mod error;
pub mod util;

#[deprecated(note = "The util module has been renamed to discovery, please use this instead.")]
pub use discovery as util;

use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
use kube::CustomResource;
Expand Down
2 changes: 1 addition & 1 deletion rust/operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/stackabletech/opa-operator"
version = "0.4.1-nightly"

[dependencies]
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.1.0" }
product-config = { git = "https://github.com/stackabletech/product-config.git", branch = "main" }
stackable-opa-crd = { path = "../crd" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", branch = "main" }

Expand Down