Skip to content

Commit

Permalink
support VM IP retain for kubevirt
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyasdf committed Jun 30, 2022
1 parent e78b24b commit fcdfea7
Show file tree
Hide file tree
Showing 16 changed files with 678 additions and 150 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: 1.16.6
go-version: 1.17.11
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: 1.16.6
go-version: 1.17.11
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: 1.16.6
go-version: 1.17.11
- name: Run golangci-lint
uses: golangci/[email protected]
with:
Expand All @@ -50,7 +50,7 @@ jobs:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: 1.16.6
go-version: 1.17.11
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ PR is the only way to make change to Hybridnet project files. To help reviewers
As a contributor, if you want to make any contribution to Hybridnet project, we should reach an agreement on the version of tools used in the development environment.
Here are some dependents with specific version:
* golang : v1.16.6
* golang : v1.17.11
* golangci-lint: 1.39.0
When you develop the Hybridnet project at the local environment, you should use subcommands of Makefile to help yourself to check and build the latest version of Hybridnet. For the convenience of developers, we use the docker to build Hybridnet. It can reduce problems of the developing environment.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16.6 as builder
FROM golang:1.17.11 as builder

ENV ARCH=amd64
ENV OS=linux
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16.6 as builder
FROM golang:1.17.11 as builder

ENV ARCH=arm64
ENV OS=linux
Expand Down
8 changes: 8 additions & 0 deletions charts/hybridnet/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ rules:
- get
- list
- update
- apiGroups:
- "kubevirt.io"
resources:
- virtualmachines
- virtualmachineinstances
verbs:
- get
- list

---
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
3 changes: 3 additions & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
"fmt"
"os"

kubevirtv1 "kubevirt.io/api/core/v1"

"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
Expand All @@ -45,6 +47,7 @@ func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(multiclusterv1.AddToScheme(scheme))
utilruntime.Must(networkingv1.AddToScheme(scheme))
utilruntime.Must(kubevirtv1.AddToScheme(scheme))
}

