headscale: compare node tags as a set, not a sequence
This commit is contained in:
@@ -68,7 +68,8 @@ const parseTags = (text: string): string[] => {
|
|||||||
return [...new Set(parts.map((t) => (t.startsWith('tag:') ? t : `tag:${t}`)))];
|
return [...new Set(parts.map((t) => (t.startsWith('tag:') ? t : `tag:${t}`)))];
|
||||||
};
|
};
|
||||||
|
|
||||||
const sameTags = (a: string[], b: string[]) => a.length === b.length && a.every((t, i) => t === b[i]);
|
/** Set comparison, not sequence: Headscale is free to store the tags in an order the owner didn't type. */
|
||||||
|
const sameTags = (a: string[], b: string[]) => a.length === b.length && a.every((t) => b.includes(t));
|
||||||
|
|
||||||
type OwnershipProps = { node: HeadscaleNode; busy: boolean; onError: (message: string) => void };
|
type OwnershipProps = { node: HeadscaleNode; busy: boolean; onError: (message: string) => void };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user