Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: remove validating label key (#8656)

boojack2840a288ccc4
diff --git a/frontend/src/components/Label/LabelListEditor.vue b/frontend/src/components/Label/LabelListEditor.vue
index 8dabb3a088..afada4005a 100644
--- a/frontend/src/components/Label/LabelListEditor.vue
+++ b/frontend/src/components/Label/LabelListEditor.vue
@@ -33,11 +33,7 @@ import { cloneDeep } from "lodash-es";
import { NButton } from "naive-ui";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
-import {
- validateLabelKey,
- MAX_LABEL_VALUE_LENGTH,
- isVirtualLabelKey,
-} from "@/utils";
+import { MAX_LABEL_VALUE_LENGTH, isVirtualLabelKey } from "@/utils";
import LabelEditorRow from "./LabelEditorRow.vue";
export type KV = { key: string; value: string };
@@ -71,9 +67,6 @@ const errorList = computed(() => {
if (isVirtualLabelKey(key)) {
errors.key.push(t("label.error.x-is-reserved-key", { key }));
}
- if (!validateLabelKey(key)) {
- errors.key.push(t("label.error.key-format"));
- }
if (kvList.filter((kv) => kv.key === key).length > 1) {
errors.key.push(t("label.error.key-duplicated"));
}
diff --git a/frontend/src/utils/label.ts b/frontend/src/utils/label.ts
index 3c0b426598..92b7d17e89 100644
--- a/frontend/src/utils/label.ts
+++ b/frontend/src/utils/label.ts
@@ -5,16 +5,6 @@ import { extractEnvironmentResourceName } from "./v1";
export const MAX_LABEL_VALUE_LENGTH = 63;
-export const validateLabelKey = (key: string) => {
- if (key.length === 0) return false;
- if (key.length >= 64) return false;
- return (
- key.match(/^[a-z0-9A-Z]/) &&
- key.match(/[a-z0-9A-Z]$/) &&
- key.match(/[a-z0-9A-Z-_.]*/)
- );
-};
-
export const convertLabelsToKVList = (
labels: Record<string, string>,
sort = true