Skip to content

Commit 95ff479

Browse files
Merge pull request #39 from kserve/main
[pull] main from kserve:main
2 parents b53c140 + 014856c commit 95ff479

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+212
-266
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
.DS_Store
55
Dockerfile
66
temp
7+
.pre-commit.log
8+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88
*.iml
99

1010
public/
11+
12+
.pre-commit.log
13+

.golangci.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,13 @@ linters:
9393
fast: false
9494
enable:
9595
# These are the defaults for golangci-lint
96-
- deadcode
9796
- errcheck
9897
- gosimple
9998
- govet
10099
- ineffassign
101100
- staticcheck
102-
- structcheck
103101
- typecheck
104102
- unused
105-
- varcheck
106103

107104
# Also enable these
108105
- goconst

.pre-commit-config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
# limitations under the License.
1414
repos:
1515
- repo: https://github.com/golangci/golangci-lint
16-
rev: v1.43.0
16+
rev: v1.51.1
1717
hooks:
1818
- id: golangci-lint
19+
log_file: .pre-commit.log
1920
- repo: https://github.com/pre-commit/mirrors-prettier
2021
rev: v2.4.1
2122
hooks:
2223
- id: prettier
24+
log_file: .pre-commit.log

Dockerfile

Lines changed: 3 additions & 1 deletion
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.17
18+
ARG GOLANG_VERSION=1.19
1919
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:$GOLANG_VERSION AS develop
2020

2121
ARG PROTOC_VERSION=21.5
@@ -93,6 +93,8 @@ RUN true \
9393
COPY .pre-commit-config.yaml ./
9494
RUN git init && \
9595
pre-commit install-hooks && \
96+
# Fix: 'fatal: detected dubious ownership in repository' \
97+
git config --global --add safe.directory "*" && \
9698
rm -rf .git
9799

98100
# Download dependencies before copying the source so they will be cached

go.mod

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ require (
1212
github.com/go-logr/zapr v1.2.3
1313
github.com/golang/mock v1.6.0
1414
github.com/joho/godotenv v1.4.0
15-
github.com/stretchr/testify v1.8.1
16-
go.uber.org/zap v1.23.0
15+
github.com/stretchr/testify v1.8.4
16+
go.uber.org/zap v1.24.0
1717
golang.org/x/sync v0.1.0
1818
google.golang.org/api v0.114.0
1919
google.golang.org/grpc v1.56.3
2020
google.golang.org/protobuf v1.30.0
2121
// controller-runtime dependency is only used for logging
22-
sigs.k8s.io/controller-runtime v0.11.2
22+
sigs.k8s.io/controller-runtime v0.14.6
2323
)
2424

2525
require (
@@ -42,11 +42,13 @@ require (
4242
github.com/googleapis/gax-go/v2 v2.7.1 // indirect
4343
github.com/jmespath/go-jmespath v0.4.0 // indirect
4444
github.com/json-iterator/go v1.1.12 // indirect
45+
github.com/kr/text v0.2.0 // indirect
4546
github.com/kylelemons/godebug v1.1.0 // indirect
4647
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4748
github.com/modern-go/reflect2 v1.0.2 // indirect
4849
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect
4950
github.com/pmezard/go-difflib v1.0.0 // indirect
51+
github.com/rogpeppe/go-internal v1.11.0 // indirect
5052
go.opencensus.io v0.24.0 // indirect
5153
go.uber.org/atomic v1.7.0 // indirect
5254
go.uber.org/multierr v1.6.0 // indirect
@@ -61,15 +63,22 @@ require (
6163
gopkg.in/inf.v0 v0.9.1 // indirect
6264
gopkg.in/yaml.v2 v2.4.0 // indirect
6365
gopkg.in/yaml.v3 v3.0.1 // indirect
64-
k8s.io/apimachinery v0.23.5 // indirect
65-
k8s.io/klog/v2 v2.30.0 // indirect
66-
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
67-
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
68-
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
66+
k8s.io/apimachinery v0.26.1 // indirect
67+
k8s.io/klog/v2 v2.90.1 // indirect
68+
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
69+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
70+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
6971
)
7072

71-
// Update to avoid CVE-2022-27191, CVE-2021-43565, CVE-2020-29652
72-
replace golang.org/x/crypto => golang.org/x/crypto v0.14.0
73-
74-
// Update to avoid CVE-2023-3978, CVE-2023-39325, CVE-2023-44487
75-
replace golang.org/x/net => golang.org/x/net v0.17.0
73+
replace (
74+
// Update to avoid CVE-2022-27191, CVE-2021-43565, CVE-2020-29652
75+
golang.org/x/crypto => golang.org/x/crypto v0.14.0
76+
// Update to avoid CVE-2023-3978, CVE-2023-39325, CVE-2023-44487
77+
golang.org/x/net => golang.org/x/net v0.17.0
78+
// remove when upgrade to controller-runtime 0.15.x or apimachinery to 0.27.x
79+
// Fixes github.com/elazarl/goproxy Denial of Service (DoS)
80+
// This dependency was removed from apimachinery 0.27.0
81+
// Even the controller-runtime being used only for logging, the version 0.15.0 brings
82+
// apimachinery 0.27.0 that brings a lot more of indirect dependencies that we don't want to pull
83+
k8s.io/apimachinery => k8s.io/apimachinery v0.27.0
84+
)

go.sum

Lines changed: 26 additions & 96 deletions
Large diffs are not rendered by default.

internal/modelschema/modelschema.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,7 +16,7 @@ package modelschema
1616
import (
1717
"encoding/json"
1818
"fmt"
19-
"io/ioutil"
19+
"os"
2020
)
2121

2222
// Filename for the schema JSON
@@ -55,7 +55,7 @@ const (
5555
)
5656

5757
func NewFromFile(schemaFilename string) (*ModelSchema, error) {
58-
jsonBytes, err := ioutil.ReadFile(schemaFilename)
58+
jsonBytes, err := os.ReadFile(schemaFilename)
5959
if err != nil {
6060
return nil, fmt.Errorf("Unable to read model schema file %s: %w", schemaFilename, err)
6161
}

internal/util/connect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,

internal/util/connect_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,

0 commit comments

Comments
 (0)