fix: allow wildcard maintenance
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@dmgnr/kuber",
|
||||
"version": "2.4.1",
|
||||
"version": "2.4.2",
|
||||
"description": "Docker Compose to Kubernetes translation layer",
|
||||
"bin": {
|
||||
"kuber": "dist/index.js"
|
||||
|
||||
@@ -31,11 +31,12 @@ export interface MaintenanceLeaseProvider {
|
||||
export function normalizeMaintenanceHost(value: unknown): string {
|
||||
if (typeof value !== "string") throw new Error("host is required");
|
||||
const host = value.trim().toLowerCase().replace(/\.$/, "");
|
||||
console.log(host)
|
||||
if (
|
||||
host.length === 0 ||
|
||||
host.length > 253 ||
|
||||
!host.includes(".") ||
|
||||
!/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/.test(host)
|
||||
!/^(?:\*\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/.test(host)
|
||||
)
|
||||
throw new Error("host must be a DNS hostname");
|
||||
return host;
|
||||
|
||||
Reference in New Issue
Block a user