fix: call EnsureNamespace on login to auto-create k8s namespace
doLogin() now calls POST /v1/namespaces/{ns}/ensure before apiListDevices().
Prevents namespace not found error when user logs in for the first time
with a new token (test mode or real JWT).
Image: v0.1.62
This commit is contained in:
@@ -604,6 +604,10 @@ async function doLogin() {
|
|||||||
S.token = tok;
|
S.token = tok;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// Создаём namespace если не существует — идемпотентный вызов.
|
||||||
|
// Terraform-провайдер делает это в Configure(), консоль — при первом логине.
|
||||||
|
// Без этого шага создание устройства упадёт с "namespace not found".
|
||||||
|
await apiCall('POST', `/v1/namespaces/${S.ns}/ensure`, {});
|
||||||
await apiListDevices(); // проверяем что токен валиден и API доступен
|
await apiListDevices(); // проверяем что токен валиден и API доступен
|
||||||
saveSettings();
|
saveSettings();
|
||||||
nav('devices');
|
nav('devices');
|
||||||
|
|||||||
Reference in New Issue
Block a user