Skip to content

Commit

Permalink
chore: use topology pkg to save components
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra committed Sep 12, 2024
1 parent 496401a commit b4e7c5e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/containrrr/shoutrrr v0.8.0
github.com/fergusstrange/embedded-postgres v1.25.0 // indirect
github.com/flanksource/commons v1.29.10
github.com/flanksource/duty v1.0.642
github.com/flanksource/duty v1.0.643
github.com/flanksource/gomplate/v3 v3.24.30
github.com/flanksource/kopper v1.0.9
github.com/gomarkdown/markdown v0.0.0-20240419095408-642f0ee99ae2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,8 @@ github.com/flanksource/artifacts v1.0.14 h1:Vv70bccsae0MwGaf/uSPp34J5V1/PyKfct9z
github.com/flanksource/artifacts v1.0.14/go.mod h1:qHVCnQu5k50aWNJ5UhpcAKEl7pAzqUrFFKGSm147G70=
github.com/flanksource/commons v1.29.10 h1:T/S95Pl8kASEFvQjQ7fJjTUqeVdhxQXg1vfkULTYFJQ=
github.com/flanksource/commons v1.29.10/go.mod h1:iTbrXOSp3Spv570Nly97D/U9cQjLZoVlmWCXqWzsvRU=
github.com/flanksource/duty v1.0.642 h1:GcEZBwLGPbm7HJGCgJnMTgP/twYQeJavx9IIi3w4Pfk=
github.com/flanksource/duty v1.0.642/go.mod h1:Oj9zIX94CR2U+nmnt97gNLMrsBWILyIhIBeJynIIgqE=
github.com/flanksource/duty v1.0.643 h1:P2bi//29BdbJbuXiT3NnWkxN8CSyJJCcngw72H48soE=
github.com/flanksource/duty v1.0.643/go.mod h1:Oj9zIX94CR2U+nmnt97gNLMrsBWILyIhIBeJynIIgqE=
github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc=
github.com/flanksource/gomplate/v3 v3.24.30 h1:6Y25KnAMX4iCuEXe1C8d1kB2PdV+zD1ZulZrv6DV14Q=
github.com/flanksource/gomplate/v3 v3.24.30/go.mod h1:/lAM7+fkcCCfghCAjzdCqwgWxN5Ow8Sk6nkdFPjejCE=
Expand Down
3 changes: 2 additions & 1 deletion push/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/flanksource/duty/context"
dutydb "github.com/flanksource/duty/db"
"github.com/flanksource/duty/models"
dutytopology "github.com/flanksource/duty/topology"
"github.com/flanksource/incident-commander/db"
"github.com/google/uuid"
"github.com/labstack/echo/v4"
Expand Down Expand Up @@ -61,7 +62,7 @@ func PushTopology(c echo.Context) error {
compIDs = append(compIDs, c.ID)
}

if err := data.Save(ctx.DB()); err != nil {
if err := dutytopology.SaveComponent(ctx, &data); err != nil {
return dutyAPI.WriteError(c, dutyAPI.Errorf(dutyAPI.EINTERNAL, "error saving components: %v", dutydb.ErrorDetails(err)))
}

Expand Down

0 comments on commit b4e7c5e

Please sign in to comment.