Skip to content

Commit

Permalink
feat: allow scope in relationship selector
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored and moshloop committed Jul 11, 2024
1 parent 88b8f99 commit 1051ae0
Show file tree
Hide file tree
Showing 13 changed files with 438 additions and 216 deletions.
144 changes: 144 additions & 0 deletions chart/crds/configs.flanksource.com_scrapeconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,22 @@ spec:
value:
type: string
type: object
scope:
description: |-
Scope is the id of the parent of the resource to select.
Example: For config items, the scope is the scraper id
- for checks, it's canaries and
- for components, it's topology.
If left empty, the scope is the requester's scope.
Use `all` to disregard scope.
properties:
expr:
type: string
label:
type: string
value:
type: string
type: object
type:
description: Lookup offers different ways to specify
a lookup value
Expand Down Expand Up @@ -896,6 +912,22 @@ spec:
value:
type: string
type: object
scope:
description: |-
Scope is the id of the parent of the resource to select.
Example: For config items, the scope is the scraper id
- for checks, it's canaries and
- for components, it's topology.
If left empty, the scope is the requester's scope.
Use `all` to disregard scope.
properties:
expr:
type: string
label:
type: string
value:
type: string
type: object
type:
description: Lookup offers different ways to specify
a lookup value
Expand Down Expand Up @@ -1273,6 +1305,22 @@ spec:
value:
type: string
type: object
scope:
description: |-
Scope is the id of the parent of the resource to select.
Example: For config items, the scope is the scraper id
- for checks, it's canaries and
- for components, it's topology.
If left empty, the scope is the requester's scope.
Use `all` to disregard scope.
properties:
expr:
type: string
label:
type: string
value:
type: string
type: object
type:
description: Lookup offers different ways to specify
a lookup value
Expand Down Expand Up @@ -1609,6 +1657,22 @@ spec:
value:
type: string
type: object
scope:
description: |-
Scope is the id of the parent of the resource to select.
Example: For config items, the scope is the scraper id
- for checks, it's canaries and
- for components, it's topology.
If left empty, the scope is the requester's scope.
Use `all` to disregard scope.
properties:
expr:
type: string
label:
type: string
value:
type: string
type: object
type:
description: Lookup offers different ways to specify
a lookup value
Expand Down Expand Up @@ -1985,6 +2049,22 @@ spec:
value:
type: string
type: object
scope:
description: |-
Scope is the id of the parent of the resource to select.
Example: For config items, the scope is the scraper id
- for checks, it's canaries and
- for components, it's topology.
If left empty, the scope is the requester's scope.
Use `all` to disregard scope.
properties:
expr:
type: string
label:
type: string
value:
type: string
type: object
type:
description: Lookup offers different ways to specify
a lookup value
Expand Down Expand Up @@ -2474,6 +2554,22 @@ spec:
value:
type: string
type: object
scope:
description: |-
Scope is the id of the parent of the resource to select.
Example: For config items, the scope is the scraper id
- for checks, it's canaries and
- for components, it's topology.
If left empty, the scope is the requester's scope.
Use `all` to disregard scope.
properties:
expr:
type: string
label:
type: string
value:
type: string
type: object
type:
description: Lookup offers different ways to specify
a lookup value
Expand Down Expand Up @@ -2880,6 +2976,22 @@ spec:
value:
type: string
type: object
scope:
description: |-
Scope is the id of the parent of the resource to select.
Example: For config items, the scope is the scraper id
- for checks, it's canaries and
- for components, it's topology.
If left empty, the scope is the requester's scope.
Use `all` to disregard scope.
properties:
expr:
type: string
label:
type: string
value:
type: string
type: object
type:
description: Lookup offers different ways to specify
a lookup value
Expand Down Expand Up @@ -3336,6 +3448,22 @@ spec:
value:
type: string
type: object
scope:
description: |-
Scope is the id of the parent of the resource to select.
Example: For config items, the scope is the scraper id
- for checks, it's canaries and
- for components, it's topology.
If left empty, the scope is the requester's scope.
Use `all` to disregard scope.
properties:
expr:
type: string
label:
type: string
value:
type: string
type: object
type:
description: Lookup offers different ways to specify
a lookup value
Expand Down Expand Up @@ -3695,6 +3823,22 @@ spec:
value:
type: string
type: object
scope:
description: |-
Scope is the id of the parent of the resource to select.
Example: For config items, the scope is the scraper id
- for checks, it's canaries and
- for components, it's topology.
If left empty, the scope is the requester's scope.
Use `all` to disregard scope.
properties:
expr:
type: string
label:
type: string
value:
type: string
type: object
type:
description: Lookup offers different ways to specify
a lookup value
Expand Down
46 changes: 26 additions & 20 deletions config/schemas/config_aws.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,21 @@
"additionalProperties": false,
"type": "object"
},
"Lookup": {
"properties": {
"expr": {
"type": "string"
},
"value": {
"type": "string"
},
"label": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
},
"Mask": {
"properties": {
"selector": {
Expand All @@ -351,19 +366,25 @@
"RelationshipConfig": {
"properties": {
"id": {
"$ref": "#/$defs/RelationshipLookup"
"$ref": "#/$defs/Lookup"
},
"external_id": {
"$ref": "#/$defs/RelationshipLookup"
"$ref": "#/$defs/Lookup"
},
"name": {
"$ref": "#/$defs/RelationshipLookup"
"$ref": "#/$defs/Lookup"
},
"namespace": {
"$ref": "#/$defs/Lookup"
},
"type": {
"$ref": "#/$defs/RelationshipLookup"
"$ref": "#/$defs/Lookup"
},
"agent": {
"$ref": "#/$defs/RelationshipLookup"
"$ref": "#/$defs/Lookup"
},
"scope": {
"$ref": "#/$defs/Lookup"
},
"labels": {
"additionalProperties": {
Expand All @@ -381,21 +402,6 @@
"additionalProperties": false,
"type": "object"
},
"RelationshipLookup": {
"properties": {
"expr": {
"type": "string"
},
"value": {
"type": "string"
},
"label": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
},
"SecretKeySelector": {
"properties": {
"name": {
Expand Down
46 changes: 26 additions & 20 deletions config/schemas/config_azure.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,21 @@
"additionalProperties": false,
"type": "object"
},
"Lookup": {
"properties": {
"expr": {
"type": "string"
},
"value": {
"type": "string"
},
"label": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
},
"Mask": {
"properties": {
"selector": {
Expand All @@ -307,19 +322,25 @@
"RelationshipConfig": {
"properties": {
"id": {
"$ref": "#/$defs/RelationshipLookup"
"$ref": "#/$defs/Lookup"
},
"external_id": {
"$ref": "#/$defs/RelationshipLookup"
"$ref": "#/$defs/Lookup"
},
"name": {
"$ref": "#/$defs/RelationshipLookup"
"$ref": "#/$defs/Lookup"
},
"namespace": {
"$ref": "#/$defs/Lookup"
},
"type": {
"$ref": "#/$defs/RelationshipLookup"
"$ref": "#/$defs/Lookup"
},
"agent": {
"$ref": "#/$defs/RelationshipLookup"
"$ref": "#/$defs/Lookup"
},
"scope": {
"$ref": "#/$defs/Lookup"
},
"labels": {
"additionalProperties": {
Expand All @@ -337,21 +358,6 @@
"additionalProperties": false,
"type": "object"
},
"RelationshipLookup": {
"properties": {
"expr": {
"type": "string"
},
"value": {
"type": "string"
},
"label": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
},
"SecretKeySelector": {
"properties": {
"name": {
Expand Down
Loading

0 comments on commit 1051ae0

Please sign in to comment.