Skip to content

Commit 2d79ada

Browse files
authored
Update license reporting (#120)
* update license reporting
1 parent a2a9bbb commit 2d79ada

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/license/license.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010
"github.com/pkg/errors"
1111
kotsv1beta1 "github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
1212
"github.com/replicatedhq/replicated-sdk/pkg/license/types"
13+
"github.com/replicatedhq/replicated-sdk/pkg/report"
14+
"github.com/replicatedhq/replicated-sdk/pkg/store"
1315
"github.com/replicatedhq/replicated-sdk/pkg/util"
1416
)
1517

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

5961
req.SetBasicAuth(licenseID, licenseID)
6062

63+
instanceData := report.GetInstanceData(store.GetStore())
64+
report.InjectInstanceDataHeaders(req, instanceData)
65+
6166
resp, err := http.DefaultClient.Do(req)
6267
if err != nil {
6368
return nil, errors.Wrap(err, "failed to execute get request")
@@ -117,6 +122,9 @@ func GetLatestLicenseFields(license *kotsv1beta1.License, endpoint string) (type
117122

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

125+
instanceData := report.GetInstanceData(store.GetStore())
126+
report.InjectInstanceDataHeaders(req, instanceData)
127+
120128
resp, err := http.DefaultClient.Do(req)
121129
if err != nil {
122130
return nil, errors.Wrap(err, "failed to execute get request")
@@ -153,6 +161,9 @@ func GetLatestLicenseField(license *kotsv1beta1.License, endpoint string, fieldN
153161

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

164+
instanceData := report.GetInstanceData(store.GetStore())
165+
report.InjectInstanceDataHeaders(req, instanceData)
166+
156167
resp, err := http.DefaultClient.Do(req)
157168
if err != nil {
158169
return nil, errors.Wrap(err, "failed to execute get request")

0 commit comments

Comments
 (0)