Skip to content

Commit db8a1b9

Browse files
authored
user_agent in airgap instance report (#111)
1 parent 22f549b commit db8a1b9

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

pkg/heartbeat/app.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/pkg/errors"
1212
"github.com/replicatedhq/kotskinds/apis/kots/v1beta1"
13+
"github.com/replicatedhq/replicated-sdk/pkg/buildversion"
1314
"github.com/replicatedhq/replicated-sdk/pkg/heartbeat/types"
1415
"github.com/replicatedhq/replicated-sdk/pkg/k8sutil"
1516
"github.com/replicatedhq/replicated-sdk/pkg/logger"
@@ -44,6 +45,7 @@ func SendAirgapHeartbeat(clientset kubernetes.Interface, namespace string, licen
4445
LicenseID: licenseID,
4546
InstanceID: heartbeatInfo.InstanceID,
4647
ClusterID: heartbeatInfo.ClusterID,
48+
UserAgent: buildversion.GetUserAgent(),
4749
AppStatus: heartbeatInfo.AppStatus,
4850
K8sVersion: heartbeatInfo.K8sVersion,
4951
K8sDistribution: heartbeatInfo.K8sDistribution,

pkg/heartbeat/instance_report_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func Test_CreateInstanceReportEvent(t *testing.T) {
2020
LicenseID: "test-license-id",
2121
InstanceID: "test-instance-id",
2222
ClusterID: "test-cluster-id",
23+
UserAgent: "test-user-agent",
2324
AppStatus: "ready",
2425
ResourceStates: "[]",
2526
K8sVersion: "1.29.0",
@@ -206,6 +207,7 @@ func Test_InstanceReportEncodeDecode(t *testing.T) {
206207
LicenseID: "test-license-id",
207208
InstanceID: "test-instance-id",
208209
ClusterID: "test-cluster-id",
210+
UserAgent: "test-user-agent",
209211
AppStatus: "ready",
210212
ResourceStates: "[]",
211213
K8sVersion: "1.29.0",

pkg/heartbeat/types/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ type InstanceReportEvent struct {
7777
LicenseID string `json:"license_id"`
7878
InstanceID string `json:"instance_id"`
7979
ClusterID string `json:"cluster_id"`
80+
UserAgent string `json:"user_agent"`
8081
AppStatus string `json:"app_status,omitempty"`
8182
ResourceStates string `json:"resource_states,omitempty"`
8283
K8sVersion string `json:"k8s_version"`

0 commit comments

Comments
 (0)