Better support for overriding docker reg + tag (for local testing); init container for ensure-system-disk

This commit is contained in:
2025-04-22 09:21:17 -04:00
parent 8a526de004
commit 1fa2fd3d95
4 changed files with 19 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ pub async fn ensure_system_disk(svc: &Services<'_>) -> Result<(), P5xError> {
// Load the dynamic-kv
let client = Client::try_default().await.map_err(P5xError::KubeError)?;
let namespace = fs::read_to_string("/var/run/secrets/kubernetes.io/serviceaccount/namespace")
.or_else(|_| env::var("P5X_OVERRIDE_NS"))
.unwrap_or_else(|_| "p5x-system".to_string());
let maps: Api<ConfigMap> = Api::namespaced(client.clone(), &namespace);