From 96ffcaa47e23c5c89a1aa4bf3ed5e5ab4009db38 Mon Sep 17 00:00:00 2001 From: = Date: Sun, 21 Sep 2025 17:48:50 +0530 Subject: [PATCH 1/2] fix: increased service name size to 1000 --- .../20250921120821_k8-auth-name-increase.ts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 backend/src/db/migrations/20250921120821_k8-auth-name-increase.ts diff --git a/backend/src/db/migrations/20250921120821_k8-auth-name-increase.ts b/backend/src/db/migrations/20250921120821_k8-auth-name-increase.ts new file mode 100644 index 000000000..3555231a7 --- /dev/null +++ b/backend/src/db/migrations/20250921120821_k8-auth-name-increase.ts @@ -0,0 +1,30 @@ +import { Knex } from "knex"; +import { TableName } from "../schemas"; + +export async function up(knex: Knex): Promise { + const hasAllowedNamespaces = await knex.schema.hasColumn(TableName.IdentityKubernetesAuth, "allowedNamespaces"); + const hasAllowedNames = await knex.schema.hasColumn(TableName.IdentityKubernetesAuth, "allowedNames"); + const hasAllowedAudience = await knex.schema.hasColumn(TableName.IdentityKubernetesAuth, "allowedAudience"); + + if (hasAllowedNamespaces || hasAllowedNames || hasAllowedAudience) { + await knex.schema.alterTable(TableName.IdentityKubernetesAuth, (t) => { + if (hasAllowedNames) t.string("allowedNames", 1000).alter(); + if (hasAllowedNamespaces) t.string("allowedNamespaces", 1000).alter(); + if (hasAllowedAudience) t.string("allowedAudience", 1000).alter(); + }); + } +} + +export async function down(knex: Knex): Promise { + const hasAllowedNamespaces = await knex.schema.hasColumn(TableName.IdentityKubernetesAuth, "allowedNamespaces"); + const hasAllowedNames = await knex.schema.hasColumn(TableName.IdentityKubernetesAuth, "allowedNames"); + const hasAllowedAudience = await knex.schema.hasColumn(TableName.IdentityKubernetesAuth, "allowedAudience"); + + if (hasAllowedNamespaces || hasAllowedNames || hasAllowedAudience) { + await knex.schema.alterTable(TableName.IdentityKubernetesAuth, (t) => { + if (hasAllowedNames) t.string("allowedNames", 255).alter(); + if (hasAllowedNamespaces) t.string("allowedNamespaces", 255).alter(); + if (hasAllowedAudience) t.string("allowedAudience", 255).alter(); + }); + } +} From 31bc54e7e6c8baa9315b9f2fd0a787fe61039565 Mon Sep 17 00:00:00 2001 From: = Date: Sun, 21 Sep 2025 17:57:43 +0530 Subject: [PATCH 2/2] fix: resolved pipeline failing --- .../20250921120821_k8-auth-name-increase.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/src/db/migrations/20250921120821_k8-auth-name-increase.ts b/backend/src/db/migrations/20250921120821_k8-auth-name-increase.ts index 3555231a7..9cd8a8d4f 100644 --- a/backend/src/db/migrations/20250921120821_k8-auth-name-increase.ts +++ b/backend/src/db/migrations/20250921120821_k8-auth-name-increase.ts @@ -1,4 +1,5 @@ import { Knex } from "knex"; + import { TableName } from "../schemas"; export async function up(knex: Knex): Promise { @@ -8,9 +9,9 @@ export async function up(knex: Knex): Promise { if (hasAllowedNamespaces || hasAllowedNames || hasAllowedAudience) { await knex.schema.alterTable(TableName.IdentityKubernetesAuth, (t) => { - if (hasAllowedNames) t.string("allowedNames", 1000).alter(); - if (hasAllowedNamespaces) t.string("allowedNamespaces", 1000).alter(); - if (hasAllowedAudience) t.string("allowedAudience", 1000).alter(); + if (hasAllowedNames) t.string("allowedNames", 1000).notNullable().alter(); + if (hasAllowedNamespaces) t.string("allowedNamespaces", 1000).notNullable().alter(); + if (hasAllowedAudience) t.string("allowedAudience", 1000).notNullable().alter(); }); } } @@ -22,9 +23,9 @@ export async function down(knex: Knex): Promise { if (hasAllowedNamespaces || hasAllowedNames || hasAllowedAudience) { await knex.schema.alterTable(TableName.IdentityKubernetesAuth, (t) => { - if (hasAllowedNames) t.string("allowedNames", 255).alter(); - if (hasAllowedNamespaces) t.string("allowedNamespaces", 255).alter(); - if (hasAllowedAudience) t.string("allowedAudience", 255).alter(); + if (hasAllowedNames) t.string("allowedNames", 255).notNullable().alter(); + if (hasAllowedNamespaces) t.string("allowedNamespaces", 255).notNullable().alter(); + if (hasAllowedAudience) t.string("allowedAudience", 255).notNullable().alter(); }); } }