From d1cc39a4d13a3210f2723b4a38445e72a6707879 Mon Sep 17 00:00:00 2001 From: Ram Lavi Date: Tue, 11 Feb 2020 17:04:03 +0200 Subject: [PATCH] bump kubvirt.io to v0.25.0 Signed-off-by: Ram Lavi --- .travis.yml | 2 +- Dockerfile | 3 +- Makefile | 4 +- go.mod | 13 +- go.sum | 37 +- hack/deploy-test-cluster.sh | 5 +- hack/docker-image/Dockerfile | 3 +- pkg/controller/controller.go | 3 +- pkg/controller/pod/pod_controller.go | 5 +- .../virtualmachine_controller.go | 4 +- pkg/manager/manager.go | 7 +- pkg/webhook/pod/pod.go | 3 +- pkg/webhook/virtualmachine/virtualmachine.go | 4 +- pkg/webhook/webhook.go | 11 +- vendor/github.com/hashicorp/golang-lru/go.mod | 2 + vendor/github.com/hashicorp/golang-lru/lru.go | 26 +- .../hashicorp/golang-lru/simplelru/lru.go | 16 + .../golang-lru/simplelru/lru_interface.go | 7 +- .../client-go/api/v1/deepcopy_generated.go | 961 ++++++------------ .../client-go/api/v1/openapi_generated.go | 212 +++- .../kubevirt.io/client-go/api/v1/register.go | 116 +++ vendor/kubevirt.io/client-go/api/v1/schema.go | 29 + .../api/v1/schema_swagger_generated.go | 15 + vendor/kubevirt.io/client-go/api/v1/types.go | 303 ++---- .../api/v1/types_swagger_generated.go | 32 +- .../client-go/api/v1/zz_generated.defaults.go | 2 +- .../tools/vms-generator/utils/utils.go | 115 ++- vendor/modules.txt | 10 +- 28 files changed, 927 insertions(+), 1023 deletions(-) create mode 100644 vendor/kubevirt.io/client-go/api/v1/register.go diff --git a/.travis.yml b/.travis.yml index acfd4fb9f..6cb21e6e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ script: - sudo cp ./cluster/dind-cluster/kubectl /usr/bin/kubectl - make test - make deploy-test-cluster - - KUBECONFIG="`pwd`/cluster/dind-cluster/config" go test -timeout 60m -v -race ./tests/... + - KUBECONFIG="`pwd`/cluster/dind-cluster/config" go test -timeout 30m -v -race ./tests/... deploy: - provider: script diff --git a/Dockerfile b/Dockerfile index f6a7fdb04..4b97f92c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # Build the manager binary -FROM golang:1.12.12 as builder +ARG GO_VERSION +FROM golang:${GO_VERSION} as builder # Copy in the go src WORKDIR /go/src/github.com/k8snetworkplumbingwg/kubemacpool diff --git a/Makefile b/Makefile index 630616c29..0da808bad 100644 --- a/Makefile +++ b/Makefile @@ -68,11 +68,11 @@ docker-generate: docker-builder # Build the docker image docker-build: docker-builder - docker build . -t ${REGISTRY}/${IMG}:${IMAGE_TAG} + docker build . -t ${REGISTRY}/${IMG}:${IMAGE_TAG} --build-arg GO_VERSION=1.12.12 # Build the docker builder image docker-builder: - docker build ${DOCKER_BUILDER_LOCATION} -t ${REGISTRY}/${IMG}:kubemacpool_builder + docker build ${DOCKER_BUILDER_LOCATION} -t ${REGISTRY}/${IMG}:kubemacpool_builder --build-arg GO_VERSION=1.12.12 # Push the docker image docker-push: diff --git a/go.mod b/go.mod index 016d00983..ffe05b5bc 100644 --- a/go.mod +++ b/go.mod @@ -3,18 +3,11 @@ module github.com/k8snetworkplumbingwg/kubemacpool go 1.12 require ( - github.com/Azure/go-autorest v11.2.8+incompatible // indirect - github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/containernetworking/cni v0.6.0 // indirect - github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect github.com/go-logr/logr v0.1.0 - github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect github.com/intel/multus-cni v0.0.0-20190127194101-cd6f9880ac19 - github.com/mattn/go-runewidth v0.0.4 // indirect - github.com/olekukonko/tablewriter v0.0.1 // indirect github.com/onsi/ginkgo v1.10.1 github.com/onsi/gomega v1.7.0 - github.com/openshift/custom-resource-status v0.0.0-20190822192428-e62f2f3b79f3 // indirect github.com/prometheus/procfs v0.0.8 // indirect github.com/qinqon/kube-admission-webhook v0.3.0 k8s.io/api v0.18.0-alpha.2 @@ -22,11 +15,9 @@ require ( k8s.io/apimachinery v0.18.0-alpha.2 k8s.io/client-go v11.0.0+incompatible k8s.io/code-generator v0.18.0-alpha.2 - k8s.io/gengo v0.0.0-20190327210449-e17681d19d3a // indirect k8s.io/utils v0.0.0-20200109141947-94aeca20bf09 // indirect - kubevirt.io/client-go v0.20.4 - kubevirt.io/containerized-data-importer v1.10.6 // indirect - kubevirt.io/kubevirt v0.20.4 + kubevirt.io/client-go v0.25.0 + kubevirt.io/kubevirt v0.25.0 sigs.k8s.io/controller-runtime v0.4.0 sigs.k8s.io/controller-tools v0.2.4 ) diff --git a/go.sum b/go.sum index 7f8a45df1..92d14b1ed 100644 --- a/go.sum +++ b/go.sum @@ -7,13 +7,16 @@ github.com/Azure/azure-pipeline-go v0.1.8/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9a github.com/Azure/azure-sdk-for-go v23.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-storage-blob-go v0.0.0-20181022225951-5152f14ace1c/go.mod h1:oGfmITT1V6x//CswqY2gtAHND+xIP64/qL7a5QJix0Y= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest v11.1.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v11.2.8+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.1/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.6.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -80,7 +83,7 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/etcd v3.3.12+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.15+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-iptables v0.4.1/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= +github.com/coreos/go-iptables v0.4.3/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -149,6 +152,8 @@ github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0 github.com/go-ini/ini v1.21.1/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= @@ -160,12 +165,10 @@ github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aA github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.17.2/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.17.2/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= @@ -185,7 +188,6 @@ github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwoh github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.17.2/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= @@ -211,7 +213,6 @@ github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dp github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.17.2/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= @@ -244,7 +245,6 @@ github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= -github.com/golang/mock v0.0.0-20190509174753-d74b93584564/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -255,7 +255,6 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20160524151835-7d79101e329e/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -286,9 +285,9 @@ github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTV github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/gophercloud/gophercloud v0.0.0-20180330165814-781450b3c4fc/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= github.com/gophercloud/gophercloud v0.0.0-20190301152420-fca40860790e/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gophercloud/gophercloud v0.4.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -328,6 +327,8 @@ github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= +github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= @@ -361,6 +362,7 @@ github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVY github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/k8snetworkplumbingwg/network-attachment-definition-client v0.0.0-20181121151021-386d141f4c94/go.mod h1:b9S5QMGDYh+GhoIlY/2ADELIEWUAyqIn1+k7PLq2NCY= +github.com/k8snetworkplumbingwg/network-attachment-definition-client v0.0.0-20190920090233-ccc72ee9eb57/go.mod h1:b9S5QMGDYh+GhoIlY/2ADELIEWUAyqIn1+k7PLq2NCY= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -410,6 +412,7 @@ github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsO github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/maxbrunsfeld/counterfeiter v0.0.0-20181017030959-1aadac120687/go.mod h1:aoVsckWnsNzazwF2kmD+bzgdr4GBlbK91zsdivQJ2eU= +github.com/mfranczy/crd-rest-coverage v0.1.0/go.mod h1:yRun7BqJIqQC+myEhfhMvbImzQ5IOE4tAlln5KDIfqQ= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/minio/cli v1.20.0/go.mod h1:bYxnK0uS629N3Bq+AOZZ+6lwF77Sodk4+UL9vNuXhOY= @@ -417,6 +420,7 @@ github.com/minio/minio-go/v6 v6.0.27-0.20190529152532-de69c0e465ed/go.mod h1:vaN github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v0.0.0-20180523094522-3864e76763d9/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= @@ -554,6 +558,7 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -667,7 +672,6 @@ golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20170412232759-a6bd8cefa181/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181105165119-ca4130e427c7/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -714,7 +718,6 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.1/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20170424234030-8be79e1e0910/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -853,14 +856,14 @@ k8s.io/kubernetes v1.11.7-beta.0.0.20181219023948-b875d52ea96d/go.mod h1:ocZa8+6 k8s.io/kubernetes v1.11.8-beta.0.0.20190124204751-3a10094374f2/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20190801114015-581e00157fb1 h1:+ySTxfHnfzZb9ys375PXNlLhkJPLKgHajBU0N62BDvE= k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -kubevirt.io/client-go v0.20.4 h1:8H4D5ey8yMjlcFH4rMlgDw9jIlc3gggpEpUPrFib0MY= -kubevirt.io/client-go v0.20.4/go.mod h1:VX5JEJ+SOHPYIvyF+FkAjyWqC2PqF0/EtG29f1A1hIM= -kubevirt.io/containerized-data-importer v1.8.1-0.20190516083534-83c12eaae2ed/go.mod h1:qF594BtRRkruyrqLwt3zbLCWdPIQNs1qWh4LR1cOzy0= -kubevirt.io/containerized-data-importer v1.10.1/go.mod h1:qF594BtRRkruyrqLwt3zbLCWdPIQNs1qWh4LR1cOzy0= +kubevirt.io/client-go v0.25.0 h1:6/bRmsjGtbvA2ObL4yXjgpEWrdIN9iYWe66u4PEoDy4= +kubevirt.io/client-go v0.25.0/go.mod h1:0ri554EgnLhqhjIORUUf/YrUmPBvGMFlOvDNzoM8qVk= kubevirt.io/containerized-data-importer v1.10.6 h1:xkqLb48pkbdoY8gB2VDP2o+KXpO18tgQuLjcXNn0qAI= kubevirt.io/containerized-data-importer v1.10.6/go.mod h1:qF594BtRRkruyrqLwt3zbLCWdPIQNs1qWh4LR1cOzy0= -kubevirt.io/kubevirt v0.20.4 h1:Fv3RylvvBKnRTRS5UOrcXUTevvhEcNhrEjlw3q5qDms= -kubevirt.io/kubevirt v0.20.4/go.mod h1:K4V4ZIjVHwFBNv6cNqK5tP4pX2ONgPWxzgRB/eNKzmg= +kubevirt.io/containerized-data-importer v1.10.9 h1:wYCPyMbCLdn5tlZWW/lPYTMPtIOSfdXDevyWw9rxl2s= +kubevirt.io/containerized-data-importer v1.10.9/go.mod h1:qF594BtRRkruyrqLwt3zbLCWdPIQNs1qWh4LR1cOzy0= +kubevirt.io/kubevirt v0.25.0 h1:tFnLcSKoy4Gw8EXsgr25VS8AAEH9kBdqdCbePHvQN9o= +kubevirt.io/kubevirt v0.25.0/go.mod h1:wWMoapTFXAGk0PP/WYHqdWw3vBlgJMmeV07/+k3kFIM= kubevirt.io/qe-tools v0.1.3-0.20190512140058-934db0579e0c/go.mod h1:PJyH/YXC4W0AmxfheDmXWMbLNsMSboVGXKpMAwfKzVE= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= diff --git a/hack/deploy-test-cluster.sh b/hack/deploy-test-cluster.sh index 9c571e2b0..b22ce65d9 100755 --- a/hack/deploy-test-cluster.sh +++ b/hack/deploy-test-cluster.sh @@ -16,14 +16,13 @@ kubectl config view --raw > ./cluster/dind-cluster/config ./cluster/dind-cluster/kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/v0.20.4/kubevirt-operator.yaml ./cluster/dind-cluster/kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/v0.20.4/kubevirt-cr.yaml +REGISTRY="localhost:5000" make docker-generate +if [[ -n "$(git status --porcelain)" ]] ; then echo "It seems like you need to run make. Please run it and commit the changes"; git status --porcelain; false; fi # Build kubemacpool REGISTRY="localhost:5000" make docker-build REGISTRY="localhost:5000" make docker-push -REGISTRY="localhost:5000" make docker-generate -if [[ -n "$(git status --porcelain)" ]] ; then echo "It seems like you need to run make. Please run it and commit the changes"; git status --porcelain; false; fi - # wait for cluster operator ./cluster/dind-cluster/kubectl wait networkaddonsconfig cluster --for condition=Available --timeout=800s diff --git a/hack/docker-image/Dockerfile b/hack/docker-image/Dockerfile index dca85e2d3..746077941 100644 --- a/hack/docker-image/Dockerfile +++ b/hack/docker-image/Dockerfile @@ -1,4 +1,5 @@ -FROM golang:1.12.12 +ARG GO_VERSION +FROM golang:${GO_VERSION} RUN apt-get clean && apt-get update && apt-get install -y unzip && apt-get upgrade -y diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index ee152efb4..ab1cccb0b 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -17,8 +17,9 @@ limitations under the License. package controller import ( - "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" "sigs.k8s.io/controller-runtime/pkg/manager" + + "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" ) // AddToManagerFuncs is a list of functions to add all Controllers to the Manager diff --git a/pkg/controller/pod/pod_controller.go b/pkg/controller/pod/pod_controller.go index c467b64c3..beb258722 100644 --- a/pkg/controller/pod/pod_controller.go +++ b/pkg/controller/pod/pod_controller.go @@ -20,7 +20,6 @@ import ( "context" "fmt" "github.com/intel/multus-cni/logging" - "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" @@ -31,6 +30,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" "sigs.k8s.io/controller-runtime/pkg/source" + + "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" ) var log = logf.Log.WithName("Pod Controller") @@ -81,7 +82,7 @@ func (r *ReconcilePolicy) Reconcile(request reconcile.Request) (reconcile.Result if errors.IsNotFound(err) { err := r.poolManager.ReleasePodMac(fmt.Sprintf("%s/%s", request.Namespace, request.Name)) if err != nil { - logging.Errorf("failed to release mac for pod %s: %v", request.NamespacedName, err) + logging.Printf(logging.ErrorLevel, "failed to release mac for pod %s: %v", request.NamespacedName, err) } return reconcile.Result{}, nil } diff --git a/pkg/controller/virtualmachine/virtualmachine_controller.go b/pkg/controller/virtualmachine/virtualmachine_controller.go index 9256dd175..d54b31180 100644 --- a/pkg/controller/virtualmachine/virtualmachine_controller.go +++ b/pkg/controller/virtualmachine/virtualmachine_controller.go @@ -21,17 +21,17 @@ import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" + kubevirt "kubevirt.io/client-go/api/v1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" + logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" "sigs.k8s.io/controller-runtime/pkg/source" pool_manager "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" helper "github.com/k8snetworkplumbingwg/kubemacpool/pkg/utils" - kubevirt "kubevirt.io/client-go/api/v1" - logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" ) var log = logf.Log.WithName("VirtualMachine Controller") diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index faad36a5c..5bca2540b 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -23,9 +23,6 @@ import ( "time" "github.com/go-logr/logr" - "github.com/k8snetworkplumbingwg/kubemacpool/pkg/controller" - poolmanager "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" - "github.com/k8snetworkplumbingwg/kubemacpool/pkg/webhook" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/leaderelection" @@ -33,6 +30,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/manager" logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" + + "github.com/k8snetworkplumbingwg/kubemacpool/pkg/controller" + poolmanager "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" + "github.com/k8snetworkplumbingwg/kubemacpool/pkg/webhook" ) var log logr.Logger diff --git a/pkg/webhook/pod/pod.go b/pkg/webhook/pod/pod.go index 1138933e7..95fea3122 100644 --- a/pkg/webhook/pod/pod.go +++ b/pkg/webhook/pod/pod.go @@ -21,13 +21,14 @@ import ( "encoding/json" "net/http" - "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" webhookserver "github.com/qinqon/kube-admission-webhook/pkg/webhook/server" corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" "sigs.k8s.io/controller-runtime/pkg/webhook" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" + + "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" ) var log = logf.Log.WithName("Webhook mutatepods") diff --git a/pkg/webhook/virtualmachine/virtualmachine.go b/pkg/webhook/virtualmachine/virtualmachine.go index fddd03e7b..937a0904e 100644 --- a/pkg/webhook/virtualmachine/virtualmachine.go +++ b/pkg/webhook/virtualmachine/virtualmachine.go @@ -23,7 +23,6 @@ import ( "net/http" "reflect" - "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" webhookserver "github.com/qinqon/kube-admission-webhook/pkg/webhook/server" admissionv1beta1 "k8s.io/api/admission/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -32,6 +31,8 @@ import ( logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" "sigs.k8s.io/controller-runtime/pkg/webhook" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" + + "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" ) var log = logf.Log.WithName("Webhook mutatevirtualmachines") @@ -61,7 +62,6 @@ func (a *virtualMachineAnnotator) Handle(ctx context.Context, req admission.Requ if virtualMachine.Annotations == nil { virtualMachine.Annotations = map[string]string{} } - if virtualMachine.Namespace == "" { virtualMachine.Namespace = req.AdmissionRequest.Namespace } diff --git a/pkg/webhook/webhook.go b/pkg/webhook/webhook.go index dfde7478a..78483ac64 100644 --- a/pkg/webhook/webhook.go +++ b/pkg/webhook/webhook.go @@ -19,8 +19,6 @@ package webhook import ( "fmt" - "github.com/k8snetworkplumbingwg/kubemacpool/pkg/names" - "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" webhookserver "github.com/qinqon/kube-admission-webhook/pkg/webhook/server" "github.com/qinqon/kube-admission-webhook/pkg/webhook/server/certificate" admissionregistration "k8s.io/api/admissionregistration/v1beta1" @@ -30,10 +28,13 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/client-go/kubernetes" "sigs.k8s.io/controller-runtime/pkg/manager" + + "github.com/k8snetworkplumbingwg/kubemacpool/pkg/names" + "github.com/k8snetworkplumbingwg/kubemacpool/pkg/pool-manager" ) const ( - mutatingWebhookConfigurationName = "kubemacpool-mutator" + WebhookServerPort = 8000 ) // AddToManagerFuncs is a list of functions to add all Controllers to the Manager @@ -50,7 +51,7 @@ var AddToWebhookFuncs []func(*webhookserver.Server, *pool_manager.PoolManager) e // AddToManager adds all Controllers to the Manager func AddToManager(mgr manager.Manager, poolManager *pool_manager.PoolManager) error { - s := webhookserver.New(mgr, mutatingWebhookConfigurationName, certificate.MutatingWebhook, webhookserver.WithPort(8000)) + s := webhookserver.New(mgr, names.MUTATE_WEBHOOK_CONFIG, certificate.MutatingWebhook, webhookserver.WithPort(WebhookServerPort)) for _, f := range AddToWebhookFuncs { if err := f(s, poolManager); err != nil { @@ -118,7 +119,7 @@ func CreateOwnerRefForService(kubeClient *kubernetes.Clientset, managerNamespace Port: 443, TargetPort: intstr.IntOrString{ Type: intstr.Int, - IntVal: 8000, + IntVal: WebhookServerPort, }}}}} _, err = kubeClient.CoreV1().Services(managerNamespace).Create(svcObject) return err diff --git a/vendor/github.com/hashicorp/golang-lru/go.mod b/vendor/github.com/hashicorp/golang-lru/go.mod index 824cb97e8..8ad8826b3 100644 --- a/vendor/github.com/hashicorp/golang-lru/go.mod +++ b/vendor/github.com/hashicorp/golang-lru/go.mod @@ -1 +1,3 @@ module github.com/hashicorp/golang-lru + +go 1.12 diff --git a/vendor/github.com/hashicorp/golang-lru/lru.go b/vendor/github.com/hashicorp/golang-lru/lru.go index 1cbe04b7d..052a38b4c 100644 --- a/vendor/github.com/hashicorp/golang-lru/lru.go +++ b/vendor/github.com/hashicorp/golang-lru/lru.go @@ -86,17 +86,35 @@ func (c *Cache) ContainsOrAdd(key, value interface{}) (ok, evicted bool) { } // Remove removes the provided key from the cache. -func (c *Cache) Remove(key interface{}) { +func (c *Cache) Remove(key interface{}) (present bool) { c.lock.Lock() - c.lru.Remove(key) + present = c.lru.Remove(key) c.lock.Unlock() + return +} + +// Resize changes the cache size. +func (c *Cache) Resize(size int) (evicted int) { + c.lock.Lock() + evicted = c.lru.Resize(size) + c.lock.Unlock() + return evicted } // RemoveOldest removes the oldest item from the cache. -func (c *Cache) RemoveOldest() { +func (c *Cache) RemoveOldest() (key interface{}, value interface{}, ok bool) { + c.lock.Lock() + key, value, ok = c.lru.RemoveOldest() + c.lock.Unlock() + return +} + +// GetOldest returns the oldest entry +func (c *Cache) GetOldest() (key interface{}, value interface{}, ok bool) { c.lock.Lock() - c.lru.RemoveOldest() + key, value, ok = c.lru.GetOldest() c.lock.Unlock() + return } // Keys returns a slice of the keys in the cache, from oldest to newest. diff --git a/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go b/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go index 5673773b2..a86c8539e 100644 --- a/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go +++ b/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go @@ -73,6 +73,9 @@ func (c *LRU) Add(key, value interface{}) (evicted bool) { func (c *LRU) Get(key interface{}) (value interface{}, ok bool) { if ent, ok := c.items[key]; ok { c.evictList.MoveToFront(ent) + if ent.Value.(*entry) == nil { + return nil, false + } return ent.Value.(*entry).value, true } return @@ -142,6 +145,19 @@ func (c *LRU) Len() int { return c.evictList.Len() } +// Resize changes the cache size. +func (c *LRU) Resize(size int) (evicted int) { + diff := c.Len() - size + if diff < 0 { + diff = 0 + } + for i := 0; i < diff; i++ { + c.removeOldest() + } + c.size = size + return diff +} + // removeOldest removes the oldest item from the cache. func (c *LRU) removeOldest() { ent := c.evictList.Back() diff --git a/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go b/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go index 74c707744..92d70934d 100644 --- a/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go +++ b/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go @@ -10,7 +10,7 @@ type LRUCache interface { // updates the "recently used"-ness of the key. #value, isFound Get(key interface{}) (value interface{}, ok bool) - // Check if a key exsists in cache without updating the recent-ness. + // Checks if a key exists in cache without updating the recent-ness. Contains(key interface{}) (ok bool) // Returns key's value without updating the "recently used"-ness of the key. @@ -31,6 +31,9 @@ type LRUCache interface { // Returns the number of items in the cache. Len() int - // Clear all cache entries + // Clears all cache entries. Purge() + + // Resizes cache, returning number evicted + Resize(int) int } diff --git a/vendor/kubevirt.io/client-go/api/v1/deepcopy_generated.go b/vendor/kubevirt.io/client-go/api/v1/deepcopy_generated.go index ee432f137..3aa93ff64 100644 --- a/vendor/kubevirt.io/client-go/api/v1/deepcopy_generated.go +++ b/vendor/kubevirt.io/client-go/api/v1/deepcopy_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The KubeVirt Authors. +Copyright 2020 The KubeVirt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,8 +21,8 @@ limitations under the License. package v1 import ( - core_v1 "k8s.io/api/core/v1" - meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" @@ -50,21 +50,13 @@ func (in *Bootloader) DeepCopyInto(out *Bootloader) { *out = *in if in.BIOS != nil { in, out := &in.BIOS, &out.BIOS - if *in == nil { - *out = nil - } else { - *out = new(BIOS) - **out = **in - } + *out = new(BIOS) + **out = **in } if in.EFI != nil { in, out := &in.EFI, &out.EFI - if *in == nil { - *out = nil - } else { - *out = new(EFI) - **out = **in - } + *out = new(EFI) + **out = **in } return } @@ -84,12 +76,8 @@ func (in *CDRomTarget) DeepCopyInto(out *CDRomTarget) { *out = *in if in.ReadOnly != nil { in, out := &in.ReadOnly, &out.ReadOnly - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -141,18 +129,30 @@ func (in *CPUFeature) DeepCopy() *CPUFeature { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Chassis) DeepCopyInto(out *Chassis) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Chassis. +func (in *Chassis) DeepCopy() *Chassis { + if in == nil { + return nil + } + out := new(Chassis) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Clock) DeepCopyInto(out *Clock) { *out = *in in.ClockOffset.DeepCopyInto(&out.ClockOffset) if in.Timer != nil { in, out := &in.Timer, &out.Timer - if *in == nil { - *out = nil - } else { - *out = new(Timer) - (*in).DeepCopyInto(*out) - } + *out = new(Timer) + (*in).DeepCopyInto(*out) } return } @@ -172,21 +172,13 @@ func (in *ClockOffset) DeepCopyInto(out *ClockOffset) { *out = *in if in.UTC != nil { in, out := &in.UTC, &out.UTC - if *in == nil { - *out = nil - } else { - *out = new(ClockOffsetUTC) - (*in).DeepCopyInto(*out) - } + *out = new(ClockOffsetUTC) + (*in).DeepCopyInto(*out) } if in.Timezone != nil { in, out := &in.Timezone, &out.Timezone - if *in == nil { - *out = nil - } else { - *out = new(ClockOffsetTimezone) - **out = **in - } + *out = new(ClockOffsetTimezone) + **out = **in } return } @@ -206,12 +198,8 @@ func (in *ClockOffsetUTC) DeepCopyInto(out *ClockOffsetUTC) { *out = *in if in.OffsetSeconds != nil { in, out := &in.OffsetSeconds, &out.OffsetSeconds - if *in == nil { - *out = nil - } else { - *out = new(int) - **out = **in - } + *out = new(int) + **out = **in } return } @@ -231,21 +219,13 @@ func (in *CloudInitConfigDriveSource) DeepCopyInto(out *CloudInitConfigDriveSour *out = *in if in.UserDataSecretRef != nil { in, out := &in.UserDataSecretRef, &out.UserDataSecretRef - if *in == nil { - *out = nil - } else { - *out = new(core_v1.LocalObjectReference) - **out = **in - } + *out = new(corev1.LocalObjectReference) + **out = **in } if in.NetworkDataSecretRef != nil { in, out := &in.NetworkDataSecretRef, &out.NetworkDataSecretRef - if *in == nil { - *out = nil - } else { - *out = new(core_v1.LocalObjectReference) - **out = **in - } + *out = new(corev1.LocalObjectReference) + **out = **in } return } @@ -265,21 +245,13 @@ func (in *CloudInitNoCloudSource) DeepCopyInto(out *CloudInitNoCloudSource) { *out = *in if in.UserDataSecretRef != nil { in, out := &in.UserDataSecretRef, &out.UserDataSecretRef - if *in == nil { - *out = nil - } else { - *out = new(core_v1.LocalObjectReference) - **out = **in - } + *out = new(corev1.LocalObjectReference) + **out = **in } if in.NetworkDataSecretRef != nil { in, out := &in.NetworkDataSecretRef, &out.NetworkDataSecretRef - if *in == nil { - *out = nil - } else { - *out = new(core_v1.LocalObjectReference) - **out = **in - } + *out = new(corev1.LocalObjectReference) + **out = **in } return } @@ -300,12 +272,8 @@ func (in *ConfigMapVolumeSource) DeepCopyInto(out *ConfigMapVolumeSource) { out.LocalObjectReference = in.LocalObjectReference if in.Optional != nil { in, out := &in.Optional, &out.Optional - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -406,12 +374,8 @@ func (in *Devices) DeepCopyInto(out *Devices) { } if in.Watchdog != nil { in, out := &in.Watchdog, &out.Watchdog - if *in == nil { - *out = nil - } else { - *out = new(Watchdog) - (*in).DeepCopyInto(*out) - } + *out = new(Watchdog) + (*in).DeepCopyInto(*out) } if in.Interfaces != nil { in, out := &in.Interfaces, &out.Interfaces @@ -427,48 +391,33 @@ func (in *Devices) DeepCopyInto(out *Devices) { } if in.AutoattachPodInterface != nil { in, out := &in.AutoattachPodInterface, &out.AutoattachPodInterface - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } if in.AutoattachGraphicsDevice != nil { in, out := &in.AutoattachGraphicsDevice, &out.AutoattachGraphicsDevice - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } if in.Rng != nil { in, out := &in.Rng, &out.Rng - if *in == nil { - *out = nil - } else { - *out = new(Rng) - **out = **in - } + *out = new(Rng) + **out = **in } if in.BlockMultiQueue != nil { in, out := &in.BlockMultiQueue, &out.BlockMultiQueue - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } if in.NetworkInterfaceMultiQueue != nil { in, out := &in.NetworkInterfaceMultiQueue, &out.NetworkInterfaceMultiQueue - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in + } + if in.GPUs != nil { + in, out := &in.GPUs, &out.GPUs + *out = make([]GPU, len(*in)) + copy(*out, *in) } return } @@ -489,21 +438,13 @@ func (in *Disk) DeepCopyInto(out *Disk) { in.DiskDevice.DeepCopyInto(&out.DiskDevice) if in.BootOrder != nil { in, out := &in.BootOrder, &out.BootOrder - if *in == nil { - *out = nil - } else { - *out = new(uint) - **out = **in - } + *out = new(uint) + **out = **in } if in.DedicatedIOThread != nil { in, out := &in.DedicatedIOThread, &out.DedicatedIOThread - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -523,39 +464,23 @@ func (in *DiskDevice) DeepCopyInto(out *DiskDevice) { *out = *in if in.Disk != nil { in, out := &in.Disk, &out.Disk - if *in == nil { - *out = nil - } else { - *out = new(DiskTarget) - **out = **in - } + *out = new(DiskTarget) + **out = **in } if in.LUN != nil { in, out := &in.LUN, &out.LUN - if *in == nil { - *out = nil - } else { - *out = new(LunTarget) - **out = **in - } + *out = new(LunTarget) + **out = **in } if in.Floppy != nil { in, out := &in.Floppy, &out.Floppy - if *in == nil { - *out = nil - } else { - *out = new(FloppyTarget) - **out = **in - } + *out = new(FloppyTarget) + **out = **in } if in.CDRom != nil { in, out := &in.CDRom, &out.CDRom - if *in == nil { - *out = nil - } else { - *out = new(CDRomTarget) - (*in).DeepCopyInto(*out) - } + *out = new(CDRomTarget) + (*in).DeepCopyInto(*out) } return } @@ -592,59 +517,40 @@ func (in *DomainSpec) DeepCopyInto(out *DomainSpec) { in.Resources.DeepCopyInto(&out.Resources) if in.CPU != nil { in, out := &in.CPU, &out.CPU - if *in == nil { - *out = nil - } else { - *out = new(CPU) - (*in).DeepCopyInto(*out) - } + *out = new(CPU) + (*in).DeepCopyInto(*out) } if in.Memory != nil { in, out := &in.Memory, &out.Memory - if *in == nil { - *out = nil - } else { - *out = new(Memory) - (*in).DeepCopyInto(*out) - } + *out = new(Memory) + (*in).DeepCopyInto(*out) } out.Machine = in.Machine if in.Firmware != nil { in, out := &in.Firmware, &out.Firmware - if *in == nil { - *out = nil - } else { - *out = new(Firmware) - (*in).DeepCopyInto(*out) - } + *out = new(Firmware) + (*in).DeepCopyInto(*out) } if in.Clock != nil { in, out := &in.Clock, &out.Clock - if *in == nil { - *out = nil - } else { - *out = new(Clock) - (*in).DeepCopyInto(*out) - } + *out = new(Clock) + (*in).DeepCopyInto(*out) } if in.Features != nil { in, out := &in.Features, &out.Features - if *in == nil { - *out = nil - } else { - *out = new(Features) - (*in).DeepCopyInto(*out) - } + *out = new(Features) + (*in).DeepCopyInto(*out) } in.Devices.DeepCopyInto(&out.Devices) if in.IOThreadsPolicy != nil { in, out := &in.IOThreadsPolicy, &out.IOThreadsPolicy - if *in == nil { - *out = nil - } else { - *out = new(IOThreadsPolicy) - **out = **in - } + *out = new(IOThreadsPolicy) + **out = **in + } + if in.Chassis != nil { + in, out := &in.Chassis, &out.Chassis + *out = new(Chassis) + **out = **in } return } @@ -697,12 +603,8 @@ func (in *EphemeralVolumeSource) DeepCopyInto(out *EphemeralVolumeSource) { *out = *in if in.PersistentVolumeClaim != nil { in, out := &in.PersistentVolumeClaim, &out.PersistentVolumeClaim - if *in == nil { - *out = nil - } else { - *out = new(core_v1.PersistentVolumeClaimVolumeSource) - **out = **in - } + *out = new(corev1.PersistentVolumeClaimVolumeSource) + **out = **in } return } @@ -722,12 +624,8 @@ func (in *FeatureAPIC) DeepCopyInto(out *FeatureAPIC) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -747,129 +645,73 @@ func (in *FeatureHyperv) DeepCopyInto(out *FeatureHyperv) { *out = *in if in.Relaxed != nil { in, out := &in.Relaxed, &out.Relaxed - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } if in.VAPIC != nil { in, out := &in.VAPIC, &out.VAPIC - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } if in.Spinlocks != nil { in, out := &in.Spinlocks, &out.Spinlocks - if *in == nil { - *out = nil - } else { - *out = new(FeatureSpinlocks) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureSpinlocks) + (*in).DeepCopyInto(*out) } if in.VPIndex != nil { in, out := &in.VPIndex, &out.VPIndex - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } if in.Runtime != nil { in, out := &in.Runtime, &out.Runtime - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } if in.SyNIC != nil { in, out := &in.SyNIC, &out.SyNIC - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } if in.SyNICTimer != nil { in, out := &in.SyNICTimer, &out.SyNICTimer - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } if in.Reset != nil { in, out := &in.Reset, &out.Reset - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } if in.VendorID != nil { in, out := &in.VendorID, &out.VendorID - if *in == nil { - *out = nil - } else { - *out = new(FeatureVendorID) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureVendorID) + (*in).DeepCopyInto(*out) } if in.Frequencies != nil { in, out := &in.Frequencies, &out.Frequencies - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } if in.Reenlightenment != nil { in, out := &in.Reenlightenment, &out.Reenlightenment - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } if in.TLBFlush != nil { in, out := &in.TLBFlush, &out.TLBFlush - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } if in.IPI != nil { in, out := &in.IPI, &out.IPI - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } if in.EVMCS != nil { in, out := &in.EVMCS, &out.EVMCS - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } return } @@ -889,21 +731,13 @@ func (in *FeatureSpinlocks) DeepCopyInto(out *FeatureSpinlocks) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } if in.Retries != nil { in, out := &in.Retries, &out.Retries - if *in == nil { - *out = nil - } else { - *out = new(uint32) - **out = **in - } + *out = new(uint32) + **out = **in } return } @@ -923,12 +757,8 @@ func (in *FeatureState) DeepCopyInto(out *FeatureState) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -948,12 +778,8 @@ func (in *FeatureVendorID) DeepCopyInto(out *FeatureVendorID) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -974,30 +800,18 @@ func (in *Features) DeepCopyInto(out *Features) { in.ACPI.DeepCopyInto(&out.ACPI) if in.APIC != nil { in, out := &in.APIC, &out.APIC - if *in == nil { - *out = nil - } else { - *out = new(FeatureAPIC) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureAPIC) + (*in).DeepCopyInto(*out) } if in.Hyperv != nil { in, out := &in.Hyperv, &out.Hyperv - if *in == nil { - *out = nil - } else { - *out = new(FeatureHyperv) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureHyperv) + (*in).DeepCopyInto(*out) } if in.SMM != nil { in, out := &in.SMM, &out.SMM - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } + *out = new(FeatureState) + (*in).DeepCopyInto(*out) } return } @@ -1017,12 +831,8 @@ func (in *Firmware) DeepCopyInto(out *Firmware) { *out = *in if in.Bootloader != nil { in, out := &in.Bootloader, &out.Bootloader - if *in == nil { - *out = nil - } else { - *out = new(Bootloader) - (*in).DeepCopyInto(*out) - } + *out = new(Bootloader) + (*in).DeepCopyInto(*out) } return } @@ -1053,6 +863,22 @@ func (in *FloppyTarget) DeepCopy() *FloppyTarget { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GPU) DeepCopyInto(out *GPU) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPU. +func (in *GPU) DeepCopy() *GPU { + if in == nil { + return nil + } + out := new(GPU) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GenieNetwork) DeepCopyInto(out *GenieNetwork) { *out = *in @@ -1074,12 +900,8 @@ func (in *HPETTimer) DeepCopyInto(out *HPETTimer) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -1099,21 +921,13 @@ func (in *Handler) DeepCopyInto(out *Handler) { *out = *in if in.HTTPGet != nil { in, out := &in.HTTPGet, &out.HTTPGet - if *in == nil { - *out = nil - } else { - *out = new(core_v1.HTTPGetAction) - (*in).DeepCopyInto(*out) - } + *out = new(corev1.HTTPGetAction) + (*in).DeepCopyInto(*out) } if in.TCPSocket != nil { in, out := &in.TCPSocket, &out.TCPSocket - if *in == nil { - *out = nil - } else { - *out = new(core_v1.TCPSocketAction) - **out = **in - } + *out = new(corev1.TCPSocketAction) + **out = **in } return } @@ -1134,12 +948,8 @@ func (in *HostDisk) DeepCopyInto(out *HostDisk) { out.Capacity = in.Capacity.DeepCopy() if in.Shared != nil { in, out := &in.Shared, &out.Shared - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -1175,12 +985,8 @@ func (in *HypervTimer) DeepCopyInto(out *HypervTimer) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -1238,21 +1044,13 @@ func (in *Interface) DeepCopyInto(out *Interface) { } if in.BootOrder != nil { in, out := &in.BootOrder, &out.BootOrder - if *in == nil { - *out = nil - } else { - *out = new(uint) - **out = **in - } + *out = new(uint) + **out = **in } if in.DHCPOptions != nil { in, out := &in.DHCPOptions, &out.DHCPOptions - if *in == nil { - *out = nil - } else { - *out = new(DHCPOptions) - (*in).DeepCopyInto(*out) - } + *out = new(DHCPOptions) + (*in).DeepCopyInto(*out) } return } @@ -1272,39 +1070,23 @@ func (in *InterfaceBindingMethod) DeepCopyInto(out *InterfaceBindingMethod) { *out = *in if in.Bridge != nil { in, out := &in.Bridge, &out.Bridge - if *in == nil { - *out = nil - } else { - *out = new(InterfaceBridge) - **out = **in - } + *out = new(InterfaceBridge) + **out = **in } if in.Slirp != nil { in, out := &in.Slirp, &out.Slirp - if *in == nil { - *out = nil - } else { - *out = new(InterfaceSlirp) - **out = **in - } + *out = new(InterfaceSlirp) + **out = **in } if in.Masquerade != nil { in, out := &in.Masquerade, &out.Masquerade - if *in == nil { - *out = nil - } else { - *out = new(InterfaceMasquerade) - **out = **in - } + *out = new(InterfaceMasquerade) + **out = **in } if in.SRIOV != nil { in, out := &in.SRIOV, &out.SRIOV - if *in == nil { - *out = nil - } else { - *out = new(InterfaceSRIOV) - **out = **in - } + *out = new(InterfaceSRIOV) + **out = **in } return } @@ -1388,12 +1170,8 @@ func (in *KVMTimer) DeepCopyInto(out *KVMTimer) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -1563,21 +1341,13 @@ func (in *Memory) DeepCopyInto(out *Memory) { *out = *in if in.Hugepages != nil { in, out := &in.Hugepages, &out.Hugepages - if *in == nil { - *out = nil - } else { - *out = new(Hugepages) - **out = **in - } + *out = new(Hugepages) + **out = **in } if in.Guest != nil { in, out := &in.Guest, &out.Guest - if *in == nil { - *out = nil - } else { - x := (*in).DeepCopy() - *out = &x - } + x := (*in).DeepCopy() + *out = &x } return } @@ -1630,30 +1400,18 @@ func (in *NetworkSource) DeepCopyInto(out *NetworkSource) { *out = *in if in.Pod != nil { in, out := &in.Pod, &out.Pod - if *in == nil { - *out = nil - } else { - *out = new(PodNetwork) - **out = **in - } + *out = new(PodNetwork) + **out = **in } if in.Multus != nil { in, out := &in.Multus, &out.Multus - if *in == nil { - *out = nil - } else { - *out = new(MultusNetwork) - **out = **in - } + *out = new(MultusNetwork) + **out = **in } if in.Genie != nil { in, out := &in.Genie, &out.Genie - if *in == nil { - *out = nil - } else { - *out = new(GenieNetwork) - **out = **in - } + *out = new(GenieNetwork) + **out = **in } return } @@ -1673,12 +1431,8 @@ func (in *PITTimer) DeepCopyInto(out *PITTimer) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -1747,12 +1501,8 @@ func (in *RTCTimer) DeepCopyInto(out *RTCTimer) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -1772,14 +1522,14 @@ func (in *ResourceRequirements) DeepCopyInto(out *ResourceRequirements) { *out = *in if in.Requests != nil { in, out := &in.Requests, &out.Requests - *out = make(core_v1.ResourceList, len(*in)) + *out = make(corev1.ResourceList, len(*in)) for key, val := range *in { (*out)[key] = val.DeepCopy() } } if in.Limits != nil { in, out := &in.Limits, &out.Limits - *out = make(core_v1.ResourceList, len(*in)) + *out = make(corev1.ResourceList, len(*in)) for key, val := range *in { (*out)[key] = val.DeepCopy() } @@ -1797,6 +1547,28 @@ func (in *ResourceRequirements) DeepCopy() *ResourceRequirements { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RestartOptions) DeepCopyInto(out *RestartOptions) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.GracePeriodSeconds != nil { + in, out := &in.GracePeriodSeconds, &out.GracePeriodSeconds + *out = new(int64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestartOptions. +func (in *RestartOptions) DeepCopy() *RestartOptions { + if in == nil { + return nil + } + out := new(RestartOptions) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Rng) DeepCopyInto(out *Rng) { *out = *in @@ -1818,12 +1590,8 @@ func (in *SecretVolumeSource) DeepCopyInto(out *SecretVolumeSource) { *out = *in if in.Optional != nil { in, out := &in.Optional, &out.Optional - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } return } @@ -1859,48 +1627,28 @@ func (in *Timer) DeepCopyInto(out *Timer) { *out = *in if in.HPET != nil { in, out := &in.HPET, &out.HPET - if *in == nil { - *out = nil - } else { - *out = new(HPETTimer) - (*in).DeepCopyInto(*out) - } + *out = new(HPETTimer) + (*in).DeepCopyInto(*out) } if in.KVM != nil { in, out := &in.KVM, &out.KVM - if *in == nil { - *out = nil - } else { - *out = new(KVMTimer) - (*in).DeepCopyInto(*out) - } + *out = new(KVMTimer) + (*in).DeepCopyInto(*out) } if in.PIT != nil { in, out := &in.PIT, &out.PIT - if *in == nil { - *out = nil - } else { - *out = new(PITTimer) - (*in).DeepCopyInto(*out) - } + *out = new(PITTimer) + (*in).DeepCopyInto(*out) } if in.RTC != nil { in, out := &in.RTC, &out.RTC - if *in == nil { - *out = nil - } else { - *out = new(RTCTimer) - (*in).DeepCopyInto(*out) - } + *out = new(RTCTimer) + (*in).DeepCopyInto(*out) } if in.Hyperv != nil { in, out := &in.Hyperv, &out.Hyperv - if *in == nil { - *out = nil - } else { - *out = new(HypervTimer) - (*in).DeepCopyInto(*out) - } + *out = new(HypervTimer) + (*in).DeepCopyInto(*out) } return } @@ -2023,6 +1771,22 @@ func (in *VirtualMachineInstanceCondition) DeepCopy() *VirtualMachineInstanceCon return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachineInstanceGuestOSInfo) DeepCopyInto(out *VirtualMachineInstanceGuestOSInfo) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceGuestOSInfo. +func (in *VirtualMachineInstanceGuestOSInfo) DeepCopy() *VirtualMachineInstanceGuestOSInfo { + if in == nil { + return nil + } + out := new(VirtualMachineInstanceGuestOSInfo) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualMachineInstanceList) DeepCopyInto(out *VirtualMachineInstanceList) { *out = *in @@ -2156,19 +1920,11 @@ func (in *VirtualMachineInstanceMigrationState) DeepCopyInto(out *VirtualMachine *out = *in if in.StartTimestamp != nil { in, out := &in.StartTimestamp, &out.StartTimestamp - if *in == nil { - *out = nil - } else { - *out = (*in).DeepCopy() - } + *out = (*in).DeepCopy() } if in.EndTimestamp != nil { in, out := &in.EndTimestamp, &out.EndTimestamp - if *in == nil { - *out = nil - } else { - *out = (*in).DeepCopy() - } + *out = (*in).DeepCopy() } if in.TargetDirectMigrationNodePorts != nil { in, out := &in.TargetDirectMigrationNodePorts, &out.TargetDirectMigrationNodePorts @@ -2300,12 +2056,8 @@ func (in *VirtualMachineInstancePresetSpec) DeepCopyInto(out *VirtualMachineInst in.Selector.DeepCopyInto(&out.Selector) if in.Domain != nil { in, out := &in.Domain, &out.Domain - if *in == nil { - *out = nil - } else { - *out = new(DomainSpec) - (*in).DeepCopyInto(*out) - } + *out = new(DomainSpec) + (*in).DeepCopyInto(*out) } return } @@ -2404,30 +2156,18 @@ func (in *VirtualMachineInstanceReplicaSetSpec) DeepCopyInto(out *VirtualMachine *out = *in if in.Replicas != nil { in, out := &in.Replicas, &out.Replicas - if *in == nil { - *out = nil - } else { - *out = new(int32) - **out = **in - } + *out = new(int32) + **out = **in } if in.Selector != nil { in, out := &in.Selector, &out.Selector - if *in == nil { - *out = nil - } else { - *out = new(meta_v1.LabelSelector) - (*in).DeepCopyInto(*out) - } + *out = new(metav1.LabelSelector) + (*in).DeepCopyInto(*out) } if in.Template != nil { in, out := &in.Template, &out.Template - if *in == nil { - *out = nil - } else { - *out = new(VirtualMachineInstanceTemplateSpec) - (*in).DeepCopyInto(*out) - } + *out = new(VirtualMachineInstanceTemplateSpec) + (*in).DeepCopyInto(*out) } return } @@ -2478,37 +2218,25 @@ func (in *VirtualMachineInstanceSpec) DeepCopyInto(out *VirtualMachineInstanceSp } if in.Affinity != nil { in, out := &in.Affinity, &out.Affinity - if *in == nil { - *out = nil - } else { - *out = new(core_v1.Affinity) - (*in).DeepCopyInto(*out) - } + *out = new(corev1.Affinity) + (*in).DeepCopyInto(*out) } if in.Tolerations != nil { in, out := &in.Tolerations, &out.Tolerations - *out = make([]core_v1.Toleration, len(*in)) + *out = make([]corev1.Toleration, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.EvictionStrategy != nil { in, out := &in.EvictionStrategy, &out.EvictionStrategy - if *in == nil { - *out = nil - } else { - *out = new(EvictionStrategy) - **out = **in - } + *out = new(EvictionStrategy) + **out = **in } if in.TerminationGracePeriodSeconds != nil { in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } + *out = new(int64) + **out = **in } if in.Volumes != nil { in, out := &in.Volumes, &out.Volumes @@ -2519,21 +2247,13 @@ func (in *VirtualMachineInstanceSpec) DeepCopyInto(out *VirtualMachineInstanceSp } if in.LivenessProbe != nil { in, out := &in.LivenessProbe, &out.LivenessProbe - if *in == nil { - *out = nil - } else { - *out = new(Probe) - (*in).DeepCopyInto(*out) - } + *out = new(Probe) + (*in).DeepCopyInto(*out) } if in.ReadinessProbe != nil { in, out := &in.ReadinessProbe, &out.ReadinessProbe - if *in == nil { - *out = nil - } else { - *out = new(Probe) - (*in).DeepCopyInto(*out) - } + *out = new(Probe) + (*in).DeepCopyInto(*out) } if in.Networks != nil { in, out := &in.Networks, &out.Networks @@ -2544,12 +2264,8 @@ func (in *VirtualMachineInstanceSpec) DeepCopyInto(out *VirtualMachineInstanceSp } if in.DNSConfig != nil { in, out := &in.DNSConfig, &out.DNSConfig - if *in == nil { - *out = nil - } else { - *out = new(core_v1.PodDNSConfig) - (*in).DeepCopyInto(*out) - } + *out = new(corev1.PodDNSConfig) + (*in).DeepCopyInto(*out) } return } @@ -2581,23 +2297,16 @@ func (in *VirtualMachineInstanceStatus) DeepCopyInto(out *VirtualMachineInstance (*in)[i].DeepCopyInto(&(*out)[i]) } } + out.GuestOSInfo = in.GuestOSInfo if in.MigrationState != nil { in, out := &in.MigrationState, &out.MigrationState - if *in == nil { - *out = nil - } else { - *out = new(VirtualMachineInstanceMigrationState) - (*in).DeepCopyInto(*out) - } + *out = new(VirtualMachineInstanceMigrationState) + (*in).DeepCopyInto(*out) } if in.QOSClass != nil { in, out := &in.QOSClass, &out.QOSClass - if *in == nil { - *out = nil - } else { - *out = new(core_v1.PodQOSClass) - **out = **in - } + *out = new(corev1.PodQOSClass) + **out = **in } return } @@ -2668,30 +2377,18 @@ func (in *VirtualMachineSpec) DeepCopyInto(out *VirtualMachineSpec) { *out = *in if in.Running != nil { in, out := &in.Running, &out.Running - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } if in.RunStrategy != nil { in, out := &in.RunStrategy, &out.RunStrategy - if *in == nil { - *out = nil - } else { - *out = new(VirtualMachineRunStrategy) - **out = **in - } + *out = new(VirtualMachineRunStrategy) + **out = **in } if in.Template != nil { in, out := &in.Template, &out.Template - if *in == nil { - *out = nil - } else { - *out = new(VirtualMachineInstanceTemplateSpec) - (*in).DeepCopyInto(*out) - } + *out = new(VirtualMachineInstanceTemplateSpec) + (*in).DeepCopyInto(*out) } if in.DataVolumeTemplates != nil { in, out := &in.DataVolumeTemplates, &out.DataVolumeTemplates @@ -2718,12 +2415,8 @@ func (in *VirtualMachineStateChangeRequest) DeepCopyInto(out *VirtualMachineStat *out = *in if in.UID != nil { in, out := &in.UID, &out.UID - if *in == nil { - *out = nil - } else { - *out = new(types.UID) - **out = **in - } + *out = new(types.UID) + **out = **in } return } @@ -2790,102 +2483,58 @@ func (in *VolumeSource) DeepCopyInto(out *VolumeSource) { *out = *in if in.HostDisk != nil { in, out := &in.HostDisk, &out.HostDisk - if *in == nil { - *out = nil - } else { - *out = new(HostDisk) - (*in).DeepCopyInto(*out) - } + *out = new(HostDisk) + (*in).DeepCopyInto(*out) } if in.PersistentVolumeClaim != nil { in, out := &in.PersistentVolumeClaim, &out.PersistentVolumeClaim - if *in == nil { - *out = nil - } else { - *out = new(core_v1.PersistentVolumeClaimVolumeSource) - **out = **in - } + *out = new(corev1.PersistentVolumeClaimVolumeSource) + **out = **in } if in.CloudInitNoCloud != nil { in, out := &in.CloudInitNoCloud, &out.CloudInitNoCloud - if *in == nil { - *out = nil - } else { - *out = new(CloudInitNoCloudSource) - (*in).DeepCopyInto(*out) - } + *out = new(CloudInitNoCloudSource) + (*in).DeepCopyInto(*out) } if in.CloudInitConfigDrive != nil { in, out := &in.CloudInitConfigDrive, &out.CloudInitConfigDrive - if *in == nil { - *out = nil - } else { - *out = new(CloudInitConfigDriveSource) - (*in).DeepCopyInto(*out) - } + *out = new(CloudInitConfigDriveSource) + (*in).DeepCopyInto(*out) } if in.ContainerDisk != nil { in, out := &in.ContainerDisk, &out.ContainerDisk - if *in == nil { - *out = nil - } else { - *out = new(ContainerDiskSource) - **out = **in - } + *out = new(ContainerDiskSource) + **out = **in } if in.Ephemeral != nil { in, out := &in.Ephemeral, &out.Ephemeral - if *in == nil { - *out = nil - } else { - *out = new(EphemeralVolumeSource) - (*in).DeepCopyInto(*out) - } + *out = new(EphemeralVolumeSource) + (*in).DeepCopyInto(*out) } if in.EmptyDisk != nil { in, out := &in.EmptyDisk, &out.EmptyDisk - if *in == nil { - *out = nil - } else { - *out = new(EmptyDiskSource) - (*in).DeepCopyInto(*out) - } + *out = new(EmptyDiskSource) + (*in).DeepCopyInto(*out) } if in.DataVolume != nil { in, out := &in.DataVolume, &out.DataVolume - if *in == nil { - *out = nil - } else { - *out = new(DataVolumeSource) - **out = **in - } + *out = new(DataVolumeSource) + **out = **in } if in.ConfigMap != nil { in, out := &in.ConfigMap, &out.ConfigMap - if *in == nil { - *out = nil - } else { - *out = new(ConfigMapVolumeSource) - (*in).DeepCopyInto(*out) - } + *out = new(ConfigMapVolumeSource) + (*in).DeepCopyInto(*out) } if in.Secret != nil { in, out := &in.Secret, &out.Secret - if *in == nil { - *out = nil - } else { - *out = new(SecretVolumeSource) - (*in).DeepCopyInto(*out) - } + *out = new(SecretVolumeSource) + (*in).DeepCopyInto(*out) } if in.ServiceAccount != nil { in, out := &in.ServiceAccount, &out.ServiceAccount - if *in == nil { - *out = nil - } else { - *out = new(ServiceAccountVolumeSource) - **out = **in - } + *out = new(ServiceAccountVolumeSource) + **out = **in } return } @@ -2922,12 +2571,8 @@ func (in *WatchdogDevice) DeepCopyInto(out *WatchdogDevice) { *out = *in if in.I6300ESB != nil { in, out := &in.I6300ESB, &out.I6300ESB - if *in == nil { - *out = nil - } else { - *out = new(I6300ESBWatchdog) - **out = **in - } + *out = new(I6300ESBWatchdog) + **out = **in } return } diff --git a/vendor/kubevirt.io/client-go/api/v1/openapi_generated.go b/vendor/kubevirt.io/client-go/api/v1/openapi_generated.go index ac4c2c9de..2d32e72f3 100644 --- a/vendor/kubevirt.io/client-go/api/v1/openapi_generated.go +++ b/vendor/kubevirt.io/client-go/api/v1/openapi_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The KubeVirt Authors. +Copyright 2020 The KubeVirt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CDRomTarget": schema_kubevirtio_client_go_api_v1_CDRomTarget(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CPU": schema_kubevirtio_client_go_api_v1_CPU(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CPUFeature": schema_kubevirtio_client_go_api_v1_CPUFeature(ref), + "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Chassis": schema_kubevirtio_client_go_api_v1_Chassis(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Clock": schema_kubevirtio_client_go_api_v1_Clock(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ClockOffset": schema_kubevirtio_client_go_api_v1_ClockOffset(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ClockOffsetUTC": schema_kubevirtio_client_go_api_v1_ClockOffsetUTC(ref), @@ -59,6 +60,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Features": schema_kubevirtio_client_go_api_v1_Features(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Firmware": schema_kubevirtio_client_go_api_v1_Firmware(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FloppyTarget": schema_kubevirtio_client_go_api_v1_FloppyTarget(ref), + "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.GPU": schema_kubevirtio_client_go_api_v1_GPU(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.GenieNetwork": schema_kubevirtio_client_go_api_v1_GenieNetwork(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.HPETTimer": schema_kubevirtio_client_go_api_v1_HPETTimer(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.HostDisk": schema_kubevirtio_client_go_api_v1_HostDisk(ref), @@ -89,6 +91,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Port": schema_kubevirtio_client_go_api_v1_Port(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.RTCTimer": schema_kubevirtio_client_go_api_v1_RTCTimer(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ResourceRequirements": schema_kubevirtio_client_go_api_v1_ResourceRequirements(ref), + "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.RestartOptions": schema_kubevirtio_client_go_api_v1_RestartOptions(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Rng": schema_kubevirtio_client_go_api_v1_Rng(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.SecretVolumeSource": schema_kubevirtio_client_go_api_v1_SecretVolumeSource(ref), "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ServiceAccountVolumeSource": schema_kubevirtio_client_go_api_v1_ServiceAccountVolumeSource(ref), @@ -250,6 +253,13 @@ func schema_kubevirtio_client_go_api_v1_CPU(ref common.ReferenceCallback) common Format: "", }, }, + "isolateEmulatorThread": { + SchemaProps: spec.SchemaProps{ + Description: "IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place the emulator thread on it.", + Type: []string{"boolean"}, + Format: "", + }, + }, }, }, }, @@ -286,6 +296,49 @@ func schema_kubevirtio_client_go_api_v1_CPUFeature(ref common.ReferenceCallback) } } +func schema_kubevirtio_client_go_api_v1_Chassis(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Chassis specifies the chassis info passed to the domain.", + Properties: map[string]spec.Schema{ + "manufacturer": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "serial": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "asset": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "sku": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{}, + } +} + func schema_kubevirtio_client_go_api_v1_Clock(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -696,11 +749,24 @@ func schema_kubevirtio_client_go_api_v1_Devices(ref common.ReferenceCallback) co Format: "", }, }, + "gpus": { + SchemaProps: spec.SchemaProps{ + Description: "Whether to attach a GPU device to the vmi.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.GPU"), + }, + }, + }, + }, + }, }, }, }, Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Disk", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Input", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Interface", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Rng", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Watchdog"}, + "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Disk", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.GPU", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Input", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Interface", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Rng", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Watchdog"}, } } @@ -908,12 +974,18 @@ func schema_kubevirtio_client_go_api_v1_DomainSpec(ref common.ReferenceCallback) Format: "", }, }, + "chassis": { + SchemaProps: spec.SchemaProps{ + Description: "Chassis specifies the chassis info passed to the domain.", + Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Chassis"), + }, + }, }, Required: []string{"devices"}, }, }, Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CPU", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Clock", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Devices", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Features", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Firmware", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Machine", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Memory", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ResourceRequirements"}, + "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CPU", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Chassis", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Clock", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Devices", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Features", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Firmware", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Machine", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Memory", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ResourceRequirements"}, } } @@ -1261,6 +1333,32 @@ func schema_kubevirtio_client_go_api_v1_FloppyTarget(ref common.ReferenceCallbac } } +func schema_kubevirtio_client_go_api_v1_GPU(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the GPU device as exposed by a device plugin", + Type: []string{"string"}, + Format: "", + }, + }, + "deviceName": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name", "deviceName"}, + }, + }, + Dependencies: []string{}, + } +} + func schema_kubevirtio_client_go_api_v1_GenieNetwork(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -1648,11 +1746,6 @@ func schema_kubevirtio_client_go_api_v1_KubeVirt(ref common.ReferenceCallback) c Format: "", }, }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, "spec": { SchemaProps: spec.SchemaProps{ Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtSpec"), @@ -1664,10 +1757,11 @@ func schema_kubevirtio_client_go_api_v1_KubeVirt(ref common.ReferenceCallback) c }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtStatus"}, + "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtStatus"}, } } @@ -1792,6 +1886,20 @@ func schema_kubevirtio_client_go_api_v1_KubeVirtSpec(ref common.ReferenceCallbac Format: "", }, }, + "monitorNamespace": { + SchemaProps: spec.SchemaProps{ + Description: "The namespace Prometheus is deployed in Defaults to openshift-monitor", + Type: []string{"string"}, + Format: "", + }, + }, + "monitorAccount": { + SchemaProps: spec.SchemaProps{ + Description: "The name of the Prometheus service account that needs read-access to KubeVirt endpoints Defaults to prometheus-k8s", + Type: []string{"string"}, + Format: "", + }, + }, }, }, }, @@ -2211,6 +2319,40 @@ func schema_kubevirtio_client_go_api_v1_ResourceRequirements(ref common.Referenc } } +func schema_kubevirtio_client_go_api_v1_RestartOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RestartOptions may be provided when deleting an API object.", + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "gracePeriodSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "The duration in seconds before the object should be force-restared. Value must be non-negative integer. The value zero indicates, restart immediately. If this value is nil, the default grace period for deletion of the corresponding VMI for the specified type will be used to determine on how much time to give the VMI to restart. Defaults to a per object value if not specified. zero means restart immediately. Allowed Values: nil and 0", + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + }, + }, + Dependencies: []string{}, + } +} + func schema_kubevirtio_client_go_api_v1_Rng(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -2334,11 +2476,6 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachine(ref common.ReferenceCallb Format: "", }, }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, "spec": { SchemaProps: spec.SchemaProps{ Description: "Spec contains the specification of VirtualMachineInstance created", @@ -2352,10 +2489,11 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachine(ref common.ReferenceCallb }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineStatus"}, + "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineStatus"}, } } @@ -2428,11 +2566,6 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachineInstance(ref common.Refere Format: "", }, }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, "spec": { SchemaProps: spec.SchemaProps{ Description: "VirtualMachineInstance Spec contains the VirtualMachineInstance specification.", @@ -2446,10 +2579,11 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachineInstance(ref common.Refere }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceStatus"}, + "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceStatus"}, } } @@ -2567,11 +2701,6 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceMigration(ref comm Format: "", }, }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, "spec": { SchemaProps: spec.SchemaProps{ Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationSpec"), @@ -2583,10 +2712,11 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceMigration(ref comm }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationStatus"}, + "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationStatus"}, } } @@ -2808,11 +2938,6 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachineInstancePreset(ref common. Format: "", }, }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, "spec": { SchemaProps: spec.SchemaProps{ Description: "VirtualMachineInstance Spec contains the VirtualMachineInstance specification.", @@ -2823,7 +2948,7 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachineInstancePreset(ref common. }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstancePresetSpec"}, + "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstancePresetSpec"}, } } @@ -2919,11 +3044,6 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceReplicaSet(ref com Format: "", }, }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, "spec": { SchemaProps: spec.SchemaProps{ Description: "VirtualMachineInstance Spec contains the VirtualMachineInstance specification.", @@ -2937,10 +3057,11 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceReplicaSet(ref com }, }, }, + Required: []string{"spec"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSetSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSetStatus"}, + "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSetSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSetStatus"}, } } @@ -3310,6 +3431,12 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceStatus(ref common. }, }, }, + "guestOSInfo": { + SchemaProps: spec.SchemaProps{ + Description: "Guest OS Information", + Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceGuestOSInfo"), + }, + }, "migrationState": { SchemaProps: spec.SchemaProps{ Description: "Represents the status of a live migration", @@ -3334,7 +3461,7 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceStatus(ref common. }, }, Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceCondition", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationState", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceNetworkInterface"}, + "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceCondition", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceGuestOSInfo", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationState", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceNetworkInterface"}, } } @@ -3389,8 +3516,7 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachineList(ref common.ReferenceC }, "items": { SchemaProps: spec.SchemaProps{ - Description: "Items is a list of VirtualMachines", - Type: []string{"array"}, + Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3401,7 +3527,7 @@ func schema_kubevirtio_client_go_api_v1_VirtualMachineList(ref common.ReferenceC }, }, }, - Required: []string{"metadata", "items"}, + Required: []string{"items"}, }, }, Dependencies: []string{ diff --git a/vendor/kubevirt.io/client-go/api/v1/register.go b/vendor/kubevirt.io/client-go/api/v1/register.go new file mode 100644 index 000000000..290e6b45d --- /dev/null +++ b/vendor/kubevirt.io/client-go/api/v1/register.go @@ -0,0 +1,116 @@ +/* + * This file is part of the KubeVirt project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Copyright 2019 Red Hat, Inc. + * + */ +package v1 + +import ( + extv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/client-go/kubernetes/scheme" +) + +// GroupName is the group name use in this package +const GroupName = "kubevirt.io" +const SubresourceGroupName = "subresources.kubevirt.io" + +var ( + ApiLatestVersion = "v1alpha3" + ApiSupportedWebhookVersions = []string{"v1alpha3"} + ApiStorageVersion = "v1alpha3" + ApiSupportedVersions = []extv1beta1.CustomResourceDefinitionVersion{ + { + Name: "v1alpha3", + Served: true, + Storage: true, + }, + } +) + +var ( + // GroupVersion is the latest group version for the KubeVirt api + GroupVersion = schema.GroupVersion{Group: GroupName, Version: ApiLatestVersion} + + // StorageGroupVersion is the group version our api is persistented internally as + StorageGroupVersion = schema.GroupVersion{Group: GroupName, Version: ApiStorageVersion} + + // GroupVersions is group version list used to register these objects + // The preferred group version is the first item in the list. + GroupVersions = []schema.GroupVersion{GroupVersion} + + // SubresourceGroupVersions is group version list used to register these objects + // The preferred group version is the first item in the list. + SubresourceGroupVersions = []schema.GroupVersion{{Group: SubresourceGroupName, Version: "v1alpha3"}} + + // SubresourceStorageGroupVersion is the group version our api is persistented internally as + SubresourceStorageGroupVersion = schema.GroupVersion{Group: SubresourceGroupName, Version: ApiStorageVersion} +) + +var ( + // GroupVersionKind + VirtualMachineInstanceGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachineInstance"} + VirtualMachineInstanceReplicaSetGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachineInstanceReplicaSet"} + VirtualMachineInstancePresetGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachineInstancePreset"} + VirtualMachineGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachine"} + VirtualMachineInstanceMigrationGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachineInstanceMigration"} + KubeVirtGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "KubeVirt"} +) + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + Scheme = runtime.NewScheme() + AddToScheme = SchemeBuilder.AddToScheme + Codecs = serializer.NewCodecFactory(Scheme) + ParameterCodec = runtime.NewParameterCodec(Scheme) +) + +func init() { + AddToScheme(Scheme) + AddToScheme(scheme.Scheme) +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + + for _, groupVersion := range GroupVersions { + scheme.AddKnownTypes(groupVersion, + &VirtualMachineInstance{}, + &VirtualMachineInstanceList{}, + &VirtualMachineInstanceReplicaSet{}, + &VirtualMachineInstanceReplicaSetList{}, + &VirtualMachineInstancePreset{}, + &VirtualMachineInstancePresetList{}, + &VirtualMachineInstanceMigration{}, + &VirtualMachineInstanceMigrationList{}, + &VirtualMachine{}, + &VirtualMachineList{}, + &KubeVirt{}, + &KubeVirtList{}, + ) + metav1.AddToGroupVersion(scheme, groupVersion) + } + + return nil +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return GroupVersion.WithResource(resource).GroupResource() +} diff --git a/vendor/kubevirt.io/client-go/api/v1/schema.go b/vendor/kubevirt.io/client-go/api/v1/schema.go index 8789fe106..18a8fda1a 100644 --- a/vendor/kubevirt.io/client-go/api/v1/schema.go +++ b/vendor/kubevirt.io/client-go/api/v1/schema.go @@ -170,6 +170,20 @@ type DomainSpec struct { // One of: shared, auto // +optional IOThreadsPolicy *IOThreadsPolicy `json:"ioThreadsPolicy,omitempty"` + // Chassis specifies the chassis info passed to the domain. + // +optional + Chassis *Chassis `json:"chassis,omitempty"` +} + +// Chassis specifies the chassis info passed to the domain. +// --- +// +k8s:openapi-gen=true +type Chassis struct { + Manufacturer string `json:"manufacturer,omitempty"` + Version string `json:"version,omitempty"` + Serial string `json:"serial,omitempty"` + Asset string `json:"asset,omitempty"` + Sku string `json:"sku,omitempty"` } // Represents the firmware blob used to assist in the domain creation process. @@ -241,6 +255,10 @@ type CPU struct { // with enough dedicated pCPUs and pin the vCPUs to it. // +optional DedicatedCPUPlacement bool `json:"dedicatedCpuPlacement,omitempty"` + // IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place + // the emulator thread on it. + // +optional + IsolateEmulatorThread bool `json:"isolateEmulatorThread,omitempty"` } // CPUFeature allows specifying a CPU feature. @@ -327,6 +345,9 @@ type Devices struct { // If specified, virtual network interfaces configured with a virtio bus will also enable the vhost multiqueue feature // +optional NetworkInterfaceMultiQueue *bool `json:"networkInterfaceMultiqueue,omitempty"` + //Whether to attach a GPU device to the vmi. + // +optional + GPUs []GPU `json:"gpus,omitempty"` } // --- @@ -342,6 +363,14 @@ type Input struct { Name string `json:"name"` } +// --- +// +k8s:openapi-gen=true +type GPU struct { + // Name of the GPU device as exposed by a device plugin + Name string `json:"name"` + DeviceName string `json:"deviceName"` +} + // --- // +k8s:openapi-gen=true type Disk struct { diff --git a/vendor/kubevirt.io/client-go/api/v1/schema_swagger_generated.go b/vendor/kubevirt.io/client-go/api/v1/schema_swagger_generated.go index 112d2f7a7..a050a79dd 100644 --- a/vendor/kubevirt.io/client-go/api/v1/schema_swagger_generated.go +++ b/vendor/kubevirt.io/client-go/api/v1/schema_swagger_generated.go @@ -69,6 +69,13 @@ func (DomainSpec) SwaggerDoc() map[string]string { "features": "Features like acpi, apic, hyperv, smm.\n+optional", "devices": "Devices allows adding disks, network interfaces, ...", "ioThreadsPolicy": "Controls whether or not disks will share IOThreads.\nOmitting IOThreadsPolicy disables use of IOThreads.\nOne of: shared, auto\n+optional", + "chassis": "Chassis specifies the chassis info passed to the domain.\n+optional", + } +} + +func (Chassis) SwaggerDoc() map[string]string { + return map[string]string{ + "": "Chassis specifies the chassis info passed to the domain.", } } @@ -109,6 +116,7 @@ func (CPU) SwaggerDoc() map[string]string { "model": "Model specifies the CPU model inside the VMI.\nList of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map.\nIt is possible to specify special cases like \"host-passthrough\" to get the same CPU as the node\nand \"host-model\" to get CPU closest to the node one.\nDefaults to host-model.\n+optional", "features": "Features specifies the CPU features list inside the VMI.\n+optional", "dedicatedCpuPlacement": "DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node\nwith enough dedicated pCPUs and pin the vCPUs to it.\n+optional", + "isolateEmulatorThread": "IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place\nthe emulator thread on it.\n+optional", } } @@ -160,6 +168,7 @@ func (Devices) SwaggerDoc() map[string]string { "rng": "Whether to have random number generator from host\n+optional", "blockMultiQueue": "Whether or not to enable virtio multi-queue for block devices\n+optional", "networkInterfaceMultiqueue": "If specified, virtual network interfaces configured with a virtio bus will also enable the vhost multiqueue feature\n+optional", + "gpus": "Whether to attach a GPU device to the vmi.\n+optional", } } @@ -171,6 +180,12 @@ func (Input) SwaggerDoc() map[string]string { } } +func (GPU) SwaggerDoc() map[string]string { + return map[string]string{ + "name": "Name of the GPU device as exposed by a device plugin", + } +} + func (Disk) SwaggerDoc() map[string]string { return map[string]string{ "name": "Name is the device name", diff --git a/vendor/kubevirt.io/client-go/api/v1/types.go b/vendor/kubevirt.io/client-go/api/v1/types.go index 54f66cb76..d9a9dc383 100644 --- a/vendor/kubevirt.io/client-go/api/v1/types.go +++ b/vendor/kubevirt.io/client-go/api/v1/types.go @@ -32,120 +32,26 @@ import ( "encoding/json" "fmt" - v1 "k8s.io/api/autoscaling/v1" k8sv1 "k8s.io/api/core/v1" - extv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes/scheme" cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1" ) -// GroupName is the group name use in this package -const GroupName = "kubevirt.io" -const SubresourceGroupName = "subresources.kubevirt.io" - const DefaultGracePeriodSeconds int64 = 30 -var ApiLatestVersion = "v1alpha3" -var ApiSupportedWebhookVersions = []string{"v1alpha3"} -var ApiStorageVersion = "v1alpha3" -var ApiSupportedVersions = []extv1beta1.CustomResourceDefinitionVersion{ - extv1beta1.CustomResourceDefinitionVersion{ - Name: "v1alpha3", - Served: true, - Storage: true, - }, -} - -// GroupVersion is the latest group version for the KubeVirt api -var GroupVersion = schema.GroupVersion{Group: GroupName, Version: ApiLatestVersion} - -// StorageGroupVersion is the group version our api is persistented internally as -var StorageGroupVersion = schema.GroupVersion{Group: GroupName, Version: ApiStorageVersion} - -// SubresourceStorageGroupVersion is the group version our api is persistented internally as -var SubresourceStorageGroupVersion = schema.GroupVersion{Group: SubresourceGroupName, Version: ApiStorageVersion} - -// GroupVersions is group version list used to register these objects -// The preferred group version is the first item in the list. -var GroupVersions = []schema.GroupVersion{{Group: GroupName, Version: "v1alpha3"}} - -// SubresourceGroupVersions is group version list used to register these objects -// The preferred group version is the first item in the list. -var SubresourceGroupVersions = []schema.GroupVersion{{Group: SubresourceGroupName, Version: "v1alpha3"}} - -// GroupVersionKind -var VirtualMachineInstanceGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachineInstance"} - -var VirtualMachineInstanceReplicaSetGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachineInstanceReplicaSet"} - -var VirtualMachineInstancePresetGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachineInstancePreset"} - -var VirtualMachineGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachine"} - -var VirtualMachineInstanceMigrationGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachineInstanceMigration"} - -var KubeVirtGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "KubeVirt"} - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - - for _, groupVersion := range GroupVersions { - scheme.AddKnownTypes(groupVersion, - &VirtualMachineInstance{}, - &VirtualMachineInstanceList{}, - &metav1.ListOptions{}, - &metav1.DeleteOptions{}, - &VirtualMachineInstanceReplicaSet{}, - &VirtualMachineInstanceReplicaSetList{}, - &VirtualMachineInstancePreset{}, - &VirtualMachineInstancePresetList{}, - &VirtualMachineInstanceMigration{}, - &VirtualMachineInstanceMigrationList{}, - &metav1.GetOptions{}, - &VirtualMachine{}, - &VirtualMachineList{}, - &KubeVirt{}, - &KubeVirtList{}, - ) - } - scheme.AddKnownTypes(metav1.Unversioned, - &metav1.Status{}, - ) - scheme.AddKnownTypes(schema.GroupVersion{Group: "autoscaling", Version: "v1"}, - &v1.Scale{}, - ) - return nil -} - -var ( - Scheme = runtime.NewScheme() - Codecs = serializer.NewCodecFactory(Scheme) - ParameterCodec = runtime.NewParameterCodec(Scheme) - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - AddToScheme = SchemeBuilder.AddToScheme -) - -func init() { - AddToScheme(Scheme) - AddToScheme(scheme.Scheme) -} - // VirtualMachineInstance is *the* VirtualMachineInstance Definition. It represents a virtual machine in the runtime environment of kubernetes. // --- // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:openapi-gen=true type VirtualMachineInstance struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +k8s:openapi-gen=false metav1.ObjectMeta `json:"metadata,omitempty"` // VirtualMachineInstance Spec contains the VirtualMachineInstance specification. - Spec VirtualMachineInstanceSpec `json:"spec,omitempty" valid:"required"` + Spec VirtualMachineInstanceSpec `json:"spec" valid:"required"` // Status is the high level overview of how the VirtualMachineInstance is doing. It contains information available to controllers and users. Status VirtualMachineInstanceStatus `json:"status,omitempty"` } @@ -164,7 +70,7 @@ func (v *VirtualMachineInstance) UnmarshalBinary(data []byte) error { // +k8s:openapi-gen=true type VirtualMachineInstanceList struct { metav1.TypeMeta `json:",inline"` - ListMeta metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta `json:"metadata,omitempty"` Items []VirtualMachineInstance `json:"items"` } @@ -251,6 +157,8 @@ type VirtualMachineInstanceStatus struct { Phase VirtualMachineInstancePhase `json:"phase,omitempty"` // Interfaces represent the details of available network interfaces. Interfaces []VirtualMachineInstanceNetworkInterface `json:"interfaces,omitempty"` + // Guest OS Information + GuestOSInfo VirtualMachineInstanceGuestOSInfo `json:"guestOSInfo,omitempty"` // Represents the status of a live migration MigrationState *VirtualMachineInstanceMigrationState `json:"migrationState,omitempty"` // Represents the method using which the vmi can be migrated: live migration or block migration @@ -262,16 +170,6 @@ type VirtualMachineInstanceStatus struct { QOSClass *k8sv1.PodQOSClass `json:"qosClass,omitempty"` } -// Required to satisfy Object interface -func (v *VirtualMachineInstance) GetObjectKind() schema.ObjectKind { - return &v.TypeMeta -} - -// Required to satisfy ObjectMetaAccessor interface -func (v *VirtualMachineInstance) GetObjectMeta() metav1.Object { - return &v.ObjectMeta -} - func (v *VirtualMachineInstance) IsScheduling() bool { return v.Status.Phase == Scheduling } @@ -309,16 +207,6 @@ func (v *VirtualMachineInstance) WantsToHaveQOSGuaranteed() bool { !resources.Requests.Cpu().IsZero() && resources.Requests.Cpu().Cmp(*resources.Limits.Cpu()) == 0 } -// Required to satisfy Object interface -func (vl *VirtualMachineInstanceList) GetObjectKind() schema.ObjectKind { - return &vl.TypeMeta -} - -// Required to satisfy ListMetaAccessor interface -func (vl *VirtualMachineInstanceList) GetListMeta() meta.List { - return &vl.ListMeta -} - // --- // +k8s:openapi-gen=true type VirtualMachineInstanceConditionType string @@ -333,6 +221,9 @@ const ( // this is reported as false. VirtualMachineInstanceSynchronized VirtualMachineInstanceConditionType = "Synchronized" + // If the VMI was paused by the user, this is reported as true. + VirtualMachineInstancePaused VirtualMachineInstanceConditionType = "Paused" + // Reflects whether the QEMU guest agent is connected through the channel VirtualMachineInstanceAgentConnected VirtualMachineInstanceConditionType = "AgentConnected" @@ -418,6 +309,25 @@ type VirtualMachineInstanceNetworkInterface struct { InterfaceName string `json:"interfaceName,omitempty"` } +type VirtualMachineInstanceGuestOSInfo struct { + // Name of the Guest OS + Name string `json:"name,omitempty"` + // Guest OS Kernel Release + KernelRelease string `json:"kernelRelease,omitempty"` + // Guest OS Version + Version string `json:"version,omitempty"` + // Guest OS Pretty Name + PrettyName string `json:"prettyName,omitempty"` + // Version ID of the Guest OS + VersionID string `json:"versionId,omitempty"` + // Kernel version of the Guest OS + KernelVersion string `json:"kernelVersion,omitempty"` + // Machine type of the Guest OS + Machine string `json:"machine,omitempty"` + // Guest OS Id + ID string `json:"id,omitempty"` +} + type VirtualMachineInstanceMigrationState struct { // The time the migration action began StartTimestamp *metav1.Time `json:"startTimestamp,omitempty"` @@ -673,10 +583,11 @@ func PrepareVMINodeAntiAffinitySelectorRequirement(vmi *VirtualMachineInstance) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:openapi-gen=true type VirtualMachineInstanceReplicaSet struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +k8s:openapi-gen=false metav1.ObjectMeta `json:"metadata,omitempty"` // VirtualMachineInstance Spec contains the VirtualMachineInstance specification. - Spec VirtualMachineInstanceReplicaSetSpec `json:"spec,omitempty" valid:"required"` + Spec VirtualMachineInstanceReplicaSetSpec `json:"spec" valid:"required"` // Status is the high level overview of how the VirtualMachineInstance is doing. It contains information available to controllers and users. Status VirtualMachineInstanceReplicaSetStatus `json:"status,omitempty"` } @@ -687,7 +598,7 @@ type VirtualMachineInstanceReplicaSet struct { // +k8s:openapi-gen=true type VirtualMachineInstanceReplicaSetList struct { metav1.TypeMeta `json:",inline"` - ListMeta metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta `json:"metadata,omitempty"` Items []VirtualMachineInstanceReplicaSet `json:"items"` } @@ -762,68 +673,29 @@ type VirtualMachineInstanceTemplateSpec struct { Spec VirtualMachineInstanceSpec `json:"spec,omitempty" valid:"required"` } -// Required to satisfy Object interface -func (v *VirtualMachineInstanceReplicaSet) GetObjectKind() schema.ObjectKind { - return &v.TypeMeta -} - -// Required to satisfy ObjectMetaAccessor interface -func (v *VirtualMachineInstanceReplicaSet) GetObjectMeta() metav1.Object { - return &v.ObjectMeta -} - -// Required to satisfy Object interface -func (vl *VirtualMachineInstanceReplicaSetList) GetObjectKind() schema.ObjectKind { - return &vl.TypeMeta -} - -// Required to satisfy ListMetaAccessor interface -func (vl *VirtualMachineInstanceReplicaSetList) GetListMeta() meta.List { - return &vl.ListMeta -} - // VirtualMachineInstanceMigration represents the object tracking a VMI's migration // to another host in the cluster // --- // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:openapi-gen=true type VirtualMachineInstanceMigration struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +k8s:openapi-gen=false metav1.ObjectMeta `json:"metadata,omitempty"` - Spec VirtualMachineInstanceMigrationSpec `json:"spec,omitempty" valid:"required"` + Spec VirtualMachineInstanceMigrationSpec `json:"spec" valid:"required"` Status VirtualMachineInstanceMigrationStatus `json:"status,omitempty"` } -// Required to satisfy Object interface -func (v *VirtualMachineInstanceMigration) GetObjectKind() schema.ObjectKind { - return &v.TypeMeta -} - -// Required to satisfy ObjectMetaAccessor interface -func (v *VirtualMachineInstanceMigration) GetObjectMeta() metav1.Object { - return &v.ObjectMeta -} - // VirtualMachineInstanceMigrationList is a list of VirtualMachineMigrations // --- // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:openapi-gen=true type VirtualMachineInstanceMigrationList struct { metav1.TypeMeta `json:",inline"` - ListMeta metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta `json:"metadata,omitempty"` Items []VirtualMachineInstanceMigration `json:"items"` } -// Required to satisfy Object interface -func (vl *VirtualMachineInstanceMigrationList) GetObjectKind() schema.ObjectKind { - return &vl.TypeMeta -} - -// Required to satisfy ListMetaAccessor interface -func (vl *VirtualMachineInstanceMigrationList) GetListMeta() meta.List { - return &vl.ListMeta -} - // --- // +k8s:openapi-gen=true type VirtualMachineInstanceMigrationSpec struct { @@ -869,29 +741,20 @@ const ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:openapi-gen=true type VirtualMachineInstancePreset struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +k8s:openapi-gen=false metav1.ObjectMeta `json:"metadata,omitempty"` // VirtualMachineInstance Spec contains the VirtualMachineInstance specification. Spec VirtualMachineInstancePresetSpec `json:"spec,omitempty" valid:"required"` } -// Required to satisfy Object interface -func (v *VirtualMachineInstancePreset) GetObjectKind() schema.ObjectKind { - return &v.TypeMeta -} - -// Required to satisfy ObjectMetaAccessor interface -func (v *VirtualMachineInstancePreset) GetObjectMeta() metav1.Object { - return &v.ObjectMeta -} - // VirtualMachineInstancePresetList is a list of VirtualMachinePresets // --- // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:openapi-gen=true type VirtualMachineInstancePresetList struct { metav1.TypeMeta `json:",inline"` - ListMeta metav1.ListMeta `json:"metadata,omitempty"` + metav1.ListMeta `json:"metadata,omitempty"` Items []VirtualMachineInstancePreset `json:"items"` } @@ -922,16 +785,6 @@ func NewVirtualMachinePreset(name string, selector metav1.LabelSelector) *Virtua } } -// Required to satisfy Object interface -func (vl *VirtualMachineInstancePresetList) GetObjectKind() schema.ObjectKind { - return &vl.TypeMeta -} - -// Required to satisfy ListMetaAccessor interface -func (vl *VirtualMachineInstancePresetList) GetListMeta() meta.List { - return &vl.ListMeta -} - // VirtualMachine handles the VirtualMachines that are not running // or are in a stopped state // The VirtualMachine contains the template to create the @@ -941,11 +794,11 @@ func (vl *VirtualMachineInstancePresetList) GetListMeta() meta.List { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:openapi-gen=true type VirtualMachine struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +k8s:openapi-gen=false metav1.ObjectMeta `json:"metadata,omitempty"` - // Spec contains the specification of VirtualMachineInstance created - Spec VirtualMachineSpec `json:"spec,omitempty"` + Spec VirtualMachineSpec `json:"spec" valid:"required"` // Status holds the current state of the controller and brief information // about its associated VirtualMachineInstance Status VirtualMachineStatus `json:"status,omitempty"` @@ -976,10 +829,8 @@ func (vm *VirtualMachine) RunStrategy() (VirtualMachineRunStrategy, error) { // +k8s:openapi-gen=true type VirtualMachineList struct { metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - // Items is a list of VirtualMachines - Items []VirtualMachine `json:"items"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualMachine `json:"items"` } // VirtualMachineRunStrategy is a label for the requested VirtualMachineInstance Running State at the current time. @@ -1057,16 +908,6 @@ type VirtualMachineStateChangeRequest struct { UID *types.UID `json:"uid,omitempty" optional:"true" protobuf:"bytes,5,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"` } -// GetObjectKind is required to satisfy Object interface -func (v *VirtualMachine) GetObjectKind() schema.ObjectKind { - return &v.TypeMeta -} - -// GetObjectMeta is required to satisfy ObjectMetaAccessor interface -func (v *VirtualMachine) GetObjectMeta() metav1.Object { - return &v.ObjectMeta -} - // VirtualMachineCondition represents the state of VirtualMachine // --- // +k8s:openapi-gen=true @@ -1088,6 +929,10 @@ const ( // fails to be created due to insufficient quota, limit ranges, pod security policy, node selectors, // etc. or deleted due to kubelet being down or finalizers are failing. VirtualMachineFailure VirtualMachineConditionType = "Failure" + + // VirtualMachinePaused is added in a virtual machine when its vmi + // signals with its own condition that it is paused. + VirtualMachinePaused VirtualMachineConditionType = "Paused" ) // --- @@ -1172,40 +1017,21 @@ type Probe struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:openapi-gen=true type KubeVirt struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +k8s:openapi-gen=false metav1.ObjectMeta `json:"metadata,omitempty"` - Spec KubeVirtSpec `json:"spec,omitempty" valid:"required"` + Spec KubeVirtSpec `json:"spec" valid:"required"` Status KubeVirtStatus `json:"status,omitempty"` } -// Required to satisfy Object interface -func (k *KubeVirt) GetObjectKind() schema.ObjectKind { - return &k.TypeMeta -} - -// Required to satisfy ObjectMetaAccessor interface -func (k *KubeVirt) GetObjectMeta() metav1.Object { - return &k.ObjectMeta -} - // KubeVirtList is a list of KubeVirts // --- // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:openapi-gen=true type KubeVirtList struct { metav1.TypeMeta `json:",inline"` - ListMeta metav1.ListMeta `json:"metadata,omitempty"` - Items []KubeVirt `json:"items"` -} - -// Required to satisfy Object interface -func (kl *KubeVirtList) GetObjectKind() schema.ObjectKind { - return &kl.TypeMeta -} - -// Required to satisfy ListMetaAccessor interface -func (kl *KubeVirtList) GetListMeta() meta.List { - return &kl.ListMeta + metav1.ListMeta `json:"metadata,omitempty"` + Items []KubeVirt `json:"items"` } // --- @@ -1220,6 +1046,14 @@ type KubeVirtSpec struct { // The ImagePullPolicy to use. ImagePullPolicy k8sv1.PullPolicy `json:"imagePullPolicy,omitempty" valid:"required"` + + // The namespace Prometheus is deployed in + // Defaults to openshift-monitor + MonitorNamespace string `json:"monitorNamespace,omitempty"` + + // The name of the Prometheus service account that needs read-access to KubeVirt endpoints + // Defaults to prometheus-k8s + MonitorAccount string `json:"monitorAccount,omitempty"` } // KubeVirtStatus represents information pertaining to a KubeVirt deployment. @@ -1291,3 +1125,18 @@ const ( const ( EvictionStrategyLiveMigrate EvictionStrategy = "LiveMigrate" ) + +// RestartOptions may be provided when deleting an API object. +// --- +// +k8s:openapi-gen=true +type RestartOptions struct { + metav1.TypeMeta `json:",inline"` + + // The duration in seconds before the object should be force-restared. Value must be non-negative integer. + // The value zero indicates, restart immediately. If this value is nil, the default grace period for deletion of the corresponding VMI for the + // specified type will be used to determine on how much time to give the VMI to restart. + // Defaults to a per object value if not specified. zero means restart immediately. + // Allowed Values: nil and 0 + // +optional + GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty" protobuf:"varint,1,opt,name=gracePeriodSeconds"` +} diff --git a/vendor/kubevirt.io/client-go/api/v1/types_swagger_generated.go b/vendor/kubevirt.io/client-go/api/v1/types_swagger_generated.go index f54e79ca3..9b049c974 100644 --- a/vendor/kubevirt.io/client-go/api/v1/types_swagger_generated.go +++ b/vendor/kubevirt.io/client-go/api/v1/types_swagger_generated.go @@ -44,6 +44,7 @@ func (VirtualMachineInstanceStatus) SwaggerDoc() map[string]string { "conditions": "Conditions are specific points in VirtualMachineInstance's pod runtime.", "phase": "Phase is the status of the VirtualMachineInstance in kubernetes world. It is not the VirtualMachineInstance status, but partially correlates to it.", "interfaces": "Interfaces represent the details of available network interfaces.", + "guestOSInfo": "Guest OS Information", "migrationState": "Represents the status of a live migration", "migrationMethod": "Represents the method using which the vmi can be migrated: live migration or block migration", "qosClass": "The Quality of Service (QOS) classification assigned to the virtual machine instance based on resource requirements\nSee PodQOSClass type for available QOS classes\nMore info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md\n+optional", @@ -68,6 +69,19 @@ func (VirtualMachineInstanceNetworkInterface) SwaggerDoc() map[string]string { } } +func (VirtualMachineInstanceGuestOSInfo) SwaggerDoc() map[string]string { + return map[string]string{ + "name": "Name of the Guest OS", + "kernelRelease": "Guest OS Kernel Release", + "version": "Guest OS Version", + "prettyName": "Guest OS Pretty Name", + "versionId": "Version ID of the Guest OS", + "kernelVersion": "Kernel version of the Guest OS", + "machine": "Machine type of the Guest OS", + "id": "Guest OS Id", + } +} + func (VirtualMachineInstanceMigrationState) SwaggerDoc() map[string]string { return map[string]string{ "startTimestamp": "The time the migration action began", @@ -186,8 +200,7 @@ func (VirtualMachine) SwaggerDoc() map[string]string { func (VirtualMachineList) SwaggerDoc() map[string]string { return map[string]string{ - "": "VirtualMachineList is a list of virtualmachines", - "items": "Items is a list of VirtualMachines", + "": "VirtualMachineList is a list of virtualmachines", } } @@ -257,9 +270,11 @@ func (KubeVirtList) SwaggerDoc() map[string]string { func (KubeVirtSpec) SwaggerDoc() map[string]string { return map[string]string{ - "imageTag": "The image tag to use for the continer images installed.\nDefaults to the same tag as the operator's container image.", - "imageRegistry": "The image registry to pull the container images from\nDefaults to the same registry the operator's container image is pulled from.", - "imagePullPolicy": "The ImagePullPolicy to use.", + "imageTag": "The image tag to use for the continer images installed.\nDefaults to the same tag as the operator's container image.", + "imageRegistry": "The image registry to pull the container images from\nDefaults to the same registry the operator's container image is pulled from.", + "imagePullPolicy": "The ImagePullPolicy to use.", + "monitorNamespace": "The namespace Prometheus is deployed in\nDefaults to openshift-monitor", + "monitorAccount": "The name of the Prometheus service account that needs read-access to KubeVirt endpoints\nDefaults to prometheus-k8s", } } @@ -274,3 +289,10 @@ func (KubeVirtCondition) SwaggerDoc() map[string]string { "": "KubeVirtCondition represents a condition of a KubeVirt deployment", } } + +func (RestartOptions) SwaggerDoc() map[string]string { + return map[string]string{ + "": "RestartOptions may be provided when deleting an API object.", + "gracePeriodSeconds": "The duration in seconds before the object should be force-restared. Value must be non-negative integer.\nThe value zero indicates, restart immediately. If this value is nil, the default grace period for deletion of the corresponding VMI for the\nspecified type will be used to determine on how much time to give the VMI to restart.\nDefaults to a per object value if not specified. zero means restart immediately.\nAllowed Values: nil and 0\n+optional", + } +} diff --git a/vendor/kubevirt.io/client-go/api/v1/zz_generated.defaults.go b/vendor/kubevirt.io/client-go/api/v1/zz_generated.defaults.go index a08b855cf..4ef247387 100644 --- a/vendor/kubevirt.io/client-go/api/v1/zz_generated.defaults.go +++ b/vendor/kubevirt.io/client-go/api/v1/zz_generated.defaults.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The KubeVirt Authors. +Copyright 2020 The KubeVirt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/kubevirt.io/kubevirt/tools/vms-generator/utils/utils.go b/vendor/kubevirt.io/kubevirt/tools/vms-generator/utils/utils.go index 6c555623d..5c722d02e 100644 --- a/vendor/kubevirt.io/kubevirt/tools/vms-generator/utils/utils.go +++ b/vendor/kubevirt.io/kubevirt/tools/vms-generator/utils/utils.go @@ -55,6 +55,7 @@ const ( VmiGeniePtp = "vmi-genie-ptp" VmiGenieMultipleNet = "vmi-genie-multiple-net" VmiHostDisk = "vmi-host-disk" + VmiGPU = "vmi-gpu" VmTemplateFedora = "vm-template-fedora" VmTemplateRHEL7 = "vm-template-rhel7" VmTemplateWindows = "vm-template-windows2012r2" @@ -82,8 +83,10 @@ const ( imageCirros = "cirros-container-disk-demo" imageFedora = "fedora-cloud-container-disk-demo" ) - const windowsFirmware = "5d307ca9-b3ef-428c-8861-06e72d69f223" +const defaultInterfaceName = "default" +const enableNetworkInterfaceMultiqueueForTemplate = true +const EthernetAdaptorModelToEnableMultiqueue = "virtio" var DockerPrefix = "registry:5000/kubevirt" var DockerTag = "devel" @@ -124,6 +127,25 @@ func initFedora(spec *v1.VirtualMachineInstanceSpec) *v1.VirtualMachineInstanceS addRNG(spec) // without RNG, newer fedora images may hang waiting for entropy sources return spec } +func enableNetworkInterfaceMultiqueue(spec *v1.VirtualMachineInstanceSpec, enable bool) { + spec.Domain.Devices.NetworkInterfaceMultiQueue = &enable +} + +func setDefaultNetworkAndInterface(spec *v1.VirtualMachineInstanceSpec, bindingMethod v1.InterfaceBindingMethod, networkSource v1.NetworkSource) *v1.VirtualMachineInstanceSpec { + spec.Domain.Devices.Interfaces = []v1.Interface{ + v1.Interface{ + Name: defaultInterfaceName, + InterfaceBindingMethod: bindingMethod, + Model: EthernetAdaptorModelToEnableMultiqueue}, + } + spec.Networks = []v1.Network{ + v1.Network{ + Name: defaultInterfaceName, + NetworkSource: networkSource}, + } + + return spec +} func addRNG(spec *v1.VirtualMachineInstanceSpec) *v1.VirtualMachineInstanceSpec { spec.Domain.Devices.Rng = &v1.Rng{} @@ -131,28 +153,24 @@ func addRNG(spec *v1.VirtualMachineInstanceSpec) *v1.VirtualMachineInstanceSpec } func addContainerDisk(spec *v1.VirtualMachineInstanceSpec, image string, bus string) *v1.VirtualMachineInstanceSpec { - spec.Domain.Devices = v1.Devices{ - Disks: []v1.Disk{ - { - Name: "containerdisk", - DiskDevice: v1.DiskDevice{ - Disk: &v1.DiskTarget{ - Bus: bus, - }, - }, + disk := &v1.Disk{ + Name: "containerdisk", + DiskDevice: v1.DiskDevice{ + Disk: &v1.DiskTarget{ + Bus: bus, }, }, } - spec.Volumes = []v1.Volume{ - { - Name: "containerdisk", - VolumeSource: v1.VolumeSource{ - ContainerDisk: &v1.ContainerDiskSource{ - Image: image, - }, + spec.Domain.Devices.Disks = append(spec.Domain.Devices.Disks, *disk) + volume := &v1.Volume{ + Name: "containerdisk", + VolumeSource: v1.VolumeSource{ + ContainerDisk: &v1.ContainerDiskSource{ + Image: image, }, }, } + spec.Volumes = append(spec.Volumes, *volume) return spec } @@ -291,6 +309,10 @@ func addHostDisk(spec *v1.VirtualMachineInstanceSpec, path string, hostDiskType func GetVMIMigratable() *v1.VirtualMachineInstance { vmi := getBaseVMI(VmiMigratable) + // having no network leads to adding a default interface that may be of type bridge on + // the pod network and that would make the VMI non-migratable. Therefore, adding a network. + vmi.Spec.Networks = []v1.Network{*v1.DefaultPodNetwork()} + vmi.Spec.Domain.Devices.Interfaces = []v1.Interface{*v1.DefaultMasqueradeNetworkInterface()} addContainerDisk(&vmi.Spec, fmt.Sprintf("%s/%s:%s", DockerPrefix, imageAlpine, DockerTag), busVirtio) return vmi @@ -351,7 +373,6 @@ func GetVMIMasquerade() *v1.VirtualMachineInstance { vm := getBaseVMI(VmiMasquerade) vm.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1024M") vm.Spec.Networks = []v1.Network{v1.Network{Name: "testmasquerade", NetworkSource: v1.NetworkSource{Pod: &v1.PodNetwork{}}}} - initFedora(&vm.Spec) addNoCloudDiskWitUserData(&vm.Spec, "#!/bin/bash\necho \"fedora\" |passwd fedora --stdin\nyum install -y nginx\nsystemctl enable nginx\nsystemctl start nginx") @@ -369,7 +390,7 @@ func GetVMISRIOV() *v1.VirtualMachineInstance { initFedora(&vm.Spec) addNoCloudDiskWitUserData(&vm.Spec, "#!/bin/bash\necho \"fedora\" |passwd fedora --stdin\ndhclient eth1\n") - vm.Spec.Domain.Devices.Interfaces = []v1.Interface{{Name: "default", InterfaceBindingMethod: v1.InterfaceBindingMethod{Bridge: &v1.InterfaceBridge{}}}, + vm.Spec.Domain.Devices.Interfaces = []v1.Interface{{Name: "default", InterfaceBindingMethod: v1.InterfaceBindingMethod{Masquerade: &v1.InterfaceMasquerade{}}}, {Name: "sriov-net", InterfaceBindingMethod: v1.InterfaceBindingMethod{SRIOV: &v1.InterfaceSRIOV{}}}} return vm @@ -394,7 +415,7 @@ func GetVMIMultusMultipleNet() *v1.VirtualMachineInstance { initFedora(&vm.Spec) addNoCloudDiskWitUserData(&vm.Spec, "#!/bin/bash\necho \"fedora\" |passwd fedora --stdin\ndhclient eth1\n") - vm.Spec.Domain.Devices.Interfaces = []v1.Interface{{Name: "default", InterfaceBindingMethod: v1.InterfaceBindingMethod{Bridge: &v1.InterfaceBridge{}}}, + vm.Spec.Domain.Devices.Interfaces = []v1.Interface{{Name: "default", InterfaceBindingMethod: v1.InterfaceBindingMethod{Masquerade: &v1.InterfaceMasquerade{}}}, {Name: "ptp", InterfaceBindingMethod: v1.InterfaceBindingMethod{Bridge: &v1.InterfaceBridge{}}}} return vm @@ -509,7 +530,7 @@ func GetVMIWindows() *v1.VirtualMachineInstance { }, }, Devices: v1.Devices{ - Interfaces: []v1.Interface{*v1.DefaultBridgeNetworkInterface()}, + Interfaces: []v1.Interface{*v1.DefaultMasqueradeNetworkInterface()}, }, }, Networks: []v1.Network{*v1.DefaultPodNetwork()}, @@ -559,8 +580,18 @@ func GetVMCirros() *v1.VirtualMachine { func GetTemplateFedora() *Template { vm := getBaseVM("", map[string]string{"kubevirt-vm": "vm-${NAME}", "kubevirt.io/os": "fedora27"}) - initFedora(&vm.Spec.Template.Spec) - addNoCloudDiskWitUserData(&vm.Spec.Template.Spec, "#cloud-config\npassword: fedora\nchpasswd: { expire: False }") + spec := &vm.Spec.Template.Spec + initFedora(spec) + addNoCloudDiskWitUserData(spec, "#cloud-config\npassword: fedora\nchpasswd: { expire: False }") + + setDefaultNetworkAndInterface(spec, v1.InterfaceBindingMethod{ + Masquerade: &v1.InterfaceMasquerade{}, + }, + v1.NetworkSource{ + Pod: &v1.PodNetwork{}, + }) + + enableNetworkInterfaceMultiqueue(spec, enableNetworkInterfaceMultiqueueForTemplate) template := getBaseTemplate(vm, "4096Mi", "4") template.ObjectMeta = metav1.ObjectMeta{ @@ -580,18 +611,35 @@ func GetTemplateFedora() *Template { func GetTemplateRHEL7() *Template { vm := getBaseVM("", map[string]string{"kubevirt-vm": "vm-${NAME}", "kubevirt.io/os": "rhel-7.4"}) - addPVCDisk(&vm.Spec.Template.Spec, "linux-vm-pvc-${NAME}", busVirtio, "disk0") + spec := &vm.Spec.Template.Spec + setDefaultNetworkAndInterface(spec, v1.InterfaceBindingMethod{ + Masquerade: &v1.InterfaceMasquerade{}, + }, + v1.NetworkSource{ + Pod: &v1.PodNetwork{}, + }) + enableNetworkInterfaceMultiqueue(spec, enableNetworkInterfaceMultiqueueForTemplate) + + addPVCDisk(spec, "linux-vm-pvc-${NAME}", busVirtio, "disk0") pvc := getPVCForTemplate("linux-vm-pvc-${NAME}") template := newTemplateForRHEL7VM(vm) template.Objects = append(template.Objects, pvc) - return template } func GetTestTemplateRHEL7() *Template { vm := getBaseVM("", map[string]string{"kubevirt-vm": "vm-${NAME}", "kubevirt.io/os": "rhel-7.4"}) - addEphemeralPVCDisk(&vm.Spec.Template.Spec, "disk-rhel", busSata, "pvcdisk") + spec := &vm.Spec.Template.Spec + addEphemeralPVCDisk(spec, "disk-rhel", busSata, "pvcdisk") + setDefaultNetworkAndInterface(spec, v1.InterfaceBindingMethod{ + Masquerade: &v1.InterfaceMasquerade{}, + }, + v1.NetworkSource{ + Pod: &v1.PodNetwork{}, + }) + + enableNetworkInterfaceMultiqueue(spec, enableNetworkInterfaceMultiqueueForTemplate) return newTemplateForRHEL7VM(vm) } @@ -855,3 +903,18 @@ func GetVMIWithHookSidecar() *v1.VirtualMachineInstance { } return vmi } + +func GetVMIGPU() *v1.VirtualMachineInstance { + vmi := getBaseVMI(VmiGPU) + vmi.Spec.Domain.Resources.Requests[k8sv1.ResourceMemory] = resource.MustParse("1024M") + GPUs := []v1.GPU{ + v1.GPU{ + Name: "gpu1", + DeviceName: "nvidia.com/GP102GL_Tesla_P40", + }, + } + vmi.Spec.Domain.Devices.GPUs = GPUs + initFedora(&vmi.Spec) + addNoCloudDiskWitUserData(&vmi.Spec, "#cloud-config\npassword: fedora\nchpasswd: { expire: False }") + return vmi +} diff --git a/vendor/modules.txt b/vendor/modules.txt index ae621bfbf..29c750b2c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -60,7 +60,7 @@ github.com/google/uuid github.com/googleapis/gnostic/OpenAPIv2 github.com/googleapis/gnostic/compiler github.com/googleapis/gnostic/extensions -# github.com/hashicorp/golang-lru v0.5.1 +# github.com/hashicorp/golang-lru v0.5.3 github.com/hashicorp/golang-lru github.com/hashicorp/golang-lru/simplelru # github.com/hpcloud/tail v1.0.0 @@ -271,8 +271,8 @@ gopkg.in/yaml.v3 k8s.io/api/core/v1 k8s.io/api/admissionregistration/v1beta1 k8s.io/api/admission/v1beta1 -k8s.io/api/autoscaling/v1 k8s.io/api/authentication/v1 +k8s.io/api/autoscaling/v1 k8s.io/api/policy/v1beta1 k8s.io/api/certificates/v1beta1 k8s.io/api/admissionregistration/v1 @@ -531,13 +531,13 @@ k8s.io/utils/pointer k8s.io/utils/integer k8s.io/utils/buffer k8s.io/utils/trace -# kubevirt.io/client-go v0.20.4 +# kubevirt.io/client-go v0.25.0 kubevirt.io/client-go/api/v1 kubevirt.io/client-go/precond -# kubevirt.io/containerized-data-importer v1.10.6 +# kubevirt.io/containerized-data-importer v1.10.9 kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1 kubevirt.io/containerized-data-importer/pkg/apis/core -# kubevirt.io/kubevirt v0.20.4 +# kubevirt.io/kubevirt v0.25.0 kubevirt.io/kubevirt/tools/vms-generator/utils # sigs.k8s.io/controller-runtime v0.4.0 sigs.k8s.io/controller-runtime/pkg/runtime/log