Skip to content

Commit

Permalink
add labels to component spec
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Jul 3, 2023
1 parent ae54626 commit 8a0d079
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 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
2 changes: 1 addition & 1 deletion checks/runchecks.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func RunChecks(ctx *context.Context) []*pkg.CheckResult {
var results []*pkg.CheckResult

// Check if canary is not marked deleted in DB
if db.Gorm != nil {
if db.Gorm != nil && ctx.Canary.GetPersistedID() != "" {
var deletedAt sql.NullTime
err := db.Gorm.Table("canaries").Select("deleted_at").Where("id = ?", ctx.Canary.GetPersistedID()).Scan(&deletedAt).Error
if err == nil && deletedAt.Valid {
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 8a0d079

Please sign in to comment.