Skip to content

Commit

Permalink
chore: upgrade Go and deps
Browse files Browse the repository at this point in the history
this allows us to get rid of all the replacements
  • Loading branch information
ctrox committed Dec 20, 2023
1 parent 704a004 commit 38f1513
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 119 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"

- uses: dominikh/[email protected]
with:
version: "2022.1.3"
version: "2023.1.6"

test:
runs-on: ubuntu-latest
Expand All @@ -20,7 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"

- name: test
run: sudo --preserve-env make test
Expand All @@ -38,7 +43,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.21"

- name: e2e
run: make test-e2e
2 changes: 1 addition & 1 deletion cmd/installer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.20 as builder
FROM --platform=$BUILDPLATFORM golang:1.21 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
4 changes: 2 additions & 2 deletions cmd/manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.20 as builder
FROM --platform=$BUILDPLATFORM golang:1.21 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -16,4 +16,4 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH GO111MODULE=on go build -ldflags
FROM gcr.io/distroless/static-debian11

COPY --from=builder /workspace/zeropod-manager /
CMD ["/zeropod-manager"]
CMD ["/zeropod-manager"]
10 changes: 5 additions & 5 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
)

const runtimeClassName = "zeropod"
Expand Down Expand Up @@ -212,12 +212,12 @@ func TestE2E(t *testing.T) {
}{
"running": {
metric: prometheus.BuildFQName(zeropod.MetricsNamespace, "", zeropod.MetricRunning),
gaugeValue: pointer.Float64(1),
gaugeValue: ptr.To(float64(1)),
pod: runningPod,
},
"not running": {
metric: prometheus.BuildFQName(zeropod.MetricsNamespace, "", zeropod.MetricRunning),
gaugeValue: pointer.Float64(0),
gaugeValue: ptr.To(float64(0)),
pod: checkpointedPod,
},
"last checkpoint time": {
Expand All @@ -228,7 +228,7 @@ func TestE2E(t *testing.T) {
metric: prometheus.BuildFQName(zeropod.MetricsNamespace, "", zeropod.MetricCheckPointDuration),
pod: checkpointedPod,
// we expect two checkpoints as the first one happens due to the startupProbe
histogramSampleCount: pointer.Uint64(2),
histogramSampleCount: ptr.To(uint64(2)),
},
"last restore time": {
metric: prometheus.BuildFQName(zeropod.MetricsNamespace, "", zeropod.MetricLastRestoreTime),
Expand All @@ -238,7 +238,7 @@ func TestE2E(t *testing.T) {
metric: prometheus.BuildFQName(zeropod.MetricsNamespace, "", zeropod.MetricRestoreDuration),
pod: restoredPod,
// we expect two restores as the first one happens due to the startupProbe
histogramSampleCount: pointer.Uint64(2),
histogramSampleCount: ptr.To(uint64(2)),
},
}

Expand Down
4 changes: 2 additions & 2 deletions e2e/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/remotecommand"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/kind/pkg/apis/config/v1alpha4"
"sigs.k8s.io/kind/pkg/cluster"
Expand Down Expand Up @@ -377,7 +377,7 @@ func testPod(opts ...podOption) *corev1.Pod {
Labels: map[string]string{"app": "zeropod-e2e"},
},
Spec: corev1.PodSpec{
RuntimeClassName: pointer.String(runtimeClassName),
RuntimeClassName: ptr.To(runtimeClassName),
},
}

Expand Down
61 changes: 26 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ctrox/zeropod

go 1.19
go 1.21

require (
github.com/cenkalti/backoff/v4 v4.1.3
Expand All @@ -21,20 +21,20 @@ require (
github.com/prometheus/client_golang v1.14.0
github.com/prometheus/client_model v0.3.0
github.com/prometheus/common v0.37.0
github.com/prometheus/procfs v0.8.0
github.com/prometheus/procfs v0.12.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.4
golang.org/x/sys v0.10.0
golang.org/x/sys v0.15.0
google.golang.org/grpc v1.52.0
k8s.io/api v0.26.1
k8s.io/apimachinery v0.26.1
k8s.io/client-go v0.26.1
k8s.io/api v0.29.0
k8s.io/apimachinery v0.29.0
k8s.io/client-go v0.29.0
k8s.io/cri-api v0.25.0
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448
k8s.io/utils v0.0.0-20231127182322-b307cd553661
sigs.k8s.io/controller-runtime v0.14.5
sigs.k8s.io/kind v0.19.0
sigs.k8s.io/kustomize/api v0.12.1
sigs.k8s.io/kustomize/kyaml v0.13.9
sigs.k8s.io/kustomize/api v0.16.0
sigs.k8s.io/kustomize/kyaml v0.16.0
)

require (
Expand All @@ -53,24 +53,24 @@ require (
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/emicklei/go-restful v2.16.0+incompatible // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gogo/googleapis v1.4.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/imdario/mergo v0.3.13 // indirect
Expand All @@ -92,8 +92,7 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/ginkgo/v2 v2.9.2 // indirect
github.com/onsi/gomega v1.27.5 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect
github.com/opencontainers/runc v1.1.8 // indirect
Expand All @@ -109,35 +108,27 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.7.0 // indirect
golang.org/x/tools v0.12.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/evanphx/json-patch.v5 v5.6.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.2.2 // indirect
k8s.io/apiserver v0.26.1 // indirect
k8s.io/component-base v0.26.1 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace (
// fork of procfs with change https://github.com/prometheus/procfs/pull/552
github.com/prometheus/procfs => github.com/ctrox/procfs v0.0.0-20230719173910-a2be10bd98d2
// because https://github.com/kubernetes/client-go/issues/1084
// should be fixed with client-go v0.28
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20220401212409-b28bf2818661
sigs.k8s.io/kustomize/kyaml => sigs.k8s.io/kustomize/kyaml v0.13.9
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading

0 comments on commit 38f1513

Please sign in to comment.