Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
feat: added team label env
Browse files Browse the repository at this point in the history
  • Loading branch information
rhoofard committed May 8, 2024
1 parent df3e8d8 commit b9e9ec4
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions controllers/tf_controller_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,21 +210,16 @@ func (r *TerraformReconciler) runnerPodSpec(terraform infrav1.Terraform, tlsSecr
}
}
}
// if terraform.GetLabels() != nil {
// for k, v := range terraform.GetLabels() {
// if strings.HasPrefix(k, "tracing.attributes/") {

// }
// }

// }
//adding traceparent env to runner
// if envValue := os.Getenv("TRACEPARENT"); envValue != "" {
// envvarsMap["TRACEPARENT"] = v1.EnvVar{
// Name: "TRACEPARENT",
// Value: envValue,
// }
// }
if terraform.GetLabels() != nil {
for k, v := range terraform.GetLabels() {
if strings.Compare(k, "tracing.attributes/team") == 0 {
envvarsMap["TEAM"] = v1.EnvVar{
Name: "TEAM",
Value: v,
}
}
}
}

for _, env := range terraform.Spec.RunnerPodTemplate.Spec.Env {
envvarsMap[env.Name] = env
Expand Down

0 comments on commit b9e9ec4

Please sign in to comment.