-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(dash): update minio tenant crd
- Loading branch information
Showing
6 changed files
with
171 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
use kube::CustomResource; | ||
use schemars::JsonSchema; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema, CustomResource)] | ||
#[kube( | ||
group = "dash.ulagbulag.io", | ||
version = "v1alpha1", | ||
kind = "ModelUser", | ||
root = "ModelUserCrd", | ||
shortname = "mu", | ||
namespaced, | ||
printcolumn = r#"{ | ||
"name": "created-at", | ||
"type": "date", | ||
"description": "created time", | ||
"jsonPath": ".metadata.creationTimestamp" | ||
}"#, | ||
printcolumn = r#"{ | ||
"name": "version", | ||
"type": "integer", | ||
"description": "model user version", | ||
"jsonPath": ".metadata.generation" | ||
}"# | ||
)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ModelUserSpec { | ||
#[serde(default)] | ||
pub access_token: Option<ModelUserAccessTokenSpec>, | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)] | ||
#[serde(rename_all = "camelCase")] | ||
pub enum ModelUserAccessTokenSpec { | ||
SecretRef(ModelUserAccessTokenSecretRefSpec), | ||
} | ||
|
||
impl Default for ModelUserAccessTokenSpec { | ||
fn default() -> Self { | ||
Self::SecretRef(ModelUserAccessTokenSecretRefSpec::default()) | ||
} | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ModelUserAccessTokenSecretRefSpec { | ||
#[serde(default = "ModelUserAccessTokenSecretRefSpec::default_map_access_key")] | ||
pub map_access_key: String, | ||
#[serde(default = "ModelUserAccessTokenSecretRefSpec::default_map_secret_key")] | ||
pub map_secret_key: String, | ||
|
||
#[serde(default = "ModelUserAccessTokenSecretRefSpec::default_name")] | ||
pub name: String, | ||
} | ||
|
||
impl Default for ModelUserAccessTokenSecretRefSpec { | ||
fn default() -> Self { | ||
Self { | ||
map_access_key: Self::default_map_access_key(), | ||
map_secret_key: Self::default_map_secret_key(), | ||
name: Self::default_name(), | ||
} | ||
} | ||
} | ||
|
||
impl ModelUserAccessTokenSecretRefSpec { | ||
fn default_map_access_key() -> String { | ||
"CONSOLE_ACCESS_KEY".into() | ||
} | ||
|
||
fn default_map_secret_key() -> String { | ||
"CONSOLE_SECRET_KEY".into() | ||
} | ||
|
||
fn default_name() -> String { | ||
"object-storage-user-0".into() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters