Skip to content

Commit

Permalink
fix: handle session creation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed May 22, 2024
1 parent 5974f2e commit 22f71e5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ require (
github.com/evanphx/json-patch v5.6.0+incompatible
github.com/fergusstrange/embedded-postgres v1.25.0
github.com/flanksource/commons v1.22.1
github.com/flanksource/duty v1.0.470
github.com/flanksource/duty v1.0.474
github.com/flanksource/is-healthy v1.0.7
github.com/flanksource/ketall v1.1.6
github.com/flanksource/mapstructure v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,8 @@ github.com/fergusstrange/embedded-postgres v1.25.0 h1:sa+k2Ycrtz40eCRPOzI7Ry7Ttk
github.com/fergusstrange/embedded-postgres v1.25.0/go.mod h1:t/MLs0h9ukYM6FSt99R7InCHs1nW0ordoVCcnzmpTYw=
github.com/flanksource/commons v1.22.1 h1:Ycg8r26bx537UTdAEFgngDW1r2j5bX6Lr3NGxLICpiw=
github.com/flanksource/commons v1.22.1/go.mod h1:GD5+yGvmYFPIW3WMNN+y1JkeDMJY74e05pQAsRbrvwY=
github.com/flanksource/duty v1.0.470 h1:rTX3rXV85a/iTqLmLXPgMD0RYvPaIO82rhVxrl7sW1I=
github.com/flanksource/duty v1.0.470/go.mod h1:Fzi/DMrXGULFqPLpxfEm7H7wcAvafAhP6mu0R43qrKM=
github.com/flanksource/duty v1.0.474 h1:HULnTzXjT6VHZsC9CU3HBbnaoz3BaFQ9cb7yQ1GW+O0=
github.com/flanksource/duty v1.0.474/go.mod h1:Fzi/DMrXGULFqPLpxfEm7H7wcAvafAhP6mu0R43qrKM=
github.com/flanksource/gomplate/v3 v3.20.4/go.mod h1:27BNWhzzSjDed1z8YShO6W+z6G9oZXuxfNFGd/iGSdc=
github.com/flanksource/gomplate/v3 v3.24.2 h1:WZSriw1MaBhzrDV1IOP9eNsupIPxIHy0yTaMOVhCvsk=
github.com/flanksource/gomplate/v3 v3.24.2/go.mod h1:94BxYobZqouGdVezuz6LNto5C+yLMG0LnNnM9CUPyoo=
Expand Down
2 changes: 1 addition & 1 deletion hack/generate-schemas/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/flanksource/duty v1.0.470 // indirect
github.com/flanksource/duty v1.0.474 // indirect
github.com/flanksource/gomplate/v3 v3.24.2 // indirect
github.com/flanksource/is-healthy v1.0.7 // indirect
github.com/flanksource/kubectl-neat v1.0.4 // indirect
Expand Down
4 changes: 2 additions & 2 deletions hack/generate-schemas/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flanksource/commons v1.22.1 h1:Ycg8r26bx537UTdAEFgngDW1r2j5bX6Lr3NGxLICpiw=
github.com/flanksource/commons v1.22.1/go.mod h1:GD5+yGvmYFPIW3WMNN+y1JkeDMJY74e05pQAsRbrvwY=
github.com/flanksource/duty v1.0.470 h1:rTX3rXV85a/iTqLmLXPgMD0RYvPaIO82rhVxrl7sW1I=
github.com/flanksource/duty v1.0.470/go.mod h1:Fzi/DMrXGULFqPLpxfEm7H7wcAvafAhP6mu0R43qrKM=
github.com/flanksource/duty v1.0.474 h1:HULnTzXjT6VHZsC9CU3HBbnaoz3BaFQ9cb7yQ1GW+O0=
github.com/flanksource/duty v1.0.474/go.mod h1:Fzi/DMrXGULFqPLpxfEm7H7wcAvafAhP6mu0R43qrKM=
github.com/flanksource/gomplate/v3 v3.24.2 h1:WZSriw1MaBhzrDV1IOP9eNsupIPxIHy0yTaMOVhCvsk=
github.com/flanksource/gomplate/v3 v3.24.2/go.mod h1:94BxYobZqouGdVezuz6LNto5C+yLMG0LnNnM9CUPyoo=
github.com/flanksource/is-healthy v1.0.7 h1:0muDQttzTkNLcOpsA23OHvLiweN44anxUgvQhucbh5E=
Expand Down
2 changes: 2 additions & 0 deletions scrapers/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ func (aws Scraper) Scrape(ctx api.ScrapeContext) v1.ScrapeResults {
awsCtx, err := aws.getContext(ctx, awsConfig, region)
if err != nil {
results.Errorf(err, "failed to create AWS context")
allResults = append(allResults, *results...)
continue
}

Expand All @@ -1157,6 +1158,7 @@ func (aws Scraper) Scrape(ctx api.ScrapeContext) v1.ScrapeResults {
awsCtx, err := aws.getContext(ctx, awsConfig, "us-east-1")
if err != nil {
results.Errorf(err, "failed to create AWS context")
allResults = append(allResults, *results...)
continue
}

Expand Down
1 change: 1 addition & 0 deletions scrapers/runscrapers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ var _ = Describe("Scrapers test", Ordered, func() {
dummyCI2 := models.ConfigItem{
ID: configItemID2,
ConfigClass: "Test",
Type: lo.ToPtr("Test"),
ScraperID: &dummyScraper.ID,
}
err = ctx.DB().Create(&dummyCI).Error
Expand Down

0 comments on commit 22f71e5

Please sign in to comment.