Skip to content

Commit a39952b

Browse files
committed
Fix issue of label to env
1 parent 7dd3594 commit a39952b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pkg/mutation/mutation_pod.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ func makePodEnvs(pod *corev1.Pod) []corev1.EnvVar {
139139

140140
for _, prefix := range validPrefixes {
141141
if strings.HasPrefix(labelKey, prefix) {
142-
trimmedKey := strings.TrimPrefix(labelKey, prefix)
143-
if trimmedKey != "" {
144-
metaPairs = append(metaPairs, fmt.Sprintf("%s=%s", trimmedKey, labelValue))
145-
}
142+
metaPairs = append(metaPairs, fmt.Sprintf("%s=%s", labelKey, labelValue))
146143
break
147144
}
148145
}

0 commit comments

Comments
 (0)