Skip to content

Commit

Permalink
Check if app from prom-data exists
Browse files Browse the repository at this point in the history
Co-authored-by: Roger Bjørnstad <[email protected]>
  • Loading branch information
jhrv and rbjornstad committed Sep 2, 2024
1 parent 1a2ed02 commit 6ea6cbe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/graph/teams.resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ import (
)

func (r *appUtilizationDataResolver) App(ctx context.Context, obj *model.AppUtilizationData) (*model.App, error) {
if !r.k8sClient.AppExists(obj.Env, obj.TeamSlug.String(), obj.AppName) {
r.log.Errorf("app %s in team %s does not exist", obj.AppName, obj.TeamSlug)
return nil, nil
}
app, err := r.k8sClient.App(ctx, obj.AppName, obj.TeamSlug.String(), obj.Env)
if err != nil {
r.log.Errorf("getting app %s in team %s: %v", obj.AppName, obj.TeamSlug, err)
return nil, apierror.ErrAppNotFound
}

Expand Down

0 comments on commit 6ea6cbe

Please sign in to comment.