@@ -13,22 +13,22 @@ import (
13
13
14
14
// Labels contains the metadata information needed for reporting to Agent
15
15
type Labels struct {
16
- ProductName string `json:"product_name "`
17
- ProductVersion string `json:"product_version "`
18
- ClusterID string `json:"cluster_id "`
19
- DeploymentName string `json:"deployment_name "`
20
- DeploymentID string `json:"deployment_id "`
21
- DeploymentNamespace string `json:"deployment_namespace "`
16
+ ProductType string `json:"product-type "`
17
+ ProductVersion string `json:"product-version "`
18
+ ClusterID string `json:"cluster-id "`
19
+ InstallationName string `json:"installation-name "`
20
+ InstallationID string `json:"installation-id "`
21
+ InstallationNamespace string `json:"installation-namespace "`
22
22
}
23
23
24
- func newMetadataInfo (deploymentNamespace , clusterID , deploymentID , productVersion , deploymentName string ) * Labels {
24
+ func newMetadataInfo (installationNamespace , clusterID , installationID , productVersion , installationName string ) * Labels {
25
25
return & Labels {
26
- ProductName : "nic" ,
27
- ProductVersion : productVersion ,
28
- ClusterID : clusterID ,
29
- DeploymentID : deploymentID ,
30
- DeploymentName : deploymentName ,
31
- DeploymentNamespace : deploymentNamespace ,
26
+ ProductType : "nic" ,
27
+ ProductVersion : productVersion ,
28
+ ClusterID : clusterID ,
29
+ InstallationID : installationID ,
30
+ InstallationName : installationName ,
31
+ InstallationNamespace : installationNamespace ,
32
32
}
33
33
}
34
34
@@ -52,19 +52,19 @@ func NewMetadataReporter(client kubernetes.Interface, pod *api_v1.Pod, version s
52
52
53
53
// CollectAndWrite collects the metadata information and returns a Labels struct
54
54
func (md * Metadata ) CollectAndWrite (ctx context.Context ) (* Labels , error ) {
55
- deploymentNamespace := md .PodNSName .Namespace
55
+ installationNamespace := md .PodNSName .Namespace
56
56
clusterID , err := clusterInfo .GetClusterID (ctx , md .K8sClientReader )
57
57
if err != nil {
58
58
return nil , fmt .Errorf ("error collecting ClusterID: %w" , err )
59
59
<
E30B
div class="diff-text-inner"> }
60
- deploymentID , err := clusterInfo .GetInstallationID (ctx , md .K8sClientReader , md .PodNSName )
60
+ installationID , err := clusterInfo .GetInstallationID (ctx , md .K8sClientReader , md .PodNSName )
61
61
if err != nil {
62
62
return nil , fmt .Errorf ("error collecting InstallationID: %w" , err )
63
63
}
64
- deploymentName , err := clusterInfo .GetDeploymentName (ctx , md .K8sClientReader , md .PodNSName )
64
+ installationName , err := clusterInfo .GetInstallationName (ctx , md .K8sClientReader , md .PodNSName )
65
65
if err != nil {
66
- return nil , fmt .Errorf ("error collecting DeploymentName : %w" , err )
66
+ return nil , fmt .Errorf ("error collecting InstallationName : %w" , err )
67
67
}
68
- info := newMetadataInfo (deploymentNamespace , clusterID , deploymentID , md .NICVersion , deploymentName )
68
+ info := newMetadataInfo (installationNamespace , clusterID , installationID , md .NICVersion , installationName )
69
69
return info , nil
70
70
}
0 commit comments