Skip to content

Commit 5358b69

Browse files
authored
Merge pull request #61 from spolti/sync
Sync
2 parents be75e15 + 8b2b2c5 commit 5358b69

File tree

4 files changed

+30
-16
lines changed

4 files changed

+30
-16
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
repos:
1515
- repo: https://github.com/golangci/golangci-lint
16-
rev: v1.51.1
16+
rev: v1.60.3
1717
hooks:
1818
- id: golangci-lint
1919
log_file: .pre-commit.log

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
###############################################################################
1616
# Stage 1: Create the developer image for the BUILDPLATFORM only
1717
###############################################################################
18-
ARG GOLANG_VERSION=1.21
18+
ARG GOLANG_VERSION=1.22
1919
ARG BUILD_BASE=develop
2020
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:$GOLANG_VERSION AS develop
2121

@@ -25,19 +25,20 @@ USER root
2525
ENV HOME=/root
2626

2727
# Install build and dev tools
28-
# NOTE: Require python38 to install pre-commit
28+
# python is required for pre-commit
2929
RUN --mount=type=cache,target=/root/.cache/dnf:rw \
3030
dnf install --setopt=cachedir=/root/.cache/dnf -y --nodocs \
3131
nodejs \
32-
python38 \
33-
&& ln -sf /usr/bin/python3 /usr/bin/python \
34-
&& ln -sf /usr/bin/pip3 /usr/bin/pip \
32+
python3.11 \
33+
python3.11-pip \
34+
&& alternatives --set python /usr/bin/python3.11 \
35+
&& alternatives --install /usr/bin/pip pip /usr/bin/pip3.11 1 \
3536
&& true
3637

3738
# Install pre-commit
3839
ENV PIP_CACHE_DIR=/root/.cache/pip
3940
RUN --mount=type=cache,target=/root/.cache/pip \
40-
pip install pre-commit
41+
/usr/bin/pip install pre-commit
4142

4243
# When using the BuildKit backend, Docker predefines a set of ARG variables with
4344
# information on the platform of the node performing the build (build platform)
@@ -140,7 +141,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
140141
###############################################################################
141142
# Stage 3: Copy binaries only to create the smallest final runtime image
142143
###############################################################################
143-
FROM registry.access.redhat.com/ubi8/ubi-micro:latest as runtime
144+
FROM registry.access.redhat.com/ubi9/ubi-micro:9.5 as runtime
144145

145146
ARG USER=2000
146147

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kserve/rest-proxy
22

3-
go 1.21
3+
go 1.22.9
44

55
require (
66
github.com/google/go-cmp v0.6.0

proxy/main.go

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ import (
3434
)
3535

3636
const (
37-
restProxyPortEnvVar = "REST_PROXY_LISTEN_PORT"
38-
restProxyGrpcMaxMsgSize = "REST_PROXY_GRPC_MAX_MSG_SIZE_BYTES"
39-
restProxyGrpcPortEnvVar = "REST_PROXY_GRPC_PORT"
40-
restProxyTlsEnvVar = "REST_PROXY_USE_TLS"
41-
tlsCertEnvVar = "MM_TLS_KEY_CERT_PATH"
42-
tlsKeyEnvVar = "MM_TLS_PRIVATE_KEY_PATH"
37+
restProxyPortEnvVar = "REST_PROXY_LISTEN_PORT"
38+
restProxyGrpcMaxMsgSize = "REST_PROXY_GRPC_MAX_MSG_SIZE_BYTES"
39+
restProxyGrpcPortEnvVar = "REST_PROXY_GRPC_PORT"
40+
restProxyTlsEnvVar = "REST_PROXY_USE_TLS"
41+
restProxySkipVerifyEnvVar = "REST_PROXY_SKIP_VERIFY"
42+
tlsCertEnvVar = "MM_TLS_KEY_CERT_PATH"
43+
tlsKeyEnvVar = "MM_TLS_PRIVATE_KEY_PATH"
4344
)
4445

4546
var (
@@ -85,8 +86,20 @@ func run() error {
8586
var transportCreds credentials.TransportCredentials
8687
if useTLS, ok := os.LookupEnv(restProxyTlsEnvVar); ok && useTLS == "true" {
8788
logger.Info("Using TLS")
89+
90+
skipVerifyBool := false
91+
skipVerify, ok := os.LookupEnv(restProxySkipVerifyEnvVar)
92+
if ok {
93+
var err error
94+
skipVerifyBool, err = strconv.ParseBool(skipVerify)
95+
if err != nil {
96+
logger.Error(err, "Failed to parse %s=%s to bool", restProxySkipVerifyEnvVar, skipVerify)
97+
skipVerifyBool = false
98+
}
99+
}
100+
88101
transportCreds = credentials.NewTLS(&tls.Config{
89-
InsecureSkipVerify: true,
102+
InsecureSkipVerify: skipVerifyBool,
90103
})
91104
} else {
92105
logger.Info("Not using TLS")

0 commit comments

Comments
 (0)