Skip to content

Commit

Permalink
Adapt for OpenShift
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha committed Apr 17, 2024
1 parent f7630ed commit 596606a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pkg/deploy/gateway/oauth_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,15 @@ func getOauthProxyContainerSpec(ctx *chetypes.DeployContext) corev1.Container {
Name: "oauth-proxy",
Image: defaults.GetGatewayAuthenticationSidecarImage(ctx.CheCluster),
ImagePullPolicy: corev1.PullIfNotPresent,
Args: []string{
"--config=/etc/oauth-proxy/oauth-proxy.cfg",
"--ping-path=/ping",
"--exclude-logging-path=/ping",
},
Args: map[bool][]string{
true: {
"--config=/etc/oauth-proxy/oauth-proxy.cfg",
},
false: {
"--config=/etc/oauth-proxy/oauth-proxy.cfg",
"--ping-path=/ping",
"--exclude-logging-path=/ping"},
}[infrastructure.IsOpenShift()],
VolumeMounts: []corev1.VolumeMount{
{
Name: "oauth-proxy-config",
Expand Down Expand Up @@ -232,7 +236,7 @@ func getOauthProxyContainerSpec(ctx *chetypes.DeployContext) corev1.Container {
ReadinessProbe: &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/ping",
Path: map[bool]string{true: "/oauth/healthz", false: "/ping"}[infrastructure.IsOpenShift()],
Port: intstr.IntOrString{
Type: intstr.Int,
IntVal: int32(8080),
Expand All @@ -249,7 +253,7 @@ func getOauthProxyContainerSpec(ctx *chetypes.DeployContext) corev1.Container {
LivenessProbe: &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/ping",
Path: map[bool]string{true: "/oauth/healthz", false: "/ping"}[infrastructure.IsOpenShift()],
Port: intstr.IntOrString{
Type: intstr.Int,
IntVal: int32(8080),
Expand Down

0 comments on commit 596606a

Please sign in to comment.