Skip to content

Commit

Permalink
fix exporter env
Browse files Browse the repository at this point in the history
Signed-off-by: drivebyer <wuyangmuc@gmail.com>
  • Loading branch information
drivebyer committed Dec 23, 2023
1 parent 8b558bc commit 469bcba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions k8sutils/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,12 @@ func getExporterEnvironmentVariables(params containerParameters) []corev1.EnvVar
Value: fmt.Sprintf(":%d", *params.RedisExporterPort),
})
}
if params.Port != nil {
envVars = append(envVars, corev1.EnvVar{
Name: "REDIS_ADDR",
Value: fmt.Sprintf("redis://localhost:%d", *params.Port),
})
}

Check warning on line 522 in k8sutils/statefulset.go

View check run for this annotation

Codecov / codecov/patch

k8sutils/statefulset.go#L518-L522

Added lines #L518 - L522 were not covered by tests
if params.RedisExporterEnv != nil {
envVars = append(envVars, *params.RedisExporterEnv...)
}
Expand Down

0 comments on commit 469bcba

Please sign in to comment.