func main() {
Expand Down
143 changes: 106 additions & 37 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
module github.com/alibaba/hybridnet

go 1.16
go 1.17

require (
github.com/containernetworking/cni v0.8.1
github.com/containernetworking/plugins v0.0.0-00010101000000-000000000000
github.com/coreos/go-iptables v0.6.0
github.com/emicklei/go-restful v2.15.0+incompatible
github.com/go-logr/logr v0.4.0
github.com/go-logr/logr v1.2.3
github.com/gogf/gf v1.16.6
github.com/heptiolabs/healthcheck v0.0.0-20211123025425-613501dd5deb
github.com/json-iterator/go v1.1.12 // indirect
github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7
github.com/mdlayher/ndp v0.0.0-20200602162440-17ab9e3e5567
github.com/mdlayher/raw v0.0.0-20190606142536-fef19f00fc18
github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.17.0
github.com/onsi/gomega v1.18.1
github.com/osrg/gobgp/v3 v3.0.0-rc4
github.com/parnurzeal/gorequest v0.2.16
github.com/prometheus/client_golang v1.11.0
Expand All @@ -25,50 +24,120 @@ require (
github.com/stretchr/testify v1.7.0
github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d
golang.org/x/sys v0.0.0-20220209214540-3681064d5158
google.golang.org/protobuf v1.27.1
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 // indirect
k8s.io/api v0.21.4
k8s.io/apimachinery v0.21.4
k8s.io/apiserver v0.21.4
k8s.io/client-go v0.21.4
k8s.io/component-base v0.21.4
k8s.io/api v0.23.6
k8s.io/apimachinery v0.23.6
k8s.io/apiserver v0.23.6
k8s.io/client-go v0.23.6
k8s.io/component-base v0.23.6
k8s.io/kubernetes v0.0.0-00010101000000-000000000000
k8s.io/utils v0.0.0-20211208161948-7d6a63dca704
moul.io/http2curl v1.0.0 // indirect
kubevirt.io/api v0.54.0
sigs.k8s.io/controller-runtime v0.0.0-00010101000000-000000000000
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/eapache/channels v1.1.0 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-logr/zapr v1.2.0 // 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/go-cmp v0.5.6 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/k-sone/critbitgo v1.4.0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/openshift/custom-resource-status v1.1.2 // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.28.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.8.1 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
gitlab.com/golang-commonmark/puny v0.0.0-20191124015043-9f83538fa04f // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // 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-20210723032227-1f47c861a9ac // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9 // indirect
google.golang.org/grpc v1.42.0 // indirect
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.62.0 // 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.0-20210107192922-496545a6307b // indirect
k8s.io/apiextensions-apiserver v0.23.5 // indirect
k8s.io/klog/v2 v2.40.1 // indirect
k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf // indirect
kubevirt.io/containerized-data-importer-api v1.47.0 // indirect
kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 // indirect
moul.io/http2curl v1.0.0 // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace k8s.io/kubernetes => k8s.io/kubernetes v1.20.13

replace (
k8s.io/api => k8s.io/api v0.21.4
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.21.4
k8s.io/apimachinery => k8s.io/apimachinery v0.21.4
k8s.io/apiserver => k8s.io/apiserver v0.21.4
k8s.io/cli-runtime => k8s.io/cli-runtime v0.21.4
k8s.io/client-go => k8s.io/client-go v0.21.4
k8s.io/cloud-provider => k8s.io/cloud-provider v0.21.4
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.21.4
k8s.io/code-generator => k8s.io/code-generator v0.21.4
k8s.io/component-base => k8s.io/component-base v0.21.4
k8s.io/component-helpers => k8s.io/component-helpers v0.21.4
k8s.io/controller-manager => k8s.io/controller-manager v0.21.4
k8s.io/cri-api => k8s.io/cri-api v0.21.4
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.21.4
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.21.4
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.21.4
k8s.io/kube-proxy => k8s.io/kube-proxy v0.21.4
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.21.4
k8s.io/kubectl => k8s.io/kubectl v0.21.4
k8s.io/kubelet => k8s.io/kubelet v0.21.4
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.21.4
k8s.io/metrics => k8s.io/metrics v0.21.4
k8s.io/mount-utils => k8s.io/mount-utils v0.21.4
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.21.4
k8s.io/api => k8s.io/api v0.23.6
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.23.6
k8s.io/apimachinery => k8s.io/apimachinery v0.23.6
k8s.io/apiserver => k8s.io/apiserver v0.23.6
k8s.io/cli-runtime => k8s.io/cli-runtime v0.23.6
k8s.io/client-go => k8s.io/client-go v0.23.6
k8s.io/cloud-provider => k8s.io/cloud-provider v0.23.6
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.23.6
k8s.io/code-generator => k8s.io/code-generator v0.23.6
k8s.io/component-base => k8s.io/component-base v0.23.6
k8s.io/component-helpers => k8s.io/component-helpers v0.23.6
k8s.io/controller-manager => k8s.io/controller-manager v0.23.6
k8s.io/cri-api => k8s.io/cri-api v0.23.6
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.23.6
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.23.6
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.23.6
k8s.io/kube-proxy => k8s.io/kube-proxy v0.23.6
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.23.6
k8s.io/kubectl => k8s.io/kubectl v0.23.6
k8s.io/kubelet => k8s.io/kubelet v0.23.6
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.23.6
k8s.io/metrics => k8s.io/metrics v0.23.6
k8s.io/mount-utils => k8s.io/mount-utils v0.23.6
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.6
)

replace sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.9.7
replace sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.11.2

replace github.com/containernetworking/cni => github.com/containernetworking/cni v0.8.1

Expand Down
Loading

0 comments on commit fcdfea7

Please sign in to comment.