Skip to content

Commit

Permalink
Remove DD_HOSTNAME from agent and move it back to check runner (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
carloscastrojumo committed Aug 27, 2020
1 parent e4f7a0a commit 3b8bf72
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ build-plugin: ${ARTIFACT_PLUGIN}
${ARTIFACT_PLUGIN}: ${SOURCES}
CGO_ENABLED=0 go build -i -installsuffix cgo ${LDFLAGS} -o ${ARTIFACT_PLUGIN} ./cmd/${ARTIFACT_PLUGIN}/main.go

container:
container: bin/operator-sdk
./bin/operator-sdk build $(PREFIX):$(TAG)
ifeq ($(KINDPUSH), true)
kind load docker-image --name $(KIND_CLUSTER_NAME) $(PREFIX):$(TAG)
Expand All @@ -54,7 +54,7 @@ container-ci:
test:
./go.test.sh

e2e:
e2e: bin/operator-sdk
kubectl apply -f deploy/datadoghq_v1alpha1_extendeddaemonset_crd.yaml
./bin/operator-sdk test local ./test/e2e --go-test-flags '-v' --image $(PREFIX):$(TAG)

Expand Down
8 changes: 0 additions & 8 deletions pkg/controller/datadogagent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,6 @@ func defaultEnvVars() []corev1.EnvVar {
},
},
},
{
Name: datadoghqv1alpha1.DDHostname,
ValueFrom: &corev1.EnvVarSource{
FieldRef: &corev1.ObjectFieldSelector{
FieldPath: FieldPathSpecNodeName,
},
},
},
{
Name: "KUBERNETES",
Value: "yes",
Expand Down
8 changes: 8 additions & 0 deletions pkg/controller/datadogagent/clusterchecksrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,14 @@ func getEnvVarsForClusterChecksRunner(dda *datadoghqv1alpha1.DatadogAgent) []cor
},
},
},
{
Name: datadoghqv1alpha1.DDHostname,
ValueFrom: &corev1.EnvVarSource{
FieldRef: &corev1.ObjectFieldSelector{
FieldPath: FieldPathSpecNodeName,
},
},
},
}

if spec.ClusterChecksRunner.Config.LogLevel != nil {
Expand Down
8 changes: 8 additions & 0 deletions pkg/controller/datadogagent/clusterchecksrunner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ func clusterChecksRunnerDefaultEnvVars() []corev1.EnvVar {
},
},
},
{
Name: datadoghqv1alpha1.DDHostname,
ValueFrom: &corev1.EnvVarSource{
FieldRef: &corev1.ObjectFieldSelector{
FieldPath: FieldPathSpecNodeName,
},
},
},
}
}

Expand Down
8 changes: 0 additions & 8 deletions pkg/controller/datadogagent/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,6 @@ func getEnvVarsCommon(dda *datadoghqv1alpha1.DatadogAgent, needAPIKey bool) ([]c
},
},
},
{
Name: datadoghqv1alpha1.DDHostname,
ValueFrom: &corev1.EnvVarSource{
FieldRef: &corev1.ObjectFieldSelector{
FieldPath: FieldPathSpecNodeName,
},
},
},
{
Name: datadoghqv1alpha1.KubernetesEnvvarName,
Value: "yes",
Expand Down

0 comments on commit 3b8bf72

Please sign in to comment.