diff --git a/changelog.d/+change-type-hierarchy.internal.md b/changelog.d/+change-type-hierarchy.internal.md new file mode 100644 index 00000000000..3252da90587 --- /dev/null +++ b/changelog.d/+change-type-hierarchy.internal.md @@ -0,0 +1 @@ +Move LicenseInfoOwned to another module \ No newline at end of file diff --git a/mirrord/cli/src/operator.rs b/mirrord/cli/src/operator.rs index 7c59314efe8..4103c8cf425 100644 --- a/mirrord/cli/src/operator.rs +++ b/mirrord/cli/src/operator.rs @@ -9,8 +9,9 @@ use mirrord_config::{ use mirrord_kube::api::kubernetes::create_kube_api; use mirrord_operator::{ client::{OperatorApiError, OperatorOperation}, - crd::{LicenseInfoOwned, MirrordOperatorCrd, MirrordOperatorSpec, OPERATOR_STATUS_NAME}, + crd::{MirrordOperatorCrd, MirrordOperatorSpec, OPERATOR_STATUS_NAME}, setup::{LicenseType, Operator, OperatorNamespace, OperatorSetup, SetupOptions}, + types::LicenseInfoOwned, }; use mirrord_progress::{Progress, ProgressTracker}; use prettytable::{row, Table}; diff --git a/mirrord/operator/src/crd.rs b/mirrord/operator/src/crd.rs index d9e33a7e74f..6e731e15891 100644 --- a/mirrord/operator/src/crd.rs +++ b/mirrord/operator/src/crd.rs @@ -1,10 +1,10 @@ -use chrono::NaiveDate; use kube::CustomResource; use mirrord_config::target::{Target, TargetConfig}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use self::label_selector::LabelSelector; +use crate::types::LicenseInfoOwned; pub mod label_selector; @@ -140,17 +140,6 @@ pub struct Session { )] pub struct SessionSpec; -#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] -pub struct LicenseInfoOwned { - pub name: String, - pub organization: String, - pub expire_at: NaiveDate, - /// Fingerprint of the operator license. - pub fingerprint: Option, - /// Subscription id encoded in the operator license extension. - pub subscription_id: Option, -} - #[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, JsonSchema)] pub enum OperatorFeatures { ProxyApi, diff --git a/mirrord/operator/src/lib.rs b/mirrord/operator/src/lib.rs index 6fc06100aee..6029966697e 100644 --- a/mirrord/operator/src/lib.rs +++ b/mirrord/operator/src/lib.rs @@ -8,6 +8,9 @@ pub mod client; #[cfg(feature = "crd")] pub mod crd; -/// Operator Setup functinality +/// Operator Setup functionality #[cfg(feature = "setup")] pub mod setup; + +/// Types used in the operator that don't require any special dependencies +pub mod types; diff --git a/mirrord/operator/src/types.rs b/mirrord/operator/src/types.rs new file mode 100644 index 00000000000..c21c1ab8282 --- /dev/null +++ b/mirrord/operator/src/types.rs @@ -0,0 +1,14 @@ +use chrono::NaiveDate; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] +pub struct LicenseInfoOwned { + pub name: String, + pub organization: String, + pub expire_at: NaiveDate, + /// Fingerprint of the operator license. + pub fingerprint: Option, + /// Subscription id encoded in the operator license extension. + pub subscription_id: Option, +}