Skip to content

Commit 80a5658

Browse files
authored
fix: add labels to component spec (#1112)
* add labels to component spec * chore: make test && make resources
1 parent 304a7ab commit 80a5658

File tree

7 files changed

+70
-6
lines changed

7 files changed

+70
-6
lines changed

api/v1/component_types.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ type Component struct {
1818
}
1919

2020
type ComponentSpec struct {
21-
Name string `json:"name,omitempty"`
22-
Tooltip string `json:"tooltip,omitempty"`
23-
Icon string `json:"icon,omitempty"`
24-
Owner string `json:"owner,omitempty"`
25-
Id *Template `json:"id,omitempty"` //nolint
26-
Order int `json:"order,omitempty"`
21+
Name string `json:"name,omitempty"`
22+
Tooltip string `json:"tooltip,omitempty"`
23+
Icon string `json:"icon,omitempty"`
24+
Owner string `json:"owner,omitempty"`
25+
Id *Template `json:"id,omitempty"` //nolint
26+
Order int `json:"order,omitempty"`
27+
Labels map[string]string `json:"labels,omitempty"`
2728
// The type of component, e.g. service, API, website, library, database, etc.
2829
Type string `json:"type,omitempty"`
2930
// The lifecycle state of the component e.g. production, staging, dev, etc.

api/v1/zz_generated.deepcopy.go

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/deploy/crd.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4019,6 +4019,10 @@ spec:
40194019
template:
40204020
type: string
40214021
type: object
4022+
labels:
4023+
additionalProperties:
4024+
type: string
4025+
type: object
40224026
lifecycle:
40234027
description: The lifecycle state of the component e.g. production, staging, dev, etc.
40244028
type: string
@@ -4310,6 +4314,10 @@ spec:
43104314
template:
43114315
type: string
43124316
type: object
4317+
labels:
4318+
additionalProperties:
4319+
type: string
4320+
type: object
43134321
lifecycle:
43144322
description: The lifecycle state of the component e.g. production, staging, dev, etc.
43154323
type: string

config/deploy/manifests.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4288,6 +4288,10 @@ spec:
42884288
template:
42894289
type: string
42904290
type: object
4291+
labels:
4292+
additionalProperties:
4293+
type: string
4294+
type: object
42914295
lifecycle:
42924296
description: The lifecycle state of the component e.g. production, staging, dev, etc.
42934297
type: string
@@ -4579,6 +4583,10 @@ spec:
45794583
template:
45804584
type: string
45814585
type: object
4586+
labels:
4587+
additionalProperties:
4588+
type: string
4589+
type: object
45824590
lifecycle:
45834591
description: The lifecycle state of the component e.g. production, staging, dev, etc.
45844592
type: string

config/schemas/component.schema.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,14 @@
659659
"order": {
660660
"type": "integer"
661661
},
662+
"labels": {
663+
"patternProperties": {
664+
".*": {
665+
"type": "string"
666+
}
667+
},
668+
"type": "object"
669+
},
662670
"type": {
663671
"type": "string"
664672
},
@@ -731,6 +739,14 @@
731739
"order": {
732740
"type": "integer"
733741
},
742+
"labels": {
743+
"patternProperties": {
744+
".*": {
745+
"type": "string"
746+
}
747+
},
748+
"type": "object"
749+
},
734750
"type": {
735751
"type": "string"
736752
},

config/schemas/topology.schema.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,14 @@
638638
"order": {
639639
"type": "integer"
640640
},
641+
"labels": {
642+
"patternProperties": {
643+
".*": {
644+
"type": "string"
645+
}
646+
},
647+
"type": "object"
648+
},
641649
"type": {
642650
"type": "string"
643651
},
@@ -710,6 +718,14 @@
710718
"order": {
711719
"type": "integer"
712720
},
721+
"labels": {
722+
"patternProperties": {
723+
".*": {
724+
"type": "string"
725+
}
726+
},
727+
"type": "object"
728+
},
713729
"type": {
714730
"type": "string"
715731
},

pkg/system_api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ func NewComponent(c v1.ComponentSpec) *Component {
267267
Icon: c.Icon,
268268
Selectors: c.Selectors,
269269
ComponentChecks: c.ComponentChecks,
270+
Labels: c.Labels,
270271
Configs: configs,
271272
LogSelectors: c.LogSelectors,
272273
}

0 commit comments

Comments
 (0)