@@ -36,7 +36,6 @@ func Test_getURL(t *testing.T) {
3636 os .Setenv ("DD_CLUSTER_NAME" , "cluster" )
3737 os .Setenv ("DD_API_KEY" , "api-key" )
3838 os .Setenv ("DD_APP_KEY" , "app-key" )
39- os .Setenv ("DD_HOSTNAME" , "host-name" )
4039 },
4140 wantURL : "https://app.datadoghq.com/api/v1/metadata" ,
4241 },
@@ -47,7 +46,6 @@ func Test_getURL(t *testing.T) {
4746 os .Setenv ("DD_SITE" , "datad0g.com" )
4847 os .Setenv ("DD_API_KEY" , "api-key" )
4948 os .Setenv ("DD_APP_KEY" , "app-key" )
50- os .Setenv ("DD_HOSTNAME" , "host-name" )
5149 },
5250 wantURL : "https://app.datad0g.com/api/v1/metadata" ,
5351 },
@@ -58,7 +56,6 @@ func Test_getURL(t *testing.T) {
5856 os .Setenv ("DD_URL" , "https://app.datad0g.com" )
5957 os .Setenv ("DD_API_KEY" , "api-key" )
6058 os .Setenv ("DD_APP_KEY" , "app-key" )
61- os .Setenv ("DD_HOSTNAME" , "host-name" )
6259 },
6360 wantURL : "https://app.datad0g.com/api/v1/metadata" ,
6461 },
@@ -116,7 +113,6 @@ func Test_setup(t *testing.T) {
116113 os .Setenv ("DD_API_KEY" , fakeAPIKeyOperator )
117114 os .Setenv ("DD_APP_KEY" , fakeAPPKeyDDA )
118115 os .Setenv ("DD_CLUSTER_NAME" , fakeClusterNameOperator )
119- os .Setenv ("DD_HOSTNAME" , "host-name" )
120116 },
121117 dda : & v2alpha1.DatadogAgent {},
122118 wantClusterName : "fake_cluster_name_operator" ,
@@ -128,7 +124,6 @@ func Test_setup(t *testing.T) {
128124 loadFunc : func () {
129125 os .Clearenv ()
130126 os .Setenv ("DD_CLUSTER_NAME" , fakeClusterNameOperator )
131- os .Setenv ("DD_HOSTNAME" , "host-name" )
132127
133128 },
134129 dda : & v2alpha1.DatadogAgent {
@@ -149,7 +144,6 @@ func Test_setup(t *testing.T) {
149144 name : "credentials and site set in DDA" ,
150145 loadFunc : func () {
151146 os .Clearenv ()
152- os .Setenv ("DD_HOSTNAME" , "host-name" )
153147 },
154148 dda : & v2alpha1.DatadogAgent {
155149 Spec : v2alpha1.DatadogAgentSpec {
@@ -209,7 +203,6 @@ func Test_GetPayload(t *testing.T) {
209203 expectedKubernetesVersion := "v1.28.0"
210204 expectedOperatorVersion := "v1.19.0"
211205 expectedClusterUID := "test-cluster-uid-12345"
212- expectedHostname := "test-host"
213206
214207 s := testutils_test .TestScheme ()
215208 kubeSystem := & corev1.Namespace {
@@ -227,9 +220,6 @@ func Test_GetPayload(t *testing.T) {
227220 },
228221 }
229222
230- // Set hostname in SharedMetadata to simulate it being populated
231- omf .hostName = expectedHostname
232-
233223 payload := omf .GetPayload (expectedClusterUID )
234224
235225 // Verify payload is valid JSON
@@ -244,10 +234,6 @@ func Test_GetPayload(t *testing.T) {
244234 }
245235
246236 // Validate top-level fields
247- if hostname , ok := parsed ["hostname" ].(string ); ! ok || hostname != expectedHostname {
248- t .Errorf ("GetPayload() hostname = %v, want %v" , hostname , expectedHostname )
249- }
250-
251237 if timestamp , ok := parsed ["timestamp" ].(float64 ); ! ok || timestamp <= 0 {
252238 t .Errorf ("GetPayload() timestamp = %v, want positive number" , timestamp )
253239 }
0 commit comments