Skip to content

Commit

Permalink
fix(shulker-operator): network admins are optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylvln committed Nov 2, 2023
1 parent 471960c commit 020a1d0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/shulker-crds/src/v1alpha1/minecraft_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ pub struct MinecraftClusterSpec {
/// List of player UUIDs that are automatically promoted as
/// network administrators, which are granted all the permissions
/// by default on all the proxies and servers
#[serde(skip_serializing_if = "Vec::is_empty")]
pub network_admins: Vec<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub network_admins: Option<Vec<String>>,

/// Redis configuration to use as a synchronization backend
/// for the different Shulker components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ lazy_static! {
..ObjectMeta::default()
},
spec: MinecraftClusterSpec {
network_admins: Vec::new(),
network_admins: None,
redis: None
},
status: None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,14 @@ impl GameServerBuilder {
},
EnvVar {
name: "SHULKER_NETWORK_ADMINS".to_string(),
value: Some(cluster.spec.network_admins.join(",")),
value: Some(
cluster
.spec
.network_admins
.as_ref()
.map(|list| list.join(","))
.unwrap_or("".to_string()),
),
..EnvVar::default()
},
EnvVar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,14 @@ impl FleetBuilder {
},
EnvVar {
name: "SHULKER_NETWORK_ADMINS".to_string(),
value: Some(cluster.spec.network_admins.join(",")),
value: Some(
cluster
.spec
.network_admins
.as_ref()
.map(|list| list.join(","))
.unwrap_or("".to_string()),
),
..EnvVar::default()
},
EnvVar {
Expand Down

0 comments on commit 020a1d0

Please sign in to comment.