Skip to content

Commit

Permalink
Update license reporting (#120)
Browse files Browse the repository at this point in the history
* update license reporting
  • Loading branch information
FourSigma authored Dec 14, 2023
1 parent a2a9bbb commit 2d79ada
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/license/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"github.com/pkg/errors"
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
"github.com/replicatedhq/replicated-sdk/pkg/license/types"
"github.com/replicatedhq/replicated-sdk/pkg/report"
"github.com/replicatedhq/replicated-sdk/pkg/store"
"github.com/replicatedhq/replicated-sdk/pkg/util"
)

Expand Down Expand Up @@ -58,6 +60,9 @@ func getLicenseFromAPI(url string, licenseID string) (*LicenseData, error) {

req.SetBasicAuth(licenseID, licenseID)

instanceData := report.GetInstanceData(store.GetStore())
report.InjectInstanceDataHeaders(req, instanceData)

resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, errors.Wrap(err, "failed to execute get request")
Expand Down Expand Up @@ -117,6 +122,9 @@ func GetLatestLicenseFields(license *kotsv1beta1.License, endpoint string) (type

req.SetBasicAuth(license.Spec.LicenseID, license.Spec.LicenseID)

instanceData := report.GetInstanceData(store.GetStore())
report.InjectInstanceDataHeaders(req, instanceData)

resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, errors.Wrap(err, "failed to execute get request")
Expand Down Expand Up @@ -153,6 +161,9 @@ func GetLatestLicenseField(license *kotsv1beta1.License, endpoint string, fieldN

req.SetBasicAuth(license.Spec.LicenseID, license.Spec.LicenseID)

instanceData := report.GetInstanceData(store.GetStore())
report.InjectInstanceDataHeaders(req, instanceData)

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

0 comments on commit 2d79ada

Please sign in to comment.