Skip to content

Commit

Permalink
fix: remove workload kind from env var
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamir David authored and Tamir David committed Oct 7, 2024
1 parent 8ee6a28 commit 94feec6
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
common "github.com/odigos-io/odigos/common"
"sigs.k8s.io/controller-runtime/pkg/webhook"

"github.com/odigos-io/odigos/k8sutils/pkg/workload"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
)
Expand Down Expand Up @@ -42,18 +41,13 @@ func (p *PodsWebhook) Default(ctx context.Context, obj runtime.Object) error {

func injectOdigosEnvVars(pod *corev1.Pod) {
namespace := pod.Namespace
workloadKind := workload.GetWorkloadKind(pod)

// Common environment variables that do not change across containers
commonEnvVars := []corev1.EnvVar{
{
Name: EnvVarNamespace,
Value: namespace,
},
{
Name: EnvVarWorkloadKind,
Value: workloadKind,
},
{
Name: EnvVarPodName,
ValueFrom: &corev1.EnvVarSource{
Expand Down

0 comments on commit 94feec6

Please sign in to comment.