Skip to content

Commit

Permalink
move LicenseInfoOwned to types module (#2430)
Browse files Browse the repository at this point in the history
* move LicenseInfoOwned to types module

* ha

* aa
  • Loading branch information
aviramha authored May 6, 2024
1 parent d8f34fd commit c2b5069
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
1 change: 1 addition & 0 deletions changelog.d/+change-type-hierarchy.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Move LicenseInfoOwned to another module
3 changes: 2 additions & 1 deletion mirrord/cli/src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
13 changes: 1 addition & 12 deletions mirrord/operator/src/crd.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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<String>,
/// Subscription id encoded in the operator license extension.
pub subscription_id: Option<String>,
}

#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, JsonSchema)]
pub enum OperatorFeatures {
ProxyApi,
Expand Down
5 changes: 4 additions & 1 deletion mirrord/operator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
14 changes: 14 additions & 0 deletions mirrord/operator/src/types.rs
Original file line number Diff line number Diff line change
@@ -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<String>,
/// Subscription id encoded in the operator license extension.
pub subscription_id: Option<String>,
}

0 comments on commit c2b5069

Please sign in to comment.