mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 10:49:15 +00:00
Allow references to groups by name (#195)
Group names are unique so we can safely use the name as a reference method to groups. This makes assigning resources created in the cluster to groups that already exist a lot easier.
This commit is contained in:
@@ -52,10 +52,10 @@ spec:
|
||||
items:
|
||||
properties:
|
||||
id:
|
||||
description: ID is the id of a resource in the Netbird API.
|
||||
description: ID is the id of the group.
|
||||
type: string
|
||||
localRef:
|
||||
description: LocalReference is a reference to a object in the
|
||||
description: LocalReference is a reference to a group in the
|
||||
same namespace.
|
||||
properties:
|
||||
name:
|
||||
@@ -69,11 +69,13 @@ spec:
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
name:
|
||||
description: Name is the name of the group.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-validations:
|
||||
- message: exactly one of id or localRef must be set
|
||||
rule: (has(self.id) && !has(self.localRef)) || (!has(self.id)
|
||||
&& has(self.localRef))
|
||||
- message: Exactly one of id, name, or localRef must be set
|
||||
rule: (has(self.id)?1:0)+(has(self.name)?1:0)+(has(self.localRef)?1:0)==1
|
||||
type: array
|
||||
networkRouterRef:
|
||||
description: NetworkRouterRef is a reference to the network and router
|
||||
|
||||
@@ -52,10 +52,10 @@ spec:
|
||||
items:
|
||||
properties:
|
||||
id:
|
||||
description: ID is the id of a resource in the Netbird API.
|
||||
description: ID is the id of the group.
|
||||
type: string
|
||||
localRef:
|
||||
description: LocalReference is a reference to a object in the
|
||||
description: LocalReference is a reference to a group in the
|
||||
same namespace.
|
||||
properties:
|
||||
name:
|
||||
@@ -69,11 +69,13 @@ spec:
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
name:
|
||||
description: Name is the name of the group.
|
||||
type: string
|
||||
type: object
|
||||
x-kubernetes-validations:
|
||||
- message: exactly one of id or localRef must be set
|
||||
rule: (has(self.id) && !has(self.localRef)) || (!has(self.id)
|
||||
&& has(self.localRef))
|
||||
- message: Exactly one of id, name, or localRef must be set
|
||||
rule: (has(self.id)?1:0)+(has(self.name)?1:0)+(has(self.localRef)?1:0)==1
|
||||
type: array
|
||||
duration:
|
||||
description: Duration sets how long the setup key is valid for.
|
||||
|
||||
Reference in New Issue
Block a user