Skip to content

Commit

Permalink
updated mapping and schema to support icons
Browse files Browse the repository at this point in the history
  • Loading branch information
OmriGez committed Feb 1, 2024
1 parent 58b7a20 commit c525b0e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/defaults/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func Test_InitIntegration_DeprecatedResourcesConfiguration(t *testing.T) {
{
Kind: "workload",
Port: port.Port{
Entity: port.EntityMappings{
Entity: port.EntityMa§ppings{
Mappings: []port.EntityMapping{
{
Identifier: "workload",
Expand Down
6 changes: 6 additions & 0 deletions pkg/port/mapping/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ func NewEntity(obj interface{}, mapping port.EntityMapping) (*port.Entity, error
return &port.Entity{}, err
}
}
if mapping.Icon != "" {
entity.Icon, err = jq.ParseString(mapping.Icon, obj)

Check failure on line 32 in pkg/port/mapping/entity.go

View workflow job for this annotation

GitHub Actions / build

entity.Icon undefined (type *port.Entity has no field or method Icon)
if err != nil {
return &port.Entity{}, err
}
}
entity.Properties, err = jq.ParseMapInterface(mapping.Properties, obj)
if err != nil {
return &port.Entity{}, err
Expand Down
1 change: 1 addition & 0 deletions pkg/port/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ type EntityMapping struct {
Identifier string `json:"identifier"`
Title string `json:"title"`
Blueprint string `json:"blueprint"`
Icon string `json:"icon,omitempty"`
Team string `json:"team,omitempty"`
Properties map[string]string `json:"properties,omitempty"`
Relations map[string]string `json:"relations,omitempty"`
Expand Down

0 comments on commit c525b0e

Please sign in to comment.