Skip to content

Commit

Permalink
chore: Bump Golang and dep versions
Browse files Browse the repository at this point in the history
  • Loading branch information
fengye87 committed Jan 11, 2024
1 parent db3f654 commit 318e476
Show file tree
Hide file tree
Showing 20 changed files with 466 additions and 1,018 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: 1.19.3
go-version: 1.21.1

- run: make test

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: 1.19.3
go-version: 1.21.1

- run: make e2e
2 changes: 1 addition & 1 deletion build/virt-controller/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-alpine AS builder
FROM golang:1.21-alpine AS builder

WORKDIR /workspace

Expand Down
2 changes: 1 addition & 1 deletion build/virt-daemon/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-alpine AS builder
FROM golang:1.21-alpine AS builder

WORKDIR /workspace

Expand Down
10 changes: 5 additions & 5 deletions build/virt-prerunner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-alpine AS builder
FROM golang:1.21-alpine AS builder

RUN apk add --no-cache gcc musl-dev

Expand All @@ -20,13 +20,13 @@ RUN set -eux; \
mkdir /var/lib/cloud-hypervisor; \
case "$(uname -m)" in \
'x86_64') \
curl -sLo /usr/bin/cloud-hypervisor https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v30.0/cloud-hypervisor-static; \
curl -sLo /usr/bin/ch-remote https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v30.0/ch-remote-static; \
curl -sLo /usr/bin/cloud-hypervisor https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v37.0/cloud-hypervisor-static; \
curl -sLo /usr/bin/ch-remote https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v37.0/ch-remote-static; \
curl -sLo /var/lib/cloud-hypervisor/hypervisor-fw https://github.com/cloud-hypervisor/rust-hypervisor-firmware/releases/download/0.4.0/hypervisor-fw; \
;; \
'aarch64') \
curl -sLo /usr/bin/cloud-hypervisor https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v30.0/cloud-hypervisor-static-aarch64; \
curl -sLo /usr/bin/ch-remote https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v30.0/ch-remote-static-aarch64; \
curl -sLo /usr/bin/cloud-hypervisor https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v37.0/cloud-hypervisor-static-aarch64; \
curl -sLo /usr/bin/ch-remote https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v37.0/ch-remote-static-aarch64; \
curl -sLo /var/lib/cloud-hypervisor/CLOUDHV_EFI.fd https://github.com/smartxworks/cloud-hypervisor-edk2-builder/releases/download/20220706/CLOUDHV_EFI.fd; \
;; \
*) echo >&2 "error: unsupported architecture '$(uname -m)'"; exit 1 ;; \
Expand Down
4 changes: 2 additions & 2 deletions cmd/cloud-hypervisor-client-gen/client.go.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
)
Expand Down Expand Up @@ -51,7 +51,7 @@ func (c *Client) {{name}}(ctx context.Context{{#arg}}, arg {{arg}}{{/arg}}) {{#r
defer resp.Body.Close()

if resp.StatusCode >= 400 {
body, _ := ioutil.ReadAll(resp.Body)
body, _ := io.ReadAll(resp.Body)
return {{#ret}}nil, {{/ret}}fmt.Errorf("request failed: %d %s: %s", resp.StatusCode, http.StatusText(resp.StatusCode), string(body))
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/cloud-hypervisor-client-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
_ "embed"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"sort"
"strings"
Expand All @@ -18,13 +18,13 @@ import (
var clientTemplate string

func main() {
resp, err := http.Get("https://raw.githubusercontent.com/cloud-hypervisor/cloud-hypervisor/v30.0/vmm/src/api/openapi/cloud-hypervisor.yaml")
resp, err := http.Get("https://raw.githubusercontent.com/cloud-hypervisor/cloud-hypervisor/v37.0/vmm/src/api/openapi/cloud-hypervisor.yaml")
if err != nil {
panic(err)
}
defer resp.Body.Close()

spec, err := ioutil.ReadAll(resp.Body)
spec, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
Expand Down
21 changes: 15 additions & 6 deletions cmd/virt-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/webhook"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"

virtv1alpha1 "github.com/smartxworks/virtink/pkg/apis/virt/v1alpha1"
"github.com/smartxworks/virtink/pkg/controller"
Expand Down Expand Up @@ -54,8 +54,7 @@ func main() {

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Port: 9443,
Metrics: metricsserver.Options{BindAddress: metricsAddr},
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "controller.virtink.smartx.com",
Expand All @@ -75,6 +74,15 @@ func main() {
os.Exit(1)
}

if err := (&controller.VMMutator{}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "VMMutator")
os.Exit(1)
}
if err := (&controller.VMValidator{}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "VMValidator")
os.Exit(1)
}

if err = (&controller.VMMReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Expand All @@ -84,9 +92,10 @@ func main() {
os.Exit(1)
}

mgr.GetWebhookServer().Register("/mutate-v1alpha1-virtualmachine", &webhook.Admission{Handler: &controller.VMMutator{}})
mgr.GetWebhookServer().Register("/validate-v1alpha1-virtualmachine", &webhook.Admission{Handler: &controller.VMValidator{}})
mgr.GetWebhookServer().Register("/validate-v1alpha1-virtualmachinemigration", &webhook.Admission{Handler: &controller.VMMValidator{Client: mgr.GetClient()}})
if err := (&controller.VMMValidator{}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "VMMValidator")
os.Exit(1)
}

if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
setupLog.Error(err, "unable to set up health check")
Expand Down
3 changes: 2 additions & 1 deletion cmd/virt-daemon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"

virtv1alpha1 "github.com/smartxworks/virtink/pkg/apis/virt/v1alpha1"
"github.com/smartxworks/virtink/pkg/daemon"
Expand Down Expand Up @@ -43,7 +44,7 @@ func main() {

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
Metrics: metricsserver.Options{BindAddress: metricsAddr},
HealthProbeBindAddress: probeAddr,
})
if err != nil {
Expand Down
162 changes: 77 additions & 85 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,132 +1,124 @@
module github.com/smartxworks/virtink

go 1.19
go 1.21

require (
github.com/docker/libnetwork v0.0.0-00010101000000-000000000000
github.com/golang/mock v1.6.0
github.com/google/uuid v1.1.2
github.com/google/uuid v1.5.0
github.com/hoisie/mustache v0.0.0-20160804235033-6375acf62c69
github.com/iancoleman/strcase v0.2.0
github.com/intel/userspace-cni-network-plugin v0.0.0-20201014132026-387fb2be6a32
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.3.0
github.com/moby/sys/mountinfo v0.6.2
github.com/iancoleman/strcase v0.3.0
github.com/intel/userspace-cni-network-plugin v0.0.0-20240109115313-ade22dc9f493
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0
github.com/moby/sys/mountinfo v0.7.1
github.com/namsral/flag v1.7.4-pre
github.com/nasa9084/go-openapi v0.0.0-20210722142352-4a81d737faf6
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.19.0
github.com/opencontainers/runc v1.1.5
github.com/onsi/gomega v1.30.0
github.com/opencontainers/runc v1.1.11
github.com/r3labs/diff/v2 v2.15.1
github.com/stretchr/testify v1.7.0
github.com/stretchr/testify v1.8.4
github.com/subgraph/libmacouflage v0.0.1
github.com/vishvananda/netlink v1.1.0
golang.org/x/sys v0.0.0-20220908164124-27713097b956
google.golang.org/grpc v1.47.0
github.com/vishvananda/netlink v1.2.1-beta.2
golang.org/x/sys v0.16.0
google.golang.org/grpc v1.60.1
gopkg.in/fsnotify.v1 v1.4.7
inet.af/tcpproxy v0.0.0-20220326234310-be3ee21c9fa0
k8s.io/api v0.25.0
k8s.io/apimachinery v0.25.0
k8s.io/apiserver v0.24.1
k8s.io/client-go v0.25.0
k8s.io/kubelet v0.24.1
kubevirt.io/containerized-data-importer-api v1.50.0
sigs.k8s.io/controller-runtime v0.13.0
sigs.k8s.io/controller-tools v0.9.0
inet.af/tcpproxy v0.0.0-20231102063150-2862066fc2a9
k8s.io/api v0.29.0
k8s.io/apimachinery v0.29.0
k8s.io/apiserver v0.29.0
k8s.io/client-go v0.29.0
k8s.io/kubelet v0.29.0
kubevirt.io/containerized-data-importer-api v1.58.0
sigs.k8s.io/controller-runtime v0.16.3
sigs.k8s.io/controller-tools v0.13.0
)

require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cilium/ebpf v0.7.0 // indirect
github.com/containernetworking/cni v1.0.1 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
github.com/containernetworking/cni v1.1.2 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/docker v20.10.16+incompatible // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/docker/docker v24.0.7+incompatible // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fatih/color v1.12.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/gobuffalo/flect v0.2.5 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/zapr v1.2.4 // 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/gobuffalo/flect v1.0.2 // indirect
github.com/godbus/dbus/v5 v5.0.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/ishidawataru/sctp v0.0.0-20210707070123-9a39160e9062 // indirect
github.com/golang/protobuf v1.5.3 // 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/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ishidawataru/sctp v0.0.0-20230406120618-7ff4192f6ff2 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
github.com/openshift/api v0.0.0-20230406152840-ce21e3fe5da2 // indirect
github.com/openshift/custom-resource-status v1.1.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/cobra v1.4.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
golang.org/x/tools v0.1.10 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect
google.golang.org/protobuf v1.28.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.16.1 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.25.0 // indirect
k8s.io/component-base v0.25.0 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
gotest.tools/v3 v3.5.1 // indirect
k8s.io/apiextensions-apiserver v0.28.3 // indirect
k8s.io/component-base v0.29.0 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace (
github.com/containernetworking/cni => github.com/containernetworking/cni v0.8.0
github.com/docker/docker => github.com/docker/docker v20.10.27+incompatible
github.com/docker/libnetwork => github.com/docker/libnetwork v0.8.0-dev.2.0.20220525220214-2dab5620d446
k8s.io/api => k8s.io/api v0.24.1
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.24.1
k8s.io/apimachinery => k8s.io/apimachinery v0.24.1
k8s.io/apiserver => k8s.io/apiserver v0.24.1
k8s.io/client-go => k8s.io/client-go v0.24.1
k8s.io/component-base => k8s.io/component-base v0.24.1
k8s.io/kubelet => k8s.io/kubelet v0.24.1
)
Loading

0 comments on commit 318e476

Please sign in to comment.