Skip to content

Commit

Permalink
update reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Siva Manivannan committed Dec 4, 2023
1 parent fa8e0ac commit bfc9eff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/replicatedapp/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
apptypes "github.com/replicatedhq/kots/pkg/app/types"
"github.com/replicatedhq/kots/pkg/logger"
"github.com/replicatedhq/kots/pkg/reporting"
"github.com/replicatedhq/kots/pkg/store"
"github.com/replicatedhq/kots/pkg/util"
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
"github.com/replicatedhq/kotskinds/client/kotsclientset/scheme"
Expand Down Expand Up @@ -149,6 +150,14 @@ func getApplicationMetadataFromHost(host string, endpoint string, upstream *url.
return nil, errors.Wrap(err, "failed to call newrequest")
}

appID, err := store.GetStore().GetAppIDFromSlug(r.AppSlug)
if err != nil {
return nil, errors.Wrap(err, "failed to get app id from slug")
}

reportingInfo := reporting.GetReportingInfo(appID)
reporting.InjectReportingInfoHeaders(getReq, reportingInfo)

getResp, err := http.DefaultClient.Do(getReq)
if err != nil {
return nil, errors.Wrap(err, "failed to execute get request")
Expand Down

0 comments on commit bfc9eff

Please sign in to comment.