-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expose OTLP collector and allInOne ports
Signed-off-by: Ruben Vargas <[email protected]>
- Loading branch information
1 parent
c7244a5
commit 621ae4c
Showing
6 changed files
with
115 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package deployment | ||
|
||
import ( | ||
"github.com/jaegertracing/jaeger-operator/pkg/util" | ||
corev1 "k8s.io/api/core/v1" | ||
) | ||
|
||
const collectorOTLPEnvVarName = "COLLECTOR_OTLP_ENABLED" | ||
|
||
func updateOTLPEnvVars(envs []corev1.EnvVar, options []string) []corev1.EnvVar { | ||
noExplicitFlag := len(util.FindItem("--collector.otlp.enabled=", options)) == 0 | ||
noExplicitEnvVar := findEnvVar(envs, collectorOTLPEnvVarName) == nil | ||
if noExplicitFlag && noExplicitEnvVar { | ||
envs = append(envs, corev1.EnvVar{ | ||
Name: collectorOTLPEnvVarName, | ||
Value: "true", | ||
}) | ||
} | ||
return envs | ||
} | ||
|
||
func findEnvVar(envs []corev1.EnvVar, name string) *corev1.EnvVar { | ||
for _, env := range envs { | ||
if env.Name == name { | ||
return &env | ||
} | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters