mirror of
https://github.com/morten-olsen/homelab-operator.git
synced 2026-02-08 01:36:28 +01:00
updates
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const GROUP = 'homelab.mortenolsen.pro';
|
||||
const NAMESPACE = 'homelab';
|
||||
|
||||
export { GROUP };
|
||||
export { GROUP, NAMESPACE };
|
||||
|
||||
13
src/utils/naming.ts
Normal file
13
src/utils/naming.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
const getWithNamespace = (input: string) => {
|
||||
const result = input.split('/');
|
||||
const first = result.pop();
|
||||
if (!first) {
|
||||
throw new Error(`${input} could not be parsed as a namespace`);
|
||||
}
|
||||
return {
|
||||
name: first,
|
||||
namespace: result.join('/'),
|
||||
};
|
||||
};
|
||||
|
||||
export { getWithNamespace };
|
||||
Reference in New Issue
Block a user