Skip to content

Commit

Permalink
fix: add labels to component spec (#1112)
Browse files Browse the repository at this point in the history
* add labels to component spec

* chore: make test && make resources
  • Loading branch information
adityathebe authored Jul 3, 2023
1 parent 304a7ab commit 80a5658
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 6 deletions.
13 changes: 7 additions & 6 deletions api/v1/component_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ type Component struct {
}

type ComponentSpec struct {
Name string `json:"name,omitempty"`
Tooltip string `json:"tooltip,omitempty"`
Icon string `json:"icon,omitempty"`
Owner string `json:"owner,omitempty"`
Id *Template `json:"id,omitempty"` //nolint
Order int `json:"order,omitempty"`
Name string `json:"name,omitempty"`
Tooltip string `json:"tooltip,omitempty"`
Icon string `json:"icon,omitempty"`
Owner string `json:"owner,omitempty"`
Id *Template `json:"id,omitempty"` //nolint
Order int `json:"order,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
// The type of component, e.g. service, API, website, library, database, etc.
Type string `json:"type,omitempty"`
// The lifecycle state of the component e.g. production, staging, dev, etc.
Expand Down
14 changes: 14 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions config/deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4019,6 +4019,10 @@ spec:
template:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
lifecycle:
description: The lifecycle state of the component e.g. production, staging, dev, etc.
type: string
Expand Down Expand Up @@ -4310,6 +4314,10 @@ spec:
template:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
lifecycle:
description: The lifecycle state of the component e.g. production, staging, dev, etc.
type: string
Expand Down
8 changes: 8 additions & 0 deletions config/deploy/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4288,6 +4288,10 @@ spec:
template:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
lifecycle:
description: The lifecycle state of the component e.g. production, staging, dev, etc.
type: string
Expand Down Expand Up @@ -4579,6 +4583,10 @@ spec:
template:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
lifecycle:
description: The lifecycle state of the component e.g. production, staging, dev, etc.
type: string
Expand Down
16 changes: 16 additions & 0 deletions config/schemas/component.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,14 @@
"order": {
"type": "integer"
},
"labels": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
},
"type": {
"type": "string"
},
Expand Down Expand Up @@ -731,6 +739,14 @@
"order": {
"type": "integer"
},
"labels": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
},
"type": {
"type": "string"
},
Expand Down
16 changes: 16 additions & 0 deletions config/schemas/topology.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,14 @@
"order": {
"type": "integer"
},
"labels": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
},
"type": {
"type": "string"
},
Expand Down Expand Up @@ -710,6 +718,14 @@
"order": {
"type": "integer"
},
"labels": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
},
"type": {
"type": "string"
},
Expand Down
1 change: 1 addition & 0 deletions pkg/system_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ func NewComponent(c v1.ComponentSpec) *Component {
Icon: c.Icon,
Selectors: c.Selectors,
ComponentChecks: c.ComponentChecks,
Labels: c.Labels,
Configs: configs,
LogSelectors: c.LogSelectors,
}
Expand Down

0 comments on commit 80a5658

Please sign in to comment.