diff --git a/Makefile b/Makefile index 7506dda9d243..a1a2bb105480 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ distclean: clean rm -rf vendor/ deps-update: - SYNC_VENDOR=true hack/dockerized "GO111MODULE=on go mod tidy && GO111MODULE=on go mod vendor && ./hack/bazel-generate.sh" + SYNC_VENDOR=true hack/dockerized "GO111MODULE=on go mod tidy && GO111MODULE=on go mod vendor && ./hack/dep-prune.sh && ./hack/bazel-generate.sh" check: hack/dockerized "./hack/check.sh" diff --git a/cmd/example-cloudinit-hook-sidecar/BUILD.bazel b/cmd/example-cloudinit-hook-sidecar/BUILD.bazel index f087b8aae683..877fae138893 100644 --- a/cmd/example-cloudinit-hook-sidecar/BUILD.bazel +++ b/cmd/example-cloudinit-hook-sidecar/BUILD.bazel @@ -10,8 +10,8 @@ go_library( "//pkg/hooks:go_default_library", "//pkg/hooks/info:go_default_library", "//pkg/hooks/v1alpha2:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/cmd/example-hook-sidecar/BUILD.bazel b/cmd/example-hook-sidecar/BUILD.bazel index b84bfc9da029..6977bbadaec2 100644 --- a/cmd/example-hook-sidecar/BUILD.bazel +++ b/cmd/example-hook-sidecar/BUILD.bazel @@ -11,9 +11,9 @@ go_library( "//pkg/hooks/v1alpha1:go_default_library", "//pkg/hooks/v1alpha2:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/cmd/subresource-access-test/BUILD.bazel b/cmd/subresource-access-test/BUILD.bazel index d058ddf4bda7..f1356e9b0d03 100644 --- a/cmd/subresource-access-test/BUILD.bazel +++ b/cmd/subresource-access-test/BUILD.bazel @@ -6,8 +6,8 @@ go_library( importpath = "kubevirt.io/kubevirt/cmd/subresource-access-test", visibility = ["//visibility:private"], deps = [ + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", ], ) diff --git a/cmd/virt-api/BUILD.bazel b/cmd/virt-api/BUILD.bazel index 2831fb89d7d3..384b2c2e04a3 100644 --- a/cmd/virt-api/BUILD.bazel +++ b/cmd/virt-api/BUILD.bazel @@ -11,7 +11,7 @@ go_library( "//pkg/monitoring/workqueue/prometheus:go_default_library", "//pkg/service:go_default_library", "//pkg/virt-api:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/cmd/virt-handler/BUILD.bazel b/cmd/virt-handler/BUILD.bazel index 2b4e9f8d1c15..9275e4f57dd0 100644 --- a/cmd/virt-handler/BUILD.bazel +++ b/cmd/virt-handler/BUILD.bazel @@ -21,7 +21,9 @@ go_library( "//pkg/virt-handler/cache:go_default_library", "//pkg/virt-launcher:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", @@ -33,9 +35,7 @@ go_library( "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", "//vendor/k8s.io/client-go/util/cert:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", + "@com_github_golang_glog//:go_default_library", ], ) diff --git a/cmd/virt-launcher/BUILD.bazel b/cmd/virt-launcher/BUILD.bazel index 9ac08dab7f8e..3e9f634e6d0f 100644 --- a/cmd/virt-launcher/BUILD.bazel +++ b/cmd/virt-launcher/BUILD.bazel @@ -21,13 +21,13 @@ go_library( "//pkg/virt-launcher/virtwrap/cmd-server:go_default_library", "//pkg/virt-launcher/virtwrap/util:go_default_library", "//pkg/watchdog:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/libvirt/libvirt-go:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/hack/dep-prune.sh b/hack/dep-prune.sh index 45469ab57fc4..2f84e117f291 100755 --- a/hack/dep-prune.sh +++ b/hack/dep-prune.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -for file in $(find vendor/ -name "*_test.go"); do rm ${file}; done + rm -rf vendor/github.com/golang/glog mkdir -p vendor/github.com/golang/ ln -s ../../../pkg/staging/glog/ vendor/github.com/golang/glog + +# create symbolic link on client-go package to avoid duplication +rm -rf vendor/kubevirt.io/client-go +mkdir -p vendor/kubevirt.io +ln -s ../../staging/src/kubevirt.io/client-go/ vendor/kubevirt.io/client-go diff --git a/pkg/certificates/BUILD.bazel b/pkg/certificates/BUILD.bazel index b6ce3d92ab07..a5a8ffce42de 100644 --- a/pkg/certificates/BUILD.bazel +++ b/pkg/certificates/BUILD.bazel @@ -20,8 +20,8 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/cloud-init/BUILD.bazel b/pkg/cloud-init/BUILD.bazel index 61dda7c81055..f309d6c80def 100644 --- a/pkg/cloud-init/BUILD.bazel +++ b/pkg/cloud-init/BUILD.bazel @@ -8,12 +8,12 @@ go_library( deps = [ "//pkg/ephemeral-disk-utils:go_default_library", "//pkg/util/net/dns:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", ], ) @@ -25,15 +25,15 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", ], ) diff --git a/pkg/config/BUILD.bazel b/pkg/config/BUILD.bazel index 4f92061ddbcc..484855774e9f 100644 --- a/pkg/config/BUILD.bazel +++ b/pkg/config/BUILD.bazel @@ -10,7 +10,7 @@ go_library( ], importpath = "kubevirt.io/kubevirt/pkg/config", visibility = ["//visibility:public"], - deps = ["//vendor/kubevirt.io/client-go/api/v1:go_default_library"], + deps = ["//staging/src/kubevirt.io/client-go/api/v1:go_default_library"], ) go_test( @@ -24,10 +24,10 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/container-disk/BUILD.bazel b/pkg/container-disk/BUILD.bazel index e63c383dd75c..236ace6b1542 100644 --- a/pkg/container-disk/BUILD.bazel +++ b/pkg/container-disk/BUILD.bazel @@ -7,10 +7,10 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/ephemeral-disk-utils:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", ], ) @@ -22,11 +22,11 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/extensions/table:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/controller/BUILD.bazel b/pkg/controller/BUILD.bazel index 61a8ecbce7de..49c57dc2ef4b 100644 --- a/pkg/controller/BUILD.bazel +++ b/pkg/controller/BUILD.bazel @@ -14,7 +14,9 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/testutils:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/openshift/api/security/v1:go_default_library", "//vendor/k8s.io/api/admissionregistration/v1beta1:go_default_library", "//vendor/k8s.io/api/apps/v1:go_default_library", @@ -39,11 +41,9 @@ go_library( "//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/util/workqueue:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/client/informers/externalversions:go_default_library", + "@com_github_golang_glog//:go_default_library", ], ) @@ -56,6 +56,8 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", @@ -68,8 +70,6 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/util/rand:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1:go_default_library", ], ) diff --git a/pkg/emptydisk/BUILD.bazel b/pkg/emptydisk/BUILD.bazel index 6b7096722bc0..1eb95fddbb25 100644 --- a/pkg/emptydisk/BUILD.bazel +++ b/pkg/emptydisk/BUILD.bazel @@ -5,7 +5,7 @@ go_library( srcs = ["emptydisk.go"], importpath = "kubevirt.io/kubevirt/pkg/emptydisk", visibility = ["//visibility:public"], - deps = ["//vendor/kubevirt.io/client-go/api/v1:go_default_library"], + deps = ["//staging/src/kubevirt.io/client-go/api/v1:go_default_library"], ) go_test( @@ -16,10 +16,10 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/ephemeral-disk-utils/BUILD.bazel b/pkg/ephemeral-disk-utils/BUILD.bazel index b0ccd48d9d7c..6f3f11cd5704 100644 --- a/pkg/ephemeral-disk-utils/BUILD.bazel +++ b/pkg/ephemeral-disk-utils/BUILD.bazel @@ -6,7 +6,7 @@ go_library( importpath = "kubevirt.io/kubevirt/pkg/ephemeral-disk-utils", visibility = ["//visibility:public"], deps = [ - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/ephemeral-disk/BUILD.bazel b/pkg/ephemeral-disk/BUILD.bazel index 005888361956..891760c96de2 100644 --- a/pkg/ephemeral-disk/BUILD.bazel +++ b/pkg/ephemeral-disk/BUILD.bazel @@ -7,7 +7,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/ephemeral-disk-utils:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", ], ) @@ -19,10 +19,10 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/healthz/BUILD.bazel b/pkg/healthz/BUILD.bazel index 4604185c505a..118498c88bc2 100644 --- a/pkg/healthz/BUILD.bazel +++ b/pkg/healthz/BUILD.bazel @@ -6,8 +6,8 @@ go_library( importpath = "kubevirt.io/kubevirt/pkg/healthz", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/json:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", ], ) diff --git a/pkg/hooks/BUILD.bazel b/pkg/hooks/BUILD.bazel index 60edd8fc7cd8..7473c36e169d 100644 --- a/pkg/hooks/BUILD.bazel +++ b/pkg/hooks/BUILD.bazel @@ -15,9 +15,9 @@ go_library( "//pkg/hooks/v1alpha2:go_default_library", "//pkg/util/net/grpc:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -29,10 +29,10 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/host-disk/BUILD.bazel b/pkg/host-disk/BUILD.bazel index 335afb88aae2..38843eb6b1be 100644 --- a/pkg/host-disk/BUILD.bazel +++ b/pkg/host-disk/BUILD.bazel @@ -7,10 +7,10 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/util/types:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -22,6 +22,9 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/extensions/table:go_default_library", @@ -30,8 +33,5 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/ignition/BUILD.bazel b/pkg/ignition/BUILD.bazel index a65ec355d9e5..79291918bb54 100644 --- a/pkg/ignition/BUILD.bazel +++ b/pkg/ignition/BUILD.bazel @@ -7,9 +7,9 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/ephemeral-disk-utils:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", ], ) @@ -21,9 +21,9 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/inotify-informer/BUILD.bazel b/pkg/inotify-informer/BUILD.bazel index f4fe1a564ebc..d46d17dd9ce9 100644 --- a/pkg/inotify-informer/BUILD.bazel +++ b/pkg/inotify-informer/BUILD.bazel @@ -7,12 +7,12 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/virt-launcher/virtwrap/api:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/fsnotify/fsnotify:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -26,11 +26,11 @@ go_test( deps = [ "//pkg/controller:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/util/workqueue:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/middleware/BUILD.bazel b/pkg/middleware/BUILD.bazel index c37ca5f5af51..3744b9a521ba 100644 --- a/pkg/middleware/BUILD.bazel +++ b/pkg/middleware/BUILD.bazel @@ -6,13 +6,13 @@ go_library( importpath = "kubevirt.io/kubevirt/pkg/middleware", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", "//vendor/github.com/go-kit/kit/endpoint:go_default_library", "//vendor/github.com/go-kit/kit/log:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", ], ) @@ -24,11 +24,11 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", "//vendor/github.com/go-kit/kit/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", ], ) diff --git a/pkg/monitoring/vms/prometheus/BUILD.bazel b/pkg/monitoring/vms/prometheus/BUILD.bazel index 0b6fd0db154f..57bc008ea04e 100644 --- a/pkg/monitoring/vms/prometheus/BUILD.bazel +++ b/pkg/monitoring/vms/prometheus/BUILD.bazel @@ -9,19 +9,21 @@ go_library( importpath = "kubevirt.io/kubevirt/pkg/monitoring/vms/prometheus", visibility = ["//visibility:public"], deps = [ + "//pkg/util/lookup:go_default_library", "//pkg/virt-handler/cmd-client:go_default_library", "//pkg/virt-launcher/virtwrap/stats:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/version:go_default_library", "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", "//vendor/github.com/prometheus/client_golang/prometheus/promhttp:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/version:go_default_library", ], ) go_test( name = "go_default_test", srcs = [ - "collector_suite_test.go", "collector_test.go", "prometheus_suite_test.go", "prometheus_test.go", @@ -29,9 +31,10 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/virt-launcher/virtwrap/stats:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/monitoring/vms/prometheus/collector.go b/pkg/monitoring/vms/prometheus/collector.go index 5184e6b1a814..18cdfe075482 100644 --- a/pkg/monitoring/vms/prometheus/collector.go +++ b/pkg/monitoring/vms/prometheus/collector.go @@ -23,7 +23,7 @@ import ( "sync" "time" - k6tv1 "kubevirt.io/client-go/pkg/api/v1" + k6tv1 "kubevirt.io/client-go/api/v1" "kubevirt.io/client-go/log" ) diff --git a/pkg/monitoring/vms/prometheus/collector_test.go b/pkg/monitoring/vms/prometheus/collector_test.go index 571a4873e848..3286c0d81c3f 100644 --- a/pkg/monitoring/vms/prometheus/collector_test.go +++ b/pkg/monitoring/vms/prometheus/collector_test.go @@ -25,7 +25,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - k6tv1 "kubevirt.io/client-go/pkg/api/v1" + k6tv1 "kubevirt.io/client-go/api/v1" ) var _ = Describe("Collector", func() { diff --git a/pkg/monitoring/vms/prometheus/prometheus.go b/pkg/monitoring/vms/prometheus/prometheus.go index 7403f3bcc600..6f8f5fb243c1 100644 --- a/pkg/monitoring/vms/prometheus/prometheus.go +++ b/pkg/monitoring/vms/prometheus/prometheus.go @@ -27,11 +27,11 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" - k6tv1 "kubevirt.io/client-go/pkg/api/v1" - "kubevirt.io/client-go/pkg/kubecli" - "kubevirt.io/client-go/pkg/log" + k6tv1 "kubevirt.io/client-go/api/v1" + "kubevirt.io/client-go/kubecli" + "kubevirt.io/client-go/log" + "kubevirt.io/client-go/version" "kubevirt.io/kubevirt/pkg/util/lookup" - "kubevirt.io/client-go/pkg/version" cmdclient "kubevirt.io/kubevirt/pkg/virt-handler/cmd-client" "kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap/stats" ) diff --git a/pkg/monitoring/vms/prometheus/prometheus_test.go b/pkg/monitoring/vms/prometheus/prometheus_test.go index 68dee1023e80..3a4567433111 100644 --- a/pkg/monitoring/vms/prometheus/prometheus_test.go +++ b/pkg/monitoring/vms/prometheus/prometheus_test.go @@ -25,8 +25,8 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - k6tv1 "kubevirt.io/client-go/pkg/api/v1" - "kubevirt.io/client-go/pkg/log" + k6tv1 "kubevirt.io/client-go/api/v1" + "kubevirt.io/client-go/log" "kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap/stats" ) diff --git a/pkg/rest/endpoints/BUILD.bazel b/pkg/rest/endpoints/BUILD.bazel index 194a5138a026..2cd04e1ea759 100644 --- a/pkg/rest/endpoints/BUILD.bazel +++ b/pkg/rest/endpoints/BUILD.bazel @@ -12,6 +12,7 @@ go_library( deps = [ "//pkg/middleware:go_default_library", "//pkg/rest:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", "//vendor/github.com/asaskevich/govalidator:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library", "//vendor/github.com/ghodss/yaml:go_default_library", @@ -21,7 +22,6 @@ go_library( "//vendor/gopkg.in/ini.v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", ], ) @@ -39,6 +39,7 @@ go_test( deps = [ "//pkg/middleware:go_default_library", "//pkg/rest:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library", "//vendor/github.com/evanphx/json-patch:go_default_library", "//vendor/github.com/ghodss/yaml:go_default_library", @@ -48,6 +49,5 @@ go_test( "//vendor/golang.org/x/net/context:go_default_library", "//vendor/gopkg.in/ini.v1:go_default_library", "//vendor/gopkg.in/yaml.v2:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/rest/filter/BUILD.bazel b/pkg/rest/filter/BUILD.bazel index 1c8342fac2f2..3c0743f6e1b5 100644 --- a/pkg/rest/filter/BUILD.bazel +++ b/pkg/rest/filter/BUILD.bazel @@ -6,7 +6,7 @@ go_library( importpath = "kubevirt.io/kubevirt/pkg/rest/filter", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/testutils/BUILD.bazel b/pkg/testutils/BUILD.bazel index 3a193ee7c6ee..0dc17d3bad11 100644 --- a/pkg/testutils/BUILD.bazel +++ b/pkg/testutils/BUILD.bazel @@ -13,6 +13,7 @@ go_library( "//pkg/rest:go_default_library", "//pkg/virt-config:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/github.com/onsi/gomega/types:go_default_library", @@ -27,7 +28,6 @@ go_library( "//vendor/k8s.io/client-go/tools/cache/testing:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", "//vendor/k8s.io/client-go/util/workqueue:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1:go_default_library", ], ) diff --git a/pkg/util/hardware/BUILD.bazel b/pkg/util/hardware/BUILD.bazel index fb2893a3a903..5083adb0c823 100644 --- a/pkg/util/hardware/BUILD.bazel +++ b/pkg/util/hardware/BUILD.bazel @@ -5,7 +5,7 @@ go_library( srcs = ["hw_utils.go"], importpath = "kubevirt.io/kubevirt/pkg/util/hardware", visibility = ["//visibility:public"], - deps = ["//vendor/kubevirt.io/client-go/api/v1:go_default_library"], + deps = ["//staging/src/kubevirt.io/client-go/api/v1:go_default_library"], ) go_test( @@ -16,9 +16,9 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/util/lookup/BUILD.bazel b/pkg/util/lookup/BUILD.bazel index e541eb56b266..503785a43572 100644 --- a/pkg/util/lookup/BUILD.bazel +++ b/pkg/util/lookup/BUILD.bazel @@ -6,8 +6,8 @@ go_library( importpath = "kubevirt.io/kubevirt/pkg/util/lookup", visibility = ["//visibility:public"], deps = [ - "//pkg/api/v1:go_default_library", - "//pkg/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", diff --git a/pkg/util/lookup/lookup.go b/pkg/util/lookup/lookup.go index 6ce5e4c3c835..4a2efc29e375 100644 --- a/pkg/util/lookup/lookup.go +++ b/pkg/util/lookup/lookup.go @@ -7,8 +7,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" - virtv1 "kubevirt.io/kubevirt/pkg/api/v1" - "kubevirt.io/kubevirt/pkg/kubecli" + virtv1 "kubevirt.io/client-go/api/v1" + "kubevirt.io/client-go/kubecli" ) func VirtualMachinesOnNode(cli kubecli.KubevirtClient, nodeName string) ([]*virtv1.VirtualMachineInstance, error) { diff --git a/pkg/util/migrations/BUILD.bazel b/pkg/util/migrations/BUILD.bazel index deedfe667183..d162ee938252 100644 --- a/pkg/util/migrations/BUILD.bazel +++ b/pkg/util/migrations/BUILD.bazel @@ -6,7 +6,7 @@ go_library( importpath = "kubevirt.io/kubevirt/pkg/util/migrations", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", ], ) diff --git a/pkg/util/net/dns/BUILD.bazel b/pkg/util/net/dns/BUILD.bazel index 91616b5c31ab..dec49142eaa3 100644 --- a/pkg/util/net/dns/BUILD.bazel +++ b/pkg/util/net/dns/BUILD.bazel @@ -9,8 +9,8 @@ go_library( importpath = "kubevirt.io/kubevirt/pkg/util/net/dns", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/validation:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", ], ) diff --git a/pkg/util/net/grpc/BUILD.bazel b/pkg/util/net/grpc/BUILD.bazel index 52f6f22ac82c..938ed780e772 100644 --- a/pkg/util/net/grpc/BUILD.bazel +++ b/pkg/util/net/grpc/BUILD.bazel @@ -6,8 +6,8 @@ go_library( importpath = "kubevirt.io/kubevirt/pkg/util/net/grpc", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/util/openapi/BUILD.bazel b/pkg/util/openapi/BUILD.bazel index e7e39f5a26d2..4819448466fc 100644 --- a/pkg/util/openapi/BUILD.bazel +++ b/pkg/util/openapi/BUILD.bazel @@ -12,7 +12,7 @@ go_library( "//vendor/github.com/go-openapi/spec:go_default_library", "//vendor/github.com/go-openapi/strfmt:go_default_library", "//vendor/github.com/go-openapi/validate:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", + "@com_github_golang_glog//:go_default_library", ], ) diff --git a/pkg/util/types/BUILD.bazel b/pkg/util/types/BUILD.bazel index 7b455cc493da..f078b96a22dd 100644 --- a/pkg/util/types/BUILD.bazel +++ b/pkg/util/types/BUILD.bazel @@ -6,11 +6,11 @@ go_library( importpath = "kubevirt.io/kubevirt/pkg/util/types", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", ], ) @@ -22,6 +22,8 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", @@ -29,7 +31,5 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-api/BUILD.bazel b/pkg/virt-api/BUILD.bazel index 24e04db7cd58..d52f21226fba 100644 --- a/pkg/virt-api/BUILD.bazel +++ b/pkg/virt-api/BUILD.bazel @@ -21,6 +21,10 @@ go_library( "//pkg/virt-api/webhooks/mutating-webhook:go_default_library", "//pkg/virt-api/webhooks/validating-webhook:go_default_library", "//pkg/virt-config:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/version:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library", "//vendor/github.com/emicklei/go-restful-openapi:go_default_library", "//vendor/github.com/go-openapi/spec:go_default_library", @@ -35,10 +39,6 @@ go_library( "//vendor/k8s.io/client-go/util/cert:go_default_library", "//vendor/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1:go_default_library", "//vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/version:go_default_library", ], ) @@ -54,6 +54,9 @@ go_test( "//pkg/certificates/triple:go_default_library", "//pkg/util:go_default_library", "//pkg/virt-api/rest:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", @@ -66,8 +69,5 @@ go_test( "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", "//vendor/k8s.io/client-go/util/cert:go_default_library", "//vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-api/rest/BUILD.bazel b/pkg/virt-api/rest/BUILD.bazel index 9f1bb45f7aa9..34022356d15f 100644 --- a/pkg/virt-api/rest/BUILD.bazel +++ b/pkg/virt-api/rest/BUILD.bazel @@ -12,6 +12,10 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/rest:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/subresources:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/gorilla/websocket:go_default_library", @@ -30,10 +34,6 @@ go_library( "//vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/tools/remotecommand:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/subresources:go_default_library", ], ) @@ -48,6 +48,9 @@ go_test( deps = [ "//pkg/testutils:go_default_library", "//pkg/virt-controller/services:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library", "//vendor/github.com/gorilla/websocket:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", @@ -62,8 +65,5 @@ go_test( "//vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-api/webhooks/BUILD.bazel b/pkg/virt-api/webhooks/BUILD.bazel index 2238753935f1..d955b600e2a5 100644 --- a/pkg/virt-api/webhooks/BUILD.bazel +++ b/pkg/virt-api/webhooks/BUILD.bazel @@ -10,13 +10,13 @@ go_library( "//pkg/util:go_default_library", "//pkg/util/openapi:go_default_library", "//pkg/virt-api/rest:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/api/admission/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", + "@com_github_golang_glog//:go_default_library", ], ) diff --git a/pkg/virt-api/webhooks/mutating-webhook/BUILD.bazel b/pkg/virt-api/webhooks/mutating-webhook/BUILD.bazel index 25db628b67dc..49cde42e57db 100644 --- a/pkg/virt-api/webhooks/mutating-webhook/BUILD.bazel +++ b/pkg/virt-api/webhooks/mutating-webhook/BUILD.bazel @@ -9,8 +9,8 @@ go_library( "//pkg/virt-api/webhooks:go_default_library", "//pkg/virt-api/webhooks/mutating-webhook/mutators:go_default_library", "//pkg/virt-config:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/api/admission/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-api/webhooks/mutating-webhook/mutators/BUILD.bazel b/pkg/virt-api/webhooks/mutating-webhook/mutators/BUILD.bazel index 42b3e289cd91..69a4a7720287 100644 --- a/pkg/virt-api/webhooks/mutating-webhook/mutators/BUILD.bazel +++ b/pkg/virt-api/webhooks/mutating-webhook/mutators/BUILD.bazel @@ -14,6 +14,8 @@ go_library( deps = [ "//pkg/virt-api/webhooks:go_default_library", "//pkg/virt-config:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/api/admission/v1beta1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", @@ -21,8 +23,6 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -40,6 +40,8 @@ go_test( "//pkg/testutils:go_default_library", "//pkg/virt-api/webhooks:go_default_library", "//pkg/virt-config:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/extensions/table:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", @@ -50,7 +52,5 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-api/webhooks/validating-webhook/BUILD.bazel b/pkg/virt-api/webhooks/validating-webhook/BUILD.bazel index 18e6d3f35c5e..ff736234bf67 100644 --- a/pkg/virt-api/webhooks/validating-webhook/BUILD.bazel +++ b/pkg/virt-api/webhooks/validating-webhook/BUILD.bazel @@ -9,8 +9,8 @@ go_library( "//pkg/virt-api/webhooks:go_default_library", "//pkg/virt-api/webhooks/validating-webhook/admitters:go_default_library", "//pkg/virt-config:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/api/admission/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-api/webhooks/validating-webhook/admitters/BUILD.bazel b/pkg/virt-api/webhooks/validating-webhook/admitters/BUILD.bazel index a5147aff34cb..9fbd7ea64738 100644 --- a/pkg/virt-api/webhooks/validating-webhook/admitters/BUILD.bazel +++ b/pkg/virt-api/webhooks/validating-webhook/admitters/BUILD.bazel @@ -18,6 +18,7 @@ go_library( "//pkg/util/hardware:go_default_library", "//pkg/virt-api/webhooks:go_default_library", "//pkg/virt-config:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", "//vendor/k8s.io/api/admission/v1beta1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", @@ -25,7 +26,6 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/validation:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", ], ) @@ -47,6 +47,8 @@ go_test( "//pkg/testutils:go_default_library", "//pkg/virt-api/webhooks:go_default_library", "//pkg/virt-config:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/extensions/table:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", @@ -59,8 +61,6 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/util/validation:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1:go_default_library", ], ) diff --git a/pkg/virt-config/BUILD.bazel b/pkg/virt-config/BUILD.bazel index 3f59082f1e89..5378c10eda2d 100644 --- a/pkg/virt-config/BUILD.bazel +++ b/pkg/virt-config/BUILD.bazel @@ -10,6 +10,8 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/util:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", @@ -17,8 +19,6 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/yaml:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -31,10 +31,10 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/testutils:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/extensions/table:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-controller/services/BUILD.bazel b/pkg/virt-controller/services/BUILD.bazel index 33d4d8542cc6..089bace7d581 100644 --- a/pkg/virt-controller/services/BUILD.bazel +++ b/pkg/virt-controller/services/BUILD.bazel @@ -13,15 +13,15 @@ go_library( "//pkg/util/net/dns:go_default_library", "//pkg/util/types:go_default_library", "//pkg/virt-config:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", ], ) @@ -36,6 +36,9 @@ go_test( "//pkg/hooks:go_default_library", "//pkg/testutils:go_default_library", "//pkg/virt-config:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1:go_default_library", "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned/fake:go_default_library", @@ -48,8 +51,5 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-controller/watch/BUILD.bazel b/pkg/virt-controller/watch/BUILD.bazel index 22fe8950617a..1ae2e1833315 100644 --- a/pkg/virt-controller/watch/BUILD.bazel +++ b/pkg/virt-controller/watch/BUILD.bazel @@ -26,8 +26,10 @@ go_library( "//pkg/virt-controller/services:go_default_library", "//pkg/virt-controller/watch/drain/disruptionbudget:go_default_library", "//pkg/virt-controller/watch/drain/evacuation:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/pborman/uuid:go_default_library", "//vendor/github.com/prometheus/client_golang/prometheus/promhttp:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", @@ -47,10 +49,8 @@ go_library( "//vendor/k8s.io/client-go/tools/leaderelection/resourcelock:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", "//vendor/k8s.io/client-go/util/workqueue:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1:go_default_library", + "@com_github_golang_glog//:go_default_library", ], ) @@ -71,6 +71,9 @@ go_test( "//pkg/rest:go_default_library", "//pkg/testutils:go_default_library", "//pkg/virt-controller/services:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned/fake:go_default_library", @@ -89,9 +92,6 @@ go_test( "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/cache/testing:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/client/clientset/versioned/fake:go_default_library", ], diff --git a/pkg/virt-controller/watch/drain/disruptionbudget/BUILD.bazel b/pkg/virt-controller/watch/drain/disruptionbudget/BUILD.bazel index 0c2139b40899..993902e780ba 100644 --- a/pkg/virt-controller/watch/drain/disruptionbudget/BUILD.bazel +++ b/pkg/virt-controller/watch/drain/disruptionbudget/BUILD.bazel @@ -7,6 +7,9 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/controller:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/api/policy/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", @@ -15,9 +18,6 @@ go_library( "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", "//vendor/k8s.io/client-go/util/workqueue:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -30,6 +30,9 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/testutils:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", @@ -44,8 +47,5 @@ go_test( "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/cache/testing:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-controller/watch/drain/evacuation/BUILD.bazel b/pkg/virt-controller/watch/drain/evacuation/BUILD.bazel index 88c3b6924cba..dab4c213c5b0 100644 --- a/pkg/virt-controller/watch/drain/evacuation/BUILD.bazel +++ b/pkg/virt-controller/watch/drain/evacuation/BUILD.bazel @@ -9,15 +9,15 @@ go_library( "//pkg/controller:go_default_library", "//pkg/util/migrations:go_default_library", "//pkg/virt-config:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", "//vendor/k8s.io/client-go/util/workqueue:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -30,6 +30,9 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/testutils:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", @@ -41,8 +44,5 @@ go_test( "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/cache/testing:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-controller/watch/node.go b/pkg/virt-controller/watch/node.go index 6a517dbf42d7..63db0b02e002 100644 --- a/pkg/virt-controller/watch/node.go +++ b/pkg/virt-controller/watch/node.go @@ -15,10 +15,10 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" - virtv1 "kubevirt.io/client-go/pkg/api/v1" + virtv1 "kubevirt.io/client-go/api/v1" + "kubevirt.io/client-go/kubecli" + "kubevirt.io/client-go/log" "kubevirt.io/kubevirt/pkg/controller" - "kubevirt.io/client-go/pkg/kubecli" - "kubevirt.io/client-go/pkg/log" "kubevirt.io/kubevirt/pkg/util/lookup" ) diff --git a/pkg/virt-handler/BUILD.bazel b/pkg/virt-handler/BUILD.bazel index cedcdad69dc9..cc496f9f9a99 100644 --- a/pkg/virt-handler/BUILD.bazel +++ b/pkg/virt-handler/BUILD.bazel @@ -18,6 +18,9 @@ go_library( "//pkg/virt-launcher:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", "//pkg/watchdog:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", @@ -26,9 +29,6 @@ go_library( "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", "//vendor/k8s.io/client-go/util/workqueue:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -46,6 +46,10 @@ go_test( "//pkg/virt-launcher:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", "//pkg/watchdog:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/extensions/table:go_default_library", @@ -59,9 +63,5 @@ go_test( "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/cache/testing:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", ], ) diff --git a/pkg/virt-handler/cache/BUILD.bazel b/pkg/virt-handler/cache/BUILD.bazel index 7b767de93752..3932d331555a 100644 --- a/pkg/virt-handler/cache/BUILD.bazel +++ b/pkg/virt-handler/cache/BUILD.bazel @@ -10,12 +10,12 @@ go_library( "//pkg/virt-handler/notify-server:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", "//pkg/watchdog:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -33,11 +33,11 @@ go_test( "//pkg/virt-launcher/virtwrap/api:go_default_library", "//pkg/virt-launcher/virtwrap/cmd-server:go_default_library", "//pkg/watchdog:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-handler/cmd-client/BUILD.bazel b/pkg/virt-handler/cmd-client/BUILD.bazel index d338065a240a..9bf47d437fe8 100644 --- a/pkg/virt-handler/cmd-client/BUILD.bazel +++ b/pkg/virt-handler/cmd-client/BUILD.bazel @@ -16,14 +16,14 @@ go_library( "//pkg/util/net/grpc:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", "//pkg/virt-launcher/virtwrap/stats:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/google.golang.org/grpc/codes:go_default_library", "//vendor/google.golang.org/grpc/status:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/json:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/virt-handler/isolation/BUILD.bazel b/pkg/virt-handler/isolation/BUILD.bazel index b90bfa873aac..eaa4a02412cf 100644 --- a/pkg/virt-handler/isolation/BUILD.bazel +++ b/pkg/virt-handler/isolation/BUILD.bazel @@ -10,9 +10,9 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/virt-handler/cmd-client:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -25,9 +25,9 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/virt-handler/cmd-client:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-handler/migration-proxy/BUILD.bazel b/pkg/virt-handler/migration-proxy/BUILD.bazel index a32a786188fb..a35acb52ef22 100644 --- a/pkg/virt-handler/migration-proxy/BUILD.bazel +++ b/pkg/virt-handler/migration-proxy/BUILD.bazel @@ -5,7 +5,7 @@ go_library( srcs = ["migration-proxy.go"], importpath = "kubevirt.io/kubevirt/pkg/virt-handler/migration-proxy", visibility = ["//visibility:public"], - deps = ["//vendor/kubevirt.io/client-go/log:go_default_library"], + deps = ["//staging/src/kubevirt.io/client-go/log:go_default_library"], ) go_test( @@ -17,8 +17,8 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/certificates:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-handler/notify-server/BUILD.bazel b/pkg/virt-handler/notify-server/BUILD.bazel index 312cf0f371e0..a5051333d922 100644 --- a/pkg/virt-handler/notify-server/BUILD.bazel +++ b/pkg/virt-handler/notify-server/BUILD.bazel @@ -13,6 +13,8 @@ go_library( "//pkg/handler-launcher-com/notify/v1:go_default_library", "//pkg/util/net/grpc:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", @@ -20,8 +22,6 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", "@org_golang_google_grpc//:go_default_library", ], ) diff --git a/pkg/virt-launcher/BUILD.bazel b/pkg/virt-launcher/BUILD.bazel index 1a2795d4ed9a..de6926f8e278 100644 --- a/pkg/virt-launcher/BUILD.bazel +++ b/pkg/virt-launcher/BUILD.bazel @@ -9,9 +9,9 @@ go_library( "//pkg/ephemeral-disk-utils:go_default_library", "//pkg/virt-handler/cmd-client:go_default_library", "//pkg/watchdog:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", ], ) @@ -28,8 +28,8 @@ go_test( data = ["//cmd/fake-qemu-process"], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-launcher/notify-client/BUILD.bazel b/pkg/virt-launcher/notify-client/BUILD.bazel index d45de7c6b246..f864b86a21c9 100644 --- a/pkg/virt-launcher/notify-client/BUILD.bazel +++ b/pkg/virt-launcher/notify-client/BUILD.bazel @@ -15,6 +15,8 @@ go_library( "//pkg/virt-launcher/virtwrap/cli:go_default_library", "//pkg/virt-launcher/virtwrap/errors:go_default_library", "//pkg/virt-launcher/virtwrap/util:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/libvirt/libvirt-go:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", @@ -23,8 +25,6 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/util/json:go_default_library", "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/client-go/tools/reference:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", "@org_golang_google_grpc//:go_default_library", ], ) @@ -43,6 +43,8 @@ go_test( "//pkg/virt-launcher/virtwrap/api:go_default_library", "//pkg/virt-launcher/virtwrap/cli:go_default_library", "//pkg/virt-launcher/virtwrap/util:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/libvirt/libvirt-go:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", @@ -51,7 +53,5 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/watch:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-launcher/virtwrap/BUILD.bazel b/pkg/virt-launcher/virtwrap/BUILD.bazel index b64cebbde068..c4116ea3330c 100644 --- a/pkg/virt-launcher/virtwrap/BUILD.bazel +++ b/pkg/virt-launcher/virtwrap/BUILD.bazel @@ -26,14 +26,14 @@ go_library( "//pkg/virt-launcher/virtwrap/network:go_default_library", "//pkg/virt-launcher/virtwrap/stats:go_default_library", "//pkg/virt-launcher/virtwrap/util:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/libvirt/libvirt-go:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -51,6 +51,8 @@ go_test( "//pkg/virt-launcher/virtwrap/cli:go_default_library", "//pkg/virt-launcher/virtwrap/network:go_default_library", "//pkg/virt-launcher/virtwrap/stats:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/libvirt/libvirt-go:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", @@ -59,7 +61,5 @@ go_test( "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-launcher/virtwrap/agent-poller/BUILD.bazel b/pkg/virt-launcher/virtwrap/agent-poller/BUILD.bazel index 49eb329c5475..49b067739d56 100644 --- a/pkg/virt-launcher/virtwrap/agent-poller/BUILD.bazel +++ b/pkg/virt-launcher/virtwrap/agent-poller/BUILD.bazel @@ -8,8 +8,8 @@ go_library( deps = [ "//pkg/virt-launcher/virtwrap/api:go_default_library", "//pkg/virt-launcher/virtwrap/cli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-launcher/virtwrap/api/BUILD.bazel b/pkg/virt-launcher/virtwrap/api/BUILD.bazel index 857a7ff3f1a0..f6b03f4451b6 100644 --- a/pkg/virt-launcher/virtwrap/api/BUILD.bazel +++ b/pkg/virt-launcher/virtwrap/api/BUILD.bazel @@ -21,6 +21,9 @@ go_library( "//pkg/ignition:go_default_library", "//pkg/util:go_default_library", "//pkg/util/net/dns:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", @@ -28,9 +31,6 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", ], ) @@ -45,6 +45,8 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/google/gofuzz:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/extensions/table:go_default_library", @@ -52,7 +54,5 @@ go_test( "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-launcher/virtwrap/cli/BUILD.bazel b/pkg/virt-launcher/virtwrap/cli/BUILD.bazel index 570ae0017ef3..bf4edf8e4709 100644 --- a/pkg/virt-launcher/virtwrap/cli/BUILD.bazel +++ b/pkg/virt-launcher/virtwrap/cli/BUILD.bazel @@ -12,10 +12,10 @@ go_library( "//pkg/virt-launcher/virtwrap/errors:go_default_library", "//pkg/virt-launcher/virtwrap/stats:go_default_library", "//pkg/virt-launcher/virtwrap/statsconv:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/libvirt/libvirt-go:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -27,8 +27,8 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-launcher/virtwrap/cmd-server/BUILD.bazel b/pkg/virt-launcher/virtwrap/cmd-server/BUILD.bazel index faa44bcc1c6a..967d4bf0095e 100644 --- a/pkg/virt-launcher/virtwrap/cmd-server/BUILD.bazel +++ b/pkg/virt-launcher/virtwrap/cmd-server/BUILD.bazel @@ -15,10 +15,10 @@ go_library( "//pkg/virt-handler/cmd-client:go_default_library", "//pkg/virt-launcher/virtwrap:go_default_library", "//pkg/virt-launcher/virtwrap/errors:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/json:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", "@org_golang_google_grpc//:go_default_library", ], ) @@ -36,10 +36,10 @@ go_test( "//pkg/virt-launcher/virtwrap:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", "//pkg/virt-launcher/virtwrap/stats:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-launcher/virtwrap/network/BUILD.bazel b/pkg/virt-launcher/virtwrap/network/BUILD.bazel index ddcb99827b12..e4aee24073f6 100644 --- a/pkg/virt-launcher/virtwrap/network/BUILD.bazel +++ b/pkg/virt-launcher/virtwrap/network/BUILD.bazel @@ -13,11 +13,11 @@ go_library( importpath = "kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap/network", visibility = ["//visibility:public"], deps = [ - "//pkg/api/v1:go_default_library", - "//pkg/log:go_default_library", - "//pkg/precond:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", "//pkg/virt-launcher/virtwrap/network/dhcp:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", "//vendor/github.com/coreos/go-iptables/iptables:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/subgraph/libmacouflage:go_default_library", @@ -35,9 +35,9 @@ go_test( ], embed = [":go_default_library"], deps = [ - "//pkg/api/v1:go_default_library", - "//pkg/log:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", diff --git a/pkg/virt-launcher/virtwrap/network/dhcp/BUILD.bazel b/pkg/virt-launcher/virtwrap/network/dhcp/BUILD.bazel index f82dd28ee9c2..3c65ddc54bbf 100644 --- a/pkg/virt-launcher/virtwrap/network/dhcp/BUILD.bazel +++ b/pkg/virt-launcher/virtwrap/network/dhcp/BUILD.bazel @@ -9,11 +9,11 @@ go_library( importpath = "kubevirt.io/kubevirt/pkg/virt-launcher/virtwrap/network/dhcp", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/krolaw/dhcp4:go_default_library", "//vendor/github.com/krolaw/dhcp4/conn:go_default_library", "//vendor/github.com/vishvananda/netlink:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -25,11 +25,11 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/krolaw/dhcp4:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/github.com/vishvananda/netlink:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-launcher/virtwrap/statsconv/BUILD.bazel b/pkg/virt-launcher/virtwrap/statsconv/BUILD.bazel index 26b806cb8ec6..6743eebd58d9 100644 --- a/pkg/virt-launcher/virtwrap/statsconv/BUILD.bazel +++ b/pkg/virt-launcher/virtwrap/statsconv/BUILD.bazel @@ -28,10 +28,10 @@ go_test( embed = [":go_default_library"], deps = [ "//pkg/virt-launcher/virtwrap/stats:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/libvirt/libvirt-go:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-launcher/virtwrap/util/BUILD.bazel b/pkg/virt-launcher/virtwrap/util/BUILD.bazel index 45a3ca831ffe..648adf2c6ef0 100644 --- a/pkg/virt-launcher/virtwrap/util/BUILD.bazel +++ b/pkg/virt-launcher/virtwrap/util/BUILD.bazel @@ -12,11 +12,11 @@ go_library( "//pkg/util/hardware:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", "//pkg/virt-launcher/virtwrap/cli:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/libvirt/libvirt-go:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -28,9 +28,9 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/go-kit/kit/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-operator/BUILD.bazel b/pkg/virt-operator/BUILD.bazel index c164e2b997b8..b6f5d8159319 100644 --- a/pkg/virt-operator/BUILD.bazel +++ b/pkg/virt-operator/BUILD.bazel @@ -16,6 +16,9 @@ go_library( "//pkg/virt-controller/leaderelectionconfig:go_default_library", "//pkg/virt-operator/install-strategy:go_default_library", "//pkg/virt-operator/util:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/prometheus/client_golang/prometheus/promhttp:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/api/apps/v1:go_default_library", @@ -31,9 +34,6 @@ go_library( "//vendor/k8s.io/client-go/tools/leaderelection/resourcelock:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", "//vendor/k8s.io/client-go/util/workqueue:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -50,6 +50,10 @@ go_test( "//pkg/virt-operator/creation/rbac:go_default_library", "//pkg/virt-operator/install-strategy:go_default_library", "//pkg/virt-operator/util:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/version:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", @@ -70,9 +74,5 @@ go_test( "//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/cache/testing:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/version:go_default_library", ], ) diff --git a/pkg/virt-operator/creation/components/BUILD.bazel b/pkg/virt-operator/creation/components/BUILD.bazel index 52cb15177feb..7a8624cf984c 100644 --- a/pkg/virt-operator/creation/components/BUILD.bazel +++ b/pkg/virt-operator/creation/components/BUILD.bazel @@ -11,14 +11,14 @@ go_library( deps = [ "//pkg/controller:go_default_library", "//pkg/virt-operator/util:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/api/apps/v1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/json:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-operator/creation/rbac/BUILD.bazel b/pkg/virt-operator/creation/rbac/BUILD.bazel index 3ac478104d1b..52dd4a5f4991 100644 --- a/pkg/virt-operator/creation/rbac/BUILD.bazel +++ b/pkg/virt-operator/creation/rbac/BUILD.bazel @@ -14,11 +14,11 @@ go_library( deps = [ "//pkg/controller:go_default_library", "//pkg/virt-operator/util:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/api/rbac/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-operator/install-strategy/BUILD.bazel b/pkg/virt-operator/install-strategy/BUILD.bazel index a876f211600e..35031797cbf2 100644 --- a/pkg/virt-operator/install-strategy/BUILD.bazel +++ b/pkg/virt-operator/install-strategy/BUILD.bazel @@ -15,6 +15,9 @@ go_library( "//pkg/virt-operator/creation/components:go_default_library", "//pkg/virt-operator/creation/rbac:go_default_library", "//pkg/virt-operator/util:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//tools/util:go_default_library", "//vendor/github.com/blang/semver:go_default_library", "//vendor/github.com/ghodss/yaml:go_default_library", @@ -28,9 +31,6 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/client-go/util/cert:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) @@ -42,6 +42,8 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/extensions/table:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", @@ -51,7 +53,5 @@ go_test( "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virt-operator/util/BUILD.bazel b/pkg/virt-operator/util/BUILD.bazel index b2ca43002ad2..c09a27a3f945 100644 --- a/pkg/virt-operator/util/BUILD.bazel +++ b/pkg/virt-operator/util/BUILD.bazel @@ -13,16 +13,16 @@ go_library( deps = [ "//pkg/controller:go_default_library", "//pkg/util:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/version:go_default_library", "//vendor/github.com/openshift/api/security/v1:go_default_library", "//vendor/k8s.io/api/apps/v1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/discovery:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/version:go_default_library", ], ) @@ -35,6 +35,9 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/extensions/table:go_default_library", @@ -44,8 +47,5 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/client-go/discovery/fake:go_default_library", "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virtctl/BUILD.bazel b/pkg/virtctl/BUILD.bazel index bf4369f2aeda..855ee6160345 100644 --- a/pkg/virtctl/BUILD.bazel +++ b/pkg/virtctl/BUILD.bazel @@ -16,9 +16,9 @@ go_library( "//pkg/virtctl/version:go_default_library", "//pkg/virtctl/vm:go_default_library", "//pkg/virtctl/vnc:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virtctl/console/BUILD.bazel b/pkg/virtctl/console/BUILD.bazel index 257f8cf3d8c7..9641103490c2 100644 --- a/pkg/virtctl/console/BUILD.bazel +++ b/pkg/virtctl/console/BUILD.bazel @@ -7,9 +7,9 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/virtctl/templates:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/golang.org/x/crypto/ssh/terminal:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", ], ) diff --git a/pkg/virtctl/expose/BUILD.bazel b/pkg/virtctl/expose/BUILD.bazel index f5e725b8f818..a4251c432dba 100644 --- a/pkg/virtctl/expose/BUILD.bazel +++ b/pkg/virtctl/expose/BUILD.bazel @@ -7,13 +7,13 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/virtctl/templates:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/intstr:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", ], ) @@ -25,6 +25,9 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//tests:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", @@ -34,8 +37,5 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library", "//vendor/k8s.io/client-go/testing:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virtctl/imageupload/BUILD.bazel b/pkg/virtctl/imageupload/BUILD.bazel index f5bc2c6dd533..76c2a728921b 100644 --- a/pkg/virtctl/imageupload/BUILD.bazel +++ b/pkg/virtctl/imageupload/BUILD.bazel @@ -7,6 +7,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/virtctl/templates:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/gopkg.in/cheggaaa/pb.v1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", @@ -16,7 +17,6 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/client-go/kubernetes:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/upload/v1alpha1:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/client/clientset/versioned:go_default_library", ], @@ -30,6 +30,7 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", "//tests:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", @@ -41,7 +42,6 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library", "//vendor/k8s.io/client-go/testing:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/client/clientset/versioned/fake:go_default_library", ], diff --git a/pkg/virtctl/version/BUILD.bazel b/pkg/virtctl/version/BUILD.bazel index a5e06b7e651c..12b0abcaf1ea 100644 --- a/pkg/virtctl/version/BUILD.bazel +++ b/pkg/virtctl/version/BUILD.bazel @@ -7,9 +7,9 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/virtctl/templates:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/version:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/version:go_default_library", ], ) diff --git a/pkg/virtctl/vm/BUILD.bazel b/pkg/virtctl/vm/BUILD.bazel index b174138d1149..8cbd36efbd03 100644 --- a/pkg/virtctl/vm/BUILD.bazel +++ b/pkg/virtctl/vm/BUILD.bazel @@ -7,9 +7,9 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/virtctl/templates:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", ], ) @@ -21,13 +21,13 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//tests:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/virtctl/vnc/BUILD.bazel b/pkg/virtctl/vnc/BUILD.bazel index e06574090827..0ce1513f97bd 100644 --- a/pkg/virtctl/vnc/BUILD.bazel +++ b/pkg/virtctl/vnc/BUILD.bazel @@ -7,9 +7,9 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/virtctl/templates:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", + "@com_github_golang_glog//:go_default_library", ], ) diff --git a/pkg/watchdog/BUILD.bazel b/pkg/watchdog/BUILD.bazel index 1b50f93b9665..db94dc705062 100644 --- a/pkg/watchdog/BUILD.bazel +++ b/pkg/watchdog/BUILD.bazel @@ -8,9 +8,9 @@ go_library( deps = [ "//pkg/ephemeral-disk-utils:go_default_library", "//pkg/virt-launcher/virtwrap/api:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", ], ) @@ -22,10 +22,10 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/precond:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", ], ) diff --git a/staging/src/kubevirt.io/BUILD.bazel b/staging/src/kubevirt.io/BUILD.bazel new file mode 100644 index 000000000000..598c4768eb9a --- /dev/null +++ b/staging/src/kubevirt.io/BUILD.bazel @@ -0,0 +1 @@ +# gazelle:prefix kubevirt.io diff --git a/staging/src/kubevirt.io/client-go/api/BUILD.bazel b/staging/src/kubevirt.io/client-go/api/BUILD.bazel index 84039a4d13f3..72f5384b0126 100644 --- a/staging/src/kubevirt.io/client-go/api/BUILD.bazel +++ b/staging/src/kubevirt.io/client-go/api/BUILD.bazel @@ -3,6 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["types.go"], - importpath = "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api", + importpath = "kubevirt.io/client-go/api", visibility = ["//visibility:public"], ) diff --git a/staging/src/kubevirt.io/client-go/api/v1/BUILD.bazel b/staging/src/kubevirt.io/client-go/api/v1/BUILD.bazel index 23678129daff..d71c13300c8b 100644 --- a/staging/src/kubevirt.io/client-go/api/v1/BUILD.bazel +++ b/staging/src/kubevirt.io/client-go/api/v1/BUILD.bazel @@ -14,9 +14,10 @@ go_library( "utils.go", "zz_generated.defaults.go", ], - importpath = "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1", + importpath = "kubevirt.io/client-go/api/v1", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/precond:go_default_library", "//vendor/github.com/go-openapi/spec:go_default_library", "//vendor/github.com/pborman/uuid:go_default_library", "//vendor/k8s.io/api/autoscaling/v1:go_default_library", @@ -30,7 +31,6 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library", "//vendor/k8s.io/kube-openapi/pkg/common:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1:go_default_library", ], ) @@ -46,12 +46,12 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/google/gofuzz:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/ginkgo/extensions/table:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/pkg/api/v1/utils.go b/staging/src/kubevirt.io/client-go/api/v1/utils.go similarity index 97% rename from pkg/api/v1/utils.go rename to staging/src/kubevirt.io/client-go/api/v1/utils.go index e2cf7a620faa..fbd9bdb45ba5 100644 --- a/pkg/api/v1/utils.go +++ b/staging/src/kubevirt.io/client-go/api/v1/utils.go @@ -24,7 +24,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "kubevirt.io/kubevirt/pkg/precond" + "kubevirt.io/client-go/precond" ) // This is meant for testing diff --git a/staging/src/kubevirt.io/client-go/kubecli/BUILD.bazel b/staging/src/kubevirt.io/client-go/kubecli/BUILD.bazel index 4ed209fbee25..620a5349ba2b 100644 --- a/staging/src/kubevirt.io/client-go/kubecli/BUILD.bazel +++ b/staging/src/kubevirt.io/client-go/kubecli/BUILD.bazel @@ -14,6 +14,9 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/version:go_default_library", "//vendor/github.com/gorilla/websocket:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", @@ -24,9 +27,6 @@ go_test( "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/version:go_default_library", ], ) @@ -46,9 +46,12 @@ go_library( "vmi.go", "vmipreset.go", ], - importpath = "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/kubecli", + importpath = "kubevirt.io/client-go/kubecli", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/subresources:go_default_library", + "//staging/src/kubevirt.io/client-go/version:go_default_library", "//vendor/github.com/golang/mock/gomock:go_default_library", "//vendor/github.com/gorilla/websocket:go_default_library", "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned:go_default_library", @@ -100,9 +103,6 @@ go_library( "//vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1:go_default_library", "//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/subresources:go_default_library", - "//vendor/kubevirt.io/client-go/version:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/client/clientset/versioned:go_default_library", ], ) diff --git a/staging/src/kubevirt.io/client-go/log/BUILD.bazel b/staging/src/kubevirt.io/client-go/log/BUILD.bazel index 3a7814d1663e..1ecc54e9b895 100644 --- a/staging/src/kubevirt.io/client-go/log/BUILD.bazel +++ b/staging/src/kubevirt.io/client-go/log/BUILD.bazel @@ -3,16 +3,16 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = ["log.go"], - importpath = "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/log", + importpath = "kubevirt.io/client-go/log", visibility = ["//visibility:public"], deps = [ "//vendor/github.com/go-kit/kit/log:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", + "@com_github_golang_glog//:go_default_library", ], ) @@ -24,10 +24,10 @@ go_test( ], embed = [":go_default_library"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", "//vendor/github.com/onsi/ginkgo:go_default_library", "//vendor/github.com/onsi/gomega:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", ], ) diff --git a/staging/src/kubevirt.io/client-go/precond/BUILD.bazel b/staging/src/kubevirt.io/client-go/precond/BUILD.bazel index ad0f1c041349..f3330734e6cc 100644 --- a/staging/src/kubevirt.io/client-go/precond/BUILD.bazel +++ b/staging/src/kubevirt.io/client-go/precond/BUILD.bazel @@ -3,6 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["precond.go"], - importpath = "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/precond", + importpath = "kubevirt.io/client-go/precond", visibility = ["//visibility:public"], ) diff --git a/staging/src/kubevirt.io/client-go/subresources/BUILD.bazel b/staging/src/kubevirt.io/client-go/subresources/BUILD.bazel index bfb03f4b86da..cbde92ba64e1 100644 --- a/staging/src/kubevirt.io/client-go/subresources/BUILD.bazel +++ b/staging/src/kubevirt.io/client-go/subresources/BUILD.bazel @@ -3,6 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["constants.go"], - importpath = "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/subresources", + importpath = "kubevirt.io/client-go/subresources", visibility = ["//visibility:public"], ) diff --git a/staging/src/kubevirt.io/client-go/version/BUILD.bazel b/staging/src/kubevirt.io/client-go/version/BUILD.bazel index 92164f832520..c278e9aa26e4 100644 --- a/staging/src/kubevirt.io/client-go/version/BUILD.bazel +++ b/staging/src/kubevirt.io/client-go/version/BUILD.bazel @@ -7,6 +7,6 @@ go_library( "types.go", "version.go", ], - importpath = "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/version", + importpath = "kubevirt.io/client-go/version", visibility = ["//visibility:public"], ) diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index 5068a679323d..ad11ac003055 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -17,6 +17,9 @@ go_library( "//pkg/virt-launcher/virtwrap/api:go_default_library", "//pkg/virt-operator/util:go_default_library", "//pkg/virtctl:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//tools/vms-generator/utils:go_default_library", "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/google/goexpect:go_default_library", @@ -45,9 +48,6 @@ go_library( "//vendor/k8s.io/client-go/tools/portforward:go_default_library", "//vendor/k8s.io/client-go/tools/remotecommand:go_default_library", "//vendor/k8s.io/client-go/transport/spdy:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1:go_default_library", ], ) @@ -114,6 +114,10 @@ go_test( "//pkg/virt-launcher/virtwrap/api:go_default_library", "//pkg/virtctl/expose:go_default_library", "//pkg/virtctl/vm:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", + "//staging/src/kubevirt.io/client-go/kubecli:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", + "//staging/src/kubevirt.io/client-go/subresources:go_default_library", "//tools/vms-generator/utils:go_default_library", "//vendor/github.com/google/goexpect:go_default_library", "//vendor/github.com/gorilla/websocket:go_default_library", @@ -142,10 +146,6 @@ go_test( "//vendor/k8s.io/client-go/rest:go_default_library", "//vendor/k8s.io/client-go/tools/leaderelection/resourcelock:go_default_library", "//vendor/k8s.io/client-go/util/cert:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/kubecli:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", - "//vendor/kubevirt.io/client-go/subresources:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1:go_default_library", "//vendor/kubevirt.io/qe-tools/pkg/ginkgo-reporters:go_default_library", ], diff --git a/tools/marketplace/helper/BUILD.bazel b/tools/marketplace/helper/BUILD.bazel index 67f99814c3ef..b5066a5ecddc 100644 --- a/tools/marketplace/helper/BUILD.bazel +++ b/tools/marketplace/helper/BUILD.bazel @@ -6,11 +6,11 @@ go_library( importpath = "kubevirt.io/kubevirt/tools/marketplace/helper", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/github.com/operator-framework/operator-marketplace/pkg/appregistry:go_default_library", "//vendor/gopkg.in/yaml.v2:go_default_library", "//vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/json:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", ], ) diff --git a/tools/openapispec/BUILD.bazel b/tools/openapispec/BUILD.bazel index eb26155ab79a..06524f5eef87 100644 --- a/tools/openapispec/BUILD.bazel +++ b/tools/openapispec/BUILD.bazel @@ -9,9 +9,9 @@ go_library( "//pkg/util/openapi:go_default_library", "//pkg/virt-api:go_default_library", "//pkg/virt-api/rest:go_default_library", + "//staging/src/kubevirt.io/client-go/log:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/kubevirt.io/client-go/log:go_default_library", ], ) diff --git a/tools/util/BUILD.bazel b/tools/util/BUILD.bazel index aa7bec53d3a5..fa1943acdb6b 100644 --- a/tools/util/BUILD.bazel +++ b/tools/util/BUILD.bazel @@ -6,9 +6,9 @@ go_library( importpath = "kubevirt.io/kubevirt/tools/util", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", "//vendor/github.com/ghodss/yaml:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", ], ) diff --git a/tools/vms-generator/BUILD.bazel b/tools/vms-generator/BUILD.bazel index 055f63a194b7..df4648acaba0 100644 --- a/tools/vms-generator/BUILD.bazel +++ b/tools/vms-generator/BUILD.bazel @@ -9,12 +9,12 @@ go_library( "//pkg/testutils:go_default_library", "//pkg/virt-api/webhooks/validating-webhook/admitters:go_default_library", "//pkg/virt-config:go_default_library", + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", "//tools/util:go_default_library", "//tools/vms-generator/utils:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", ], ) diff --git a/tools/vms-generator/utils/BUILD.bazel b/tools/vms-generator/utils/BUILD.bazel index d91567e15571..0e66ff92a69c 100644 --- a/tools/vms-generator/utils/BUILD.bazel +++ b/tools/vms-generator/utils/BUILD.bazel @@ -9,13 +9,13 @@ go_library( importpath = "kubevirt.io/kubevirt/tools/vms-generator/utils", visibility = ["//visibility:public"], deps = [ + "//staging/src/kubevirt.io/client-go/api/v1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1:go_default_library", ], ) diff --git a/vendor/github.com/golang/glog b/vendor/github.com/golang/glog new file mode 120000 index 000000000000..01ae3bd586a4 --- /dev/null +++ b/vendor/github.com/golang/glog @@ -0,0 +1 @@ +../../../pkg/staging/glog/ \ No newline at end of file diff --git a/vendor/github.com/golang/glog/BUILD.bazel b/vendor/github.com/golang/glog/BUILD.bazel deleted file mode 100644 index 6b2aca36300e..000000000000 --- a/vendor/github.com/golang/glog/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "glog.go", - "glog_file.go", - ], - importmap = "kubevirt.io/kubevirt/vendor/github.com/golang/glog", - importpath = "github.com/golang/glog", - visibility = ["//visibility:public"], -) diff --git a/vendor/github.com/golang/glog/LICENSE b/vendor/github.com/golang/glog/LICENSE deleted file mode 100644 index 37ec93a14fdc..000000000000 --- a/vendor/github.com/golang/glog/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets "[]" replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same "printed page" as the copyright notice for easier identification within -third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/vendor/github.com/golang/glog/README b/vendor/github.com/golang/glog/README deleted file mode 100644 index 387b4eb68909..000000000000 --- a/vendor/github.com/golang/glog/README +++ /dev/null @@ -1,44 +0,0 @@ -glog -==== - -Leveled execution logs for Go. - -This is an efficient pure Go implementation of leveled logs in the -manner of the open source C++ package - https://github.com/google/glog - -By binding methods to booleans it is possible to use the log package -without paying the expense of evaluating the arguments to the log. -Through the -vmodule flag, the package also provides fine-grained -control over logging at the file level. - -The comment from glog.go introduces the ideas: - - Package glog implements logging analogous to the Google-internal - C++ INFO/ERROR/V setup. It provides functions Info, Warning, - Error, Fatal, plus formatting variants such as Infof. It - also provides V-style logging controlled by the -v and - -vmodule=file=2 flags. - - Basic examples: - - glog.Info("Prepare to repel boarders") - - glog.Fatalf("Initialization failed: %s", err) - - See the documentation for the V function for an explanation - of these examples: - - if glog.V(2) { - glog.Info("Starting transaction...") - } - - glog.V(2).Infoln("Processed", nItems, "elements") - - -The repository contains an open source version of the log package -used inside Google. The master copy of the source lives inside -Google, not here. The code in this repo is for export only and is not itself -under development. Feature requests will be ignored. - -Send bug reports to golang-nuts@googlegroups.com. diff --git a/vendor/github.com/golang/glog/glog.go b/vendor/github.com/golang/glog/glog.go deleted file mode 100644 index 54bd7afdcabe..000000000000 --- a/vendor/github.com/golang/glog/glog.go +++ /dev/null @@ -1,1180 +0,0 @@ -// Go support for leveled logs, analogous to https://code.google.com/p/google-glog/ -// -// Copyright 2013 Google Inc. All Rights Reserved. -// -// 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. - -// Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup. -// It provides functions Info, Warning, Error, Fatal, plus formatting variants such as -// Infof. It also provides V-style logging controlled by the -v and -vmodule=file=2 flags. -// -// Basic examples: -// -// glog.Info("Prepare to repel boarders") -// -// glog.Fatalf("Initialization failed: %s", err) -// -// See the documentation for the V function for an explanation of these examples: -// -// if glog.V(2) { -// glog.Info("Starting transaction...") -// } -// -// glog.V(2).Infoln("Processed", nItems, "elements") -// -// Log output is buffered and written periodically using Flush. Programs -// should call Flush before exiting to guarantee all log output is written. -// -// By default, all log statements write to files in a temporary directory. -// This package provides several flags that modify this behavior. -// As a result, flag.Parse must be called before any logging is done. -// -// -logtostderr=false -// Logs are written to standard error instead of to files. -// -alsologtostderr=false -// Logs are written to standard error as well as to files. -// -stderrthreshold=ERROR -// Log events at or above this severity are logged to standard -// error as well as to files. -// -log_dir="" -// Log files will be written to this directory instead of the -// default temporary directory. -// -// Other flags provide aids to debugging. -// -// -log_backtrace_at="" -// When set to a file and line number holding a logging statement, -// such as -// -log_backtrace_at=gopherflakes.go:234 -// a stack trace will be written to the Info log whenever execution -// hits that statement. (Unlike with -vmodule, the ".go" must be -// present.) -// -v=0 -// Enable V-leveled logging at the specified level. -// -vmodule="" -// The syntax of the argument is a comma-separated list of pattern=N, -// where pattern is a literal file name (minus the ".go" suffix) or -// "glob" pattern and N is a V level. For instance, -// -vmodule=gopher*=3 -// sets the V level to 3 in all Go files whose names begin "gopher". -// -package glog - -import ( - "bufio" - "bytes" - "errors" - "flag" - "fmt" - "io" - stdLog "log" - "os" - "path/filepath" - "runtime" - "strconv" - "strings" - "sync" - "sync/atomic" - "time" -) - -// severity identifies the sort of log: info, warning etc. It also implements -// the flag.Value interface. The -stderrthreshold flag is of type severity and -// should be modified only through the flag.Value interface. The values match -// the corresponding constants in C++. -type severity int32 // sync/atomic int32 - -// These constants identify the log levels in order of increasing severity. -// A message written to a high-severity log file is also written to each -// lower-severity log file. -const ( - infoLog severity = iota - warningLog - errorLog - fatalLog - numSeverity = 4 -) - -const severityChar = "IWEF" - -var severityName = []string{ - infoLog: "INFO", - warningLog: "WARNING", - errorLog: "ERROR", - fatalLog: "FATAL", -} - -// get returns the value of the severity. -func (s *severity) get() severity { - return severity(atomic.LoadInt32((*int32)(s))) -} - -// set sets the value of the severity. -func (s *severity) set(val severity) { - atomic.StoreInt32((*int32)(s), int32(val)) -} - -// String is part of the flag.Value interface. -func (s *severity) String() string { - return strconv.FormatInt(int64(*s), 10) -} - -// Get is part of the flag.Value interface. -func (s *severity) Get() interface{} { - return *s -} - -// Set is part of the flag.Value interface. -func (s *severity) Set(value string) error { - var threshold severity - // Is it a known name? - if v, ok := severityByName(value); ok { - threshold = v - } else { - v, err := strconv.Atoi(value) - if err != nil { - return err - } - threshold = severity(v) - } - logging.stderrThreshold.set(threshold) - return nil -} - -func severityByName(s string) (severity, bool) { - s = strings.ToUpper(s) - for i, name := range severityName { - if name == s { - return severity(i), true - } - } - return 0, false -} - -// OutputStats tracks the number of output lines and bytes written. -type OutputStats struct { - lines int64 - bytes int64 -} - -// Lines returns the number of lines written. -func (s *OutputStats) Lines() int64 { - return atomic.LoadInt64(&s.lines) -} - -// Bytes returns the number of bytes written. -func (s *OutputStats) Bytes() int64 { - return atomic.LoadInt64(&s.bytes) -} - -// Stats tracks the number of lines of output and number of bytes -// per severity level. Values must be read with atomic.LoadInt64. -var Stats struct { - Info, Warning, Error OutputStats -} - -var severityStats = [numSeverity]*OutputStats{ - infoLog: &Stats.Info, - warningLog: &Stats.Warning, - errorLog: &Stats.Error, -} - -// Level is exported because it appears in the arguments to V and is -// the type of the v flag, which can be set programmatically. -// It's a distinct type because we want to discriminate it from logType. -// Variables of type level are only changed under logging.mu. -// The -v flag is read only with atomic ops, so the state of the logging -// module is consistent. - -// Level is treated as a sync/atomic int32. - -// Level specifies a level of verbosity for V logs. *Level implements -// flag.Value; the -v flag is of type Level and should be modified -// only through the flag.Value interface. -type Level int32 - -// get returns the value of the Level. -func (l *Level) get() Level { - return Level(atomic.LoadInt32((*int32)(l))) -} - -// set sets the value of the Level. -func (l *Level) set(val Level) { - atomic.StoreInt32((*int32)(l), int32(val)) -} - -// String is part of the flag.Value interface. -func (l *Level) String() string { - return strconv.FormatInt(int64(*l), 10) -} - -// Get is part of the flag.Value interface. -func (l *Level) Get() interface{} { - return *l -} - -// Set is part of the flag.Value interface. -func (l *Level) Set(value string) error { - v, err := strconv.Atoi(value) - if err != nil { - return err - } - logging.mu.Lock() - defer logging.mu.Unlock() - logging.setVState(Level(v), logging.vmodule.filter, false) - return nil -} - -// moduleSpec represents the setting of the -vmodule flag. -type moduleSpec struct { - filter []modulePat -} - -// modulePat contains a filter for the -vmodule flag. -// It holds a verbosity level and a file pattern to match. -type modulePat struct { - pattern string - literal bool // The pattern is a literal string - level Level -} - -// match reports whether the file matches the pattern. It uses a string -// comparison if the pattern contains no metacharacters. -func (m *modulePat) match(file string) bool { - if m.literal { - return file == m.pattern - } - match, _ := filepath.Match(m.pattern, file) - return match -} - -func (m *moduleSpec) String() string { - // Lock because the type is not atomic. TODO: clean this up. - logging.mu.Lock() - defer logging.mu.Unlock() - var b bytes.Buffer - for i, f := range m.filter { - if i > 0 { - b.WriteRune(',') - } - fmt.Fprintf(&b, "%s=%d", f.pattern, f.level) - } - return b.String() -} - -// Get is part of the (Go 1.2) flag.Getter interface. It always returns nil for this flag type since the -// struct is not exported. -func (m *moduleSpec) Get() interface{} { - return nil -} - -var errVmoduleSyntax = errors.New("syntax error: expect comma-separated list of filename=N") - -// Syntax: -vmodule=recordio=2,file=1,gfs*=3 -func (m *moduleSpec) Set(value string) error { - var filter []modulePat - for _, pat := range strings.Split(value, ",") { - if len(pat) == 0 { - // Empty strings such as from a trailing comma can be ignored. - continue - } - patLev := strings.Split(pat, "=") - if len(patLev) != 2 || len(patLev[0]) == 0 || len(patLev[1]) == 0 { - return errVmoduleSyntax - } - pattern := patLev[0] - v, err := strconv.Atoi(patLev[1]) - if err != nil { - return errors.New("syntax error: expect comma-separated list of filename=N") - } - if v < 0 { - return errors.New("negative value for vmodule level") - } - if v == 0 { - continue // Ignore. It's harmless but no point in paying the overhead. - } - // TODO: check syntax of filter? - filter = append(filter, modulePat{pattern, isLiteral(pattern), Level(v)}) - } - logging.mu.Lock() - defer logging.mu.Unlock() - logging.setVState(logging.verbosity, filter, true) - return nil -} - -// isLiteral reports whether the pattern is a literal string, that is, has no metacharacters -// that require filepath.Match to be called to match the pattern. -func isLiteral(pattern string) bool { - return !strings.ContainsAny(pattern, `\*?[]`) -} - -// traceLocation represents the setting of the -log_backtrace_at flag. -type traceLocation struct { - file string - line int -} - -// isSet reports whether the trace location has been specified. -// logging.mu is held. -func (t *traceLocation) isSet() bool { - return t.line > 0 -} - -// match reports whether the specified file and line matches the trace location. -// The argument file name is the full path, not the basename specified in the flag. -// logging.mu is held. -func (t *traceLocation) match(file string, line int) bool { - if t.line != line { - return false - } - if i := strings.LastIndex(file, "/"); i >= 0 { - file = file[i+1:] - } - return t.file == file -} - -func (t *traceLocation) String() string { - // Lock because the type is not atomic. TODO: clean this up. - logging.mu.Lock() - defer logging.mu.Unlock() - return fmt.Sprintf("%s:%d", t.file, t.line) -} - -// Get is part of the (Go 1.2) flag.Getter interface. It always returns nil for this flag type since the -// struct is not exported -func (t *traceLocation) Get() interface{} { - return nil -} - -var errTraceSyntax = errors.New("syntax error: expect file.go:234") - -// Syntax: -log_backtrace_at=gopherflakes.go:234 -// Note that unlike vmodule the file extension is included here. -func (t *traceLocation) Set(value string) error { - if value == "" { - // Unset. - t.line = 0 - t.file = "" - } - fields := strings.Split(value, ":") - if len(fields) != 2 { - return errTraceSyntax - } - file, line := fields[0], fields[1] - if !strings.Contains(file, ".") { - return errTraceSyntax - } - v, err := strconv.Atoi(line) - if err != nil { - return errTraceSyntax - } - if v <= 0 { - return errors.New("negative or zero value for level") - } - logging.mu.Lock() - defer logging.mu.Unlock() - t.line = v - t.file = file - return nil -} - -// flushSyncWriter is the interface satisfied by logging destinations. -type flushSyncWriter interface { - Flush() error - Sync() error - io.Writer -} - -func init() { - flag.BoolVar(&logging.toStderr, "logtostderr", false, "log to standard error instead of files") - flag.BoolVar(&logging.alsoToStderr, "alsologtostderr", false, "log to standard error as well as files") - flag.Var(&logging.verbosity, "v", "log level for V logs") - flag.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr") - flag.Var(&logging.vmodule, "vmodule", "comma-separated list of pattern=N settings for file-filtered logging") - flag.Var(&logging.traceLocation, "log_backtrace_at", "when logging hits line file:N, emit a stack trace") - - // Default stderrThreshold is ERROR. - logging.stderrThreshold = errorLog - - logging.setVState(0, nil, false) - go logging.flushDaemon() -} - -// Flush flushes all pending log I/O. -func Flush() { - logging.lockAndFlushAll() -} - -// loggingT collects all the global state of the logging setup. -type loggingT struct { - // Boolean flags. Not handled atomically because the flag.Value interface - // does not let us avoid the =true, and that shorthand is necessary for - // compatibility. TODO: does this matter enough to fix? Seems unlikely. - toStderr bool // The -logtostderr flag. - alsoToStderr bool // The -alsologtostderr flag. - - // Level flag. Handled atomically. - stderrThreshold severity // The -stderrthreshold flag. - - // freeList is a list of byte buffers, maintained under freeListMu. - freeList *buffer - // freeListMu maintains the free list. It is separate from the main mutex - // so buffers can be grabbed and printed to without holding the main lock, - // for better parallelization. - freeListMu sync.Mutex - - // mu protects the remaining elements of this structure and is - // used to synchronize logging. - mu sync.Mutex - // file holds writer for each of the log types. - file [numSeverity]flushSyncWriter - // pcs is used in V to avoid an allocation when computing the caller's PC. - pcs [1]uintptr - // vmap is a cache of the V Level for each V() call site, identified by PC. - // It is wiped whenever the vmodule flag changes state. - vmap map[uintptr]Level - // filterLength stores the length of the vmodule filter chain. If greater - // than zero, it means vmodule is enabled. It may be read safely - // using sync.LoadInt32, but is only modified under mu. - filterLength int32 - // traceLocation is the state of the -log_backtrace_at flag. - traceLocation traceLocation - // These flags are modified only under lock, although verbosity may be fetched - // safely using atomic.LoadInt32. - vmodule moduleSpec // The state of the -vmodule flag. - verbosity Level // V logging level, the value of the -v flag/ -} - -// buffer holds a byte Buffer for reuse. The zero value is ready for use. -type buffer struct { - bytes.Buffer - tmp [64]byte // temporary byte array for creating headers. - next *buffer -} - -var logging loggingT - -// setVState sets a consistent state for V logging. -// l.mu is held. -func (l *loggingT) setVState(verbosity Level, filter []modulePat, setFilter bool) { - // Turn verbosity off so V will not fire while we are in transition. - logging.verbosity.set(0) - // Ditto for filter length. - atomic.StoreInt32(&logging.filterLength, 0) - - // Set the new filters and wipe the pc->Level map if the filter has changed. - if setFilter { - logging.vmodule.filter = filter - logging.vmap = make(map[uintptr]Level) - } - - // Things are consistent now, so enable filtering and verbosity. - // They are enabled in order opposite to that in V. - atomic.StoreInt32(&logging.filterLength, int32(len(filter))) - logging.verbosity.set(verbosity) -} - -// getBuffer returns a new, ready-to-use buffer. -func (l *loggingT) getBuffer() *buffer { - l.freeListMu.Lock() - b := l.freeList - if b != nil { - l.freeList = b.next - } - l.freeListMu.Unlock() - if b == nil { - b = new(buffer) - } else { - b.next = nil - b.Reset() - } - return b -} - -// putBuffer returns a buffer to the free list. -func (l *loggingT) putBuffer(b *buffer) { - if b.Len() >= 256 { - // Let big buffers die a natural death. - return - } - l.freeListMu.Lock() - b.next = l.freeList - l.freeList = b - l.freeListMu.Unlock() -} - -var timeNow = time.Now // Stubbed out for testing. - -/* -header formats a log header as defined by the C++ implementation. -It returns a buffer containing the formatted header and the user's file and line number. -The depth specifies how many stack frames above lives the source line to be identified in the log message. - -Log lines have this form: - Lmmdd hh:mm:ss.uuuuuu threadid file:line] msg... -where the fields are defined as follows: - L A single character, representing the log level (eg 'I' for INFO) - mm The month (zero padded; ie May is '05') - dd The day (zero padded) - hh:mm:ss.uuuuuu Time in hours, minutes and fractional seconds - threadid The space-padded thread ID as returned by GetTID() - file The file name - line The line number - msg The user-supplied message -*/ -func (l *loggingT) header(s severity, depth int) (*buffer, string, int) { - _, file, line, ok := runtime.Caller(3 + depth) - if !ok { - file = "???" - line = 1 - } else { - slash := strings.LastIndex(file, "/") - if slash >= 0 { - file = file[slash+1:] - } - } - return l.formatHeader(s, file, line), file, line -} - -// formatHeader formats a log header using the provided file name and line number. -func (l *loggingT) formatHeader(s severity, file string, line int) *buffer { - now := timeNow() - if line < 0 { - line = 0 // not a real line number, but acceptable to someDigits - } - if s > fatalLog { - s = infoLog // for safety. - } - buf := l.getBuffer() - - // Avoid Fprintf, for speed. The format is so simple that we can do it quickly by hand. - // It's worth about 3X. Fprintf is hard. - _, month, day := now.Date() - hour, minute, second := now.Clock() - // Lmmdd hh:mm:ss.uuuuuu threadid file:line] - buf.tmp[0] = severityChar[s] - buf.twoDigits(1, int(month)) - buf.twoDigits(3, day) - buf.tmp[5] = ' ' - buf.twoDigits(6, hour) - buf.tmp[8] = ':' - buf.twoDigits(9, minute) - buf.tmp[11] = ':' - buf.twoDigits(12, second) - buf.tmp[14] = '.' - buf.nDigits(6, 15, now.Nanosecond()/1000, '0') - buf.tmp[21] = ' ' - buf.nDigits(7, 22, pid, ' ') // TODO: should be TID - buf.tmp[29] = ' ' - buf.Write(buf.tmp[:30]) - buf.WriteString(file) - buf.tmp[0] = ':' - n := buf.someDigits(1, line) - buf.tmp[n+1] = ']' - buf.tmp[n+2] = ' ' - buf.Write(buf.tmp[:n+3]) - return buf -} - -// Some custom tiny helper functions to print the log header efficiently. - -const digits = "0123456789" - -// twoDigits formats a zero-prefixed two-digit integer at buf.tmp[i]. -func (buf *buffer) twoDigits(i, d int) { - buf.tmp[i+1] = digits[d%10] - d /= 10 - buf.tmp[i] = digits[d%10] -} - -// nDigits formats an n-digit integer at buf.tmp[i], -// padding with pad on the left. -// It assumes d >= 0. -func (buf *buffer) nDigits(n, i, d int, pad byte) { - j := n - 1 - for ; j >= 0 && d > 0; j-- { - buf.tmp[i+j] = digits[d%10] - d /= 10 - } - for ; j >= 0; j-- { - buf.tmp[i+j] = pad - } -} - -// someDigits formats a zero-prefixed variable-width integer at buf.tmp[i]. -func (buf *buffer) someDigits(i, d int) int { - // Print into the top, then copy down. We know there's space for at least - // a 10-digit number. - j := len(buf.tmp) - for { - j-- - buf.tmp[j] = digits[d%10] - d /= 10 - if d == 0 { - break - } - } - return copy(buf.tmp[i:], buf.tmp[j:]) -} - -func (l *loggingT) println(s severity, args ...interface{}) { - buf, file, line := l.header(s, 0) - fmt.Fprintln(buf, args...) - l.output(s, buf, file, line, false) -} - -func (l *loggingT) print(s severity, args ...interface{}) { - l.printDepth(s, 1, args...) -} - -func (l *loggingT) printDepth(s severity, depth int, args ...interface{}) { - buf, file, line := l.header(s, depth) - fmt.Fprint(buf, args...) - if buf.Bytes()[buf.Len()-1] != '\n' { - buf.WriteByte('\n') - } - l.output(s, buf, file, line, false) -} - -func (l *loggingT) printf(s severity, format string, args ...interface{}) { - buf, file, line := l.header(s, 0) - fmt.Fprintf(buf, format, args...) - if buf.Bytes()[buf.Len()-1] != '\n' { - buf.WriteByte('\n') - } - l.output(s, buf, file, line, false) -} - -// printWithFileLine behaves like print but uses the provided file and line number. If -// alsoLogToStderr is true, the log message always appears on standard error; it -// will also appear in the log file unless --logtostderr is set. -func (l *loggingT) printWithFileLine(s severity, file string, line int, alsoToStderr bool, args ...interface{}) { - buf := l.formatHeader(s, file, line) - fmt.Fprint(buf, args...) - if buf.Bytes()[buf.Len()-1] != '\n' { - buf.WriteByte('\n') - } - l.output(s, buf, file, line, alsoToStderr) -} - -// output writes the data to the log files and releases the buffer. -func (l *loggingT) output(s severity, buf *buffer, file string, line int, alsoToStderr bool) { - l.mu.Lock() - if l.traceLocation.isSet() { - if l.traceLocation.match(file, line) { - buf.Write(stacks(false)) - } - } - data := buf.Bytes() - if !flag.Parsed() { - os.Stderr.Write([]byte("ERROR: logging before flag.Parse: ")) - os.Stderr.Write(data) - } else if l.toStderr { - os.Stderr.Write(data) - } else { - if alsoToStderr || l.alsoToStderr || s >= l.stderrThreshold.get() { - os.Stderr.Write(data) - } - if l.file[s] == nil { - if err := l.createFiles(s); err != nil { - os.Stderr.Write(data) // Make sure the message appears somewhere. - l.exit(err) - } - } - switch s { - case fatalLog: - l.file[fatalLog].Write(data) - fallthrough - case errorLog: - l.file[errorLog].Write(data) - fallthrough - case warningLog: - l.file[warningLog].Write(data) - fallthrough - case infoLog: - l.file[infoLog].Write(data) - } - } - if s == fatalLog { - // If we got here via Exit rather than Fatal, print no stacks. - if atomic.LoadUint32(&fatalNoStacks) > 0 { - l.mu.Unlock() - timeoutFlush(10 * time.Second) - os.Exit(1) - } - // Dump all goroutine stacks before exiting. - // First, make sure we see the trace for the current goroutine on standard error. - // If -logtostderr has been specified, the loop below will do that anyway - // as the first stack in the full dump. - if !l.toStderr { - os.Stderr.Write(stacks(false)) - } - // Write the stack trace for all goroutines to the files. - trace := stacks(true) - logExitFunc = func(error) {} // If we get a write error, we'll still exit below. - for log := fatalLog; log >= infoLog; log-- { - if f := l.file[log]; f != nil { // Can be nil if -logtostderr is set. - f.Write(trace) - } - } - l.mu.Unlock() - timeoutFlush(10 * time.Second) - os.Exit(255) // C++ uses -1, which is silly because it's anded with 255 anyway. - } - l.putBuffer(buf) - l.mu.Unlock() - if stats := severityStats[s]; stats != nil { - atomic.AddInt64(&stats.lines, 1) - atomic.AddInt64(&stats.bytes, int64(len(data))) - } -} - -// timeoutFlush calls Flush and returns when it completes or after timeout -// elapses, whichever happens first. This is needed because the hooks invoked -// by Flush may deadlock when glog.Fatal is called from a hook that holds -// a lock. -func timeoutFlush(timeout time.Duration) { - done := make(chan bool, 1) - go func() { - Flush() // calls logging.lockAndFlushAll() - done <- true - }() - select { - case <-done: - case <-time.After(timeout): - fmt.Fprintln(os.Stderr, "glog: Flush took longer than", timeout) - } -} - -// stacks is a wrapper for runtime.Stack that attempts to recover the data for all goroutines. -func stacks(all bool) []byte { - // We don't know how big the traces are, so grow a few times if they don't fit. Start large, though. - n := 10000 - if all { - n = 100000 - } - var trace []byte - for i := 0; i < 5; i++ { - trace = make([]byte, n) - nbytes := runtime.Stack(trace, all) - if nbytes < len(trace) { - return trace[:nbytes] - } - n *= 2 - } - return trace -} - -// logExitFunc provides a simple mechanism to override the default behavior -// of exiting on error. Used in testing and to guarantee we reach a required exit -// for fatal logs. Instead, exit could be a function rather than a method but that -// would make its use clumsier. -var logExitFunc func(error) - -// exit is called if there is trouble creating or writing log files. -// It flushes the logs and exits the program; there's no point in hanging around. -// l.mu is held. -func (l *loggingT) exit(err error) { - fmt.Fprintf(os.Stderr, "log: exiting because of error: %s\n", err) - // If logExitFunc is set, we do that instead of exiting. - if logExitFunc != nil { - logExitFunc(err) - return - } - l.flushAll() - os.Exit(2) -} - -// syncBuffer joins a bufio.Writer to its underlying file, providing access to the -// file's Sync method and providing a wrapper for the Write method that provides log -// file rotation. There are conflicting methods, so the file cannot be embedded. -// l.mu is held for all its methods. -type syncBuffer struct { - logger *loggingT - *bufio.Writer - file *os.File - sev severity - nbytes uint64 // The number of bytes written to this file -} - -func (sb *syncBuffer) Sync() error { - return sb.file.Sync() -} - -func (sb *syncBuffer) Write(p []byte) (n int, err error) { - if sb.nbytes+uint64(len(p)) >= MaxSize { - if err := sb.rotateFile(time.Now()); err != nil { - sb.logger.exit(err) - } - } - n, err = sb.Writer.Write(p) - sb.nbytes += uint64(n) - if err != nil { - sb.logger.exit(err) - } - return -} - -// rotateFile closes the syncBuffer's file and starts a new one. -func (sb *syncBuffer) rotateFile(now time.Time) error { - if sb.file != nil { - sb.Flush() - sb.file.Close() - } - var err error - sb.file, _, err = create(severityName[sb.sev], now) - sb.nbytes = 0 - if err != nil { - return err - } - - sb.Writer = bufio.NewWriterSize(sb.file, bufferSize) - - // Write header. - var buf bytes.Buffer - fmt.Fprintf(&buf, "Log file created at: %s\n", now.Format("2006/01/02 15:04:05")) - fmt.Fprintf(&buf, "Running on machine: %s\n", host) - fmt.Fprintf(&buf, "Binary: Built with %s %s for %s/%s\n", runtime.Compiler, runtime.Version(), runtime.GOOS, runtime.GOARCH) - fmt.Fprintf(&buf, "Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg\n") - n, err := sb.file.Write(buf.Bytes()) - sb.nbytes += uint64(n) - return err -} - -// bufferSize sizes the buffer associated with each log file. It's large -// so that log records can accumulate without the logging thread blocking -// on disk I/O. The flushDaemon will block instead. -const bufferSize = 256 * 1024 - -// createFiles creates all the log files for severity from sev down to infoLog. -// l.mu is held. -func (l *loggingT) createFiles(sev severity) error { - now := time.Now() - // Files are created in decreasing severity order, so as soon as we find one - // has already been created, we can stop. - for s := sev; s >= infoLog && l.file[s] == nil; s-- { - sb := &syncBuffer{ - logger: l, - sev: s, - } - if err := sb.rotateFile(now); err != nil { - return err - } - l.file[s] = sb - } - return nil -} - -const flushInterval = 30 * time.Second - -// flushDaemon periodically flushes the log file buffers. -func (l *loggingT) flushDaemon() { - for _ = range time.NewTicker(flushInterval).C { - l.lockAndFlushAll() - } -} - -// lockAndFlushAll is like flushAll but locks l.mu first. -func (l *loggingT) lockAndFlushAll() { - l.mu.Lock() - l.flushAll() - l.mu.Unlock() -} - -// flushAll flushes all the logs and attempts to "sync" their data to disk. -// l.mu is held. -func (l *loggingT) flushAll() { - // Flush from fatal down, in case there's trouble flushing. - for s := fatalLog; s >= infoLog; s-- { - file := l.file[s] - if file != nil { - file.Flush() // ignore error - file.Sync() // ignore error - } - } -} - -// CopyStandardLogTo arranges for messages written to the Go "log" package's -// default logs to also appear in the Google logs for the named and lower -// severities. Subsequent changes to the standard log's default output location -// or format may break this behavior. -// -// Valid names are "INFO", "WARNING", "ERROR", and "FATAL". If the name is not -// recognized, CopyStandardLogTo panics. -func CopyStandardLogTo(name string) { - sev, ok := severityByName(name) - if !ok { - panic(fmt.Sprintf("log.CopyStandardLogTo(%q): unrecognized severity name", name)) - } - // Set a log format that captures the user's file and line: - // d.go:23: message - stdLog.SetFlags(stdLog.Lshortfile) - stdLog.SetOutput(logBridge(sev)) -} - -// logBridge provides the Write method that enables CopyStandardLogTo to connect -// Go's standard logs to the logs provided by this package. -type logBridge severity - -// Write parses the standard logging line and passes its components to the -// logger for severity(lb). -func (lb logBridge) Write(b []byte) (n int, err error) { - var ( - file = "???" - line = 1 - text string - ) - // Split "d.go:23: message" into "d.go", "23", and "message". - if parts := bytes.SplitN(b, []byte{':'}, 3); len(parts) != 3 || len(parts[0]) < 1 || len(parts[2]) < 1 { - text = fmt.Sprintf("bad log format: %s", b) - } else { - file = string(parts[0]) - text = string(parts[2][1:]) // skip leading space - line, err = strconv.Atoi(string(parts[1])) - if err != nil { - text = fmt.Sprintf("bad line number: %s", b) - line = 1 - } - } - // printWithFileLine with alsoToStderr=true, so standard log messages - // always appear on standard error. - logging.printWithFileLine(severity(lb), file, line, true, text) - return len(b), nil -} - -// setV computes and remembers the V level for a given PC -// when vmodule is enabled. -// File pattern matching takes the basename of the file, stripped -// of its .go suffix, and uses filepath.Match, which is a little more -// general than the *? matching used in C++. -// l.mu is held. -func (l *loggingT) setV(pc uintptr) Level { - fn := runtime.FuncForPC(pc) - file, _ := fn.FileLine(pc) - // The file is something like /a/b/c/d.go. We want just the d. - if strings.HasSuffix(file, ".go") { - file = file[:len(file)-3] - } - if slash := strings.LastIndex(file, "/"); slash >= 0 { - file = file[slash+1:] - } - for _, filter := range l.vmodule.filter { - if filter.match(file) { - l.vmap[pc] = filter.level - return filter.level - } - } - l.vmap[pc] = 0 - return 0 -} - -// Verbose is a boolean type that implements Infof (like Printf) etc. -// See the documentation of V for more information. -type Verbose bool - -// V reports whether verbosity at the call site is at least the requested level. -// The returned value is a boolean of type Verbose, which implements Info, Infoln -// and Infof. These methods will write to the Info log if called. -// Thus, one may write either -// if glog.V(2) { glog.Info("log this") } -// or -// glog.V(2).Info("log this") -// The second form is shorter but the first is cheaper if logging is off because it does -// not evaluate its arguments. -// -// Whether an individual call to V generates a log record depends on the setting of -// the -v and --vmodule flags; both are off by default. If the level in the call to -// V is at least the value of -v, or of -vmodule for the source file containing the -// call, the V call will log. -func V(level Level) Verbose { - // This function tries hard to be cheap unless there's work to do. - // The fast path is two atomic loads and compares. - - // Here is a cheap but safe test to see if V logging is enabled globally. - if logging.verbosity.get() >= level { - return Verbose(true) - } - - // It's off globally but it vmodule may still be set. - // Here is another cheap but safe test to see if vmodule is enabled. - if atomic.LoadInt32(&logging.filterLength) > 0 { - // Now we need a proper lock to use the logging structure. The pcs field - // is shared so we must lock before accessing it. This is fairly expensive, - // but if V logging is enabled we're slow anyway. - logging.mu.Lock() - defer logging.mu.Unlock() - if runtime.Callers(2, logging.pcs[:]) == 0 { - return Verbose(false) - } - v, ok := logging.vmap[logging.pcs[0]] - if !ok { - v = logging.setV(logging.pcs[0]) - } - return Verbose(v >= level) - } - return Verbose(false) -} - -// Info is equivalent to the global Info function, guarded by the value of v. -// See the documentation of V for usage. -func (v Verbose) Info(args ...interface{}) { - if v { - logging.print(infoLog, args...) - } -} - -// Infoln is equivalent to the global Infoln function, guarded by the value of v. -// See the documentation of V for usage. -func (v Verbose) Infoln(args ...interface{}) { - if v { - logging.println(infoLog, args...) - } -} - -// Infof is equivalent to the global Infof function, guarded by the value of v. -// See the documentation of V for usage. -func (v Verbose) Infof(format string, args ...interface{}) { - if v { - logging.printf(infoLog, format, args...) - } -} - -// Info logs to the INFO log. -// Arguments are handled in the manner of fmt.Print; a newline is appended if missing. -func Info(args ...interface{}) { - logging.print(infoLog, args...) -} - -// InfoDepth acts as Info but uses depth to determine which call frame to log. -// InfoDepth(0, "msg") is the same as Info("msg"). -func InfoDepth(depth int, args ...interface{}) { - logging.printDepth(infoLog, depth, args...) -} - -// Infoln logs to the INFO log. -// Arguments are handled in the manner of fmt.Println; a newline is appended if missing. -func Infoln(args ...interface{}) { - logging.println(infoLog, args...) -} - -// Infof logs to the INFO log. -// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. -func Infof(format string, args ...interface{}) { - logging.printf(infoLog, format, args...) -} - -// Warning logs to the WARNING and INFO logs. -// Arguments are handled in the manner of fmt.Print; a newline is appended if missing. -func Warning(args ...interface{}) { - logging.print(warningLog, args...) -} - -// WarningDepth acts as Warning but uses depth to determine which call frame to log. -// WarningDepth(0, "msg") is the same as Warning("msg"). -func WarningDepth(depth int, args ...interface{}) { - logging.printDepth(warningLog, depth, args...) -} - -// Warningln logs to the WARNING and INFO logs. -// Arguments are handled in the manner of fmt.Println; a newline is appended if missing. -func Warningln(args ...interface{}) { - logging.println(warningLog, args...) -} - -// Warningf logs to the WARNING and INFO logs. -// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. -func Warningf(format string, args ...interface{}) { - logging.printf(warningLog, format, args...) -} - -// Error logs to the ERROR, WARNING, and INFO logs. -// Arguments are handled in the manner of fmt.Print; a newline is appended if missing. -func Error(args ...interface{}) { - logging.print(errorLog, args...) -} - -// ErrorDepth acts as Error but uses depth to determine which call frame to log. -// ErrorDepth(0, "msg") is the same as Error("msg"). -func ErrorDepth(depth int, args ...interface{}) { - logging.printDepth(errorLog, depth, args...) -} - -// Errorln logs to the ERROR, WARNING, and INFO logs. -// Arguments are handled in the manner of fmt.Println; a newline is appended if missing. -func Errorln(args ...interface{}) { - logging.println(errorLog, args...) -} - -// Errorf logs to the ERROR, WARNING, and INFO logs. -// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. -func Errorf(format string, args ...interface{}) { - logging.printf(errorLog, format, args...) -} - -// Fatal logs to the FATAL, ERROR, WARNING, and INFO logs, -// including a stack trace of all running goroutines, then calls os.Exit(255). -// Arguments are handled in the manner of fmt.Print; a newline is appended if missing. -func Fatal(args ...interface{}) { - logging.print(fatalLog, args...) -} - -// FatalDepth acts as Fatal but uses depth to determine which call frame to log. -// FatalDepth(0, "msg") is the same as Fatal("msg"). -func FatalDepth(depth int, args ...interface{}) { - logging.printDepth(fatalLog, depth, args...) -} - -// Fatalln logs to the FATAL, ERROR, WARNING, and INFO logs, -// including a stack trace of all running goroutines, then calls os.Exit(255). -// Arguments are handled in the manner of fmt.Println; a newline is appended if missing. -func Fatalln(args ...interface{}) { - logging.println(fatalLog, args...) -} - -// Fatalf logs to the FATAL, ERROR, WARNING, and INFO logs, -// including a stack trace of all running goroutines, then calls os.Exit(255). -// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. -func Fatalf(format string, args ...interface{}) { - logging.printf(fatalLog, format, args...) -} - -// fatalNoStacks is non-zero if we are to exit without dumping goroutine stacks. -// It allows Exit and relatives to use the Fatal logs. -var fatalNoStacks uint32 - -// Exit logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). -// Arguments are handled in the manner of fmt.Print; a newline is appended if missing. -func Exit(args ...interface{}) { - atomic.StoreUint32(&fatalNoStacks, 1) - logging.print(fatalLog, args...) -} - -// ExitDepth acts as Exit but uses depth to determine which call frame to log. -// ExitDepth(0, "msg") is the same as Exit("msg"). -func ExitDepth(depth int, args ...interface{}) { - atomic.StoreUint32(&fatalNoStacks, 1) - logging.printDepth(fatalLog, depth, args...) -} - -// Exitln logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). -func Exitln(args ...interface{}) { - atomic.StoreUint32(&fatalNoStacks, 1) - logging.println(fatalLog, args...) -} - -// Exitf logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). -// Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. -func Exitf(format string, args ...interface{}) { - atomic.StoreUint32(&fatalNoStacks, 1) - logging.printf(fatalLog, format, args...) -} diff --git a/vendor/github.com/golang/glog/glog_file.go b/vendor/github.com/golang/glog/glog_file.go deleted file mode 100644 index 65075d281110..000000000000 --- a/vendor/github.com/golang/glog/glog_file.go +++ /dev/null @@ -1,124 +0,0 @@ -// Go support for leveled logs, analogous to https://code.google.com/p/google-glog/ -// -// Copyright 2013 Google Inc. All Rights Reserved. -// -// 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. - -// File I/O for logs. - -package glog - -import ( - "errors" - "flag" - "fmt" - "os" - "os/user" - "path/filepath" - "strings" - "sync" - "time" -) - -// MaxSize is the maximum size of a log file in bytes. -var MaxSize uint64 = 1024 * 1024 * 1800 - -// logDirs lists the candidate directories for new log files. -var logDirs []string - -// If non-empty, overrides the choice of directory in which to write logs. -// See createLogDirs for the full list of possible destinations. -var logDir = flag.String("log_dir", "", "If non-empty, write log files in this directory") - -func createLogDirs() { - if *logDir != "" { - logDirs = append(logDirs, *logDir) - } - logDirs = append(logDirs, os.TempDir()) -} - -var ( - pid = os.Getpid() - program = filepath.Base(os.Args[0]) - host = "unknownhost" - userName = "unknownuser" -) - -func init() { - h, err := os.Hostname() - if err == nil { - host = shortHostname(h) - } - - current, err := user.Current() - if err == nil { - userName = current.Username - } - - // Sanitize userName since it may contain filepath separators on Windows. - userName = strings.Replace(userName, `\`, "_", -1) -} - -// shortHostname returns its argument, truncating at the first period. -// For instance, given "www.google.com" it returns "www". -func shortHostname(hostname string) string { - if i := strings.Index(hostname, "."); i >= 0 { - return hostname[:i] - } - return hostname -} - -// logName returns a new log file name containing tag, with start time t, and -// the name for the symlink for tag. -func logName(tag string, t time.Time) (name, link string) { - name = fmt.Sprintf("%s.%s.%s.log.%s.%04d%02d%02d-%02d%02d%02d.%d", - program, - host, - userName, - tag, - t.Year(), - t.Month(), - t.Day(), - t.Hour(), - t.Minute(), - t.Second(), - pid) - return name, program + "." + tag -} - -var onceLogDirs sync.Once - -// create creates a new log file and returns the file and its filename, which -// contains tag ("INFO", "FATAL", etc.) and t. If the file is created -// successfully, create also attempts to update the symlink for that tag, ignoring -// errors. -func create(tag string, t time.Time) (f *os.File, filename string, err error) { - onceLogDirs.Do(createLogDirs) - if len(logDirs) == 0 { - return nil, "", errors.New("log: no log dirs") - } - name, link := logName(tag, t) - var lastErr error - for _, dir := range logDirs { - fname := filepath.Join(dir, name) - f, err := os.Create(fname) - if err == nil { - symlink := filepath.Join(dir, link) - os.Remove(symlink) // ignore err - os.Symlink(name, symlink) // ignore err - return f, fname, nil - } - lastErr = err - } - return nil, "", fmt.Errorf("log: cannot create log: %v", lastErr) -} diff --git a/vendor/kubevirt.io/client-go b/vendor/kubevirt.io/client-go new file mode 120000 index 000000000000..80cc33d57a94 --- /dev/null +++ b/vendor/kubevirt.io/client-go @@ -0,0 +1 @@ +../../staging/src/kubevirt.io/client-go/ \ No newline at end of file diff --git a/vendor/kubevirt.io/client-go/api/v1/BUILD.bazel b/vendor/kubevirt.io/client-go/api/v1/BUILD.bazel deleted file mode 100644 index f98c96c92eff..000000000000 --- a/vendor/kubevirt.io/client-go/api/v1/BUILD.bazel +++ /dev/null @@ -1,36 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "deepcopy_generated.go", - "defaults.go", - "doc.go", - "openapi_generated.go", - "schema.go", - "schema_swagger_generated.go", - "types.go", - "types_swagger_generated.go", - "zz_generated.defaults.go", - ], - importmap = "kubevirt.io/kubevirt/vendor/kubevirt.io/client-go/api/v1", - importpath = "kubevirt.io/client-go/api/v1", - visibility = ["//visibility:public"], - deps = [ - "//vendor/github.com/go-openapi/spec:go_default_library", - "//vendor/github.com/pborman/uuid:go_default_library", - "//vendor/k8s.io/api/autoscaling/v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library", - "//vendor/k8s.io/kube-openapi/pkg/common:go_default_library", - "//vendor/kubevirt.io/client-go/precond:go_default_library", - "//vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1:go_default_library", - ], -) diff --git a/vendor/kubevirt.io/client-go/api/v1/deepcopy_generated.go b/vendor/kubevirt.io/client-go/api/v1/deepcopy_generated.go deleted file mode 100644 index 6207c1c2a8b7..000000000000 --- a/vendor/kubevirt.io/client-go/api/v1/deepcopy_generated.go +++ /dev/null @@ -1,2934 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2019 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. -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. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - core_v1 "k8s.io/api/core/v1" - meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - types "k8s.io/apimachinery/pkg/types" - - v1alpha1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BIOS) DeepCopyInto(out *BIOS) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BIOS. -func (in *BIOS) DeepCopy() *BIOS { - if in == nil { - return nil - } - out := new(BIOS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - if in.EFI != nil { - in, out := &in.EFI, &out.EFI - if *in == nil { - *out = nil - } else { - *out = new(EFI) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bootloader. -func (in *Bootloader) DeepCopy() *Bootloader { - if in == nil { - return nil - } - out := new(Bootloader) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CDRomTarget. -func (in *CDRomTarget) DeepCopy() *CDRomTarget { - if in == nil { - return nil - } - out := new(CDRomTarget) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CPU) DeepCopyInto(out *CPU) { - *out = *in - if in.Features != nil { - in, out := &in.Features, &out.Features - *out = make([]CPUFeature, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPU. -func (in *CPU) DeepCopy() *CPU { - if in == nil { - return nil - } - out := new(CPU) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CPUFeature) DeepCopyInto(out *CPUFeature) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPUFeature. -func (in *CPUFeature) DeepCopy() *CPUFeature { - if in == nil { - return nil - } - out := new(CPUFeature) - 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) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Clock. -func (in *Clock) DeepCopy() *Clock { - if in == nil { - return nil - } - out := new(Clock) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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) - } - } - if in.Timezone != nil { - in, out := &in.Timezone, &out.Timezone - if *in == nil { - *out = nil - } else { - *out = new(ClockOffsetTimezone) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClockOffset. -func (in *ClockOffset) DeepCopy() *ClockOffset { - if in == nil { - return nil - } - out := new(ClockOffset) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClockOffsetUTC. -func (in *ClockOffsetUTC) DeepCopy() *ClockOffsetUTC { - if in == nil { - return nil - } - out := new(ClockOffsetUTC) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CloudInitConfigDriveSource) DeepCopyInto(out *CloudInitConfigDriveSource) { - *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 - } - } - if in.NetworkDataSecretRef != nil { - in, out := &in.NetworkDataSecretRef, &out.NetworkDataSecretRef - if *in == nil { - *out = nil - } else { - *out = new(core_v1.LocalObjectReference) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudInitConfigDriveSource. -func (in *CloudInitConfigDriveSource) DeepCopy() *CloudInitConfigDriveSource { - if in == nil { - return nil - } - out := new(CloudInitConfigDriveSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - if in.NetworkDataSecretRef != nil { - in, out := &in.NetworkDataSecretRef, &out.NetworkDataSecretRef - if *in == nil { - *out = nil - } else { - *out = new(core_v1.LocalObjectReference) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudInitNoCloudSource. -func (in *CloudInitNoCloudSource) DeepCopy() *CloudInitNoCloudSource { - if in == nil { - return nil - } - out := new(CloudInitNoCloudSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigMapVolumeSource) DeepCopyInto(out *ConfigMapVolumeSource) { - *out = *in - 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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapVolumeSource. -func (in *ConfigMapVolumeSource) DeepCopy() *ConfigMapVolumeSource { - if in == nil { - return nil - } - out := new(ConfigMapVolumeSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ContainerDiskSource) DeepCopyInto(out *ContainerDiskSource) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerDiskSource. -func (in *ContainerDiskSource) DeepCopy() *ContainerDiskSource { - if in == nil { - return nil - } - out := new(ContainerDiskSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DHCPOptions) DeepCopyInto(out *DHCPOptions) { - *out = *in - if in.NTPServers != nil { - in, out := &in.NTPServers, &out.NTPServers - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.PrivateOptions != nil { - in, out := &in.PrivateOptions, &out.PrivateOptions - *out = make([]DHCPPrivateOptions, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DHCPOptions. -func (in *DHCPOptions) DeepCopy() *DHCPOptions { - if in == nil { - return nil - } - out := new(DHCPOptions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DHCPPrivateOptions) DeepCopyInto(out *DHCPPrivateOptions) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DHCPPrivateOptions. -func (in *DHCPPrivateOptions) DeepCopy() *DHCPPrivateOptions { - if in == nil { - return nil - } - out := new(DHCPPrivateOptions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DataVolumeSource) DeepCopyInto(out *DataVolumeSource) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataVolumeSource. -func (in *DataVolumeSource) DeepCopy() *DataVolumeSource { - if in == nil { - return nil - } - out := new(DataVolumeSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Devices) DeepCopyInto(out *Devices) { - *out = *in - if in.Disks != nil { - in, out := &in.Disks, &out.Disks - *out = make([]Disk, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Watchdog != nil { - in, out := &in.Watchdog, &out.Watchdog - if *in == nil { - *out = nil - } else { - *out = new(Watchdog) - (*in).DeepCopyInto(*out) - } - } - if in.Interfaces != nil { - in, out := &in.Interfaces, &out.Interfaces - *out = make([]Interface, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Inputs != nil { - in, out := &in.Inputs, &out.Inputs - *out = make([]Input, len(*in)) - copy(*out, *in) - } - if in.AutoattachPodInterface != nil { - in, out := &in.AutoattachPodInterface, &out.AutoattachPodInterface - if *in == nil { - *out = nil - } else { - *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 - } - } - if in.Rng != nil { - in, out := &in.Rng, &out.Rng - if *in == nil { - *out = nil - } else { - *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 - } - } - if in.NetworkInterfaceMultiQueue != nil { - in, out := &in.NetworkInterfaceMultiQueue, &out.NetworkInterfaceMultiQueue - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Devices. -func (in *Devices) DeepCopy() *Devices { - if in == nil { - return nil - } - out := new(Devices) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Disk) DeepCopyInto(out *Disk) { - *out = *in - 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 - } - } - if in.DedicatedIOThread != nil { - in, out := &in.DedicatedIOThread, &out.DedicatedIOThread - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Disk. -func (in *Disk) DeepCopy() *Disk { - if in == nil { - return nil - } - out := new(Disk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - if in.LUN != nil { - in, out := &in.LUN, &out.LUN - if *in == nil { - *out = nil - } else { - *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 - } - } - if in.CDRom != nil { - in, out := &in.CDRom, &out.CDRom - if *in == nil { - *out = nil - } else { - *out = new(CDRomTarget) - (*in).DeepCopyInto(*out) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskDevice. -func (in *DiskDevice) DeepCopy() *DiskDevice { - if in == nil { - return nil - } - out := new(DiskDevice) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DiskTarget) DeepCopyInto(out *DiskTarget) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskTarget. -func (in *DiskTarget) DeepCopy() *DiskTarget { - if in == nil { - return nil - } - out := new(DiskTarget) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DomainSpec) DeepCopyInto(out *DomainSpec) { - *out = *in - 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) - } - } - if in.Memory != nil { - in, out := &in.Memory, &out.Memory - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.Clock != nil { - in, out := &in.Clock, &out.Clock - if *in == nil { - *out = nil - } else { - *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) - } - } - 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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainSpec. -func (in *DomainSpec) DeepCopy() *DomainSpec { - if in == nil { - return nil - } - out := new(DomainSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EFI) DeepCopyInto(out *EFI) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EFI. -func (in *EFI) DeepCopy() *EFI { - if in == nil { - return nil - } - out := new(EFI) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EmptyDiskSource) DeepCopyInto(out *EmptyDiskSource) { - *out = *in - out.Capacity = in.Capacity.DeepCopy() - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmptyDiskSource. -func (in *EmptyDiskSource) DeepCopy() *EmptyDiskSource { - if in == nil { - return nil - } - out := new(EmptyDiskSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EphemeralVolumeSource. -func (in *EphemeralVolumeSource) DeepCopy() *EphemeralVolumeSource { - if in == nil { - return nil - } - out := new(EphemeralVolumeSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureAPIC. -func (in *FeatureAPIC) DeepCopy() *FeatureAPIC { - if in == nil { - return nil - } - out := new(FeatureAPIC) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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) - } - } - if in.VAPIC != nil { - in, out := &in.VAPIC, &out.VAPIC - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.VPIndex != nil { - in, out := &in.VPIndex, &out.VPIndex - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.SyNIC != nil { - in, out := &in.SyNIC, &out.SyNIC - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.Reset != nil { - in, out := &in.Reset, &out.Reset - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.Frequencies != nil { - in, out := &in.Frequencies, &out.Frequencies - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.TLBFlush != nil { - in, out := &in.TLBFlush, &out.TLBFlush - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.EVMCS != nil { - in, out := &in.EVMCS, &out.EVMCS - if *in == nil { - *out = nil - } else { - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureHyperv. -func (in *FeatureHyperv) DeepCopy() *FeatureHyperv { - if in == nil { - return nil - } - out := new(FeatureHyperv) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - if in.Retries != nil { - in, out := &in.Retries, &out.Retries - if *in == nil { - *out = nil - } else { - *out = new(uint32) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureSpinlocks. -func (in *FeatureSpinlocks) DeepCopy() *FeatureSpinlocks { - if in == nil { - return nil - } - out := new(FeatureSpinlocks) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureState. -func (in *FeatureState) DeepCopy() *FeatureState { - if in == nil { - return nil - } - out := new(FeatureState) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureVendorID. -func (in *FeatureVendorID) DeepCopy() *FeatureVendorID { - if in == nil { - return nil - } - out := new(FeatureVendorID) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Features) DeepCopyInto(out *Features) { - *out = *in - 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) - } - } - if in.Hyperv != nil { - in, out := &in.Hyperv, &out.Hyperv - if *in == nil { - *out = nil - } else { - *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) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Features. -func (in *Features) DeepCopy() *Features { - if in == nil { - return nil - } - out := new(Features) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Firmware. -func (in *Firmware) DeepCopy() *Firmware { - if in == nil { - return nil - } - out := new(Firmware) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FloppyTarget) DeepCopyInto(out *FloppyTarget) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FloppyTarget. -func (in *FloppyTarget) DeepCopy() *FloppyTarget { - if in == nil { - return nil - } - out := new(FloppyTarget) - 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 - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenieNetwork. -func (in *GenieNetwork) DeepCopy() *GenieNetwork { - if in == nil { - return nil - } - out := new(GenieNetwork) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HPETTimer. -func (in *HPETTimer) DeepCopy() *HPETTimer { - if in == nil { - return nil - } - out := new(HPETTimer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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) - } - } - if in.TCPSocket != nil { - in, out := &in.TCPSocket, &out.TCPSocket - if *in == nil { - *out = nil - } else { - *out = new(core_v1.TCPSocketAction) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Handler. -func (in *Handler) DeepCopy() *Handler { - if in == nil { - return nil - } - out := new(Handler) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HostDisk) DeepCopyInto(out *HostDisk) { - *out = *in - 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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostDisk. -func (in *HostDisk) DeepCopy() *HostDisk { - if in == nil { - return nil - } - out := new(HostDisk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Hugepages) DeepCopyInto(out *Hugepages) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Hugepages. -func (in *Hugepages) DeepCopy() *Hugepages { - if in == nil { - return nil - } - out := new(Hugepages) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HypervTimer. -func (in *HypervTimer) DeepCopy() *HypervTimer { - if in == nil { - return nil - } - out := new(HypervTimer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *I6300ESBWatchdog) DeepCopyInto(out *I6300ESBWatchdog) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new I6300ESBWatchdog. -func (in *I6300ESBWatchdog) DeepCopy() *I6300ESBWatchdog { - if in == nil { - return nil - } - out := new(I6300ESBWatchdog) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Input) DeepCopyInto(out *Input) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Input. -func (in *Input) DeepCopy() *Input { - if in == nil { - return nil - } - out := new(Input) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Interface) DeepCopyInto(out *Interface) { - *out = *in - in.InterfaceBindingMethod.DeepCopyInto(&out.InterfaceBindingMethod) - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]Port, len(*in)) - copy(*out, *in) - } - if in.BootOrder != nil { - in, out := &in.BootOrder, &out.BootOrder - if *in == nil { - *out = nil - } else { - *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) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Interface. -func (in *Interface) DeepCopy() *Interface { - if in == nil { - return nil - } - out := new(Interface) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - if in.Slirp != nil { - in, out := &in.Slirp, &out.Slirp - if *in == nil { - *out = nil - } else { - *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 - } - } - if in.SRIOV != nil { - in, out := &in.SRIOV, &out.SRIOV - if *in == nil { - *out = nil - } else { - *out = new(InterfaceSRIOV) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InterfaceBindingMethod. -func (in *InterfaceBindingMethod) DeepCopy() *InterfaceBindingMethod { - if in == nil { - return nil - } - out := new(InterfaceBindingMethod) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InterfaceBridge) DeepCopyInto(out *InterfaceBridge) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InterfaceBridge. -func (in *InterfaceBridge) DeepCopy() *InterfaceBridge { - if in == nil { - return nil - } - out := new(InterfaceBridge) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InterfaceMasquerade) DeepCopyInto(out *InterfaceMasquerade) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InterfaceMasquerade. -func (in *InterfaceMasquerade) DeepCopy() *InterfaceMasquerade { - if in == nil { - return nil - } - out := new(InterfaceMasquerade) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InterfaceSRIOV) DeepCopyInto(out *InterfaceSRIOV) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InterfaceSRIOV. -func (in *InterfaceSRIOV) DeepCopy() *InterfaceSRIOV { - if in == nil { - return nil - } - out := new(InterfaceSRIOV) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InterfaceSlirp) DeepCopyInto(out *InterfaceSlirp) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InterfaceSlirp. -func (in *InterfaceSlirp) DeepCopy() *InterfaceSlirp { - if in == nil { - return nil - } - out := new(InterfaceSlirp) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KVMTimer. -func (in *KVMTimer) DeepCopy() *KVMTimer { - if in == nil { - return nil - } - out := new(KVMTimer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeVirt) DeepCopyInto(out *KubeVirt) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeVirt. -func (in *KubeVirt) DeepCopy() *KubeVirt { - if in == nil { - return nil - } - out := new(KubeVirt) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeVirt) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeVirtCondition) DeepCopyInto(out *KubeVirtCondition) { - *out = *in - in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeVirtCondition. -func (in *KubeVirtCondition) DeepCopy() *KubeVirtCondition { - if in == nil { - return nil - } - out := new(KubeVirtCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeVirtList) DeepCopyInto(out *KubeVirtList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KubeVirt, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeVirtList. -func (in *KubeVirtList) DeepCopy() *KubeVirtList { - if in == nil { - return nil - } - out := new(KubeVirtList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeVirtList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeVirtSpec) DeepCopyInto(out *KubeVirtSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeVirtSpec. -func (in *KubeVirtSpec) DeepCopy() *KubeVirtSpec { - if in == nil { - return nil - } - out := new(KubeVirtSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeVirtStatus) DeepCopyInto(out *KubeVirtStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]KubeVirtCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeVirtStatus. -func (in *KubeVirtStatus) DeepCopy() *KubeVirtStatus { - if in == nil { - return nil - } - out := new(KubeVirtStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LunTarget) DeepCopyInto(out *LunTarget) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LunTarget. -func (in *LunTarget) DeepCopy() *LunTarget { - if in == nil { - return nil - } - out := new(LunTarget) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Machine) DeepCopyInto(out *Machine) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine. -func (in *Machine) DeepCopy() *Machine { - if in == nil { - return nil - } - out := new(Machine) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - if in.Guest != nil { - in, out := &in.Guest, &out.Guest - if *in == nil { - *out = nil - } else { - x := (*in).DeepCopy() - *out = &x - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Memory. -func (in *Memory) DeepCopy() *Memory { - if in == nil { - return nil - } - out := new(Memory) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MultusNetwork) DeepCopyInto(out *MultusNetwork) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultusNetwork. -func (in *MultusNetwork) DeepCopy() *MultusNetwork { - if in == nil { - return nil - } - out := new(MultusNetwork) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Network) DeepCopyInto(out *Network) { - *out = *in - in.NetworkSource.DeepCopyInto(&out.NetworkSource) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network. -func (in *Network) DeepCopy() *Network { - if in == nil { - return nil - } - out := new(Network) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - if in.Multus != nil { - in, out := &in.Multus, &out.Multus - if *in == nil { - *out = nil - } else { - *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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSource. -func (in *NetworkSource) DeepCopy() *NetworkSource { - if in == nil { - return nil - } - out := new(NetworkSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PITTimer. -func (in *PITTimer) DeepCopy() *PITTimer { - if in == nil { - return nil - } - out := new(PITTimer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodNetwork) DeepCopyInto(out *PodNetwork) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodNetwork. -func (in *PodNetwork) DeepCopy() *PodNetwork { - if in == nil { - return nil - } - out := new(PodNetwork) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Port) DeepCopyInto(out *Port) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Port. -func (in *Port) DeepCopy() *Port { - if in == nil { - return nil - } - out := new(Port) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Probe) DeepCopyInto(out *Probe) { - *out = *in - in.Handler.DeepCopyInto(&out.Handler) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Probe. -func (in *Probe) DeepCopy() *Probe { - if in == nil { - return nil - } - out := new(Probe) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RTCTimer. -func (in *RTCTimer) DeepCopy() *RTCTimer { - if in == nil { - return nil - } - out := new(RTCTimer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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)) - 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)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRequirements. -func (in *ResourceRequirements) DeepCopy() *ResourceRequirements { - if in == nil { - return nil - } - out := new(ResourceRequirements) - 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 - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rng. -func (in *Rng) DeepCopy() *Rng { - if in == nil { - return nil - } - out := new(Rng) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretVolumeSource. -func (in *SecretVolumeSource) DeepCopy() *SecretVolumeSource { - if in == nil { - return nil - } - out := new(SecretVolumeSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceAccountVolumeSource) DeepCopyInto(out *ServiceAccountVolumeSource) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountVolumeSource. -func (in *ServiceAccountVolumeSource) DeepCopy() *ServiceAccountVolumeSource { - if in == nil { - return nil - } - out := new(ServiceAccountVolumeSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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) - } - } - if in.KVM != nil { - in, out := &in.KVM, &out.KVM - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.RTC != nil { - in, out := &in.RTC, &out.RTC - if *in == nil { - *out = nil - } else { - *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) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Timer. -func (in *Timer) DeepCopy() *Timer { - if in == nil { - return nil - } - out := new(Timer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VMISelector) DeepCopyInto(out *VMISelector) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VMISelector. -func (in *VMISelector) DeepCopy() *VMISelector { - if in == nil { - return nil - } - out := new(VMISelector) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachine) DeepCopyInto(out *VirtualMachine) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachine. -func (in *VirtualMachine) DeepCopy() *VirtualMachine { - if in == nil { - return nil - } - out := new(VirtualMachine) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachine) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineCondition) DeepCopyInto(out *VirtualMachineCondition) { - *out = *in - in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineCondition. -func (in *VirtualMachineCondition) DeepCopy() *VirtualMachineCondition { - if in == nil { - return nil - } - out := new(VirtualMachineCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstance) DeepCopyInto(out *VirtualMachineInstance) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstance. -func (in *VirtualMachineInstance) DeepCopy() *VirtualMachineInstance { - if in == nil { - return nil - } - out := new(VirtualMachineInstance) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachineInstance) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceCondition) DeepCopyInto(out *VirtualMachineInstanceCondition) { - *out = *in - in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceCondition. -func (in *VirtualMachineInstanceCondition) DeepCopy() *VirtualMachineInstanceCondition { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceCondition) - 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 - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]VirtualMachineInstance, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceList. -func (in *VirtualMachineInstanceList) DeepCopy() *VirtualMachineInstanceList { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachineInstanceList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceMigration) DeepCopyInto(out *VirtualMachineInstanceMigration) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceMigration. -func (in *VirtualMachineInstanceMigration) DeepCopy() *VirtualMachineInstanceMigration { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceMigration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachineInstanceMigration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceMigrationCondition) DeepCopyInto(out *VirtualMachineInstanceMigrationCondition) { - *out = *in - in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceMigrationCondition. -func (in *VirtualMachineInstanceMigrationCondition) DeepCopy() *VirtualMachineInstanceMigrationCondition { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceMigrationCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceMigrationList) DeepCopyInto(out *VirtualMachineInstanceMigrationList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]VirtualMachineInstanceMigration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceMigrationList. -func (in *VirtualMachineInstanceMigrationList) DeepCopy() *VirtualMachineInstanceMigrationList { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceMigrationList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachineInstanceMigrationList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceMigrationSpec) DeepCopyInto(out *VirtualMachineInstanceMigrationSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceMigrationSpec. -func (in *VirtualMachineInstanceMigrationSpec) DeepCopy() *VirtualMachineInstanceMigrationSpec { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceMigrationSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceMigrationState) DeepCopyInto(out *VirtualMachineInstanceMigrationState) { - *out = *in - if in.StartTimestamp != nil { - in, out := &in.StartTimestamp, &out.StartTimestamp - if *in == nil { - *out = nil - } else { - *out = (*in).DeepCopy() - } - } - if in.EndTimestamp != nil { - in, out := &in.EndTimestamp, &out.EndTimestamp - if *in == nil { - *out = nil - } else { - *out = (*in).DeepCopy() - } - } - if in.TargetDirectMigrationNodePorts != nil { - in, out := &in.TargetDirectMigrationNodePorts, &out.TargetDirectMigrationNodePorts - *out = make(map[int]int, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceMigrationState. -func (in *VirtualMachineInstanceMigrationState) DeepCopy() *VirtualMachineInstanceMigrationState { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceMigrationState) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceMigrationStatus) DeepCopyInto(out *VirtualMachineInstanceMigrationStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]VirtualMachineInstanceMigrationCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceMigrationStatus. -func (in *VirtualMachineInstanceMigrationStatus) DeepCopy() *VirtualMachineInstanceMigrationStatus { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceMigrationStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceNetworkInterface) DeepCopyInto(out *VirtualMachineInstanceNetworkInterface) { - *out = *in - if in.IPs != nil { - in, out := &in.IPs, &out.IPs - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceNetworkInterface. -func (in *VirtualMachineInstanceNetworkInterface) DeepCopy() *VirtualMachineInstanceNetworkInterface { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceNetworkInterface) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstancePreset) DeepCopyInto(out *VirtualMachineInstancePreset) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstancePreset. -func (in *VirtualMachineInstancePreset) DeepCopy() *VirtualMachineInstancePreset { - if in == nil { - return nil - } - out := new(VirtualMachineInstancePreset) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachineInstancePreset) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstancePresetList) DeepCopyInto(out *VirtualMachineInstancePresetList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]VirtualMachineInstancePreset, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstancePresetList. -func (in *VirtualMachineInstancePresetList) DeepCopy() *VirtualMachineInstancePresetList { - if in == nil { - return nil - } - out := new(VirtualMachineInstancePresetList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachineInstancePresetList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstancePresetSpec) DeepCopyInto(out *VirtualMachineInstancePresetSpec) { - *out = *in - 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) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstancePresetSpec. -func (in *VirtualMachineInstancePresetSpec) DeepCopy() *VirtualMachineInstancePresetSpec { - if in == nil { - return nil - } - out := new(VirtualMachineInstancePresetSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceReplicaSet) DeepCopyInto(out *VirtualMachineInstanceReplicaSet) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceReplicaSet. -func (in *VirtualMachineInstanceReplicaSet) DeepCopy() *VirtualMachineInstanceReplicaSet { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceReplicaSet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachineInstanceReplicaSet) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceReplicaSetCondition) DeepCopyInto(out *VirtualMachineInstanceReplicaSetCondition) { - *out = *in - in.LastProbeTime.DeepCopyInto(&out.LastProbeTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceReplicaSetCondition. -func (in *VirtualMachineInstanceReplicaSetCondition) DeepCopy() *VirtualMachineInstanceReplicaSetCondition { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceReplicaSetCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceReplicaSetList) DeepCopyInto(out *VirtualMachineInstanceReplicaSetList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]VirtualMachineInstanceReplicaSet, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceReplicaSetList. -func (in *VirtualMachineInstanceReplicaSetList) DeepCopy() *VirtualMachineInstanceReplicaSetList { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceReplicaSetList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachineInstanceReplicaSetList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceReplicaSetSpec) DeepCopyInto(out *VirtualMachineInstanceReplicaSetSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.Template != nil { - in, out := &in.Template, &out.Template - if *in == nil { - *out = nil - } else { - *out = new(VirtualMachineInstanceTemplateSpec) - (*in).DeepCopyInto(*out) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceReplicaSetSpec. -func (in *VirtualMachineInstanceReplicaSetSpec) DeepCopy() *VirtualMachineInstanceReplicaSetSpec { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceReplicaSetSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceReplicaSetStatus) DeepCopyInto(out *VirtualMachineInstanceReplicaSetStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]VirtualMachineInstanceReplicaSetCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceReplicaSetStatus. -func (in *VirtualMachineInstanceReplicaSetStatus) DeepCopy() *VirtualMachineInstanceReplicaSetStatus { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceReplicaSetStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceSpec) DeepCopyInto(out *VirtualMachineInstanceSpec) { - *out = *in - in.Domain.DeepCopyInto(&out.Domain) - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Affinity != nil { - in, out := &in.Affinity, &out.Affinity - if *in == nil { - *out = nil - } else { - *out = new(core_v1.Affinity) - (*in).DeepCopyInto(*out) - } - } - if in.Tolerations != nil { - in, out := &in.Tolerations, &out.Tolerations - *out = make([]core_v1.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 - } - } - if in.TerminationGracePeriodSeconds != nil { - in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds - if *in == nil { - *out = nil - } else { - *out = new(int64) - **out = **in - } - } - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]Volume, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.LivenessProbe != nil { - in, out := &in.LivenessProbe, &out.LivenessProbe - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.Networks != nil { - in, out := &in.Networks, &out.Networks - *out = make([]Network, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.DNSConfig != nil { - in, out := &in.DNSConfig, &out.DNSConfig - if *in == nil { - *out = nil - } else { - *out = new(core_v1.PodDNSConfig) - (*in).DeepCopyInto(*out) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceSpec. -func (in *VirtualMachineInstanceSpec) DeepCopy() *VirtualMachineInstanceSpec { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceStatus) DeepCopyInto(out *VirtualMachineInstanceStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]VirtualMachineInstanceCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Interfaces != nil { - in, out := &in.Interfaces, &out.Interfaces - *out = make([]VirtualMachineInstanceNetworkInterface, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.MigrationState != nil { - in, out := &in.MigrationState, &out.MigrationState - if *in == nil { - *out = nil - } else { - *out = new(VirtualMachineInstanceMigrationState) - (*in).DeepCopyInto(*out) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceStatus. -func (in *VirtualMachineInstanceStatus) DeepCopy() *VirtualMachineInstanceStatus { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceTemplateSpec) DeepCopyInto(out *VirtualMachineInstanceTemplateSpec) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceTemplateSpec. -func (in *VirtualMachineInstanceTemplateSpec) DeepCopy() *VirtualMachineInstanceTemplateSpec { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineList) DeepCopyInto(out *VirtualMachineList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]VirtualMachine, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineList. -func (in *VirtualMachineList) DeepCopy() *VirtualMachineList { - if in == nil { - return nil - } - out := new(VirtualMachineList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachineList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - if in.RunStrategy != nil { - in, out := &in.RunStrategy, &out.RunStrategy - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.DataVolumeTemplates != nil { - in, out := &in.DataVolumeTemplates, &out.DataVolumeTemplates - *out = make([]v1alpha1.DataVolume, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineSpec. -func (in *VirtualMachineSpec) DeepCopy() *VirtualMachineSpec { - if in == nil { - return nil - } - out := new(VirtualMachineSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineStateChangeRequest) DeepCopyInto(out *VirtualMachineStateChangeRequest) { - *out = *in - if in.UID != nil { - in, out := &in.UID, &out.UID - if *in == nil { - *out = nil - } else { - *out = new(types.UID) - **out = **in - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineStateChangeRequest. -func (in *VirtualMachineStateChangeRequest) DeepCopy() *VirtualMachineStateChangeRequest { - if in == nil { - return nil - } - out := new(VirtualMachineStateChangeRequest) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineStatus) DeepCopyInto(out *VirtualMachineStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]VirtualMachineCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.StateChangeRequests != nil { - in, out := &in.StateChangeRequests, &out.StateChangeRequests - *out = make([]VirtualMachineStateChangeRequest, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineStatus. -func (in *VirtualMachineStatus) DeepCopy() *VirtualMachineStatus { - if in == nil { - return nil - } - out := new(VirtualMachineStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Volume) DeepCopyInto(out *Volume) { - *out = *in - in.VolumeSource.DeepCopyInto(&out.VolumeSource) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Volume. -func (in *Volume) DeepCopy() *Volume { - if in == nil { - return nil - } - out := new(Volume) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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) - } - } - if in.PersistentVolumeClaim != nil { - in, out := &in.PersistentVolumeClaim, &out.PersistentVolumeClaim - if *in == nil { - *out = nil - } else { - *out = new(core_v1.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) - } - } - if in.CloudInitConfigDrive != nil { - in, out := &in.CloudInitConfigDrive, &out.CloudInitConfigDrive - if *in == nil { - *out = nil - } else { - *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 - } - } - if in.Ephemeral != nil { - in, out := &in.Ephemeral, &out.Ephemeral - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.DataVolume != nil { - in, out := &in.DataVolume, &out.DataVolume - if *in == nil { - *out = nil - } else { - *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) - } - } - if in.Secret != nil { - in, out := &in.Secret, &out.Secret - if *in == nil { - *out = nil - } else { - *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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSource. -func (in *VolumeSource) DeepCopy() *VolumeSource { - if in == nil { - return nil - } - out := new(VolumeSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Watchdog) DeepCopyInto(out *Watchdog) { - *out = *in - in.WatchdogDevice.DeepCopyInto(&out.WatchdogDevice) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Watchdog. -func (in *Watchdog) DeepCopy() *Watchdog { - if in == nil { - return nil - } - out := new(Watchdog) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WatchdogDevice. -func (in *WatchdogDevice) DeepCopy() *WatchdogDevice { - if in == nil { - return nil - } - out := new(WatchdogDevice) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/kubevirt.io/client-go/api/v1/defaults.go b/vendor/kubevirt.io/client-go/api/v1/defaults.go deleted file mode 100644 index e178fb88069d..000000000000 --- a/vendor/kubevirt.io/client-go/api/v1/defaults.go +++ /dev/null @@ -1,195 +0,0 @@ -package v1 - -import ( - "github.com/pborman/uuid" - "k8s.io/apimachinery/pkg/types" -) - -var _true = t(true) -var _false = t(false) - -func SetDefaults_HPETTimer(obj *HPETTimer) { - if obj.Enabled == nil { - obj.Enabled = _true - } -} - -func SetDefaults_PITTimer(obj *PITTimer) { - if obj.Enabled == nil { - obj.Enabled = _true - } -} - -func SetDefaults_KVMTimer(obj *KVMTimer) { - if obj.Enabled == nil { - obj.Enabled = _true - } -} - -func SetDefaults_HypervTimer(obj *HypervTimer) { - if obj.Enabled == nil { - obj.Enabled = _true - } -} - -func SetDefaults_RTCTimer(obj *RTCTimer) { - if obj.Enabled == nil { - obj.Enabled = _true - } -} - -func SetDefaults_FeatureState(obj *FeatureState) { - if obj.Enabled == nil { - obj.Enabled = _true - } -} - -func SetDefaults_FeatureAPIC(obj *FeatureAPIC) { - if obj.Enabled == nil { - obj.Enabled = _true - } -} - -func SetDefaults_FeatureVendorID(obj *FeatureVendorID) { - if obj.Enabled == nil { - obj.Enabled = _true - } -} - -func SetDefaults_DiskDevice(obj *DiskDevice) { - if obj.Disk == nil && - obj.CDRom == nil && - obj.Floppy == nil && - obj.LUN == nil { - obj.Disk = &DiskTarget{} - } -} - -func SetDefaults_Watchdog(obj *Watchdog) { - if obj.I6300ESB == nil { - obj.I6300ESB = &I6300ESBWatchdog{} - } -} - -func SetDefaults_CDRomTarget(obj *CDRomTarget) { - if obj.ReadOnly == nil { - obj.ReadOnly = _true - } - if obj.Tray == "" { - obj.Tray = TrayStateClosed - } -} - -func SetDefaults_FloppyTarget(obj *FloppyTarget) { - if obj.Tray == "" { - obj.Tray = TrayStateClosed - } -} - -func SetDefaults_FeatureSpinlocks(obj *FeatureSpinlocks) { - if obj.Enabled == nil { - obj.Enabled = _true - } - if *obj.Enabled == *_true && obj.Retries == nil { - obj.Retries = ui32(4096) - } -} - -func SetDefaults_I6300ESBWatchdog(obj *I6300ESBWatchdog) { - if obj.Action == "" { - obj.Action = WatchdogActionReset - } -} - -func SetDefaults_Firmware(obj *Firmware) { - if obj.UUID == "" { - obj.UUID = types.UID(uuid.NewRandom().String()) - } -} - -func SetDefaults_VirtualMachineInstance(obj *VirtualMachineInstance) { - if obj.Spec.Domain.Firmware == nil { - obj.Spec.Domain.Firmware = &Firmware{} - } - - if obj.Spec.Domain.Features == nil { - obj.Spec.Domain.Features = &Features{} - } - - setDefaults_Disk(obj) - SetDefaults_NetworkInterface(obj) -} - -func setDefaults_Disk(obj *VirtualMachineInstance) { - // Setting SATA as the default bus since it is typically supported out of the box by - // guest operating systems (we support only q35 and therefore IDE is not supported) - // TODO: consider making this OS-specific (VIRTIO for linux, SATA for others) - bus := "sata" - - for i := range obj.Spec.Domain.Devices.Disks { - disk := &obj.Spec.Domain.Devices.Disks[i].DiskDevice - - SetDefaults_DiskDevice(disk) - - if disk.Disk != nil && disk.Disk.Bus == "" { - disk.Disk.Bus = bus - } - if disk.CDRom != nil && disk.CDRom.Bus == "" { - disk.CDRom.Bus = bus - } - if disk.LUN != nil && disk.LUN.Bus == "" { - disk.LUN.Bus = bus - } - } -} - -func SetDefaults_NetworkInterface(obj *VirtualMachineInstance) { - autoAttach := obj.Spec.Domain.Devices.AutoattachPodInterface - if autoAttach != nil && *autoAttach == false { - return - } - - // Override only when nothing is specified - if len(obj.Spec.Networks) == 0 { - obj.Spec.Domain.Devices.Interfaces = []Interface{*DefaultNetworkInterface()} - obj.Spec.Networks = []Network{*DefaultPodNetwork()} - } -} - -func DefaultNetworkInterface() *Interface { - iface := &Interface{ - Name: "default", - InterfaceBindingMethod: InterfaceBindingMethod{ - Bridge: &InterfaceBridge{}, - }, - } - return iface -} - -func DefaultSlirpNetworkInterface() *Interface { - iface := &Interface{ - Name: "default", - InterfaceBindingMethod: InterfaceBindingMethod{ - Slirp: &InterfaceSlirp{}, - }, - } - return iface -} - -func DefaultPodNetwork() *Network { - defaultNet := &Network{ - Name: "default", - NetworkSource: NetworkSource{ - Pod: &PodNetwork{}, - }, - } - return defaultNet -} - -func t(v bool) *bool { - return &v -} - -func ui32(v uint32) *uint32 { - return &v -} diff --git a/vendor/kubevirt.io/client-go/api/v1/doc.go b/vendor/kubevirt.io/client-go/api/v1/doc.go deleted file mode 100644 index eacf13d30565..000000000000 --- a/vendor/kubevirt.io/client-go/api/v1/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// +k8s:deepcopy-gen=package -// +k8s:defaulter-gen=TypeMeta - -package v1 diff --git a/vendor/kubevirt.io/client-go/api/v1/openapi_generated.go b/vendor/kubevirt.io/client-go/api/v1/openapi_generated.go deleted file mode 100644 index 90a63b26c64b..000000000000 --- a/vendor/kubevirt.io/client-go/api/v1/openapi_generated.go +++ /dev/null @@ -1,3697 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2019 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. -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. -*/ - -// Code generated by openapi-gen. DO NOT EDIT. - -// This file was autogenerated by openapi-gen. Do not edit it manually! - -package v1 - -import ( - spec "github.com/go-openapi/spec" - common "k8s.io/kube-openapi/pkg/common" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "kubevirt.io/kubevirt/pkg/api/v1.BIOS": schema_kubevirt_pkg_api_v1_BIOS(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Bootloader": schema_kubevirt_pkg_api_v1_Bootloader(ref), - "kubevirt.io/kubevirt/pkg/api/v1.CDRomTarget": schema_kubevirt_pkg_api_v1_CDRomTarget(ref), - "kubevirt.io/kubevirt/pkg/api/v1.CPU": schema_kubevirt_pkg_api_v1_CPU(ref), - "kubevirt.io/kubevirt/pkg/api/v1.CPUFeature": schema_kubevirt_pkg_api_v1_CPUFeature(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Clock": schema_kubevirt_pkg_api_v1_Clock(ref), - "kubevirt.io/kubevirt/pkg/api/v1.ClockOffset": schema_kubevirt_pkg_api_v1_ClockOffset(ref), - "kubevirt.io/kubevirt/pkg/api/v1.ClockOffsetUTC": schema_kubevirt_pkg_api_v1_ClockOffsetUTC(ref), - "kubevirt.io/kubevirt/pkg/api/v1.CloudInitConfigDriveSource": schema_kubevirt_pkg_api_v1_CloudInitConfigDriveSource(ref), - "kubevirt.io/kubevirt/pkg/api/v1.CloudInitNoCloudSource": schema_kubevirt_pkg_api_v1_CloudInitNoCloudSource(ref), - "kubevirt.io/kubevirt/pkg/api/v1.ConfigMapVolumeSource": schema_kubevirt_pkg_api_v1_ConfigMapVolumeSource(ref), - "kubevirt.io/kubevirt/pkg/api/v1.ContainerDiskSource": schema_kubevirt_pkg_api_v1_ContainerDiskSource(ref), - "kubevirt.io/kubevirt/pkg/api/v1.DHCPOptions": schema_kubevirt_pkg_api_v1_DHCPOptions(ref), - "kubevirt.io/kubevirt/pkg/api/v1.DataVolumeSource": schema_kubevirt_pkg_api_v1_DataVolumeSource(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Devices": schema_kubevirt_pkg_api_v1_Devices(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Disk": schema_kubevirt_pkg_api_v1_Disk(ref), - "kubevirt.io/kubevirt/pkg/api/v1.DiskDevice": schema_kubevirt_pkg_api_v1_DiskDevice(ref), - "kubevirt.io/kubevirt/pkg/api/v1.DiskTarget": schema_kubevirt_pkg_api_v1_DiskTarget(ref), - "kubevirt.io/kubevirt/pkg/api/v1.DomainSpec": schema_kubevirt_pkg_api_v1_DomainSpec(ref), - "kubevirt.io/kubevirt/pkg/api/v1.EFI": schema_kubevirt_pkg_api_v1_EFI(ref), - "kubevirt.io/kubevirt/pkg/api/v1.EmptyDiskSource": schema_kubevirt_pkg_api_v1_EmptyDiskSource(ref), - "kubevirt.io/kubevirt/pkg/api/v1.EphemeralVolumeSource": schema_kubevirt_pkg_api_v1_EphemeralVolumeSource(ref), - "kubevirt.io/kubevirt/pkg/api/v1.FeatureAPIC": schema_kubevirt_pkg_api_v1_FeatureAPIC(ref), - "kubevirt.io/kubevirt/pkg/api/v1.FeatureHyperv": schema_kubevirt_pkg_api_v1_FeatureHyperv(ref), - "kubevirt.io/kubevirt/pkg/api/v1.FeatureSpinlocks": schema_kubevirt_pkg_api_v1_FeatureSpinlocks(ref), - "kubevirt.io/kubevirt/pkg/api/v1.FeatureState": schema_kubevirt_pkg_api_v1_FeatureState(ref), - "kubevirt.io/kubevirt/pkg/api/v1.FeatureVendorID": schema_kubevirt_pkg_api_v1_FeatureVendorID(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Features": schema_kubevirt_pkg_api_v1_Features(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Firmware": schema_kubevirt_pkg_api_v1_Firmware(ref), - "kubevirt.io/kubevirt/pkg/api/v1.FloppyTarget": schema_kubevirt_pkg_api_v1_FloppyTarget(ref), - "kubevirt.io/kubevirt/pkg/api/v1.GenieNetwork": schema_kubevirt_pkg_api_v1_GenieNetwork(ref), - "kubevirt.io/kubevirt/pkg/api/v1.HPETTimer": schema_kubevirt_pkg_api_v1_HPETTimer(ref), - "kubevirt.io/kubevirt/pkg/api/v1.HostDisk": schema_kubevirt_pkg_api_v1_HostDisk(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Hugepages": schema_kubevirt_pkg_api_v1_Hugepages(ref), - "kubevirt.io/kubevirt/pkg/api/v1.HypervTimer": schema_kubevirt_pkg_api_v1_HypervTimer(ref), - "kubevirt.io/kubevirt/pkg/api/v1.I6300ESBWatchdog": schema_kubevirt_pkg_api_v1_I6300ESBWatchdog(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Input": schema_kubevirt_pkg_api_v1_Input(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Interface": schema_kubevirt_pkg_api_v1_Interface(ref), - "kubevirt.io/kubevirt/pkg/api/v1.InterfaceBindingMethod": schema_kubevirt_pkg_api_v1_InterfaceBindingMethod(ref), - "kubevirt.io/kubevirt/pkg/api/v1.InterfaceBridge": schema_kubevirt_pkg_api_v1_InterfaceBridge(ref), - "kubevirt.io/kubevirt/pkg/api/v1.InterfaceMasquerade": schema_kubevirt_pkg_api_v1_InterfaceMasquerade(ref), - "kubevirt.io/kubevirt/pkg/api/v1.InterfaceSRIOV": schema_kubevirt_pkg_api_v1_InterfaceSRIOV(ref), - "kubevirt.io/kubevirt/pkg/api/v1.InterfaceSlirp": schema_kubevirt_pkg_api_v1_InterfaceSlirp(ref), - "kubevirt.io/kubevirt/pkg/api/v1.KVMTimer": schema_kubevirt_pkg_api_v1_KVMTimer(ref), - "kubevirt.io/kubevirt/pkg/api/v1.KubeVirt": schema_kubevirt_pkg_api_v1_KubeVirt(ref), - "kubevirt.io/kubevirt/pkg/api/v1.KubeVirtCondition": schema_kubevirt_pkg_api_v1_KubeVirtCondition(ref), - "kubevirt.io/kubevirt/pkg/api/v1.KubeVirtList": schema_kubevirt_pkg_api_v1_KubeVirtList(ref), - "kubevirt.io/kubevirt/pkg/api/v1.KubeVirtSpec": schema_kubevirt_pkg_api_v1_KubeVirtSpec(ref), - "kubevirt.io/kubevirt/pkg/api/v1.KubeVirtStatus": schema_kubevirt_pkg_api_v1_KubeVirtStatus(ref), - "kubevirt.io/kubevirt/pkg/api/v1.LunTarget": schema_kubevirt_pkg_api_v1_LunTarget(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Machine": schema_kubevirt_pkg_api_v1_Machine(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Memory": schema_kubevirt_pkg_api_v1_Memory(ref), - "kubevirt.io/kubevirt/pkg/api/v1.MultusNetwork": schema_kubevirt_pkg_api_v1_MultusNetwork(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Network": schema_kubevirt_pkg_api_v1_Network(ref), - "kubevirt.io/kubevirt/pkg/api/v1.NetworkSource": schema_kubevirt_pkg_api_v1_NetworkSource(ref), - "kubevirt.io/kubevirt/pkg/api/v1.PITTimer": schema_kubevirt_pkg_api_v1_PITTimer(ref), - "kubevirt.io/kubevirt/pkg/api/v1.PodNetwork": schema_kubevirt_pkg_api_v1_PodNetwork(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Port": schema_kubevirt_pkg_api_v1_Port(ref), - "kubevirt.io/kubevirt/pkg/api/v1.RTCTimer": schema_kubevirt_pkg_api_v1_RTCTimer(ref), - "kubevirt.io/kubevirt/pkg/api/v1.ResourceRequirements": schema_kubevirt_pkg_api_v1_ResourceRequirements(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Rng": schema_kubevirt_pkg_api_v1_Rng(ref), - "kubevirt.io/kubevirt/pkg/api/v1.SecretVolumeSource": schema_kubevirt_pkg_api_v1_SecretVolumeSource(ref), - "kubevirt.io/kubevirt/pkg/api/v1.ServiceAccountVolumeSource": schema_kubevirt_pkg_api_v1_ServiceAccountVolumeSource(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Timer": schema_kubevirt_pkg_api_v1_Timer(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachine": schema_kubevirt_pkg_api_v1_VirtualMachine(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineCondition": schema_kubevirt_pkg_api_v1_VirtualMachineCondition(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstance": schema_kubevirt_pkg_api_v1_VirtualMachineInstance(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceCondition": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceCondition(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceList": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceList(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigration": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceMigration(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigrationCondition": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceMigrationCondition(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigrationList": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceMigrationList(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigrationSpec": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceMigrationSpec(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigrationStatus": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceMigrationStatus(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceNetworkInterface": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceNetworkInterface(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstancePreset": schema_kubevirt_pkg_api_v1_VirtualMachineInstancePreset(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstancePresetList": schema_kubevirt_pkg_api_v1_VirtualMachineInstancePresetList(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstancePresetSpec": schema_kubevirt_pkg_api_v1_VirtualMachineInstancePresetSpec(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSet": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceReplicaSet(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSetCondition": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceReplicaSetCondition(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSetList": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceReplicaSetList(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSetSpec": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceReplicaSetSpec(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSetStatus": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceReplicaSetStatus(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceSpec": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceSpec(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceStatus": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceStatus(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceTemplateSpec": schema_kubevirt_pkg_api_v1_VirtualMachineInstanceTemplateSpec(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineList": schema_kubevirt_pkg_api_v1_VirtualMachineList(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineSpec": schema_kubevirt_pkg_api_v1_VirtualMachineSpec(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineStatus": schema_kubevirt_pkg_api_v1_VirtualMachineStatus(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Volume": schema_kubevirt_pkg_api_v1_Volume(ref), - "kubevirt.io/kubevirt/pkg/api/v1.VolumeSource": schema_kubevirt_pkg_api_v1_VolumeSource(ref), - "kubevirt.io/kubevirt/pkg/api/v1.Watchdog": schema_kubevirt_pkg_api_v1_Watchdog(ref), - "kubevirt.io/kubevirt/pkg/api/v1.WatchdogDevice": schema_kubevirt_pkg_api_v1_WatchdogDevice(ref), - } -} - -func schema_kubevirt_pkg_api_v1_BIOS(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "If set (default), BIOS will be used.", - Properties: map[string]spec.Schema{}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_Bootloader(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the firmware blob used to assist in the domain creation process. Used for setting the QEMU BIOS file path for the libvirt domain.", - Properties: map[string]spec.Schema{ - "bios": { - SchemaProps: spec.SchemaProps{ - Description: "If set (default), BIOS will be used.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.BIOS"), - }, - }, - "efi": { - SchemaProps: spec.SchemaProps{ - Description: "If set, EFI will be used instead of BIOS.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.EFI"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.BIOS", "kubevirt.io/kubevirt/pkg/api/v1.EFI"}, - } -} - -func schema_kubevirt_pkg_api_v1_CDRomTarget(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "bus": { - SchemaProps: spec.SchemaProps{ - Description: "Bus indicates the type of disk device to emulate. supported values: virtio, sata, scsi.", - Type: []string{"string"}, - Format: "", - }, - }, - "readonly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "tray": { - SchemaProps: spec.SchemaProps{ - Description: "Tray indicates if the tray of the device is open or closed. Allowed values are \"open\" and \"closed\". Defaults to closed.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_CPU(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CPU allows specifying the CPU topology.", - Properties: map[string]spec.Schema{ - "cores": { - SchemaProps: spec.SchemaProps{ - Description: "Cores specifies the number of cores inside the vmi. Must be a value greater or equal 1.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "sockets": { - SchemaProps: spec.SchemaProps{ - Description: "Sockets specifies the number of sockets inside the vmi. Must be a value greater or equal 1.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "threads": { - SchemaProps: spec.SchemaProps{ - Description: "Threads specifies the number of threads inside the vmi. Must be a value greater or equal 1.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "model": { - SchemaProps: spec.SchemaProps{ - Description: "Model specifies the CPU model inside the VMI. List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map. It is possible to specify special cases like \"host-passthrough\" to get the same CPU as the node and \"host-model\" to get CPU closest to the node one. Defaults to host-model.", - Type: []string{"string"}, - Format: "", - }, - }, - "features": { - SchemaProps: spec.SchemaProps{ - Description: "Features specifies the CPU features list inside the VMI.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.CPUFeature"), - }, - }, - }, - }, - }, - "dedicatedCpuPlacement": { - SchemaProps: spec.SchemaProps{ - Description: "DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node with enough dedicated pCPUs and pin the vCPUs to it.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.CPUFeature"}, - } -} - -func schema_kubevirt_pkg_api_v1_CPUFeature(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CPUFeature allows specifying a CPU feature.", - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the CPU feature", - Type: []string{"string"}, - Format: "", - }, - }, - "policy": { - SchemaProps: spec.SchemaProps{ - Description: "Policy is the CPU feature attribute which can have the following attributes: force - The virtual CPU will claim the feature is supported regardless of it being supported by host CPU. require - Guest creation will fail unless the feature is supported by the host CPU or the hypervisor is able to emulate it. optional - The feature will be supported by virtual CPU if and only if it is supported by host CPU. disable - The feature will not be supported by virtual CPU. forbid - Guest creation will fail if the feature is supported by host CPU. Defaults to require", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_Clock(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the clock and timers of a vmi.", - Properties: map[string]spec.Schema{ - "utc": { - SchemaProps: spec.SchemaProps{ - Description: "UTC sets the guest clock to UTC on each boot. If an offset is specified, guest changes to the clock will be kept during reboots and are not reset.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.ClockOffsetUTC"), - }, - }, - "timezone": { - SchemaProps: spec.SchemaProps{ - Description: "Timezone sets the guest clock to the specified timezone. Zone name follows the TZ environment variable format (e.g. 'America/New_York').", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.ClockOffsetUTC"}, - } -} - -func schema_kubevirt_pkg_api_v1_ClockOffset(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Exactly one of its members must be set.", - Properties: map[string]spec.Schema{ - "utc": { - SchemaProps: spec.SchemaProps{ - Description: "UTC sets the guest clock to UTC on each boot. If an offset is specified, guest changes to the clock will be kept during reboots and are not reset.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.ClockOffsetUTC"), - }, - }, - "timezone": { - SchemaProps: spec.SchemaProps{ - Description: "Timezone sets the guest clock to the specified timezone. Zone name follows the TZ environment variable format (e.g. 'America/New_York').", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.ClockOffsetUTC"}, - } -} - -func schema_kubevirt_pkg_api_v1_ClockOffsetUTC(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UTC sets the guest clock to UTC on each boot.", - Properties: map[string]spec.Schema{ - "offsetSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "OffsetSeconds specifies an offset in seconds, relative to UTC. If set, guest changes to the clock will be kept during reboots and not reset.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_CloudInitConfigDriveSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a cloud-init config drive user data source. More info: https://cloudinit.readthedocs.io/en/latest/topics/datasources/configdrive.html", - Properties: map[string]spec.Schema{ - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "UserDataSecretRef references a k8s secret that contains config drive userdata.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "userDataBase64": { - SchemaProps: spec.SchemaProps{ - Description: "UserDataBase64 contains config drive cloud-init userdata as a base64 encoded string.", - Type: []string{"string"}, - Format: "", - }, - }, - "userData": { - SchemaProps: spec.SchemaProps{ - Description: "UserData contains config drive inline cloud-init userdata.", - Type: []string{"string"}, - Format: "", - }, - }, - "networkDataSecretRef": { - SchemaProps: spec.SchemaProps{ - Description: "NetworkDataSecretRef references a k8s secret that contains config drive networkdata.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "networkDataBase64": { - SchemaProps: spec.SchemaProps{ - Description: "NetworkDataBase64 contains config drive cloud-init networkdata as a base64 encoded string.", - Type: []string{"string"}, - Format: "", - }, - }, - "networkData": { - SchemaProps: spec.SchemaProps{ - Description: "NetworkData contains config drive inline cloud-init networkdata.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_kubevirt_pkg_api_v1_CloudInitNoCloudSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a cloud-init nocloud user data source. More info: http://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html", - Properties: map[string]spec.Schema{ - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "UserDataSecretRef references a k8s secret that contains NoCloud userdata.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "userDataBase64": { - SchemaProps: spec.SchemaProps{ - Description: "UserDataBase64 contains NoCloud cloud-init userdata as a base64 encoded string.", - Type: []string{"string"}, - Format: "", - }, - }, - "userData": { - SchemaProps: spec.SchemaProps{ - Description: "UserData contains NoCloud inline cloud-init userdata.", - Type: []string{"string"}, - Format: "", - }, - }, - "networkDataSecretRef": { - SchemaProps: spec.SchemaProps{ - Description: "NetworkDataSecretRef references a k8s secret that contains NoCloud networkdata.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "networkDataBase64": { - SchemaProps: spec.SchemaProps{ - Description: "NetworkDataBase64 contains NoCloud cloud-init networkdata as a base64 encoded string.", - Type: []string{"string"}, - Format: "", - }, - }, - "networkData": { - SchemaProps: spec.SchemaProps{ - Description: "NetworkData contains NoCloud inline cloud-init networkdata.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_kubevirt_pkg_api_v1_ConfigMapVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ConfigMapVolumeSource adapts a ConfigMap into a volume. More info: https://kubernetes.io/docs/concepts/storage/volumes/#configmap", - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the ConfigMap or it's keys must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_ContainerDiskSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a docker image with an embedded disk.", - Properties: map[string]spec.Schema{ - "image": { - SchemaProps: spec.SchemaProps{ - Description: "Image is the name of the image with the embedded disk.", - Type: []string{"string"}, - Format: "", - }, - }, - "imagePullSecret": { - SchemaProps: spec.SchemaProps{ - Description: "ImagePullSecret is the name of the Docker registry secret required to pull the image. The secret must already exist.", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path defines the path to disk file in the container", - Type: []string{"string"}, - Format: "", - }, - }, - "imagePullPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"image"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_DHCPOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Extra DHCP options to use in the interface.", - Properties: map[string]spec.Schema{ - "bootFileName": { - SchemaProps: spec.SchemaProps{ - Description: "If specified will pass option 67 to interface's DHCP server", - Type: []string{"string"}, - Format: "", - }, - }, - "tftpServerName": { - SchemaProps: spec.SchemaProps{ - Description: "If specified will pass option 66 to interface's DHCP server", - Type: []string{"string"}, - Format: "", - }, - }, - "ntpServers": { - SchemaProps: spec.SchemaProps{ - Description: "If specified will pass the configured NTP server to the VM via DHCP option 042.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "privateOptions": { - SchemaProps: spec.SchemaProps{ - Description: "If specified will pass extra DHCP options for private use, range: 224-254", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.DHCPPrivateOptions"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.DHCPPrivateOptions"}, - } -} - -func schema_kubevirt_pkg_api_v1_DataVolumeSource(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 represents the name of the DataVolume in the same namespace", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_Devices(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "disks": { - SchemaProps: spec.SchemaProps{ - Description: "Disks describes disks, cdroms, floppy and luns which are connected to the vmi.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Disk"), - }, - }, - }, - }, - }, - "watchdog": { - SchemaProps: spec.SchemaProps{ - Description: "Watchdog describes a watchdog device which can be added to the vmi.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Watchdog"), - }, - }, - "interfaces": { - SchemaProps: spec.SchemaProps{ - Description: "Interfaces describe network interfaces which are added to the vmi.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Interface"), - }, - }, - }, - }, - }, - "inputs": { - SchemaProps: spec.SchemaProps{ - Description: "Inputs describe input devices", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Input"), - }, - }, - }, - }, - }, - "autoattachPodInterface": { - SchemaProps: spec.SchemaProps{ - Description: "Whether to attach a pod network interface. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "autoattachGraphicsDevice": { - SchemaProps: spec.SchemaProps{ - Description: "Whether to attach the default graphics device or not. VNC will not be available if set to false. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "rng": { - SchemaProps: spec.SchemaProps{ - Description: "Whether to have random number generator from host", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Rng"), - }, - }, - "blockMultiQueue": { - SchemaProps: spec.SchemaProps{ - Description: "Whether or not to enable virtio multi-queue for block devices", - Type: []string{"boolean"}, - Format: "", - }, - }, - "networkInterfaceMultiqueue": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, virtual network interfaces configured with a virtio bus will also enable the vhost multiqueue feature", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.Disk", "kubevirt.io/kubevirt/pkg/api/v1.Input", "kubevirt.io/kubevirt/pkg/api/v1.Interface", "kubevirt.io/kubevirt/pkg/api/v1.Rng", "kubevirt.io/kubevirt/pkg/api/v1.Watchdog"}, - } -} - -func schema_kubevirt_pkg_api_v1_Disk(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 is the device name", - Type: []string{"string"}, - Format: "", - }, - }, - "disk": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a disk to the vmi.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.DiskTarget"), - }, - }, - "lun": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a LUN to the vmi.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.LunTarget"), - }, - }, - "floppy": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a floppy to the vmi.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FloppyTarget"), - }, - }, - "cdrom": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a cdrom to the vmi.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.CDRomTarget"), - }, - }, - "bootOrder": { - SchemaProps: spec.SchemaProps{ - Description: "BootOrder is an integer value > 0, used to determine ordering of boot devices. Lower values take precedence. Each disk or interface that has a boot order must have a unique value. Disks without a boot order are not tried if a disk with a boot order exists.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "serial": { - SchemaProps: spec.SchemaProps{ - Description: "Serial provides the ability to specify a serial number for the disk device.", - Type: []string{"string"}, - Format: "", - }, - }, - "dedicatedIOThread": { - SchemaProps: spec.SchemaProps{ - Description: "dedicatedIOThread indicates this disk should have an exclusive IO Thread. Enabling this implies useIOThreads = true. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "cache": { - SchemaProps: spec.SchemaProps{ - Description: "Cache specifies which kvm disk cache mode should be used.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.CDRomTarget", "kubevirt.io/kubevirt/pkg/api/v1.DiskTarget", "kubevirt.io/kubevirt/pkg/api/v1.FloppyTarget", "kubevirt.io/kubevirt/pkg/api/v1.LunTarget"}, - } -} - -func schema_kubevirt_pkg_api_v1_DiskDevice(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the target of a volume to mount. Only one of its members may be specified.", - Properties: map[string]spec.Schema{ - "disk": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a disk to the vmi.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.DiskTarget"), - }, - }, - "lun": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a LUN to the vmi.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.LunTarget"), - }, - }, - "floppy": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a floppy to the vmi.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FloppyTarget"), - }, - }, - "cdrom": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a cdrom to the vmi.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.CDRomTarget"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.CDRomTarget", "kubevirt.io/kubevirt/pkg/api/v1.DiskTarget", "kubevirt.io/kubevirt/pkg/api/v1.FloppyTarget", "kubevirt.io/kubevirt/pkg/api/v1.LunTarget"}, - } -} - -func schema_kubevirt_pkg_api_v1_DiskTarget(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "bus": { - SchemaProps: spec.SchemaProps{ - Description: "Bus indicates the type of disk device to emulate. supported values: virtio, sata, scsi.", - Type: []string{"string"}, - Format: "", - }, - }, - "readonly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "pciAddress": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the virtual disk will be placed on the guests pci address with the specifed PCI address. For example: 0000:81:01.10", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_DomainSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "resources": { - SchemaProps: spec.SchemaProps{ - Description: "Resources describes the Compute Resources required by this vmi.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.ResourceRequirements"), - }, - }, - "cpu": { - SchemaProps: spec.SchemaProps{ - Description: "CPU allow specified the detailed CPU topology inside the vmi.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.CPU"), - }, - }, - "memory": { - SchemaProps: spec.SchemaProps{ - Description: "Memory allow specifying the VMI memory features.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Memory"), - }, - }, - "machine": { - SchemaProps: spec.SchemaProps{ - Description: "Machine type.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Machine"), - }, - }, - "firmware": { - SchemaProps: spec.SchemaProps{ - Description: "Firmware.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Firmware"), - }, - }, - "clock": { - SchemaProps: spec.SchemaProps{ - Description: "Clock sets the clock and timers of the vmi.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Clock"), - }, - }, - "features": { - SchemaProps: spec.SchemaProps{ - Description: "Features like acpi, apic, hyperv, smm.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Features"), - }, - }, - "devices": { - SchemaProps: spec.SchemaProps{ - Description: "Devices allows adding disks, network interfaces, ...", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Devices"), - }, - }, - "ioThreadsPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Controls whether or not disks will share IOThreads. Omitting IOThreadsPolicy disables use of IOThreads. One of: shared, auto", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"devices"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.CPU", "kubevirt.io/kubevirt/pkg/api/v1.Clock", "kubevirt.io/kubevirt/pkg/api/v1.Devices", "kubevirt.io/kubevirt/pkg/api/v1.Features", "kubevirt.io/kubevirt/pkg/api/v1.Firmware", "kubevirt.io/kubevirt/pkg/api/v1.Machine", "kubevirt.io/kubevirt/pkg/api/v1.Memory", "kubevirt.io/kubevirt/pkg/api/v1.ResourceRequirements"}, - } -} - -func schema_kubevirt_pkg_api_v1_EFI(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "If set, EFI will be used instead of BIOS.", - Properties: map[string]spec.Schema{}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_EmptyDiskSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EmptyDisk represents a temporary disk which shares the vmis lifecycle.", - Properties: map[string]spec.Schema{ - "capacity": { - SchemaProps: spec.SchemaProps{ - Description: "Capacity of the sparse disk.", - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - Required: []string{"capacity"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_kubevirt_pkg_api_v1_EphemeralVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "persistentVolumeClaim": { - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. Directly attached to the vmi via qemu. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource"}, - } -} - -func schema_kubevirt_pkg_api_v1_FeatureAPIC(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "enabled": { - SchemaProps: spec.SchemaProps{ - Description: "Enabled determines if the feature should be enabled or disabled on the guest. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "endOfInterrupt": { - SchemaProps: spec.SchemaProps{ - Description: "EndOfInterrupt enables the end of interrupt notification in the guest. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_FeatureHyperv(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Hyperv specific features.", - Properties: map[string]spec.Schema{ - "relaxed": { - SchemaProps: spec.SchemaProps{ - Description: "Relaxed instructs the guest OS to disable watchdog timeouts. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - "vapic": { - SchemaProps: spec.SchemaProps{ - Description: "VAPIC improves the paravirtualized handling of interrupts. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - "spinlocks": { - SchemaProps: spec.SchemaProps{ - Description: "Spinlocks allows to configure the spinlock retry attempts.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureSpinlocks"), - }, - }, - "vpindex": { - SchemaProps: spec.SchemaProps{ - Description: "VPIndex enables the Virtual Processor Index to help windows identifying virtual processors. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - "runtime": { - SchemaProps: spec.SchemaProps{ - Description: "Runtime improves the time accounting to improve scheduling in the guest. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - "synic": { - SchemaProps: spec.SchemaProps{ - Description: "SyNIC enables the Synthetic Interrupt Controller. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - "synictimer": { - SchemaProps: spec.SchemaProps{ - Description: "SyNICTimer enables Synthetic Interrupt Controller Timers, reducing CPU load. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - "reset": { - SchemaProps: spec.SchemaProps{ - Description: "Reset enables Hyperv reboot/reset for the vmi. Requires synic. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - "vendorid": { - SchemaProps: spec.SchemaProps{ - Description: "VendorID allows setting the hypervisor vendor id. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureVendorID"), - }, - }, - "frequencies": { - SchemaProps: spec.SchemaProps{ - Description: "Frequencies improves the TSC clock source handling for Hyper-V on KVM. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - "reenlightenment": { - SchemaProps: spec.SchemaProps{ - Description: "Reenlightenment enables the notifications on TSC frequency changes. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - "tlbflush": { - SchemaProps: spec.SchemaProps{ - Description: "TLBFlush improves performances in overcommited environments. Requires vpindex. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - "ipi": { - SchemaProps: spec.SchemaProps{ - Description: "IPI improves performances in overcommited environments. Requires vpindex. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - "evmcs": { - SchemaProps: spec.SchemaProps{ - Description: "EVMCS Speeds up L2 vmexits, but disables other virtualization features. Requires vapic. Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.FeatureSpinlocks", "kubevirt.io/kubevirt/pkg/api/v1.FeatureState", "kubevirt.io/kubevirt/pkg/api/v1.FeatureVendorID"}, - } -} - -func schema_kubevirt_pkg_api_v1_FeatureSpinlocks(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "enabled": { - SchemaProps: spec.SchemaProps{ - Description: "Enabled determines if the feature should be enabled or disabled on the guest. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "spinlocks": { - SchemaProps: spec.SchemaProps{ - Description: "Retries indicates the number of retries. Must be a value greater or equal 4096. Defaults to 4096.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_FeatureState(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents if a feature is enabled or disabled.", - Properties: map[string]spec.Schema{ - "enabled": { - SchemaProps: spec.SchemaProps{ - Description: "Enabled determines if the feature should be enabled or disabled on the guest. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_FeatureVendorID(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "enabled": { - SchemaProps: spec.SchemaProps{ - Description: "Enabled determines if the feature should be enabled or disabled on the guest. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "vendorid": { - SchemaProps: spec.SchemaProps{ - Description: "VendorID sets the hypervisor vendor id, visible to the vmi. String up to twelve characters.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_Features(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "acpi": { - SchemaProps: spec.SchemaProps{ - Description: "ACPI enables/disables ACPI insidejsondata guest. Defaults to enabled.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - "apic": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureAPIC"), - }, - }, - "hyperv": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureHyperv"), - }, - }, - "smm": { - SchemaProps: spec.SchemaProps{ - Description: "SMM enables/disables System Management Mode. TSEG not yet implemented.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.FeatureState"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.FeatureAPIC", "kubevirt.io/kubevirt/pkg/api/v1.FeatureHyperv", "kubevirt.io/kubevirt/pkg/api/v1.FeatureState"}, - } -} - -func schema_kubevirt_pkg_api_v1_Firmware(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "uuid": { - SchemaProps: spec.SchemaProps{ - Description: "UUID reported by the vmi bios. Defaults to a random generated uid.", - Type: []string{"string"}, - Format: "", - }, - }, - "bootloader": { - SchemaProps: spec.SchemaProps{ - Description: "Settings to control the bootloader that is used.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Bootloader"), - }, - }, - "serial": { - SchemaProps: spec.SchemaProps{ - Description: "The system-serial-number in SMBIOS", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.Bootloader"}, - } -} - -func schema_kubevirt_pkg_api_v1_FloppyTarget(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "readonly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "tray": { - SchemaProps: spec.SchemaProps{ - Description: "Tray indicates if the tray of the device is open or closed. Allowed values are \"open\" and \"closed\". Defaults to closed.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_GenieNetwork(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the genie cni network.", - Properties: map[string]spec.Schema{ - "networkName": { - SchemaProps: spec.SchemaProps{ - Description: "References the CNI plugin name.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"networkName"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_HPETTimer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "tickPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "TickPolicy determines what happens when QEMU misses a deadline for injecting a tick to the guest. One of \"delay\", \"catchup\", \"merge\", \"discard\".", - Type: []string{"string"}, - Format: "", - }, - }, - "present": { - SchemaProps: spec.SchemaProps{ - Description: "Enabled set to false makes sure that the machine type or a preset can't add the timer. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_HostDisk(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a disk created on the cluster level", - Properties: map[string]spec.Schema{ - "path": { - SchemaProps: spec.SchemaProps{ - Description: "The path to HostDisk image located on the cluster", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Contains information if disk.img exists or should be created allowed options are 'Disk' and 'DiskOrCreate'", - Type: []string{"string"}, - Format: "", - }, - }, - "capacity": { - SchemaProps: spec.SchemaProps{ - Description: "Capacity of the sparse disk", - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - "shared": { - SchemaProps: spec.SchemaProps{ - Description: "Shared indicate whether the path is shared between nodes", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"path", "type"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_kubevirt_pkg_api_v1_Hugepages(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Hugepages allow to use hugepages for the VirtualMachineInstance instead of regular memory.", - Properties: map[string]spec.Schema{ - "pageSize": { - SchemaProps: spec.SchemaProps{ - Description: "PageSize specifies the hugepage size, for x86_64 architecture valid values are 1Gi and 2Mi.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_HypervTimer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "present": { - SchemaProps: spec.SchemaProps{ - Description: "Enabled set to false makes sure that the machine type or a preset can't add the timer. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_I6300ESBWatchdog(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "i6300esb watchdog device.", - Properties: map[string]spec.Schema{ - "action": { - SchemaProps: spec.SchemaProps{ - Description: "The action to take. Valid values are poweroff, reset, shutdown. Defaults to reset.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_Input(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "bus": { - SchemaProps: spec.SchemaProps{ - Description: "Bus indicates the bus of input device to emulate. Supported values: virtio, usb.", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type indicated the type of input device. Supported values: tablet.", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the device name", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "name"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_Interface(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Logical name of the interface as well as a reference to the associated networks. Must match the Name of a Network.", - Type: []string{"string"}, - Format: "", - }, - }, - "model": { - SchemaProps: spec.SchemaProps{ - Description: "Interface model. One of: e1000, e1000e, ne2k_pci, pcnet, rtl8139, virtio. Defaults to virtio.", - Type: []string{"string"}, - Format: "", - }, - }, - "bridge": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.InterfaceBridge"), - }, - }, - "slirp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.InterfaceSlirp"), - }, - }, - "masquerade": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.InterfaceMasquerade"), - }, - }, - "sriov": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.InterfaceSRIOV"), - }, - }, - "ports": { - SchemaProps: spec.SchemaProps{ - Description: "List of ports to be forwarded to the virtual machine.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Port"), - }, - }, - }, - }, - }, - "macAddress": { - SchemaProps: spec.SchemaProps{ - Description: "Interface MAC address. For example: de:ad:00:00:be:af or DE-AD-00-00-BE-AF.", - Type: []string{"string"}, - Format: "", - }, - }, - "bootOrder": { - SchemaProps: spec.SchemaProps{ - Description: "BootOrder is an integer value > 0, used to determine ordering of boot devices. Lower values take precedence. Each interface or disk that has a boot order must have a unique value. Interfaces without a boot order are not tried.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "pciAddress": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the virtual network interface will be placed on the guests pci address with the specifed PCI address. For example: 0000:81:01.10", - Type: []string{"string"}, - Format: "", - }, - }, - "dhcpOptions": { - SchemaProps: spec.SchemaProps{ - Description: "If specified the network interface will pass additional DHCP options to the VMI", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.DHCPOptions"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.DHCPOptions", "kubevirt.io/kubevirt/pkg/api/v1.InterfaceBridge", "kubevirt.io/kubevirt/pkg/api/v1.InterfaceMasquerade", "kubevirt.io/kubevirt/pkg/api/v1.InterfaceSRIOV", "kubevirt.io/kubevirt/pkg/api/v1.InterfaceSlirp", "kubevirt.io/kubevirt/pkg/api/v1.Port"}, - } -} - -func schema_kubevirt_pkg_api_v1_InterfaceBindingMethod(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the method which will be used to connect the interface to the guest. Only one of its members may be specified.", - Properties: map[string]spec.Schema{ - "bridge": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.InterfaceBridge"), - }, - }, - "slirp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.InterfaceSlirp"), - }, - }, - "masquerade": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.InterfaceMasquerade"), - }, - }, - "sriov": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.InterfaceSRIOV"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.InterfaceBridge", "kubevirt.io/kubevirt/pkg/api/v1.InterfaceMasquerade", "kubevirt.io/kubevirt/pkg/api/v1.InterfaceSRIOV", "kubevirt.io/kubevirt/pkg/api/v1.InterfaceSlirp"}, - } -} - -func schema_kubevirt_pkg_api_v1_InterfaceBridge(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_InterfaceMasquerade(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_InterfaceSRIOV(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_InterfaceSlirp(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_KVMTimer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "present": { - SchemaProps: spec.SchemaProps{ - Description: "Enabled set to false makes sure that the machine type or a preset can't add the timer. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_KubeVirt(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "KubeVirt represents the object deploying all KubeVirt resources", - 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: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.KubeVirtSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.KubeVirtStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/pkg/api/v1.KubeVirtSpec", "kubevirt.io/kubevirt/pkg/api/v1.KubeVirtStatus"}, - } -} - -func schema_kubevirt_pkg_api_v1_KubeVirtCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "KubeVirtCondition represents a condition of a KubeVirt deployment", - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "lastProbeTime": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_kubevirt_pkg_api_v1_KubeVirtList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "KubeVirtList is a list of KubeVirts", - 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: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.KubeVirt"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/pkg/api/v1.KubeVirt"}, - } -} - -func schema_kubevirt_pkg_api_v1_KubeVirtSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "imageTag": { - SchemaProps: spec.SchemaProps{ - Description: "The image tag to use for the continer images installed. Defaults to the same tag as the operator's container image.", - Type: []string{"string"}, - Format: "", - }, - }, - "imageRegistry": { - SchemaProps: spec.SchemaProps{ - Description: "The image registry to pull the container images from Defaults to the same registry the operator's container image is pulled from.", - Type: []string{"string"}, - Format: "", - }, - }, - "imagePullPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "The ImagePullPolicy to use.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_KubeVirtStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "KubeVirtStatus represents information pertaining to a KubeVirt deployment.", - Properties: map[string]spec.Schema{ - "phase": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "conditions": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.KubeVirtCondition"), - }, - }, - }, - }, - }, - "operatorVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "targetKubeVirtVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "targetKubeVirtRegistry": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "observedKubeVirtVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "observedKubeVirtRegistry": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.KubeVirtCondition"}, - } -} - -func schema_kubevirt_pkg_api_v1_LunTarget(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "bus": { - SchemaProps: spec.SchemaProps{ - Description: "Bus indicates the type of disk device to emulate. supported values: virtio, sata, scsi.", - Type: []string{"string"}, - Format: "", - }, - }, - "readonly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_Machine(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "QEMU machine type is the actual chipset of the VirtualMachineInstance.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_Memory(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Memory allows specifying the VirtualMachineInstance memory features.", - Properties: map[string]spec.Schema{ - "hugepages": { - SchemaProps: spec.SchemaProps{ - Description: "Hugepages allow to use hugepages for the VirtualMachineInstance instead of regular memory.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Hugepages"), - }, - }, - "guest": { - SchemaProps: spec.SchemaProps{ - Description: "Guest allows to specifying the amount of memory which is visible inside the Guest OS. The Guest must lie between Requests and Limits from the resources section. Defaults to the requested memory in the resources section if not specified.", - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", "kubevirt.io/kubevirt/pkg/api/v1.Hugepages"}, - } -} - -func schema_kubevirt_pkg_api_v1_MultusNetwork(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the multus cni network.", - Properties: map[string]spec.Schema{ - "networkName": { - SchemaProps: spec.SchemaProps{ - Description: "References to a NetworkAttachmentDefinition CRD object. Format: , /. If namespace is not specified, VMI namespace is assumed.", - Type: []string{"string"}, - Format: "", - }, - }, - "default": { - SchemaProps: spec.SchemaProps{ - Description: "Select the default network and add it to the multus-cni.io/default-network annotation.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"networkName"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_Network(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Network represents a network type and a resource that should be connected to the vm.", - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Network name. Must be a DNS_LABEL and unique within the vm. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "pod": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.PodNetwork"), - }, - }, - "multus": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.MultusNetwork"), - }, - }, - "genie": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.GenieNetwork"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.GenieNetwork", "kubevirt.io/kubevirt/pkg/api/v1.MultusNetwork", "kubevirt.io/kubevirt/pkg/api/v1.PodNetwork"}, - } -} - -func schema_kubevirt_pkg_api_v1_NetworkSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the source resource that will be connected to the vm. Only one of its members may be specified.", - Properties: map[string]spec.Schema{ - "pod": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.PodNetwork"), - }, - }, - "multus": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.MultusNetwork"), - }, - }, - "genie": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.GenieNetwork"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.GenieNetwork", "kubevirt.io/kubevirt/pkg/api/v1.MultusNetwork", "kubevirt.io/kubevirt/pkg/api/v1.PodNetwork"}, - } -} - -func schema_kubevirt_pkg_api_v1_PITTimer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "tickPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "TickPolicy determines what happens when QEMU misses a deadline for injecting a tick to the guest. One of \"delay\", \"catchup\", \"discard\".", - Type: []string{"string"}, - Format: "", - }, - }, - "present": { - SchemaProps: spec.SchemaProps{ - Description: "Enabled set to false makes sure that the machine type or a preset can't add the timer. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_PodNetwork(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the stock pod network interface.", - Properties: map[string]spec.Schema{ - "vmNetworkCIDR": { - SchemaProps: spec.SchemaProps{ - Description: "CIDR for vm network. Default 10.0.2.0/24 if not specified.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_Port(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Port repesents a port to expose from the virtual machine. Default protocol TCP. The port field is mandatory", - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.", - Type: []string{"string"}, - Format: "", - }, - }, - "protocol": { - SchemaProps: spec.SchemaProps{ - Description: "Protocol for port. Must be UDP or TCP. Defaults to \"TCP\".", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Number of port to expose for the virtual machine. This must be a valid port number, 0 < x < 65536.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"port"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_RTCTimer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "tickPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "TickPolicy determines what happens when QEMU misses a deadline for injecting a tick to the guest. One of \"delay\", \"catchup\".", - Type: []string{"string"}, - Format: "", - }, - }, - "present": { - SchemaProps: spec.SchemaProps{ - Description: "Enabled set to false makes sure that the machine type or a preset can't add the timer. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "track": { - SchemaProps: spec.SchemaProps{ - Description: "Track the guest or the wall clock.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_ResourceRequirements(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "requests": { - SchemaProps: spec.SchemaProps{ - Description: "Requests is a description of the initial vmi resources. Valid resource keys are \"memory\" and \"cpu\".", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "limits": { - SchemaProps: spec.SchemaProps{ - Description: "Limits describes the maximum amount of compute resources allowed. Valid resource keys are \"memory\" and \"cpu\".", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "overcommitGuestOverhead": { - SchemaProps: spec.SchemaProps{ - Description: "Don't ask the scheduler to take the guest-management overhead into account. Instead put the overhead only into the requested memory limits. This can lead to crashes if all memory is in use on a node. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_kubevirt_pkg_api_v1_Rng(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Rng represents the random device passed from host", - Properties: map[string]spec.Schema{}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_SecretVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SecretVolumeSource adapts a Secret into a volume.", - Properties: map[string]spec.Schema{ - "secretName": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret", - Type: []string{"string"}, - Format: "", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the Secret or it's keys must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_ServiceAccountVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceAccountVolumeSource adapts a ServiceAccount into a volume.", - Properties: map[string]spec.Schema{ - "serviceAccountName": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the service account in the pod's namespace to use. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_Timer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents all available timers in a vmi.", - Properties: map[string]spec.Schema{ - "hpet": { - SchemaProps: spec.SchemaProps{ - Description: "HPET (High Precision Event Timer) - multiple timers with periodic interrupts.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.HPETTimer"), - }, - }, - "kvm": { - SchemaProps: spec.SchemaProps{ - Description: "KVM \t(KVM clock) - lets guests read the host’s wall clock time (paravirtualized). For linux guests.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.KVMTimer"), - }, - }, - "pit": { - SchemaProps: spec.SchemaProps{ - Description: "PIT (Programmable Interval Timer) - a timer with periodic interrupts.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.PITTimer"), - }, - }, - "rtc": { - SchemaProps: spec.SchemaProps{ - Description: "RTC (Real Time Clock) - a continuously running timer with periodic interrupts.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.RTCTimer"), - }, - }, - "hyperv": { - SchemaProps: spec.SchemaProps{ - Description: "Hyperv (Hypervclock) - lets guests read the host’s wall clock time (paravirtualized). For windows guests.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.HypervTimer"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.HPETTimer", "kubevirt.io/kubevirt/pkg/api/v1.HypervTimer", "kubevirt.io/kubevirt/pkg/api/v1.KVMTimer", "kubevirt.io/kubevirt/pkg/api/v1.PITTimer", "kubevirt.io/kubevirt/pkg/api/v1.RTCTimer"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachine(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachine handles the VirtualMachines that are not running or are in a stopped state The VirtualMachine contains the template to create the VirtualMachineInstance. It also mirrors the running state of the created VirtualMachineInstance in its status.", - 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: "", - }, - }, - "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", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status holds the current state of the controller and brief information about its associated VirtualMachineInstance", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineSpec", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineStatus"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineCondition represents the state of VirtualMachine", - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "lastProbeTime": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstance(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstance is *the* VirtualMachineInstance Definition. It represents a virtual machine in the runtime environment of kubernetes.", - 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: "", - }, - }, - "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.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status is the high level overview of how the VirtualMachineInstance is doing. It contains information available to controllers and users.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceSpec", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceStatus"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "lastProbeTime": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstanceList is a list of VirtualMachines", - 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: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstance"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstance"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceMigration(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstanceMigration represents the object tracking a VMI's migration to another host in the cluster", - 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: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigrationSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigrationStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigrationSpec", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigrationStatus"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceMigrationCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "lastProbeTime": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceMigrationList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstanceMigrationList is a list of VirtualMachineMigrations", - 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: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigration"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigration"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceMigrationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "vmiName": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the VMI to perform the migration on. VMI must exist in the migration objects namespace", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceMigrationStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstanceMigration reprents information pertaining to a VMI's migration.", - Properties: map[string]spec.Schema{ - "phase": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "conditions": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigrationCondition"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigrationCondition"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceNetworkInterface(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "ipAddress": { - SchemaProps: spec.SchemaProps{ - Description: "IP address of a Virtual Machine interface", - Type: []string{"string"}, - Format: "", - }, - }, - "mac": { - SchemaProps: spec.SchemaProps{ - Description: "Hardware address of a Virtual Machine interface", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the interface, corresponds to name of the network assigned to the interface", - Type: []string{"string"}, - Format: "", - }, - }, - "ipAddresses": { - SchemaProps: spec.SchemaProps{ - Description: "List of all IP addresses of a Virtual Machine interface", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "interfaceName": { - SchemaProps: spec.SchemaProps{ - Description: "The interface name inside the Virtual Machine", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstancePreset(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - 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: "", - }, - }, - "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.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstancePresetSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstancePresetSpec"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstancePresetList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstancePresetList is a list of VirtualMachinePresets", - 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: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstancePreset"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstancePreset"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstancePresetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "Selector is a label query over a set of VMIs. Required.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), - }, - }, - "domain": { - SchemaProps: spec.SchemaProps{ - Description: "Domain is the same object type as contained in VirtualMachineInstanceSpec", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.DomainSpec"), - }, - }, - }, - Required: []string{"selector"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "kubevirt.io/kubevirt/pkg/api/v1.DomainSpec"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceReplicaSet(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstance is *the* VirtualMachineInstance Definition. It represents a virtual machine in the runtime environment of kubernetes.", - 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: "", - }, - }, - "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.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSetSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status is the high level overview of how the VirtualMachineInstance is doing. It contains information available to controllers and users.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSetStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSetSpec", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSetStatus"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceReplicaSetCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "lastProbeTime": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceReplicaSetList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VMIList is a list of VMIs", - 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: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSet"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSet"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceReplicaSetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "replicas": { - SchemaProps: spec.SchemaProps{ - Description: "Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), - }, - }, - "template": { - SchemaProps: spec.SchemaProps{ - Description: "Template describes the pods that will be created.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceTemplateSpec"), - }, - }, - "paused": { - SchemaProps: spec.SchemaProps{ - Description: "Indicates that the replica set is paused.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"selector", "template"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceTemplateSpec"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceReplicaSetStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "replicas": { - SchemaProps: spec.SchemaProps{ - Description: "Total number of non-terminated pods targeted by this deployment (their labels match the selector).", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "readyReplicas": { - SchemaProps: spec.SchemaProps{ - Description: "The number of ready replicas for this replica set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "conditions": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSetCondition"), - }, - }, - }, - }, - }, - "labelSelector": { - SchemaProps: spec.SchemaProps{ - Description: "Canonical form of the label selector for HPA which consumes it through the scale subresource.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceReplicaSetCondition"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstanceSpec is a description of a VirtualMachineInstance.", - Properties: map[string]spec.Schema{ - "domain": { - SchemaProps: spec.SchemaProps{ - Description: "Specification of the desired behavior of the VirtualMachineInstance on the host.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.DomainSpec"), - }, - }, - "nodeSelector": { - SchemaProps: spec.SchemaProps{ - Description: "NodeSelector is a selector which must be true for the vmi to fit on a node. Selector which must match a node's labels for the vmi to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "affinity": { - SchemaProps: spec.SchemaProps{ - Description: "If affinity is specifies, obey all the affinity rules", - Ref: ref("k8s.io/api/core/v1.Affinity"), - }, - }, - "tolerations": { - SchemaProps: spec.SchemaProps{ - Description: "If toleration is specified, obey all the toleration rules.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Toleration"), - }, - }, - }, - }, - }, - "evictionStrategy": { - SchemaProps: spec.SchemaProps{ - Description: "EvictionStrategy can be set to \"LiveMigrate\" if the VirtualMachineInstance should be migrated instead of shut-off in case of a node drain.", - Type: []string{"string"}, - Format: "", - }, - }, - "terminationGracePeriodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Grace period observed after signalling a VirtualMachineInstance to stop after which the VirtualMachineInstance is force terminated.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "volumes": { - SchemaProps: spec.SchemaProps{ - Description: "List of volumes that can be mounted by disks belonging to the vmi.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Volume"), - }, - }, - }, - }, - }, - "livenessProbe": { - SchemaProps: spec.SchemaProps{ - Description: "Periodic probe of VirtualMachineInstance liveness. VirtualmachineInstances will be stopped if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Probe"), - }, - }, - "readinessProbe": { - SchemaProps: spec.SchemaProps{ - Description: "Periodic probe of VirtualMachineInstance service readiness. VirtualmachineInstances will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Probe"), - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the hostname of the vmi If not specified, the hostname will be set to the name of the vmi, if dhcp or cloud-init is configured properly.", - Type: []string{"string"}, - Format: "", - }, - }, - "subdomain": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the fully qualified vmi hostname will be \"...svc.\". If not specified, the vmi will not have a domainname at all. The DNS entry will resolve to the vmi, no matter if the vmi itself can pick up a hostname.", - Type: []string{"string"}, - Format: "", - }, - }, - "networks": { - SchemaProps: spec.SchemaProps{ - Description: "List of networks that can be attached to a vm's virtual interface.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.Network"), - }, - }, - }, - }, - }, - "dnsPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.", - Type: []string{"string"}, - Format: "", - }, - }, - "dnsConfig": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.", - Ref: ref("k8s.io/api/core/v1.PodDNSConfig"), - }, - }, - }, - Required: []string{"domain"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.PodDNSConfig", "k8s.io/api/core/v1.Toleration", "kubevirt.io/kubevirt/pkg/api/v1.DomainSpec", "kubevirt.io/kubevirt/pkg/api/v1.Network", "kubevirt.io/kubevirt/pkg/api/v1.Probe", "kubevirt.io/kubevirt/pkg/api/v1.Volume"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstanceStatus represents information about the status of a VirtualMachineInstance. Status may trail the actual state of a system.", - Properties: map[string]spec.Schema{ - "nodeName": { - SchemaProps: spec.SchemaProps{ - Description: "NodeName is the name where the VirtualMachineInstance is currently running.", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "A brief CamelCase message indicating details about why the VMI is in this state. e.g. 'NodeUnresponsive'", - Type: []string{"string"}, - Format: "", - }, - }, - "conditions": { - SchemaProps: spec.SchemaProps{ - Description: "Conditions are specific points in VirtualMachineInstance's pod runtime.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceCondition"), - }, - }, - }, - }, - }, - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "Phase is the status of the VirtualMachineInstance in kubernetes world. It is not the VirtualMachineInstance status, but partially correlates to it.", - Type: []string{"string"}, - Format: "", - }, - }, - "interfaces": { - SchemaProps: spec.SchemaProps{ - Description: "Interfaces represent the details of available network interfaces.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceNetworkInterface"), - }, - }, - }, - }, - }, - "migrationState": { - SchemaProps: spec.SchemaProps{ - Description: "Represents the status of a live migration", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigrationState"), - }, - }, - "migrationMethod": { - SchemaProps: spec.SchemaProps{ - Description: "Represents the method using which the vmi can be migrated: live migration or block migration", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceCondition", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceMigrationState", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceNetworkInterface"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineInstanceTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Properties: map[string]spec.Schema{ - "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.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceSpec"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineList is a list of virtualmachines", - 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: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of VirtualMachines", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachine"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachine"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineSpec describes how the proper VirtualMachine should look like", - Properties: map[string]spec.Schema{ - "running": { - SchemaProps: spec.SchemaProps{ - Description: "Running controls whether the associatied VirtualMachineInstance is created or not Mutually exclusive with RunStrategy", - Type: []string{"boolean"}, - Format: "", - }, - }, - "runStrategy": { - SchemaProps: spec.SchemaProps{ - Description: "Running state indicates the requested running state of the VirtualMachineInstance mutually exclusive with Running", - Type: []string{"string"}, - Format: "", - }, - }, - "template": { - SchemaProps: spec.SchemaProps{ - Description: "Template is the direct specification of VirtualMachineInstance", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceTemplateSpec"), - }, - }, - "dataVolumeTemplates": { - SchemaProps: spec.SchemaProps{ - Description: "dataVolumeTemplates is a list of dataVolumes that the VirtualMachineInstance template can reference. DataVolumes in this list are dynamically created for the VirtualMachine and are tied to the VirtualMachine's life-cycle.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolume"), - }, - }, - }, - }, - }, - }, - Required: []string{"template"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolume", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineInstanceTemplateSpec"}, - } -} - -func schema_kubevirt_pkg_api_v1_VirtualMachineStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineStatus represents the status returned by the controller to describe how the VirtualMachine is doing", - Properties: map[string]spec.Schema{ - "created": { - SchemaProps: spec.SchemaProps{ - Description: "Created indicates if the virtual machine is created in the cluster", - Type: []string{"boolean"}, - Format: "", - }, - }, - "ready": { - SchemaProps: spec.SchemaProps{ - Description: "Ready indicates if the virtual machine is running and ready", - Type: []string{"boolean"}, - Format: "", - }, - }, - "conditions": { - SchemaProps: spec.SchemaProps{ - Description: "Hold the state information of the VirtualMachine and its VirtualMachineInstance", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineCondition"), - }, - }, - }, - }, - }, - "stateChangeRequests": { - SchemaProps: spec.SchemaProps{ - Description: "StateChangeRequests indicates a list of actions that should be taken on a VMI e.g. stop a specific VMI then start a new one.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineStateChangeRequest"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineCondition", "kubevirt.io/kubevirt/pkg/api/v1.VirtualMachineStateChangeRequest"}, - } -} - -func schema_kubevirt_pkg_api_v1_Volume(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Volume represents a named volume in a vmi.", - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Volume's name. Must be a DNS_LABEL and unique within the vmi. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "hostDisk": { - SchemaProps: spec.SchemaProps{ - Description: "HostDisk represents a disk created on the cluster level", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.HostDisk"), - }, - }, - "persistentVolumeClaim": { - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. Directly attached to the vmi via qemu. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource"), - }, - }, - "cloudInitNoCloud": { - SchemaProps: spec.SchemaProps{ - Description: "CloudInitNoCloud represents a cloud-init NoCloud user-data source. The NoCloud data will be added as a disk to the vmi. A proper cloud-init installation is required inside the guest. More info: http://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.CloudInitNoCloudSource"), - }, - }, - "cloudInitConfigDrive": { - SchemaProps: spec.SchemaProps{ - Description: "CloudInitConfigDrive represents a cloud-init Config Drive user-data source. The Config Drive data will be added as a disk to the vmi. A proper cloud-init installation is required inside the guest. More info: https://cloudinit.readthedocs.io/en/latest/topics/datasources/configdrive.html", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.CloudInitConfigDriveSource"), - }, - }, - "containerDisk": { - SchemaProps: spec.SchemaProps{ - Description: "ContainerDisk references a docker image, embedding a qcow or raw disk. More info: https://kubevirt.gitbooks.io/user-guide/registry-disk.html", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.ContainerDiskSource"), - }, - }, - "ephemeral": { - SchemaProps: spec.SchemaProps{ - Description: "Ephemeral is a special volume source that \"wraps\" specified source and provides copy-on-write image on top of it.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.EphemeralVolumeSource"), - }, - }, - "emptyDisk": { - SchemaProps: spec.SchemaProps{ - Description: "EmptyDisk represents a temporary disk which shares the vmis lifecycle. More info: https://kubevirt.gitbooks.io/user-guide/disks-and-volumes.html", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.EmptyDiskSource"), - }, - }, - "dataVolume": { - SchemaProps: spec.SchemaProps{ - Description: "DataVolume represents the dynamic creation a PVC for this volume as well as the process of populating that PVC with a disk image.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.DataVolumeSource"), - }, - }, - "configMap": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigMapSource represents a reference to a ConfigMap in the same namespace. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.ConfigMapVolumeSource"), - }, - }, - "secret": { - SchemaProps: spec.SchemaProps{ - Description: "SecretVolumeSource represents a reference to a secret data in the same namespace. More info: https://kubernetes.io/docs/concepts/configuration/secret/", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.SecretVolumeSource"), - }, - }, - "serviceAccount": { - SchemaProps: spec.SchemaProps{ - Description: "ServiceAccountVolumeSource represents a reference to a service account. There can only be one volume of this type! More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.ServiceAccountVolumeSource"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "kubevirt.io/kubevirt/pkg/api/v1.CloudInitConfigDriveSource", "kubevirt.io/kubevirt/pkg/api/v1.CloudInitNoCloudSource", "kubevirt.io/kubevirt/pkg/api/v1.ConfigMapVolumeSource", "kubevirt.io/kubevirt/pkg/api/v1.ContainerDiskSource", "kubevirt.io/kubevirt/pkg/api/v1.DataVolumeSource", "kubevirt.io/kubevirt/pkg/api/v1.EmptyDiskSource", "kubevirt.io/kubevirt/pkg/api/v1.EphemeralVolumeSource", "kubevirt.io/kubevirt/pkg/api/v1.HostDisk", "kubevirt.io/kubevirt/pkg/api/v1.SecretVolumeSource", "kubevirt.io/kubevirt/pkg/api/v1.ServiceAccountVolumeSource"}, - } -} - -func schema_kubevirt_pkg_api_v1_VolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the source of a volume to mount. Only one of its members may be specified.", - Properties: map[string]spec.Schema{ - "hostDisk": { - SchemaProps: spec.SchemaProps{ - Description: "HostDisk represents a disk created on the cluster level", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.HostDisk"), - }, - }, - "persistentVolumeClaim": { - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. Directly attached to the vmi via qemu. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource"), - }, - }, - "cloudInitNoCloud": { - SchemaProps: spec.SchemaProps{ - Description: "CloudInitNoCloud represents a cloud-init NoCloud user-data source. The NoCloud data will be added as a disk to the vmi. A proper cloud-init installation is required inside the guest. More info: http://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.CloudInitNoCloudSource"), - }, - }, - "cloudInitConfigDrive": { - SchemaProps: spec.SchemaProps{ - Description: "CloudInitConfigDrive represents a cloud-init Config Drive user-data source. The Config Drive data will be added as a disk to the vmi. A proper cloud-init installation is required inside the guest. More info: https://cloudinit.readthedocs.io/en/latest/topics/datasources/configdrive.html", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.CloudInitConfigDriveSource"), - }, - }, - "containerDisk": { - SchemaProps: spec.SchemaProps{ - Description: "ContainerDisk references a docker image, embedding a qcow or raw disk. More info: https://kubevirt.gitbooks.io/user-guide/registry-disk.html", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.ContainerDiskSource"), - }, - }, - "ephemeral": { - SchemaProps: spec.SchemaProps{ - Description: "Ephemeral is a special volume source that \"wraps\" specified source and provides copy-on-write image on top of it.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.EphemeralVolumeSource"), - }, - }, - "emptyDisk": { - SchemaProps: spec.SchemaProps{ - Description: "EmptyDisk represents a temporary disk which shares the vmis lifecycle. More info: https://kubevirt.gitbooks.io/user-guide/disks-and-volumes.html", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.EmptyDiskSource"), - }, - }, - "dataVolume": { - SchemaProps: spec.SchemaProps{ - Description: "DataVolume represents the dynamic creation a PVC for this volume as well as the process of populating that PVC with a disk image.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.DataVolumeSource"), - }, - }, - "configMap": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigMapSource represents a reference to a ConfigMap in the same namespace. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.ConfigMapVolumeSource"), - }, - }, - "secret": { - SchemaProps: spec.SchemaProps{ - Description: "SecretVolumeSource represents a reference to a secret data in the same namespace. More info: https://kubernetes.io/docs/concepts/configuration/secret/", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.SecretVolumeSource"), - }, - }, - "serviceAccount": { - SchemaProps: spec.SchemaProps{ - Description: "ServiceAccountVolumeSource represents a reference to a service account. There can only be one volume of this type! More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.ServiceAccountVolumeSource"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "kubevirt.io/kubevirt/pkg/api/v1.CloudInitConfigDriveSource", "kubevirt.io/kubevirt/pkg/api/v1.CloudInitNoCloudSource", "kubevirt.io/kubevirt/pkg/api/v1.ConfigMapVolumeSource", "kubevirt.io/kubevirt/pkg/api/v1.ContainerDiskSource", "kubevirt.io/kubevirt/pkg/api/v1.DataVolumeSource", "kubevirt.io/kubevirt/pkg/api/v1.EmptyDiskSource", "kubevirt.io/kubevirt/pkg/api/v1.EphemeralVolumeSource", "kubevirt.io/kubevirt/pkg/api/v1.HostDisk", "kubevirt.io/kubevirt/pkg/api/v1.SecretVolumeSource", "kubevirt.io/kubevirt/pkg/api/v1.ServiceAccountVolumeSource"}, - } -} - -func schema_kubevirt_pkg_api_v1_Watchdog(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Named watchdog device.", - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the watchdog.", - Type: []string{"string"}, - Format: "", - }, - }, - "i6300esb": { - SchemaProps: spec.SchemaProps{ - Description: "i6300esb watchdog device.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.I6300ESBWatchdog"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.I6300ESBWatchdog"}, - } -} - -func schema_kubevirt_pkg_api_v1_WatchdogDevice(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Hardware watchdog device. Exactly one of its members must be set.", - Properties: map[string]spec.Schema{ - "i6300esb": { - SchemaProps: spec.SchemaProps{ - Description: "i6300esb watchdog device.", - Ref: ref("kubevirt.io/kubevirt/pkg/api/v1.I6300ESBWatchdog"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/pkg/api/v1.I6300ESBWatchdog"}, - } -} diff --git a/vendor/kubevirt.io/client-go/api/v1/schema.go b/vendor/kubevirt.io/client-go/api/v1/schema.go deleted file mode 100644 index 0d495d4c5822..000000000000 --- a/vendor/kubevirt.io/client-go/api/v1/schema.go +++ /dev/null @@ -1,1078 +0,0 @@ -/* - * 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 2017, 2018 Red Hat, Inc. - * - */ - -package v1 - -import ( - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/apimachinery/pkg/types" -) - -type IOThreadsPolicy string - -const ( - IOThreadsPolicyShared IOThreadsPolicy = "shared" - IOThreadsPolicyAuto IOThreadsPolicy = "auto" - CPUModeHostPassthrough = "host-passthrough" - CPUModeHostModel = "host-model" -) - -//go:generate swagger-doc -//go:generate openapi-gen -i . --output-package=kubevirt.io/kubevirt/pkg/api/v1 --go-header-file ../../../hack/boilerplate/boilerplate.go.txt - -/* - ATTENTION: Rerun code generators when comments on structs or fields are modified. -*/ - -// Represents a disk created on the cluster level -// --- -// +k8s:openapi-gen=true -type HostDisk struct { - // The path to HostDisk image located on the cluster - Path string `json:"path"` - // Contains information if disk.img exists or should be created - // allowed options are 'Disk' and 'DiskOrCreate' - Type HostDiskType `json:"type"` - // Capacity of the sparse disk - // +optional - Capacity resource.Quantity `json:"capacity,omitempty"` - // Shared indicate whether the path is shared between nodes - Shared *bool `json:"shared,omitempty"` -} - -// ConfigMapVolumeSource adapts a ConfigMap into a volume. -// More info: https://kubernetes.io/docs/concepts/storage/volumes/#configmap -// --- -// +k8s:openapi-gen=true -type ConfigMapVolumeSource struct { - v1.LocalObjectReference `json:",inline"` - // Specify whether the ConfigMap or it's keys must be defined - // +optional - Optional *bool `json:"optional,omitempty"` -} - -// SecretVolumeSource adapts a Secret into a volume. -// --- -// +k8s:openapi-gen=true -type SecretVolumeSource struct { - // Name of the secret in the pod's namespace to use. - // More info: https://kubernetes.io/docs/concepts/storage/volumes#secret - // +optional - SecretName string `json:"secretName,omitempty"` - // Specify whether the Secret or it's keys must be defined - // +optional - Optional *bool `json:"optional,omitempty"` -} - -// ServiceAccountVolumeSource adapts a ServiceAccount into a volume. -// --- -// +k8s:openapi-gen=true -type ServiceAccountVolumeSource struct { - // Name of the service account in the pod's namespace to use. - // More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ - ServiceAccountName string `json:"serviceAccountName,omitempty"` -} - -// Represents a cloud-init nocloud user data source. -// More info: http://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html -// --- -// +k8s:openapi-gen=true -type CloudInitNoCloudSource struct { - // UserDataSecretRef references a k8s secret that contains NoCloud userdata. - // + optional - UserDataSecretRef *v1.LocalObjectReference `json:"secretRef,omitempty"` - // UserDataBase64 contains NoCloud cloud-init userdata as a base64 encoded string. - // + optional - UserDataBase64 string `json:"userDataBase64,omitempty"` - // UserData contains NoCloud inline cloud-init userdata. - // + optional - UserData string `json:"userData,omitempty"` - // NetworkDataSecretRef references a k8s secret that contains NoCloud networkdata. - // + optional - NetworkDataSecretRef *v1.LocalObjectReference `json:"networkDataSecretRef,omitempty"` - // NetworkDataBase64 contains NoCloud cloud-init networkdata as a base64 encoded string. - // + optional - NetworkDataBase64 string `json:"networkDataBase64,omitempty"` - // NetworkData contains NoCloud inline cloud-init networkdata. - // + optional - NetworkData string `json:"networkData,omitempty"` -} - -// Represents a cloud-init config drive user data source. -// More info: https://cloudinit.readthedocs.io/en/latest/topics/datasources/configdrive.html -// --- -// +k8s:openapi-gen=true -type CloudInitConfigDriveSource struct { - // UserDataSecretRef references a k8s secret that contains config drive userdata. - // + optional - UserDataSecretRef *v1.LocalObjectReference `json:"secretRef,omitempty"` - // UserDataBase64 contains config drive cloud-init userdata as a base64 encoded string. - // + optional - UserDataBase64 string `json:"userDataBase64,omitempty"` - // UserData contains config drive inline cloud-init userdata. - // + optional - UserData string `json:"userData,omitempty"` - // NetworkDataSecretRef references a k8s secret that contains config drive networkdata. - // + optional - NetworkDataSecretRef *v1.LocalObjectReference `json:"networkDataSecretRef,omitempty"` - // NetworkDataBase64 contains config drive cloud-init networkdata as a base64 encoded string. - // + optional - NetworkDataBase64 string `json:"networkDataBase64,omitempty"` - // NetworkData contains config drive inline cloud-init networkdata. - // + optional - NetworkData string `json:"networkData,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type DomainSpec struct { - // Resources describes the Compute Resources required by this vmi. - Resources ResourceRequirements `json:"resources,omitempty"` - // CPU allow specified the detailed CPU topology inside the vmi. - // +optional - CPU *CPU `json:"cpu,omitempty"` - // Memory allow specifying the VMI memory features. - // +optional - Memory *Memory `json:"memory,omitempty"` - // Machine type. - // +optional - Machine Machine `json:"machine,omitempty"` - // Firmware. - // +optional - Firmware *Firmware `json:"firmware,omitempty"` - // Clock sets the clock and timers of the vmi. - // +optional - Clock *Clock `json:"clock,omitempty"` - // Features like acpi, apic, hyperv, smm. - // +optional - Features *Features `json:"features,omitempty"` - // Devices allows adding disks, network interfaces, ... - Devices Devices `json:"devices"` - // Controls whether or not disks will share IOThreads. - // Omitting IOThreadsPolicy disables use of IOThreads. - // One of: shared, auto - // +optional - IOThreadsPolicy *IOThreadsPolicy `json:"ioThreadsPolicy,omitempty"` -} - -// Represents the firmware blob used to assist in the domain creation process. -// Used for setting the QEMU BIOS file path for the libvirt domain. -// --- -// +k8s:openapi-gen=true -type Bootloader struct { - // If set (default), BIOS will be used. - // +optional - BIOS *BIOS `json:"bios,omitempty"` - // If set, EFI will be used instead of BIOS. - // +optional - EFI *EFI `json:"efi,omitempty"` -} - -// If set (default), BIOS will be used. -// --- -// +k8s:openapi-gen=true -type BIOS struct { -} - -// If set, EFI will be used instead of BIOS. -// --- -// +k8s:openapi-gen=true -type EFI struct { -} - -// --- -// +k8s:openapi-gen=true -type ResourceRequirements struct { - // Requests is a description of the initial vmi resources. - // Valid resource keys are "memory" and "cpu". - // +optional - Requests v1.ResourceList `json:"requests,omitempty"` - // Limits describes the maximum amount of compute resources allowed. - // Valid resource keys are "memory" and "cpu". - // +optional - Limits v1.ResourceList `json:"limits,omitempty"` - // Don't ask the scheduler to take the guest-management overhead into account. Instead - // put the overhead only into the requested memory limits. This can lead to crashes if - // all memory is in use on a node. Defaults to false. - OvercommitGuestOverhead bool `json:"overcommitGuestOverhead,omitempty"` -} - -// CPU allows specifying the CPU topology. -// --- -// +k8s:openapi-gen=true -type CPU struct { - // Cores specifies the number of cores inside the vmi. - // Must be a value greater or equal 1. - Cores uint32 `json:"cores,omitempty"` - // Sockets specifies the number of sockets inside the vmi. - // Must be a value greater or equal 1. - Sockets uint32 `json:"sockets,omitempty"` - // Threads specifies the number of threads inside the vmi. - // Must be a value greater or equal 1. - Threads uint32 `json:"threads,omitempty"` - // Model specifies the CPU model inside the VMI. - // List of available models https://github.com/libvirt/libvirt/tree/master/src/cpu_map. - // It is possible to specify special cases like "host-passthrough" to get the same CPU as the node - // and "host-model" to get CPU closest to the node one. - // Defaults to host-model. - // +optional - Model string `json:"model,omitempty"` - // Features specifies the CPU features list inside the VMI. - // +optional - Features []CPUFeature `json:"features,omitempty"` - // DedicatedCPUPlacement requests the scheduler to place the VirtualMachineInstance on a node - // with enough dedicated pCPUs and pin the vCPUs to it. - // +optional - DedicatedCPUPlacement bool `json:"dedicatedCpuPlacement,omitempty"` -} - -// CPUFeature allows specifying a CPU feature. -// --- -// +k8s:openapi-gen=true -type CPUFeature struct { - // Name of the CPU feature - Name string `json:"name"` - // Policy is the CPU feature attribute which can have the following attributes: - // force - The virtual CPU will claim the feature is supported regardless of it being supported by host CPU. - // require - Guest creation will fail unless the feature is supported by the host CPU or the hypervisor is able to emulate it. - // optional - The feature will be supported by virtual CPU if and only if it is supported by host CPU. - // disable - The feature will not be supported by virtual CPU. - // forbid - Guest creation will fail if the feature is supported by host CPU. - // Defaults to require - // +optional - Policy string `json:"policy,omitempty"` -} - -// Memory allows specifying the VirtualMachineInstance memory features. -// --- -// +k8s:openapi-gen=true -type Memory struct { - // Hugepages allow to use hugepages for the VirtualMachineInstance instead of regular memory. - // +optional - Hugepages *Hugepages `json:"hugepages,omitempty"` - // Guest allows to specifying the amount of memory which is visible inside the Guest OS. - // The Guest must lie between Requests and Limits from the resources section. - // Defaults to the requested memory in the resources section if not specified. - // + optional - Guest *resource.Quantity `json:"guest,omitempty"` -} - -// Hugepages allow to use hugepages for the VirtualMachineInstance instead of regular memory. -// --- -// +k8s:openapi-gen=true -type Hugepages struct { - // PageSize specifies the hugepage size, for x86_64 architecture valid values are 1Gi and 2Mi. - PageSize string `json:"pageSize,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type Machine struct { - // QEMU machine type is the actual chipset of the VirtualMachineInstance. - Type string `json:"type"` -} - -// --- -// +k8s:openapi-gen=true -type Firmware struct { - // UUID reported by the vmi bios. - // Defaults to a random generated uid. - UUID types.UID `json:"uuid,omitempty"` - // Settings to control the bootloader that is used. - // +optional - Bootloader *Bootloader `json:"bootloader,omitempty"` - // The system-serial-number in SMBIOS - Serial string `json:"serial,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type Devices struct { - // Disks describes disks, cdroms, floppy and luns which are connected to the vmi. - Disks []Disk `json:"disks,omitempty"` - // Watchdog describes a watchdog device which can be added to the vmi. - Watchdog *Watchdog `json:"watchdog,omitempty"` - // Interfaces describe network interfaces which are added to the vmi. - Interfaces []Interface `json:"interfaces,omitempty"` - // Inputs describe input devices - Inputs []Input `json:"inputs,omitempty"` - // Whether to attach a pod network interface. Defaults to true. - AutoattachPodInterface *bool `json:"autoattachPodInterface,omitempty"` - // Whether to attach the default graphics device or not. - // VNC will not be available if set to false. Defaults to true. - AutoattachGraphicsDevice *bool `json:"autoattachGraphicsDevice,omitempty"` - // Whether to have random number generator from host - // +optional - Rng *Rng `json:"rng,omitempty"` - // Whether or not to enable virtio multi-queue for block devices - // +optional - BlockMultiQueue *bool `json:"blockMultiQueue,omitempty"` - // If specified, virtual network interfaces configured with a virtio bus will also enable the vhost multiqueue feature - // +optional - NetworkInterfaceMultiQueue *bool `json:"networkInterfaceMultiqueue,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type Input struct { - // Bus indicates the bus of input device to emulate. - // Supported values: virtio, usb. - Bus string `json:"bus,omitempty"` - // Type indicated the type of input device. - // Supported values: tablet. - Type string `json:"type"` - // Name is the device name - Name string `json:"name"` -} - -// --- -// +k8s:openapi-gen=true -type Disk struct { - // Name is the device name - Name string `json:"name"` - // DiskDevice specifies as which device the disk should be added to the guest. - // Defaults to Disk. - DiskDevice `json:",inline"` - // BootOrder is an integer value > 0, used to determine ordering of boot devices. - // Lower values take precedence. - // Each disk or interface that has a boot order must have a unique value. - // Disks without a boot order are not tried if a disk with a boot order exists. - // +optional - BootOrder *uint `json:"bootOrder,omitempty"` - // Serial provides the ability to specify a serial number for the disk device. - // +optional - Serial string `json:"serial,omitempty"` - // dedicatedIOThread indicates this disk should have an exclusive IO Thread. - // Enabling this implies useIOThreads = true. - // Defaults to false. - // +optional - DedicatedIOThread *bool `json:"dedicatedIOThread,omitempty"` - // Cache specifies which kvm disk cache mode should be used. - // +optional - Cache DriverCache `json:"cache,omitempty"` -} - -// Represents the target of a volume to mount. -// Only one of its members may be specified. -// --- -// +k8s:openapi-gen=true -type DiskDevice struct { - // Attach a volume as a disk to the vmi. - Disk *DiskTarget `json:"disk,omitempty"` - // Attach a volume as a LUN to the vmi. - LUN *LunTarget `json:"lun,omitempty"` - // Attach a volume as a floppy to the vmi. - Floppy *FloppyTarget `json:"floppy,omitempty"` - // Attach a volume as a cdrom to the vmi. - CDRom *CDRomTarget `json:"cdrom,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type DiskTarget struct { - // Bus indicates the type of disk device to emulate. - // supported values: virtio, sata, scsi. - Bus string `json:"bus,omitempty"` - // ReadOnly. - // Defaults to false. - ReadOnly bool `json:"readonly,omitempty"` - // If specified, the virtual disk will be placed on the guests pci address with the specifed PCI address. For example: 0000:81:01.10 - // +optional - PciAddress string `json:"pciAddress,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type LunTarget struct { - // Bus indicates the type of disk device to emulate. - // supported values: virtio, sata, scsi. - Bus string `json:"bus,omitempty"` - // ReadOnly. - // Defaults to false. - ReadOnly bool `json:"readonly,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type FloppyTarget struct { - // ReadOnly. - // Defaults to false. - ReadOnly bool `json:"readonly,omitempty"` - // Tray indicates if the tray of the device is open or closed. - // Allowed values are "open" and "closed". - // Defaults to closed. - // +optional - Tray TrayState `json:"tray,omitempty"` -} - -// TrayState indicates if a tray of a cdrom or floppy is open or closed. -// --- -// +k8s:openapi-gen=true -type TrayState string - -const ( - // TrayStateOpen indicates that the tray of a cdrom or floppy is open. - TrayStateOpen TrayState = "open" - // TrayStateClosed indicates that the tray of a cdrom or floppy is closed. - TrayStateClosed TrayState = "closed" -) - -// --- -// +k8s:openapi-gen=true -type CDRomTarget struct { - // Bus indicates the type of disk device to emulate. - // supported values: virtio, sata, scsi. - Bus string `json:"bus,omitempty"` - // ReadOnly. - // Defaults to true. - ReadOnly *bool `json:"readonly,omitempty"` - // Tray indicates if the tray of the device is open or closed. - // Allowed values are "open" and "closed". - // Defaults to closed. - // +optional - Tray TrayState `json:"tray,omitempty"` -} - -// Volume represents a named volume in a vmi. -// --- -// +k8s:openapi-gen=true -type Volume struct { - // Volume's name. - // Must be a DNS_LABEL and unique within the vmi. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - Name string `json:"name"` - // VolumeSource represents the location and type of the mounted volume. - // Defaults to Disk, if no type is specified. - VolumeSource `json:",inline"` -} - -// Represents the source of a volume to mount. -// Only one of its members may be specified. -// --- -// +k8s:openapi-gen=true -type VolumeSource struct { - // HostDisk represents a disk created on the cluster level - // +optional - HostDisk *HostDisk `json:"hostDisk,omitempty"` - // PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. - // Directly attached to the vmi via qemu. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - // +optional - PersistentVolumeClaim *v1.PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"` - // CloudInitNoCloud represents a cloud-init NoCloud user-data source. - // The NoCloud data will be added as a disk to the vmi. A proper cloud-init installation is required inside the guest. - // More info: http://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html - // +optional - CloudInitNoCloud *CloudInitNoCloudSource `json:"cloudInitNoCloud,omitempty"` - // CloudInitConfigDrive represents a cloud-init Config Drive user-data source. - // The Config Drive data will be added as a disk to the vmi. A proper cloud-init installation is required inside the guest. - // More info: https://cloudinit.readthedocs.io/en/latest/topics/datasources/configdrive.html - // +optional - CloudInitConfigDrive *CloudInitConfigDriveSource `json:"cloudInitConfigDrive,omitempty"` - // ContainerDisk references a docker image, embedding a qcow or raw disk. - // More info: https://kubevirt.gitbooks.io/user-guide/registry-disk.html - // +optional - ContainerDisk *ContainerDiskSource `json:"containerDisk,omitempty"` - // Ephemeral is a special volume source that "wraps" specified source and provides copy-on-write image on top of it. - // +optional - Ephemeral *EphemeralVolumeSource `json:"ephemeral,omitempty"` - // EmptyDisk represents a temporary disk which shares the vmis lifecycle. - // More info: https://kubevirt.gitbooks.io/user-guide/disks-and-volumes.html - // +optional - EmptyDisk *EmptyDiskSource `json:"emptyDisk,omitempty"` - // DataVolume represents the dynamic creation a PVC for this volume as well as - // the process of populating that PVC with a disk image. - // +optional - DataVolume *DataVolumeSource `json:"dataVolume,omitempty"` - // ConfigMapSource represents a reference to a ConfigMap in the same namespace. - // More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/ - // +optional - ConfigMap *ConfigMapVolumeSource `json:"configMap,omitempty"` - // SecretVolumeSource represents a reference to a secret data in the same namespace. - // More info: https://kubernetes.io/docs/concepts/configuration/secret/ - // +optional - Secret *SecretVolumeSource `json:"secret,omitempty"` - // ServiceAccountVolumeSource represents a reference to a service account. - // There can only be one volume of this type! - // More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ - // +optional - ServiceAccount *ServiceAccountVolumeSource `json:"serviceAccount,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type DataVolumeSource struct { - // Name represents the name of the DataVolume in the same namespace - Name string `json:"name"` -} - -// --- -// +k8s:openapi-gen=true -type EphemeralVolumeSource struct { - // PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. - // Directly attached to the vmi via qemu. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - // +optional - PersistentVolumeClaim *v1.PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"` -} - -// EmptyDisk represents a temporary disk which shares the vmis lifecycle. -// --- -// +k8s:openapi-gen=true -type EmptyDiskSource struct { - // Capacity of the sparse disk. - Capacity resource.Quantity `json:"capacity"` -} - -// Represents a docker image with an embedded disk. -// --- -// +k8s:openapi-gen=true -type ContainerDiskSource struct { - // Image is the name of the image with the embedded disk. - Image string `json:"image"` - // ImagePullSecret is the name of the Docker registry secret required to pull the image. The secret must already exist. - ImagePullSecret string `json:"imagePullSecret,omitempty"` - // Path defines the path to disk file in the container - Path string `json:"path,omitempty"` - // Image pull policy. - // One of Always, Never, IfNotPresent. - // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. - // Cannot be updated. - // More info: https://kubernetes.io/docs/concepts/containers/images#updating-images - // +optional - ImagePullPolicy v1.PullPolicy `json:"imagePullPolicy,omitempty"` -} - -// Exactly one of its members must be set. -// --- -// +k8s:openapi-gen=true -type ClockOffset struct { - // UTC sets the guest clock to UTC on each boot. If an offset is specified, - // guest changes to the clock will be kept during reboots and are not reset. - UTC *ClockOffsetUTC `json:"utc,omitempty"` - // Timezone sets the guest clock to the specified timezone. - // Zone name follows the TZ environment variable format (e.g. 'America/New_York'). - Timezone *ClockOffsetTimezone `json:"timezone,omitempty"` -} - -// UTC sets the guest clock to UTC on each boot. -// --- -// +k8s:openapi-gen=true -type ClockOffsetUTC struct { - // OffsetSeconds specifies an offset in seconds, relative to UTC. If set, - // guest changes to the clock will be kept during reboots and not reset. - OffsetSeconds *int `json:"offsetSeconds,omitempty"` -} - -// ClockOffsetTimezone sets the guest clock to the specified timezone. -// Zone name follows the TZ environment variable format (e.g. 'America/New_York'). -// --- -// +k8s:openapi-gen=true -type ClockOffsetTimezone string - -// Represents the clock and timers of a vmi. -// --- -// +k8s:openapi-gen=true -type Clock struct { - // ClockOffset allows specifying the UTC offset or the timezone of the guest clock. - ClockOffset `json:",inline"` - // Timer specifies whih timers are attached to the vmi. - Timer *Timer `json:"timer,inline"` -} - -// Represents all available timers in a vmi. -// --- -// +k8s:openapi-gen=true -type Timer struct { - // HPET (High Precision Event Timer) - multiple timers with periodic interrupts. - HPET *HPETTimer `json:"hpet,omitempty"` - // KVM (KVM clock) - lets guests read the host’s wall clock time (paravirtualized). For linux guests. - KVM *KVMTimer `json:"kvm,omitempty"` - // PIT (Programmable Interval Timer) - a timer with periodic interrupts. - PIT *PITTimer `json:"pit,omitempty"` - // RTC (Real Time Clock) - a continuously running timer with periodic interrupts. - RTC *RTCTimer `json:"rtc,omitempty"` - // Hyperv (Hypervclock) - lets guests read the host’s wall clock time (paravirtualized). For windows guests. - Hyperv *HypervTimer `json:"hyperv,omitempty"` -} - -// HPETTickPolicy determines what happens when QEMU misses a deadline for injecting a tick to the guest. -// --- -// +k8s:openapi-gen=true -type HPETTickPolicy string - -// PITTickPolicy determines what happens when QEMU misses a deadline for injecting a tick to the guest. -// --- -// +k8s:openapi-gen=true -type PITTickPolicy string - -// RTCTickPolicy determines what happens when QEMU misses a deadline for injecting a tick to the guest. -// --- -// +k8s:openapi-gen=true -type RTCTickPolicy string - -const ( - // HPETTickPolicyDelay delivers ticks at a constant rate. The guest time will - // be delayed due to the late tick - HPETTickPolicyDelay HPETTickPolicy = "delay" - // HPETTickPolicyCatchup Delivers ticks at a higher rate to catch up with the - // missed tick. The guest time should not be delayed once catchup is complete - HPETTickPolicyCatchup HPETTickPolicy = "catchup" - // HPETTickPolicyMerge merges the missed tick(s) into one tick and inject. The - // guest time may be delayed, depending on how the OS reacts to the merging - // of ticks. - HPETTickPolicyMerge HPETTickPolicy = "merge" - // HPETTickPolicyDiscard discards all missed ticks. - HPETTickPolicyDiscard HPETTickPolicy = "discard" - - // PITTickPolicyDelay delivers ticks at a constant rate. The guest time will - // be delayed due to the late tick. - PITTickPolicyDelay PITTickPolicy = "delay" - // PITTickPolicyCatchup Delivers ticks at a higher rate to catch up with the - // missed tick. The guest time should not be delayed once catchup is complete. - PITTickPolicyCatchup PITTickPolicy = "catchup" - // PITTickPolicyDiscard discards all missed ticks. - PITTickPolicyDiscard PITTickPolicy = "discard" - - // RTCTickPolicyDelay delivers ticks at a constant rate. The guest time will - // be delayed due to the late tick. - RTCTickPolicyDelay RTCTickPolicy = "delay" - // RTCTickPolicyCatchup Delivers ticks at a higher rate to catch up with the - // missed tick. The guest time should not be delayed once catchup is complete. - RTCTickPolicyCatchup RTCTickPolicy = "catchup" -) - -// RTCTimerTrack specifies from which source to track the time. -// --- -// +k8s:openapi-gen=true -type RTCTimerTrack string - -const ( - // TrackGuest tracks the guest time. - TrackGuest RTCTimerTrack = "guest" - // TrackWall tracks the host time. - TrackWall RTCTimerTrack = "wall" -) - -// --- -// +k8s:openapi-gen=true -type RTCTimer struct { - // TickPolicy determines what happens when QEMU misses a deadline for injecting a tick to the guest. - // One of "delay", "catchup". - TickPolicy RTCTickPolicy `json:"tickPolicy,omitempty"` - // Enabled set to false makes sure that the machine type or a preset can't add the timer. - // Defaults to true. - // +optional - Enabled *bool `json:"present,omitempty"` - // Track the guest or the wall clock. - Track RTCTimerTrack `json:"track,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type HPETTimer struct { - // TickPolicy determines what happens when QEMU misses a deadline for injecting a tick to the guest. - // One of "delay", "catchup", "merge", "discard". - TickPolicy HPETTickPolicy `json:"tickPolicy,omitempty"` - // Enabled set to false makes sure that the machine type or a preset can't add the timer. - // Defaults to true. - // +optional - Enabled *bool `json:"present,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type PITTimer struct { - // TickPolicy determines what happens when QEMU misses a deadline for injecting a tick to the guest. - // One of "delay", "catchup", "discard". - TickPolicy PITTickPolicy `json:"tickPolicy,omitempty"` - // Enabled set to false makes sure that the machine type or a preset can't add the timer. - // Defaults to true. - // +optional - Enabled *bool `json:"present,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type KVMTimer struct { - // Enabled set to false makes sure that the machine type or a preset can't add the timer. - // Defaults to true. - // +optional - Enabled *bool `json:"present,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type HypervTimer struct { - // Enabled set to false makes sure that the machine type or a preset can't add the timer. - // Defaults to true. - // +optional - Enabled *bool `json:"present,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type Features struct { - // ACPI enables/disables ACPI insidejsondata guest. - // Defaults to enabled. - // +optional - ACPI FeatureState `json:"acpi,omitempty"` - // Defaults to the machine type setting. - // +optional - APIC *FeatureAPIC `json:"apic,omitempty"` - // Defaults to the machine type setting. - // +optional - Hyperv *FeatureHyperv `json:"hyperv,omitempty"` - // SMM enables/disables System Management Mode. - // TSEG not yet implemented. - // +optional - SMM *FeatureState `json:"smm,omitempty"` -} - -// Represents if a feature is enabled or disabled. -// --- -// +k8s:openapi-gen=true -type FeatureState struct { - // Enabled determines if the feature should be enabled or disabled on the guest. - // Defaults to true. - // +optional - Enabled *bool `json:"enabled,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type FeatureAPIC struct { - // Enabled determines if the feature should be enabled or disabled on the guest. - // Defaults to true. - // +optional - Enabled *bool `json:"enabled,omitempty"` - // EndOfInterrupt enables the end of interrupt notification in the guest. - // Defaults to false. - // +optional - EndOfInterrupt bool `json:"endOfInterrupt,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type FeatureSpinlocks struct { - // Enabled determines if the feature should be enabled or disabled on the guest. - // Defaults to true. - // +optional - Enabled *bool `json:"enabled,omitempty"` - // Retries indicates the number of retries. - // Must be a value greater or equal 4096. - // Defaults to 4096. - // +optional - Retries *uint32 `json:"spinlocks,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type FeatureVendorID struct { - // Enabled determines if the feature should be enabled or disabled on the guest. - // Defaults to true. - // +optional - Enabled *bool `json:"enabled,omitempty"` - // VendorID sets the hypervisor vendor id, visible to the vmi. - // String up to twelve characters. - VendorID string `json:"vendorid,omitempty"` -} - -// Hyperv specific features. -// --- -// +k8s:openapi-gen=true -type FeatureHyperv struct { - // Relaxed instructs the guest OS to disable watchdog timeouts. - // Defaults to the machine type setting. - // +optional - Relaxed *FeatureState `json:"relaxed,omitempty"` - // VAPIC improves the paravirtualized handling of interrupts. - // Defaults to the machine type setting. - // +optional - VAPIC *FeatureState `json:"vapic,omitempty"` - // Spinlocks allows to configure the spinlock retry attempts. - // +optional - Spinlocks *FeatureSpinlocks `json:"spinlocks,omitempty"` - // VPIndex enables the Virtual Processor Index to help windows identifying virtual processors. - // Defaults to the machine type setting. - // +optional - VPIndex *FeatureState `json:"vpindex,omitempty"` - // Runtime improves the time accounting to improve scheduling in the guest. - // Defaults to the machine type setting. - // +optional - Runtime *FeatureState `json:"runtime,omitempty"` - // SyNIC enables the Synthetic Interrupt Controller. - // Defaults to the machine type setting. - // +optional - SyNIC *FeatureState `json:"synic,omitempty"` - // SyNICTimer enables Synthetic Interrupt Controller Timers, reducing CPU load. - // Defaults to the machine type setting. - // +optional - SyNICTimer *FeatureState `json:"synictimer,omitempty"` - // Reset enables Hyperv reboot/reset for the vmi. Requires synic. - // Defaults to the machine type setting. - // +optional - Reset *FeatureState `json:"reset,omitempty"` - // VendorID allows setting the hypervisor vendor id. - // Defaults to the machine type setting. - // +optional - VendorID *FeatureVendorID `json:"vendorid,omitempty"` - // Frequencies improves the TSC clock source handling for Hyper-V on KVM. - // Defaults to the machine type setting. - // +optional - Frequencies *FeatureState `json:"frequencies,omitempty"` - // Reenlightenment enables the notifications on TSC frequency changes. - // Defaults to the machine type setting. - // +optional - Reenlightenment *FeatureState `json:"reenlightenment,omitempty"` - // TLBFlush improves performances in overcommited environments. Requires vpindex. - // Defaults to the machine type setting. - // +optional - TLBFlush *FeatureState `json:"tlbflush,omitempty"` - // IPI improves performances in overcommited environments. Requires vpindex. - // Defaults to the machine type setting. - // +optional - IPI *FeatureState `json:"ipi,omitempty"` - // EVMCS Speeds up L2 vmexits, but disables other virtualization features. Requires vapic. - // Defaults to the machine type setting. - // +optional - EVMCS *FeatureState `json:"evmcs,omitempty"` -} - -// WatchdogAction defines the watchdog action, if a watchdog gets triggered. -// --- -// +k8s:openapi-gen=true -type WatchdogAction string - -const ( - // WatchdogActionPoweroff will poweroff the vmi if the watchdog gets triggered. - WatchdogActionPoweroff WatchdogAction = "poweroff" - // WatchdogActionReset will reset the vmi if the watchdog gets triggered. - WatchdogActionReset WatchdogAction = "reset" - // WatchdogActionShutdown will shutdown the vmi if the watchdog gets triggered. - WatchdogActionShutdown WatchdogAction = "shutdown" -) - -// Named watchdog device. -// --- -// +k8s:openapi-gen=true -type Watchdog struct { - // Name of the watchdog. - Name string `json:"name"` - // WatchdogDevice contains the watchdog type and actions. - // Defaults to i6300esb. - WatchdogDevice `json:",inline"` -} - -// Hardware watchdog device. -// Exactly one of its members must be set. -// --- -// +k8s:openapi-gen=true -type WatchdogDevice struct { - // i6300esb watchdog device. - // +optional - I6300ESB *I6300ESBWatchdog `json:"i6300esb,omitempty"` -} - -// i6300esb watchdog device. -// --- -// +k8s:openapi-gen=true -type I6300ESBWatchdog struct { - // The action to take. Valid values are poweroff, reset, shutdown. - // Defaults to reset. - Action WatchdogAction `json:"action,omitempty"` -} - -// TODO ballooning, rng, cpu ... - -func NewMinimalDomainSpec() DomainSpec { - domain := DomainSpec{} - domain.Resources.Requests = v1.ResourceList{ - v1.ResourceMemory: resource.MustParse("8192Ki"), - } - return domain -} - -// --- -// +k8s:openapi-gen=true -type Interface struct { - // Logical name of the interface as well as a reference to the associated networks. - // Must match the Name of a Network. - Name string `json:"name"` - // Interface model. - // One of: e1000, e1000e, ne2k_pci, pcnet, rtl8139, virtio. - // Defaults to virtio. - // TODO:(ihar) switch to enums once opengen-api supports them. See: https://github.com/kubernetes/kube-openapi/issues/51 - Model string `json:"model,omitempty"` - // BindingMethod specifies the method which will be used to connect the interface to the guest. - // Defaults to Bridge. - InterfaceBindingMethod `json:",inline"` - // List of ports to be forwarded to the virtual machine. - Ports []Port `json:"ports,omitempty"` - // Interface MAC address. For example: de:ad:00:00:be:af or DE-AD-00-00-BE-AF. - MacAddress string `json:"macAddress,omitempty"` - // BootOrder is an integer value > 0, used to determine ordering of boot devices. - // Lower values take precedence. - // Each interface or disk that has a boot order must have a unique value. - // Interfaces without a boot order are not tried. - // +optional - BootOrder *uint `json:"bootOrder,omitempty"` - // If specified, the virtual network interface will be placed on the guests pci address with the specifed PCI address. For example: 0000:81:01.10 - // +optional - PciAddress string `json:"pciAddress,omitempty"` - // If specified the network interface will pass additional DHCP options to the VMI - // +optional - DHCPOptions *DHCPOptions `json:"dhcpOptions,omitempty"` -} - -// Extra DHCP options to use in the interface. -// --- -// +k8s:openapi-gen=true -type DHCPOptions struct { - // If specified will pass option 67 to interface's DHCP server - // +optional - BootFileName string `json:"bootFileName,omitempty"` - // If specified will pass option 66 to interface's DHCP server - // +optional - TFTPServerName string `json:"tftpServerName,omitempty"` - // If specified will pass the configured NTP server to the VM via DHCP option 042. - // +optional - NTPServers []string `json:"ntpServers,omitempty"` - // If specified will pass extra DHCP options for private use, range: 224-254 - // +optional - PrivateOptions []DHCPPrivateOptions `json:"privateOptions,omitempty"` -} - -// DHCPExtraOptions defines Extra DHCP options for a VM. -type DHCPPrivateOptions struct { - // Option is an Integer value from 224-254 - // Required. - Option int `json:"option"` - // Value is a String value for the Option provided - // Required. - Value string `json:"value"` -} - -// Represents the method which will be used to connect the interface to the guest. -// Only one of its members may be specified. -// --- -// +k8s:openapi-gen=true -type InterfaceBindingMethod struct { - Bridge *InterfaceBridge `json:"bridge,omitempty"` - Slirp *InterfaceSlirp `json:"slirp,omitempty"` - Masquerade *InterfaceMasquerade `json:"masquerade,omitempty"` - SRIOV *InterfaceSRIOV `json:"sriov,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type InterfaceBridge struct{} - -// --- -// +k8s:openapi-gen=true -type InterfaceSlirp struct{} - -// --- -// +k8s:openapi-gen=true -type InterfaceMasquerade struct{} - -// --- -// +k8s:openapi-gen=true -type InterfaceSRIOV struct{} - -// Port repesents a port to expose from the virtual machine. -// Default protocol TCP. -// The port field is mandatory -// --- -// +k8s:openapi-gen=true -type Port struct { - // If specified, this must be an IANA_SVC_NAME and unique within the pod. Each - // named port in a pod must have a unique name. Name for the port that can be - // referred to by services. - // +optional - Name string `json:"name,omitempty"` - // Protocol for port. Must be UDP or TCP. - // Defaults to "TCP". - // +optional - Protocol string `json:"protocol,omitempty"` - // Number of port to expose for the virtual machine. - // This must be a valid port number, 0 < x < 65536. - Port int32 `json:"port"` -} - -// Network represents a network type and a resource that should be connected to the vm. -// --- -// +k8s:openapi-gen=true -type Network struct { - // Network name. - // Must be a DNS_LABEL and unique within the vm. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - Name string `json:"name"` - // NetworkSource represents the network type and the source interface that should be connected to the virtual machine. - // Defaults to Pod, if no type is specified. - NetworkSource `json:",inline"` -} - -// Represents the source resource that will be connected to the vm. -// Only one of its members may be specified. -// --- -// +k8s:openapi-gen=true -type NetworkSource struct { - Pod *PodNetwork `json:"pod,omitempty"` - Multus *MultusNetwork `json:"multus,omitempty"` - Genie *GenieNetwork `json:"genie,omitempty"` -} - -// Represents the stock pod network interface. -// --- -// +k8s:openapi-gen=true -type PodNetwork struct { - // CIDR for vm network. - // Default 10.0.2.0/24 if not specified. - VMNetworkCIDR string `json:"vmNetworkCIDR,omitempty"` -} - -// Rng represents the random device passed from host -// --- -// +k8s:openapi-gen=true -type Rng struct { -} - -// Represents the genie cni network. -// --- -// +k8s:openapi-gen=true -type GenieNetwork struct { - // References the CNI plugin name. - NetworkName string `json:"networkName"` -} - -// Represents the multus cni network. -// --- -// +k8s:openapi-gen=true -type MultusNetwork struct { - // References to a NetworkAttachmentDefinition CRD object. Format: - // , /. If namespace is not - // specified, VMI namespace is assumed. - NetworkName string `json:"networkName"` - - // Select the default network and add it to the - // multus-cni.io/default-network annotation. - Default bool `json:"default,omitempty"` -} 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 deleted file mode 100644 index c44b860e2313..000000000000 --- a/vendor/kubevirt.io/client-go/api/v1/schema_swagger_generated.go +++ /dev/null @@ -1,522 +0,0 @@ -// Code generated by swagger-doc. DO NOT EDIT. - -package v1 - -func (HostDisk) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents a disk created on the cluster level", - "path": "The path to HostDisk image located on the cluster", - "type": "Contains information if disk.img exists or should be created\nallowed options are 'Disk' and 'DiskOrCreate'", - "capacity": "Capacity of the sparse disk\n+optional", - "shared": "Shared indicate whether the path is shared between nodes", - } -} - -func (ConfigMapVolumeSource) SwaggerDoc() map[string]string { - return map[string]string{ - "": "ConfigMapVolumeSource adapts a ConfigMap into a volume.\nMore info: https://kubernetes.io/docs/concepts/storage/volumes/#configmap", - "optional": "Specify whether the ConfigMap or it's keys must be defined\n+optional", - } -} - -func (SecretVolumeSource) SwaggerDoc() map[string]string { - return map[string]string{ - "": "SecretVolumeSource adapts a Secret into a volume.", - "secretName": "Name of the secret in the pod's namespace to use.\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#secret\n+optional", - "optional": "Specify whether the Secret or it's keys must be defined\n+optional", - } -} - -func (ServiceAccountVolumeSource) SwaggerDoc() map[string]string { - return map[string]string{ - "": "ServiceAccountVolumeSource adapts a ServiceAccount into a volume.", - "serviceAccountName": "Name of the service account in the pod's namespace to use.\nMore info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", - } -} - -func (CloudInitNoCloudSource) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents a cloud-init nocloud user data source.\nMore info: http://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html", - "secretRef": "UserDataSecretRef references a k8s secret that contains NoCloud userdata.\n+ optional", - "userDataBase64": "UserDataBase64 contains NoCloud cloud-init userdata as a base64 encoded string.\n+ optional", - "userData": "UserData contains NoCloud inline cloud-init userdata.\n+ optional", - "networkDataSecretRef": "NetworkDataSecretRef references a k8s secret that contains NoCloud networkdata.\n+ optional", - "networkDataBase64": "NetworkDataBase64 contains NoCloud cloud-init networkdata as a base64 encoded string.\n+ optional", - "networkData": "NetworkData contains NoCloud inline cloud-init networkdata.\n+ optional", - } -} - -func (CloudInitConfigDriveSource) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents a cloud-init config drive user data source.\nMore info: https://cloudinit.readthedocs.io/en/latest/topics/datasources/configdrive.html", - "secretRef": "UserDataSecretRef references a k8s secret that contains config drive userdata.\n+ optional", - "userDataBase64": "UserDataBase64 contains config drive cloud-init userdata as a base64 encoded string.\n+ optional", - "userData": "UserData contains config drive inline cloud-init userdata.\n+ optional", - "networkDataSecretRef": "NetworkDataSecretRef references a k8s secret that contains config drive networkdata.\n+ optional", - "networkDataBase64": "NetworkDataBase64 contains config drive cloud-init networkdata as a base64 encoded string.\n+ optional", - "networkData": "NetworkData contains config drive inline cloud-init networkdata.\n+ optional", - } -} - -func (DomainSpec) SwaggerDoc() map[string]string { - return map[string]string{ - "resources": "Resources describes the Compute Resources required by this vmi.", - "cpu": "CPU allow specified the detailed CPU topology inside the vmi.\n+optional", - "memory": "Memory allow specifying the VMI memory features.\n+optional", - "machine": "Machine type.\n+optional", - "firmware": "Firmware.\n+optional", - "clock": "Clock sets the clock and timers of the vmi.\n+optional", - "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", - } -} - -func (Bootloader) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents the firmware blob used to assist in the domain creation process.\nUsed for setting the QEMU BIOS file path for the libvirt domain.", - "bios": "If set (default), BIOS will be used.\n+optional", - "efi": "If set, EFI will be used instead of BIOS.\n+optional", - } -} - -func (BIOS) SwaggerDoc() map[string]string { - return map[string]string{ - "": "If set (default), BIOS will be used.", - } -} - -func (EFI) SwaggerDoc() map[string]string { - return map[string]string{ - "": "If set, EFI will be used instead of BIOS.", - } -} - -func (ResourceRequirements) SwaggerDoc() map[string]string { - return map[string]string{ - "requests": "Requests is a description of the initial vmi resources.\nValid resource keys are \"memory\" and \"cpu\".\n+optional", - "limits": "Limits describes the maximum amount of compute resources allowed.\nValid resource keys are \"memory\" and \"cpu\".\n+optional", - "overcommitGuestOverhead": "Don't ask the scheduler to take the guest-management overhead into account. Instead\nput the overhead only into the requested memory limits. This can lead to crashes if\nall memory is in use on a node. Defaults to false.", - } -} - -func (CPU) SwaggerDoc() map[string]string { - return map[string]string{ - "": "CPU allows specifying the CPU topology.", - "cores": "Cores specifies the number of cores inside the vmi.\nMust be a value greater or equal 1.", - "sockets": "Sockets specifies the number of sockets inside the vmi.\nMust be a value greater or equal 1.", - "threads": "Threads specifies the number of threads inside the vmi.\nMust be a value greater or equal 1.", - "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", - } -} - -func (CPUFeature) SwaggerDoc() map[string]string { - return map[string]string{ - "": "CPUFeature allows specifying a CPU feature.", - "name": "Name of the CPU feature", - "policy": "Policy is the CPU feature attribute which can have the following attributes:\nforce - The virtual CPU will claim the feature is supported regardless of it being supported by host CPU.\nrequire - Guest creation will fail unless the feature is supported by the host CPU or the hypervisor is able to emulate it.\noptional - The feature will be supported by virtual CPU if and only if it is supported by host CPU.\ndisable - The feature will not be supported by virtual CPU.\nforbid - Guest creation will fail if the feature is supported by host CPU.\nDefaults to require\n+optional", - } -} - -func (Memory) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Memory allows specifying the VirtualMachineInstance memory features.", - "hugepages": "Hugepages allow to use hugepages for the VirtualMachineInstance instead of regular memory.\n+optional", - "guest": "Guest allows to specifying the amount of memory which is visible inside the Guest OS.\nThe Guest must lie between Requests and Limits from the resources section.\nDefaults to the requested memory in the resources section if not specified.\n+ optional", - } -} - -func (Hugepages) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Hugepages allow to use hugepages for the VirtualMachineInstance instead of regular memory.", - "pageSize": "PageSize specifies the hugepage size, for x86_64 architecture valid values are 1Gi and 2Mi.", - } -} - -func (Machine) SwaggerDoc() map[string]string { - return map[string]string{ - "type": "QEMU machine type is the actual chipset of the VirtualMachineInstance.", - } -} - -func (Firmware) SwaggerDoc() map[string]string { - return map[string]string{ - "uuid": "UUID reported by the vmi bios.\nDefaults to a random generated uid.", - "bootloader": "Settings to control the bootloader that is used.\n+optional", - "serial": "The system-serial-number in SMBIOS", - } -} - -func (Devices) SwaggerDoc() map[string]string { - return map[string]string{ - "disks": "Disks describes disks, cdroms, floppy and luns which are connected to the vmi.", - "watchdog": "Watchdog describes a watchdog device which can be added to the vmi.", - "interfaces": "Interfaces describe network interfaces which are added to the vmi.", - "inputs": "Inputs describe input devices", - "autoattachPodInterface": "Whether to attach a pod network interface. Defaults to true.", - "autoattachGraphicsDevice": "Whether to attach the default graphics device or not.\nVNC will not be available if set to false. Defaults to true.", - "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", - } -} - -func (Input) SwaggerDoc() map[string]string { - return map[string]string{ - "bus": "Bus indicates the bus of input device to emulate.\nSupported values: virtio, usb.", - "type": "Type indicated the type of input device.\nSupported values: tablet.", - "name": "Name is the device name", - } -} - -func (Disk) SwaggerDoc() map[string]string { - return map[string]string{ - "name": "Name is the device name", - "bootOrder": "BootOrder is an integer value > 0, used to determine ordering of boot devices.\nLower values take precedence.\nEach disk or interface that has a boot order must have a unique value.\nDisks without a boot order are not tried if a disk with a boot order exists.\n+optional", - "serial": "Serial provides the ability to specify a serial number for the disk device.\n+optional", - "dedicatedIOThread": "dedicatedIOThread indicates this disk should have an exclusive IO Thread.\nEnabling this implies useIOThreads = true.\nDefaults to false.\n+optional", - "cache": "Cache specifies which kvm disk cache mode should be used.\n+optional", - } -} - -func (DiskDevice) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents the target of a volume to mount.\nOnly one of its members may be specified.", - "disk": "Attach a volume as a disk to the vmi.", - "lun": "Attach a volume as a LUN to the vmi.", - "floppy": "Attach a volume as a floppy to the vmi.", - "cdrom": "Attach a volume as a cdrom to the vmi.", - } -} - -func (DiskTarget) SwaggerDoc() map[string]string { - return map[string]string{ - "bus": "Bus indicates the type of disk device to emulate.\nsupported values: virtio, sata, scsi.", - "readonly": "ReadOnly.\nDefaults to false.", - "pciAddress": "If specified, the virtual disk will be placed on the guests pci address with the specifed PCI address. For example: 0000:81:01.10\n+optional", - } -} - -func (LunTarget) SwaggerDoc() map[string]string { - return map[string]string{ - "bus": "Bus indicates the type of disk device to emulate.\nsupported values: virtio, sata, scsi.", - "readonly": "ReadOnly.\nDefaults to false.", - } -} - -func (FloppyTarget) SwaggerDoc() map[string]string { - return map[string]string{ - "readonly": "ReadOnly.\nDefaults to false.", - "tray": "Tray indicates if the tray of the device is open or closed.\nAllowed values are \"open\" and \"closed\".\nDefaults to closed.\n+optional", - } -} - -func (CDRomTarget) SwaggerDoc() map[string]string { - return map[string]string{ - "bus": "Bus indicates the type of disk device to emulate.\nsupported values: virtio, sata, scsi.", - "readonly": "ReadOnly.\nDefaults to true.", - "tray": "Tray indicates if the tray of the device is open or closed.\nAllowed values are \"open\" and \"closed\".\nDefaults to closed.\n+optional", - } -} - -func (Volume) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Volume represents a named volume in a vmi.", - "name": "Volume's name.\nMust be a DNS_LABEL and unique within the vmi.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - } -} - -func (VolumeSource) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents the source of a volume to mount.\nOnly one of its members may be specified.", - "hostDisk": "HostDisk represents a disk created on the cluster level\n+optional", - "persistentVolumeClaim": "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace.\nDirectly attached to the vmi via qemu.\nMore info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims\n+optional", - "cloudInitNoCloud": "CloudInitNoCloud represents a cloud-init NoCloud user-data source.\nThe NoCloud data will be added as a disk to the vmi. A proper cloud-init installation is required inside the guest.\nMore info: http://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html\n+optional", - "cloudInitConfigDrive": "CloudInitConfigDrive represents a cloud-init Config Drive user-data source.\nThe Config Drive data will be added as a disk to the vmi. A proper cloud-init installation is required inside the guest.\nMore info: https://cloudinit.readthedocs.io/en/latest/topics/datasources/configdrive.html\n+optional", - "containerDisk": "ContainerDisk references a docker image, embedding a qcow or raw disk.\nMore info: https://kubevirt.gitbooks.io/user-guide/registry-disk.html\n+optional", - "ephemeral": "Ephemeral is a special volume source that \"wraps\" specified source and provides copy-on-write image on top of it.\n+optional", - "emptyDisk": "EmptyDisk represents a temporary disk which shares the vmis lifecycle.\nMore info: https://kubevirt.gitbooks.io/user-guide/disks-and-volumes.html\n+optional", - "dataVolume": "DataVolume represents the dynamic creation a PVC for this volume as well as\nthe process of populating that PVC with a disk image.\n+optional", - "configMap": "ConfigMapSource represents a reference to a ConfigMap in the same namespace.\nMore info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/\n+optional", - "secret": "SecretVolumeSource represents a reference to a secret data in the same namespace.\nMore info: https://kubernetes.io/docs/concepts/configuration/secret/\n+optional", - "serviceAccount": "ServiceAccountVolumeSource represents a reference to a service account.\nThere can only be one volume of this type!\nMore info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/\n+optional", - } -} - -func (DataVolumeSource) SwaggerDoc() map[string]string { - return map[string]string{ - "name": "Name represents the name of the DataVolume in the same namespace", - } -} - -func (EphemeralVolumeSource) SwaggerDoc() map[string]string { - return map[string]string{ - "persistentVolumeClaim": "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace.\nDirectly attached to the vmi via qemu.\nMore info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims\n+optional", - } -} - -func (EmptyDiskSource) SwaggerDoc() map[string]string { - return map[string]string{ - "": "EmptyDisk represents a temporary disk which shares the vmis lifecycle.", - "capacity": "Capacity of the sparse disk.", - } -} - -func (ContainerDiskSource) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents a docker image with an embedded disk.", - "image": "Image is the name of the image with the embedded disk.", - "imagePullSecret": "ImagePullSecret is the name of the Docker registry secret required to pull the image. The secret must already exist.", - "path": "Path defines the path to disk file in the container", - "imagePullPolicy": "Image pull policy.\nOne of Always, Never, IfNotPresent.\nDefaults to Always if :latest tag is specified, or IfNotPresent otherwise.\nCannot be updated.\nMore info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n+optional", - } -} - -func (ClockOffset) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Exactly one of its members must be set.", - "utc": "UTC sets the guest clock to UTC on each boot. If an offset is specified,\nguest changes to the clock will be kept during reboots and are not reset.", - "timezone": "Timezone sets the guest clock to the specified timezone.\nZone name follows the TZ environment variable format (e.g. 'America/New_York').", - } -} - -func (ClockOffsetUTC) SwaggerDoc() map[string]string { - return map[string]string{ - "": "UTC sets the guest clock to UTC on each boot.", - "offsetSeconds": "OffsetSeconds specifies an offset in seconds, relative to UTC. If set,\nguest changes to the clock will be kept during reboots and not reset.", - } -} - -func (Clock) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents the clock and timers of a vmi.", - "timer": "Timer specifies whih timers are attached to the vmi.", - } -} - -func (Timer) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents all available timers in a vmi.", - "hpet": "HPET (High Precision Event Timer) - multiple timers with periodic interrupts.", - "kvm": "KVM \t(KVM clock) - lets guests read the host’s wall clock time (paravirtualized). For linux guests.", - "pit": "PIT (Programmable Interval Timer) - a timer with periodic interrupts.", - "rtc": "RTC (Real Time Clock) - a continuously running timer with periodic interrupts.", - "hyperv": "Hyperv (Hypervclock) - lets guests read the host’s wall clock time (paravirtualized). For windows guests.", - } -} - -func (RTCTimer) SwaggerDoc() map[string]string { - return map[string]string{ - "tickPolicy": "TickPolicy determines what happens when QEMU misses a deadline for injecting a tick to the guest.\nOne of \"delay\", \"catchup\".", - "present": "Enabled set to false makes sure that the machine type or a preset can't add the timer.\nDefaults to true.\n+optional", - "track": "Track the guest or the wall clock.", - } -} - -func (HPETTimer) SwaggerDoc() map[string]string { - return map[string]string{ - "tickPolicy": "TickPolicy determines what happens when QEMU misses a deadline for injecting a tick to the guest.\nOne of \"delay\", \"catchup\", \"merge\", \"discard\".", - "present": "Enabled set to false makes sure that the machine type or a preset can't add the timer.\nDefaults to true.\n+optional", - } -} - -func (PITTimer) SwaggerDoc() map[string]string { - return map[string]string{ - "tickPolicy": "TickPolicy determines what happens when QEMU misses a deadline for injecting a tick to the guest.\nOne of \"delay\", \"catchup\", \"discard\".", - "present": "Enabled set to false makes sure that the machine type or a preset can't add the timer.\nDefaults to true.\n+optional", - } -} - -func (KVMTimer) SwaggerDoc() map[string]string { - return map[string]string{ - "present": "Enabled set to false makes sure that the machine type or a preset can't add the timer.\nDefaults to true.\n+optional", - } -} - -func (HypervTimer) SwaggerDoc() map[string]string { - return map[string]string{ - "present": "Enabled set to false makes sure that the machine type or a preset can't add the timer.\nDefaults to true.\n+optional", - } -} - -func (Features) SwaggerDoc() map[string]string { - return map[string]string{ - "acpi": "ACPI enables/disables ACPI insidejsondata guest.\nDefaults to enabled.\n+optional", - "apic": "Defaults to the machine type setting.\n+optional", - "hyperv": "Defaults to the machine type setting.\n+optional", - "smm": "SMM enables/disables System Management Mode.\nTSEG not yet implemented.\n+optional", - } -} - -func (FeatureState) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents if a feature is enabled or disabled.", - "enabled": "Enabled determines if the feature should be enabled or disabled on the guest.\nDefaults to true.\n+optional", - } -} - -func (FeatureAPIC) SwaggerDoc() map[string]string { - return map[string]string{ - "enabled": "Enabled determines if the feature should be enabled or disabled on the guest.\nDefaults to true.\n+optional", - "endOfInterrupt": "EndOfInterrupt enables the end of interrupt notification in the guest.\nDefaults to false.\n+optional", - } -} - -func (FeatureSpinlocks) SwaggerDoc() map[string]string { - return map[string]string{ - "enabled": "Enabled determines if the feature should be enabled or disabled on the guest.\nDefaults to true.\n+optional", - "spinlocks": "Retries indicates the number of retries.\nMust be a value greater or equal 4096.\nDefaults to 4096.\n+optional", - } -} - -func (FeatureVendorID) SwaggerDoc() map[string]string { - return map[string]string{ - "enabled": "Enabled determines if the feature should be enabled or disabled on the guest.\nDefaults to true.\n+optional", - "vendorid": "VendorID sets the hypervisor vendor id, visible to the vmi.\nString up to twelve characters.", - } -} - -func (FeatureHyperv) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Hyperv specific features.", - "relaxed": "Relaxed instructs the guest OS to disable watchdog timeouts.\nDefaults to the machine type setting.\n+optional", - "vapic": "VAPIC improves the paravirtualized handling of interrupts.\nDefaults to the machine type setting.\n+optional", - "spinlocks": "Spinlocks allows to configure the spinlock retry attempts.\n+optional", - "vpindex": "VPIndex enables the Virtual Processor Index to help windows identifying virtual processors.\nDefaults to the machine type setting.\n+optional", - "runtime": "Runtime improves the time accounting to improve scheduling in the guest.\nDefaults to the machine type setting.\n+optional", - "synic": "SyNIC enables the Synthetic Interrupt Controller.\nDefaults to the machine type setting.\n+optional", - "synictimer": "SyNICTimer enables Synthetic Interrupt Controller Timers, reducing CPU load.\nDefaults to the machine type setting.\n+optional", - "reset": "Reset enables Hyperv reboot/reset for the vmi. Requires synic.\nDefaults to the machine type setting.\n+optional", - "vendorid": "VendorID allows setting the hypervisor vendor id.\nDefaults to the machine type setting.\n+optional", - "frequencies": "Frequencies improves the TSC clock source handling for Hyper-V on KVM.\nDefaults to the machine type setting.\n+optional", - "reenlightenment": "Reenlightenment enables the notifications on TSC frequency changes.\nDefaults to the machine type setting.\n+optional", - "tlbflush": "TLBFlush improves performances in overcommited environments. Requires vpindex.\nDefaults to the machine type setting.\n+optional", - "ipi": "IPI improves performances in overcommited environments. Requires vpindex.\nDefaults to the machine type setting.\n+optional", - "evmcs": "EVMCS Speeds up L2 vmexits, but disables other virtualization features. Requires vapic.\nDefaults to the machine type setting.\n+optional", - } -} - -func (Watchdog) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Named watchdog device.", - "name": "Name of the watchdog.", - } -} - -func (WatchdogDevice) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Hardware watchdog device.\nExactly one of its members must be set.", - "i6300esb": "i6300esb watchdog device.\n+optional", - } -} - -func (I6300ESBWatchdog) SwaggerDoc() map[string]string { - return map[string]string{ - "": "i6300esb watchdog device.", - "action": "The action to take. Valid values are poweroff, reset, shutdown.\nDefaults to reset.", - } -} - -func (Interface) SwaggerDoc() map[string]string { - return map[string]string{ - "name": "Logical name of the interface as well as a reference to the associated networks.\nMust match the Name of a Network.", - "model": "Interface model.\nOne of: e1000, e1000e, ne2k_pci, pcnet, rtl8139, virtio.\nDefaults to virtio.", - "ports": "List of ports to be forwarded to the virtual machine.", - "macAddress": "Interface MAC address. For example: de:ad:00:00:be:af or DE-AD-00-00-BE-AF.", - "bootOrder": "BootOrder is an integer value > 0, used to determine ordering of boot devices.\nLower values take precedence.\nEach interface or disk that has a boot order must have a unique value.\nInterfaces without a boot order are not tried.\n+optional", - "pciAddress": "If specified, the virtual network interface will be placed on the guests pci address with the specifed PCI address. For example: 0000:81:01.10\n+optional", - "dhcpOptions": "If specified the network interface will pass additional DHCP options to the VMI\n+optional", - } -} - -func (DHCPOptions) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Extra DHCP options to use in the interface.", - "bootFileName": "If specified will pass option 67 to interface's DHCP server\n+optional", - "tftpServerName": "If specified will pass option 66 to interface's DHCP server\n+optional", - "ntpServers": "If specified will pass the configured NTP server to the VM via DHCP option 042.\n+optional", - "privateOptions": "If specified will pass extra DHCP options for private use, range: 224-254\n+optional", - } -} - -func (DHCPPrivateOptions) SwaggerDoc() map[string]string { - return map[string]string{ - "": "DHCPExtraOptions defines Extra DHCP options for a VM.", - "option": "Option is an Integer value from 224-254\nRequired.", - "value": "Value is a String value for the Option provided\nRequired.", - } -} - -func (InterfaceBindingMethod) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents the method which will be used to connect the interface to the guest.\nOnly one of its members may be specified.", - } -} - -func (InterfaceBridge) SwaggerDoc() map[string]string { - return map[string]string{} -} - -func (InterfaceSlirp) SwaggerDoc() map[string]string { - return map[string]string{} -} - -func (InterfaceMasquerade) SwaggerDoc() map[string]string { - return map[string]string{} -} - -func (InterfaceSRIOV) SwaggerDoc() map[string]string { - return map[string]string{} -} - -func (Port) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Port repesents a port to expose from the virtual machine.\nDefault protocol TCP.\nThe port field is mandatory", - "name": "If specified, this must be an IANA_SVC_NAME and unique within the pod. Each\nnamed port in a pod must have a unique name. Name for the port that can be\nreferred to by services.\n+optional", - "protocol": "Protocol for port. Must be UDP or TCP.\nDefaults to \"TCP\".\n+optional", - "port": "Number of port to expose for the virtual machine.\nThis must be a valid port number, 0 < x < 65536.", - } -} - -func (Network) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Network represents a network type and a resource that should be connected to the vm.", - "name": "Network name.\nMust be a DNS_LABEL and unique within the vm.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - } -} - -func (NetworkSource) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents the source resource that will be connected to the vm.\nOnly one of its members may be specified.", - } -} - -func (PodNetwork) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents the stock pod network interface.", - "vmNetworkCIDR": "CIDR for vm network.\nDefault 10.0.2.0/24 if not specified.", - } -} - -func (Rng) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Rng represents the random device passed from host", - } -} - -func (GenieNetwork) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents the genie cni network.", - "networkName": "References the CNI plugin name.", - } -} - -func (MultusNetwork) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Represents the multus cni network.", - "networkName": "References to a NetworkAttachmentDefinition CRD object. Format:\n, /. If namespace is not\nspecified, VMI namespace is assumed.", - "default": "Select the default network and add it to the\nmultus-cni.io/default-network annotation.", - } -} diff --git a/vendor/kubevirt.io/client-go/api/v1/types.go b/vendor/kubevirt.io/client-go/api/v1/types.go deleted file mode 100644 index 8ba2d5f319b0..000000000000 --- a/vendor/kubevirt.io/client-go/api/v1/types.go +++ /dev/null @@ -1,1243 +0,0 @@ -/* - * 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 2017 Red Hat, Inc. - * - */ - -package v1 - -//go:generate swagger-doc -//go:generate deepcopy-gen -i . --go-header-file ../../../hack/boilerplate/boilerplate.go.txt -//go:generate defaulter-gen -i . --go-header-file ../../../hack/boilerplate/boilerplate.go.txt -//go:generate openapi-gen -i . --output-package=kubevirt.io/kubevirt/pkg/api/v1 --go-header-file ../../../hack/boilerplate/boilerplate.go.txt - -/* - ATTENTION: Rerun code generators when comments on structs or fields are modified. -*/ - -import ( - "encoding/json" - "fmt" - - v1 "k8s.io/api/autoscaling/v1" - k8sv1 "k8s.io/api/core/v1" - "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" - - "kubevirt.io/client-go/precond" - 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 - -// GroupVersion is group version used to register these objects -var GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha3"} - -// GroupVersion is group version used to register these objects -var SubresourceGroupVersion = 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 { - 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.ObjectMeta `json:"metadata,omitempty"` - // VirtualMachineInstance Spec contains the VirtualMachineInstance specification. - Spec VirtualMachineInstanceSpec `json:"spec,omitempty" 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"` -} - -func (v *VirtualMachineInstance) MarshalBinary() (data []byte, err error) { - return json.Marshal(*v) -} - -func (v *VirtualMachineInstance) UnmarshalBinary(data []byte) error { - return json.Unmarshal(data, v) -} - -// VirtualMachineInstanceList is a list of VirtualMachines -// --- -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type VirtualMachineInstanceList struct { - metav1.TypeMeta `json:",inline"` - ListMeta metav1.ListMeta `json:"metadata,omitempty"` - Items []VirtualMachineInstance `json:"items"` -} - -// +k8s:openapi-gen=true -type EvictionStrategy string - -// VirtualMachineInstanceSpec is a description of a VirtualMachineInstance. -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceSpec struct { - // Specification of the desired behavior of the VirtualMachineInstance on the host. - Domain DomainSpec `json:"domain"` - // NodeSelector is a selector which must be true for the vmi to fit on a node. - // Selector which must match a node's labels for the vmi to be scheduled on that node. - // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ - // +optional - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - // If affinity is specifies, obey all the affinity rules - Affinity *k8sv1.Affinity `json:"affinity,omitempty"` - // If toleration is specified, obey all the toleration rules. - Tolerations []k8sv1.Toleration `json:"tolerations,omitempty"` - - // EvictionStrategy can be set to "LiveMigrate" if the VirtualMachineInstance should be - // migrated instead of shut-off in case of a node drain. - // --- - // +optional - EvictionStrategy *EvictionStrategy `json:"evictionStrategy,omitempty"` - - // Grace period observed after signalling a VirtualMachineInstance to stop after which the VirtualMachineInstance is force terminated. - TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` - // List of volumes that can be mounted by disks belonging to the vmi. - Volumes []Volume `json:"volumes,omitempty"` - // Periodic probe of VirtualMachineInstance liveness. - // VirtualmachineInstances will be stopped if the probe fails. - // Cannot be updated. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - // +optional - LivenessProbe *Probe `json:"livenessProbe,omitempty"` - // Periodic probe of VirtualMachineInstance service readiness. - // VirtualmachineInstances will be removed from service endpoints if the probe fails. - // Cannot be updated. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - // +optional - ReadinessProbe *Probe `json:"readinessProbe,omitempty"` - // Specifies the hostname of the vmi - // If not specified, the hostname will be set to the name of the vmi, if dhcp or cloud-init is configured properly. - // +optional - Hostname string `json:"hostname,omitempty"` - // If specified, the fully qualified vmi hostname will be "...svc.". - // If not specified, the vmi will not have a domainname at all. The DNS entry will resolve to the vmi, - // no matter if the vmi itself can pick up a hostname. - // +optional - Subdomain string `json:"subdomain,omitempty"` - // List of networks that can be attached to a vm's virtual interface. - Networks []Network `json:"networks,omitempty"` - // Set DNS policy for the pod. - // Defaults to "ClusterFirst". - // Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. - // DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. - // To have DNS options set along with hostNetwork, you have to specify DNS policy - // explicitly to 'ClusterFirstWithHostNet'. - // +optional - DNSPolicy k8sv1.DNSPolicy `json:"dnsPolicy,omitempty" protobuf:"bytes,6,opt,name=dnsPolicy,casttype=DNSPolicy"` - // Specifies the DNS parameters of a pod. - // Parameters specified here will be merged to the generated DNS - // configuration based on DNSPolicy. - // +optional - DNSConfig *k8sv1.PodDNSConfig `json:"dnsConfig,omitempty" protobuf:"bytes,26,opt,name=dnsConfig"` -} - -// VirtualMachineInstanceStatus represents information about the status of a VirtualMachineInstance. Status may trail the actual -// state of a system. -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceStatus struct { - // NodeName is the name where the VirtualMachineInstance is currently running. - NodeName string `json:"nodeName,omitempty"` - // A brief CamelCase message indicating details about why the VMI is in this state. e.g. 'NodeUnresponsive' - // +optional - Reason string `json:"reason,omitempty"` - // Conditions are specific points in VirtualMachineInstance's pod runtime. - Conditions []VirtualMachineInstanceCondition `json:"conditions,omitempty"` - // Phase is the status of the VirtualMachineInstance in kubernetes world. It is not the VirtualMachineInstance status, but partially correlates to it. - Phase VirtualMachineInstancePhase `json:"phase,omitempty"` - // Interfaces represent the details of available network interfaces. - Interfaces []VirtualMachineInstanceNetworkInterface `json:"interfaces,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 - MigrationMethod VirtualMachineInstanceMigrationMethod `json:"migrationMethod,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 -} - -func (v *VirtualMachineInstance) IsScheduled() bool { - return v.Status.Phase == Scheduled -} - -func (v *VirtualMachineInstance) IsRunning() bool { - return v.Status.Phase == Running -} - -func (v *VirtualMachineInstance) IsFinal() bool { - return v.Status.Phase == Failed || v.Status.Phase == Succeeded -} - -func (v *VirtualMachineInstance) IsUnknown() bool { - return v.Status.Phase == Unknown -} - -func (v *VirtualMachineInstance) IsUnprocessed() bool { - return v.Status.Phase == Pending || v.Status.Phase == VmPhaseUnset -} - -// Checks if CPU pinning has been requested -func (v *VirtualMachineInstance) IsCPUDedicated() bool { - return v.Spec.Domain.CPU != nil && v.Spec.Domain.CPU.DedicatedCPUPlacement -} - -// 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 - -// These are valid conditions of VMIs. -const ( - // VMIReady means the pod is able to service requests and should be added to the - // load balancing pools of all matching services. - VirtualMachineInstanceReady VirtualMachineInstanceConditionType = "Ready" - - // If there happens any error while trying to synchronize the VirtualMachineInstance with the Domain, - // this is reported as false. - VirtualMachineInstanceSynchronized VirtualMachineInstanceConditionType = "Synchronized" - - // Reflects whether the QEMU guest agent is connected through the channel - VirtualMachineInstanceAgentConnected VirtualMachineInstanceConditionType = "AgentConnected" - - // Indicates whether the VMI is live migratable - VirtualMachineInstanceIsMigratable VirtualMachineInstanceConditionType = "LiveMigratable" - // Reason means that VMI is not live migratioable because of it's disks collection - VirtualMachineInstanceReasonDisksNotMigratable = "DisksNotLiveMigratable" -) - -// +k8s:openapi-gen=true -type VirtualMachineInstanceMigrationConditionType string - -// These are valid conditions of VMIs. -const ( - // VirtualMachineInstanceMigrationAbortRequested indicates that live migration abort has been requested - VirtualMachineInstanceMigrationAbortRequested VirtualMachineInstanceMigrationConditionType = "migrationAbortRequested" -) - -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceCondition struct { - Type VirtualMachineInstanceConditionType `json:"type"` - Status k8sv1.ConditionStatus `json:"status"` - LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` - Reason string `json:"reason,omitempty"` - Message string `json:"message,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceMigrationCondition struct { - Type VirtualMachineInstanceMigrationConditionType `json:"type"` - Status k8sv1.ConditionStatus `json:"status"` - LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` - Reason string `json:"reason,omitempty"` - Message string `json:"message,omitempty"` -} - -// The migration phase indicates that the job has completed -func (m *VirtualMachineInstanceMigration) IsFinal() bool { - return m.Status.Phase == MigrationFailed || m.Status.Phase == MigrationSucceeded -} - -func (m *VirtualMachineInstanceMigration) IsRunning() bool { - switch m.Status.Phase { - case MigrationFailed, MigrationPending, MigrationPhaseUnset, MigrationSucceeded: - return false - } - return true -} - -// The migration phase indicates that the target pod should have already been created -func (m *VirtualMachineInstanceMigration) TargetIsCreated() bool { - return m.Status.Phase != MigrationPhaseUnset && - m.Status.Phase != MigrationPending -} - -// The migration phase indicates that job has been handed off to the VMI controllers to complete. -func (m *VirtualMachineInstanceMigration) TargetIsHandedOff() bool { - return m.Status.Phase != MigrationPhaseUnset && - m.Status.Phase != MigrationPending && - m.Status.Phase != MigrationScheduling && - m.Status.Phase != MigrationScheduled -} - -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceNetworkInterface struct { - // IP address of a Virtual Machine interface - IP string `json:"ipAddress,omitempty"` - // Hardware address of a Virtual Machine interface - MAC string `json:"mac,omitempty"` - // Name of the interface, corresponds to name of the network assigned to the interface - // TODO: remove omitempty, when api breaking changes are allowed - Name string `json:"name,omitempty"` - // List of all IP addresses of a Virtual Machine interface - IPs []string `json:"ipAddresses,omitempty"` - // The interface name inside the Virtual Machine - InterfaceName string `json:"interfaceName,omitempty"` -} - -type VirtualMachineInstanceMigrationState struct { - // The time the migration action began - StartTimestamp *metav1.Time `json:"startTimestamp,omitempty"` - // The time the migration action ended - EndTimestamp *metav1.Time `json:"endTimestamp,omitempty"` - // The Target Node has seen the Domain Start Event - TargetNodeDomainDetected bool `json:"targetNodeDomainDetected,omitempty"` - // The address of the target node to use for the migration - TargetNodeAddress string `json:"targetNodeAddress,omitempty"` - // The list of ports opened for live migration on the destination node - TargetDirectMigrationNodePorts map[int]int `json:"targetDirectMigrationNodePorts,omitempty"` - // The target node that the VMI is moving to - TargetNode string `json:"targetNode,omitempty"` - // The target pod that the VMI is moving to - TargetPod string `json:"targetPod,omitempty"` - // The source node that the VMI originated on - SourceNode string `json:"sourceNode,omitempty"` - // Indicates the migration completed - Completed bool `json:"completed,omitempty"` - // Indicates that the migration failed - Failed bool `json:"failed,omitempty"` - // Indicates that the migration has been requested to abort - AbortRequested bool `json:"abortRequested,omitempty"` - // Indicates the final status of the live migration abortion - AbortStatus MigrationAbortStatus `json:"abortStatus,omitempty"` - // The VirtualMachineInstanceMigration object associated with this migration - MigrationUID types.UID `json:"migrationUid,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type MigrationAbortStatus string - -const ( - // MigrationAbortSucceeded means that the VirtualMachineInstance live migration has been aborted - MigrationAbortSucceeded MigrationAbortStatus = "Succeeded" - // MigrationAbortFailed means that the vmi live migration has failed to be abort - MigrationAbortFailed MigrationAbortStatus = "Failed" - // MigrationAbortInProgress mean that the vmi live migration is aborting - MigrationAbortInProgress MigrationAbortStatus = "Aborting" -) - -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceMigrationMethod string - -const ( - // BlockMigration means that all VirtualMachineInstance disks should be copied over to the destination host - BlockMigration VirtualMachineInstanceMigrationMethod = "BlockMigration" - // LiveMigration means that VirtualMachineInstance disks will not be copied over to the destination host - LiveMigration VirtualMachineInstanceMigrationMethod = "LiveMigration" -) - -// VirtualMachineInstancePhase is a label for the condition of a VirtualMachineInstance at the current time. -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstancePhase string - -// These are the valid statuses of pods. -const ( - //When a VirtualMachineInstance Object is first initialized and no phase, or Pending is present. - VmPhaseUnset VirtualMachineInstancePhase = "" - // Pending means the VirtualMachineInstance has been accepted by the system. - Pending VirtualMachineInstancePhase = "Pending" - // A target Pod exists but is not yet scheduled and in running state. - Scheduling VirtualMachineInstancePhase = "Scheduling" - // A target pod was scheduled and the system saw that Pod in runnig state. - // Here is where the responsibility of virt-controller ends and virt-handler takes over. - Scheduled VirtualMachineInstancePhase = "Scheduled" - // Running means the pod has been bound to a node and the VirtualMachineInstance is started. - Running VirtualMachineInstancePhase = "Running" - // Succeeded means that the VirtualMachineInstance stopped voluntarily, e.g. reacted to SIGTERM or shutdown was invoked from - // inside the VirtualMachineInstance. - Succeeded VirtualMachineInstancePhase = "Succeeded" - // Failed means that the vmi crashed, disappeared unexpectedly or got deleted from the cluster before it was ever started. - Failed VirtualMachineInstancePhase = "Failed" - // Unknown means that for some reason the state of the VirtualMachineInstance could not be obtained, typically due - // to an error in communicating with the host of the VirtualMachineInstance. - Unknown VirtualMachineInstancePhase = "Unknown" -) - -const ( - // This label marks resources that belong to KubeVirt. An optional value - // may indicate which specific KubeVirt component a resource belongs to. - AppLabel string = "kubevirt.io" - // This annotation is used to match virtual machine instances represented as - // libvirt XML domains with their pods. Among other things, the annotation is - // used to detect virtual machines with dead pods. Used on Pod. - DomainAnnotation string = "kubevirt.io/domain" - // Represents the name of the migration job this target pod is associated with - MigrationJobNameAnnotation string = "kubevirt.io/migrationJobName" - // This label is used to match virtual machine instance IDs with pods. - // Similar to kubevirt.io/domain. Used on Pod. - // Internal use only. - CreatedByLabel string = "kubevirt.io/created-by" - // This label is used to indicate that this pod is the target of a migration job. - MigrationJobLabel string = "kubevirt.io/migrationJobUID" - // This label describes which cluster node runs the virtual machine - // instance. Needed because with CRDs we can't use field selectors. Used on - // VirtualMachineInstance. - NodeNameLabel string = "kubevirt.io/nodeName" - // This label describes which cluster node runs the target Pod for a Virtual - // Machine Instance migration job. Needed because with CRDs we can't use field - // selectors. Used on VirtualMachineInstance. - MigrationTargetNodeNameLabel string = "kubevirt.io/migrationTargetNodeName" - // This label declares whether a particular node is available for - // scheduling virtual machine instances on it. Used on Node. - NodeSchedulable string = "kubevirt.io/schedulable" - // This annotation is regularly updated by virt-handler to help determine - // if a particular node is alive and hence should be available for new - // virtual machine instance scheduling. Used on Node. - VirtHandlerHeartbeat string = "kubevirt.io/heartbeat" - // This label will be set on all resources created by the operator - ManagedByLabel = "app.kubernetes.io/managed-by" - ManagedByLabelOperatorValue = "kubevirt-operator" - // This annotation represents the kubevirt version for an install strategy configmap. - InstallStrategyVersionAnnotation = "kubevirt.io/install-strategy-version" - // This annotation represents the kubevirt registry used for an install strategy configmap. - InstallStrategyRegistryAnnotation = "kubevirt.io/install-strategy-registry" - // This annotation represents that this object is for temporary use during updates - EphemeralBackupObject = "kubevirt.io/ephemeral-backup-object" - - // This label indicates the object is a part of the install strategy retrieval process. - InstallStrategyLabel = "kubevirt.io/install-strategy" - - VirtualMachineInstanceFinalizer string = "foregroundDeleteVirtualMachine" - VirtualMachineInstanceMigrationFinalizer string = "kubevirt.io/migrationJobFinalize" - CPUManager string = "cpumanager" - // This annotation is used to inject ignition data - // Used on VirtualMachineInstance. - IgnitionAnnotation string = "kubevirt.io/ignitiondata" -) - -func NewVMI(name string, uid types.UID) *VirtualMachineInstance { - return &VirtualMachineInstance{ - Spec: VirtualMachineInstanceSpec{}, - ObjectMeta: metav1.ObjectMeta{ - Name: name, - UID: uid, - Namespace: k8sv1.NamespaceDefault, - }, - Status: VirtualMachineInstanceStatus{}, - TypeMeta: metav1.TypeMeta{ - APIVersion: GroupVersion.String(), - Kind: VirtualMachineInstanceGroupVersionKind.Kind, - }, - } -} - -// --- -// +k8s:openapi-gen=true -type SyncEvent string - -const ( - Created SyncEvent = "Created" - Deleted SyncEvent = "Deleted" - PresetFailed SyncEvent = "PresetFailed" - Override SyncEvent = "Override" - Started SyncEvent = "Started" - ShuttingDown SyncEvent = "ShuttingDown" - Stopped SyncEvent = "Stopped" - PreparingTarget SyncEvent = "PreparingTarget" - Migrating SyncEvent = "Migrating" - Migrated SyncEvent = "Migrated" - SyncFailed SyncEvent = "SyncFailed" - Resumed SyncEvent = "Resumed" -) - -func (s SyncEvent) String() string { - return string(s) -} - -func NewMinimalVMI(vmiName string) *VirtualMachineInstance { - return NewMinimalVMIWithNS(k8sv1.NamespaceDefault, vmiName) -} - -func NewMinimalVMIWithNS(namespace string, vmiName string) *VirtualMachineInstance { - precond.CheckNotEmpty(vmiName) - vmi := NewVMIReferenceFromNameWithNS(namespace, vmiName) - vmi.Spec = VirtualMachineInstanceSpec{Domain: NewMinimalDomainSpec()} - vmi.TypeMeta = metav1.TypeMeta{ - APIVersion: GroupVersion.String(), - Kind: "VirtualMachineInstance", - } - return vmi -} - -// TODO Namespace could be different, also store it somewhere in the domain, so that we can report deletes on handler startup properly -func NewVMIReferenceFromName(name string) *VirtualMachineInstance { - return NewVMIReferenceFromNameWithNS(k8sv1.NamespaceDefault, name) -} - -func NewVMIReferenceFromNameWithNS(namespace string, name string) *VirtualMachineInstance { - vmi := &VirtualMachineInstance{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - SelfLink: fmt.Sprintf("/apis/%s/namespaces/%s/virtualmachineinstances/%s", GroupVersion.String(), namespace, name), - }, - } - vmi.SetGroupVersionKind(schema.GroupVersionKind{Group: GroupVersion.Group, Kind: "VirtualMachineInstance", Version: GroupVersion.Version}) - return vmi -} - -func NewVMIReferenceWithUUID(namespace string, name string, uuid types.UID) *VirtualMachineInstance { - vmi := NewVMIReferenceFromNameWithNS(namespace, name) - vmi.UID = uuid - return vmi -} - -type VMISelector struct { - // Name of the VirtualMachineInstance to migrate - Name string `json:"name" valid:"required"` -} - -// Given a VirtualMachineInstance, update all NodeSelectorTerms with anti-affinity for that VirtualMachineInstance's node. -// This is useful for the case when a migration away from a node must occur. -// This method returns the full Affinity structure updated the anti affinity terms -func UpdateAntiAffinityFromVMINode(pod *k8sv1.Pod, vmi *VirtualMachineInstance) *k8sv1.Affinity { - if pod.Spec.Affinity == nil { - pod.Spec.Affinity = &k8sv1.Affinity{} - } - - if pod.Spec.Affinity.NodeAffinity == nil { - pod.Spec.Affinity.NodeAffinity = &k8sv1.NodeAffinity{} - } - - if pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution == nil { - pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution = &k8sv1.NodeSelector{} - } - - selector := pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution - terms := selector.NodeSelectorTerms - - if len(terms) == 0 { - selector.NodeSelectorTerms = append(terms, k8sv1.NodeSelectorTerm{}) - terms = selector.NodeSelectorTerms - } - - for idx, term := range terms { - if term.MatchExpressions == nil { - term.MatchExpressions = []k8sv1.NodeSelectorRequirement{} - } - - term.MatchExpressions = append(term.MatchExpressions, PrepareVMINodeAntiAffinitySelectorRequirement(vmi)) - selector.NodeSelectorTerms[idx] = term - } - - return pod.Spec.Affinity -} - -// Given a VirtualMachineInstance, create a NodeSelectorTerm with anti-affinity for that VirtualMachineInstance's node. -// This is useful for the case when a migration away from a node must occur. -func PrepareVMINodeAntiAffinitySelectorRequirement(vmi *VirtualMachineInstance) k8sv1.NodeSelectorRequirement { - return k8sv1.NodeSelectorRequirement{ - Key: "kubernetes.io/hostname", - Operator: k8sv1.NodeSelectorOpNotIn, - Values: []string{vmi.Status.NodeName}, - } -} - -// 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 VirtualMachineInstanceReplicaSet struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - // VirtualMachineInstance Spec contains the VirtualMachineInstance specification. - Spec VirtualMachineInstanceReplicaSetSpec `json:"spec,omitempty" 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"` -} - -// VMIList is a list of VMIs -// --- -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type VirtualMachineInstanceReplicaSetList struct { - metav1.TypeMeta `json:",inline"` - ListMeta metav1.ListMeta `json:"metadata,omitempty"` - Items []VirtualMachineInstanceReplicaSet `json:"items"` -} - -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceReplicaSetSpec struct { - // Number of desired pods. This is a pointer to distinguish between explicit - // zero and not specified. Defaults to 1. - // +optional - Replicas *int32 `json:"replicas,omitempty"` - - // Label selector for pods. Existing ReplicaSets whose pods are - // selected by this will be the ones affected by this deployment. - Selector *metav1.LabelSelector `json:"selector" valid:"required"` - - // Template describes the pods that will be created. - Template *VirtualMachineInstanceTemplateSpec `json:"template" valid:"required"` - - // Indicates that the replica set is paused. - // +optional - Paused bool `json:"paused,omitempty" protobuf:"varint,7,opt,name=paused"` -} - -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceReplicaSetStatus struct { - // Total number of non-terminated pods targeted by this deployment (their labels match the selector). - // +optional - Replicas int32 `json:"replicas,omitempty" protobuf:"varint,2,opt,name=replicas"` - - // The number of ready replicas for this replica set. - // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,4,opt,name=readyReplicas"` - - Conditions []VirtualMachineInstanceReplicaSetCondition `json:"conditions,omitempty" optional:"true"` - - // Canonical form of the label selector for HPA which consumes it through the scale subresource. - LabelSelector string `json:"labelSelector,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceReplicaSetCondition struct { - Type VirtualMachineInstanceReplicaSetConditionType `json:"type"` - Status k8sv1.ConditionStatus `json:"status"` - LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` - Reason string `json:"reason,omitempty"` - Message string `json:"message,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceReplicaSetConditionType string - -const ( - // VirtualMachineInstanceReplicaSetReplicaFailure is added in a replica set when one of its vmis - // 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. - VirtualMachineInstanceReplicaSetReplicaFailure VirtualMachineInstanceReplicaSetConditionType = "ReplicaFailure" - - // VirtualMachineInstanceReplicaSetReplicaPaused is added in a replica set when the replica set got paused by the controller. - // After this condition was added, it is safe to remove or add vmis by hand and adjust the replica count by hand. - VirtualMachineInstanceReplicaSetReplicaPaused VirtualMachineInstanceReplicaSetConditionType = "ReplicaPaused" -) - -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceTemplateSpec struct { - ObjectMeta metav1.ObjectMeta `json:"metadata,omitempty"` - // VirtualMachineInstance Spec contains the VirtualMachineInstance specification. - 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.ObjectMeta `json:"metadata,omitempty"` - Spec VirtualMachineInstanceMigrationSpec `json:"spec,omitempty" 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"` - 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 { - // The name of the VMI to perform the migration on. VMI must exist in the migration objects namespace - VMIName string `json:"vmiName,omitempty" valid:"required"` -} - -// VirtualMachineInstanceMigration reprents information pertaining to a VMI's migration. -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceMigrationStatus struct { - Phase VirtualMachineInstanceMigrationPhase `json:"phase,omitempty"` - Conditions []VirtualMachineInstanceMigrationCondition `json:"conditions,omitempty"` -} - -// VirtualMachineInstanceMigrationPhase is a label for the condition of a VirtualMachineInstanceMigration at the current time. -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstanceMigrationPhase string - -// These are the valid migration phases -const ( - MigrationPhaseUnset VirtualMachineInstanceMigrationPhase = "" - // The migration is accepted by the system - MigrationPending VirtualMachineInstanceMigrationPhase = "Pending" - // The migration's target pod is being scheduled - MigrationScheduling VirtualMachineInstanceMigrationPhase = "Scheduling" - // The migration's target pod is running - MigrationScheduled VirtualMachineInstanceMigrationPhase = "Scheduled" - // The migration's target pod is being prepared for migration - MigrationPreparingTarget VirtualMachineInstanceMigrationPhase = "PreparingTarget" - // The migration's target pod is prepared and ready for migration - MigrationTargetReady VirtualMachineInstanceMigrationPhase = "TargetReady" - // The migration is in progress - MigrationRunning VirtualMachineInstanceMigrationPhase = "Running" - // The migration passed - MigrationSucceeded VirtualMachineInstanceMigrationPhase = "Succeeded" - // The migration failed - MigrationFailed VirtualMachineInstanceMigrationPhase = "Failed" -) - -// --- -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type VirtualMachineInstancePreset struct { - metav1.TypeMeta `json:",inline"` - 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"` - Items []VirtualMachineInstancePreset `json:"items"` -} - -// --- -// +k8s:openapi-gen=true -type VirtualMachineInstancePresetSpec struct { - // Selector is a label query over a set of VMIs. - // Required. - Selector metav1.LabelSelector `json:"selector"` - // Domain is the same object type as contained in VirtualMachineInstanceSpec - Domain *DomainSpec `json:"domain,omitempty"` -} - -func NewVirtualMachinePreset(name string, selector metav1.LabelSelector) *VirtualMachineInstancePreset { - return &VirtualMachineInstancePreset{ - Spec: VirtualMachineInstancePresetSpec{ - Selector: selector, - Domain: &DomainSpec{}, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: k8sv1.NamespaceDefault, - }, - TypeMeta: metav1.TypeMeta{ - APIVersion: GroupVersion.String(), - Kind: VirtualMachineInstancePresetGroupVersionKind.Kind, - }, - } -} - -// 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 -// VirtualMachineInstance. It also mirrors the running state of the created -// VirtualMachineInstance in its status. -// --- -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type VirtualMachine struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Spec contains the specification of VirtualMachineInstance created - Spec VirtualMachineSpec `json:"spec,omitempty"` - // Status holds the current state of the controller and brief information - // about its associated VirtualMachineInstance - Status VirtualMachineStatus `json:"status,omitempty"` -} - -// Return the current runStrategy for the VirtualMachine -// if vm.spec.running is set, that will be mapped to runStrategy: -// false: RunStrategyHalted -// true: RunStrategyAlways -func (vm *VirtualMachine) RunStrategy() (VirtualMachineRunStrategy, error) { - if vm.Spec.Running != nil && vm.Spec.RunStrategy != nil { - return RunStrategyUnknown, fmt.Errorf("running and runstrategy are mutually exclusive") - } - RunStrategy := RunStrategyHalted - if vm.Spec.Running != nil { - if (*vm.Spec.Running) == true { - RunStrategy = RunStrategyAlways - } - } else if vm.Spec.RunStrategy != nil { - RunStrategy = *vm.Spec.RunStrategy - } - return RunStrategy, nil -} - -// VirtualMachineList is a list of virtualmachines -// --- -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +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"` -} - -// VirtualMachineRunStrategy is a label for the requested VirtualMachineInstance Running State at the current time. -// --- -// +k8s:openapi-gen=true -type VirtualMachineRunStrategy string - -// These are the valid VMI run strategies -const ( - // Placeholder. Not a valid RunStrategy. - RunStrategyUnknown VirtualMachineRunStrategy = "" - // VMI should always be running. - RunStrategyAlways VirtualMachineRunStrategy = "Always" - // VMI should never be running. - RunStrategyHalted VirtualMachineRunStrategy = "Halted" - // VMI can be started/stopped using API endpoints. - RunStrategyManual VirtualMachineRunStrategy = "Manual" - // VMI will initially be running--and restarted if a failure occurs. - // It will not be restarted upon successful completion. - RunStrategyRerunOnFailure VirtualMachineRunStrategy = "RerunOnFailure" -) - -// VirtualMachineSpec describes how the proper VirtualMachine -// should look like -// --- -// +k8s:openapi-gen=true -type VirtualMachineSpec struct { - // Running controls whether the associatied VirtualMachineInstance is created or not - // Mutually exclusive with RunStrategy - Running *bool `json:"running,omitempty" optional:"true"` - - // Running state indicates the requested running state of the VirtualMachineInstance - // mutually exclusive with Running - RunStrategy *VirtualMachineRunStrategy `json:"runStrategy,omitempty" optional:"true"` - - // Template is the direct specification of VirtualMachineInstance - Template *VirtualMachineInstanceTemplateSpec `json:"template"` - - // dataVolumeTemplates is a list of dataVolumes that the VirtualMachineInstance template can reference. - // DataVolumes in this list are dynamically created for the VirtualMachine and are tied to the VirtualMachine's life-cycle. - DataVolumeTemplates []cdiv1.DataVolume `json:"dataVolumeTemplates,omitempty"` -} - -// StateChangeRequestType represents the existing state change requests that are possible -// --- -// +k8s:openapi-gen=true -type StateChangeRequestAction string - -// These are the currently defined state change requests -const ( - StartRequest StateChangeRequestAction = "Start" - StopRequest StateChangeRequestAction = "Stop" -) - -// VirtualMachineStatus represents the status returned by the -// controller to describe how the VirtualMachine is doing -// --- -// +k8s:openapi-gen=true -type VirtualMachineStatus struct { - // Created indicates if the virtual machine is created in the cluster - Created bool `json:"created,omitempty"` - // Ready indicates if the virtual machine is running and ready - Ready bool `json:"ready,omitempty"` - // Hold the state information of the VirtualMachine and its VirtualMachineInstance - Conditions []VirtualMachineCondition `json:"conditions,omitempty" optional:"true"` - // StateChangeRequests indicates a list of actions that should be taken on a VMI - // e.g. stop a specific VMI then start a new one. - StateChangeRequests []VirtualMachineStateChangeRequest `json:"stateChangeRequests,omitempty" optional:"true"` -} - -type VirtualMachineStateChangeRequest struct { - // Indicates the type of action that is requested. e.g. Start or Stop - Action StateChangeRequestAction `json:"action"` - // Indicates the UUID of an existing Virtual Machine Instance that this change request applies to -- if applicable - 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 -type VirtualMachineCondition struct { - Type VirtualMachineConditionType `json:"type"` - Status k8sv1.ConditionStatus `json:"status"` - LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` - Reason string `json:"reason,omitempty"` - Message string `json:"message,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type VirtualMachineConditionType string - -const ( - // VirtualMachineFailure is added in a virtual machine when its vmi - // 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" -) - -// --- -// +k8s:openapi-gen=true -type HostDiskType string - -const ( - // if disk does not exist at the given path, - // a disk image will be created there - HostDiskExistsOrCreate HostDiskType = "DiskOrCreate" - // a disk image must exist at given disk path - HostDiskExists HostDiskType = "Disk" -) - -// --- -// +k8s:openapi-gen=true -type DriverCache string - -const ( - // CacheNone - I/O from the guest is not cached on the host, but may be kept in a writeback disk cache. - CacheNone DriverCache = "none" - // CacheWriteThrough - I/O from the guest is cached on the host but written through to the physical medium. - CacheWriteThrough DriverCache = "writethrough" -) - -// Handler defines a specific action that should be taken -// TODO: pass structured data to these actions, and document that data here. -type Handler struct { - // HTTPGet specifies the http request to perform. - // +optional - HTTPGet *k8sv1.HTTPGetAction `json:"httpGet,omitempty"` - // TCPSocket specifies an action involving a TCP port. - // TCP hooks not yet supported - // TODO: implement a realistic TCP lifecycle hook - // +optional - TCPSocket *k8sv1.TCPSocketAction `json:"tcpSocket,omitempty"` -} - -// Probe describes a health check to be performed against a VirtualMachineInstance to determine whether it is -// alive or ready to receive traffic. -type Probe struct { - // The action taken to determine the health of a VirtualMachineInstance - Handler `json:",inline"` - // Number of seconds after the VirtualMachineInstance has started before liveness probes are initiated. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - // +optional - InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"` - // Number of seconds after which the probe times out. - // Defaults to 1 second. Minimum value is 1. - // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes - // +optional - TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"` - // How often (in seconds) to perform the probe. - // Default to 10 seconds. Minimum value is 1. - // +optional - PeriodSeconds int32 `json:"periodSeconds,omitempty"` - // Minimum consecutive successes for the probe to be considered successful after having failed. - // Defaults to 1. Must be 1 for liveness. Minimum value is 1. - // +optional - SuccessThreshold int32 `json:"successThreshold,omitempty"` - // Minimum consecutive failures for the probe to be considered failed after having succeeded. - // Defaults to 3. Minimum value is 1. - // +optional - FailureThreshold int32 `json:"failureThreshold,omitempty"` -} - -// KubeVirt represents the object deploying all KubeVirt resources -// --- -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type KubeVirt struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec KubeVirtSpec `json:"spec,omitempty" 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 -} - -// --- -// +k8s:openapi-gen=true -type KubeVirtSpec struct { - // The image tag to use for the continer images installed. - // Defaults to the same tag as the operator's container image. - ImageTag string `json:"imageTag,omitempty"` - // The image registry to pull the container images from - // Defaults to the same registry the operator's container image is pulled from. - ImageRegistry string `json:"imageRegistry,omitempty"` - - // The ImagePullPolicy to use. - ImagePullPolicy k8sv1.PullPolicy `json:"imagePullPolicy,omitempty" valid:"required"` -} - -// KubeVirtStatus represents information pertaining to a KubeVirt deployment. -// --- -// +k8s:openapi-gen=true -type KubeVirtStatus struct { - Phase KubeVirtPhase `json:"phase,omitempty"` - Conditions []KubeVirtCondition `json:"conditions,omitempty" optional:"true"` - OperatorVersion string `json:"operatorVersion,omitempty" optional:"true"` - TargetKubeVirtVersion string `json:"targetKubeVirtVersion,omitempty" optional:"true"` - TargetKubeVirtRegistry string `json:"targetKubeVirtRegistry,omitempty" optional:"true"` - ObservedKubeVirtVersion string `json:"observedKubeVirtVersion,omitempty" optional:"true"` - ObservedKubeVirtRegistry string `json:"observedKubeVirtRegistry,omitempty" optional:"true"` -} - -// KubeVirtPhase is a label for the phase of a KubeVirt deployment at the current time. -// --- -// +k8s:openapi-gen=true -type KubeVirtPhase string - -// These are the valid KubeVirt deployment phases -const ( - // The deployment is processing - KubeVirtPhaseDeploying KubeVirtPhase = "Deploying" - // The deployment succeeded - KubeVirtPhaseDeployed KubeVirtPhase = "Deployed" - // The deletion is processing - KubeVirtPhaseDeleting KubeVirtPhase = "Deleting" - // The deletion succeeeded - KubeVirtPhaseDeleted KubeVirtPhase = "Deleted" -) - -// KubeVirtCondition represents a condition of a KubeVirt deployment -// --- -// +k8s:openapi-gen=true -type KubeVirtCondition struct { - Type KubeVirtConditionType `json:"type"` - Status k8sv1.ConditionStatus `json:"status"` - LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` - Reason string `json:"reason,omitempty"` - Message string `json:"message,omitempty"` -} - -// --- -// +k8s:openapi-gen=true -type KubeVirtConditionType string - -// These are the valid KubeVirt condition types -const ( - // Whether the deployment or deletion was successful (only used if false) - KubeVirtConditionSynchronized KubeVirtConditionType = "Synchronized" - // Whether all resources were created and up-to-date - KubeVirtConditionCreated KubeVirtConditionType = "Created" - // Whether all components were ready - KubeVirtConditionReady KubeVirtConditionType = "Ready" - // Whether we're in the process of updating previously deployed version - KubeVirtConditionUpdating KubeVirtConditionType = "Updating" -) - -const ( - EvictionStrategyLiveMigrate EvictionStrategy = "LiveMigrate" -) 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 deleted file mode 100644 index 8f4becf53e9b..000000000000 --- a/vendor/kubevirt.io/client-go/api/v1/types_swagger_generated.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by swagger-doc. DO NOT EDIT. - -package v1 - -func (VirtualMachineInstance) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstance is *the* VirtualMachineInstance Definition. It represents a virtual machine in the runtime environment of kubernetes.", - "spec": "VirtualMachineInstance Spec contains the VirtualMachineInstance specification.", - "status": "Status is the high level overview of how the VirtualMachineInstance is doing. It contains information available to controllers and users.", - } -} - -func (VirtualMachineInstanceList) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstanceList is a list of VirtualMachines", - } -} - -func (VirtualMachineInstanceSpec) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstanceSpec is a description of a VirtualMachineInstance.", - "domain": "Specification of the desired behavior of the VirtualMachineInstance on the host.", - "nodeSelector": "NodeSelector is a selector which must be true for the vmi to fit on a node.\nSelector which must match a node's labels for the vmi to be scheduled on that node.\nMore info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/\n+optional", - "affinity": "If affinity is specifies, obey all the affinity rules", - "tolerations": "If toleration is specified, obey all the toleration rules.", - "evictionStrategy": "EvictionStrategy can be set to \"LiveMigrate\" if the VirtualMachineInstance should be\nmigrated instead of shut-off in case of a node drain.", - "terminationGracePeriodSeconds": "Grace period observed after signalling a VirtualMachineInstance to stop after which the VirtualMachineInstance is force terminated.", - "volumes": "List of volumes that can be mounted by disks belonging to the vmi.", - "livenessProbe": "Periodic probe of VirtualMachineInstance liveness.\nVirtualmachineInstances will be stopped if the probe fails.\nCannot be updated.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes\n+optional", - "readinessProbe": "Periodic probe of VirtualMachineInstance service readiness.\nVirtualmachineInstances will be removed from service endpoints if the probe fails.\nCannot be updated.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes\n+optional", - "hostname": "Specifies the hostname of the vmi\nIf not specified, the hostname will be set to the name of the vmi, if dhcp or cloud-init is configured properly.\n+optional", - "subdomain": "If specified, the fully qualified vmi hostname will be \"...svc.\".\nIf not specified, the vmi will not have a domainname at all. The DNS entry will resolve to the vmi,\nno matter if the vmi itself can pick up a hostname.\n+optional", - "networks": "List of networks that can be attached to a vm's virtual interface.", - "dnsPolicy": "Set DNS policy for the pod.\nDefaults to \"ClusterFirst\".\nValid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'.\nDNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy.\nTo have DNS options set along with hostNetwork, you have to specify DNS policy\nexplicitly to 'ClusterFirstWithHostNet'.\n+optional", - "dnsConfig": "Specifies the DNS parameters of a pod.\nParameters specified here will be merged to the generated DNS\nconfiguration based on DNSPolicy.\n+optional", - } -} - -func (VirtualMachineInstanceStatus) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstanceStatus represents information about the status of a VirtualMachineInstance. Status may trail the actual\nstate of a system.", - "nodeName": "NodeName is the name where the VirtualMachineInstance is currently running.", - "reason": "A brief CamelCase message indicating details about why the VMI is in this state. e.g. 'NodeUnresponsive'\n+optional", - "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.", - "migrationState": "Represents the status of a live migration", - "migrationMethod": "Represents the method using which the vmi can be migrated: live migration or block migration", - } -} - -func (VirtualMachineInstanceCondition) SwaggerDoc() map[string]string { - return map[string]string{} -} - -func (VirtualMachineInstanceMigrationCondition) SwaggerDoc() map[string]string { - return map[string]string{} -} - -func (VirtualMachineInstanceNetworkInterface) SwaggerDoc() map[string]string { - return map[string]string{ - "ipAddress": "IP address of a Virtual Machine interface", - "mac": "Hardware address of a Virtual Machine interface", - "name": "Name of the interface, corresponds to name of the network assigned to the interface", - "ipAddresses": "List of all IP addresses of a Virtual Machine interface", - "interfaceName": "The interface name inside the Virtual Machine", - } -} - -func (VirtualMachineInstanceMigrationState) SwaggerDoc() map[string]string { - return map[string]string{ - "startTimestamp": "The time the migration action began", - "endTimestamp": "The time the migration action ended", - "targetNodeDomainDetected": "The Target Node has seen the Domain Start Event", - "targetNodeAddress": "The address of the target node to use for the migration", - "targetDirectMigrationNodePorts": "The list of ports opened for live migration on the destination node", - "targetNode": "The target node that the VMI is moving to", - "targetPod": "The target pod that the VMI is moving to", - "sourceNode": "The source node that the VMI originated on", - "completed": "Indicates the migration completed", - "failed": "Indicates that the migration failed", - "abortRequested": "Indicates that the migration has been requested to abort", - "abortStatus": "Indicates the final status of the live migration abortion", - "migrationUid": "The VirtualMachineInstanceMigration object associated with this migration", - } -} - -func (VMISelector) SwaggerDoc() map[string]string { - return map[string]string{ - "name": "Name of the VirtualMachineInstance to migrate", - } -} - -func (VirtualMachineInstanceReplicaSet) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstance is *the* VirtualMachineInstance Definition. It represents a virtual machine in the runtime environment of kubernetes.", - "spec": "VirtualMachineInstance Spec contains the VirtualMachineInstance specification.", - "status": "Status is the high level overview of how the VirtualMachineInstance is doing. It contains information available to controllers and users.", - } -} - -func (VirtualMachineInstanceReplicaSetList) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VMIList is a list of VMIs", - } -} - -func (VirtualMachineInstanceReplicaSetSpec) SwaggerDoc() map[string]string { - return map[string]string{ - "replicas": "Number of desired pods. This is a pointer to distinguish between explicit\nzero and not specified. Defaults to 1.\n+optional", - "selector": "Label selector for pods. Existing ReplicaSets whose pods are\nselected by this will be the ones affected by this deployment.", - "template": "Template describes the pods that will be created.", - "paused": "Indicates that the replica set is paused.\n+optional", - } -} - -func (VirtualMachineInstanceReplicaSetStatus) SwaggerDoc() map[string]string { - return map[string]string{ - "replicas": "Total number of non-terminated pods targeted by this deployment (their labels match the selector).\n+optional", - "readyReplicas": "The number of ready replicas for this replica set.\n+optional", - "labelSelector": "Canonical form of the label selector for HPA which consumes it through the scale subresource.", - } -} - -func (VirtualMachineInstanceReplicaSetCondition) SwaggerDoc() map[string]string { - return map[string]string{} -} - -func (VirtualMachineInstanceTemplateSpec) SwaggerDoc() map[string]string { - return map[string]string{ - "spec": "VirtualMachineInstance Spec contains the VirtualMachineInstance specification.", - } -} - -func (VirtualMachineInstanceMigration) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstanceMigration represents the object tracking a VMI's migration\nto another host in the cluster", - } -} - -func (VirtualMachineInstanceMigrationList) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstanceMigrationList is a list of VirtualMachineMigrations", - } -} - -func (VirtualMachineInstanceMigrationSpec) SwaggerDoc() map[string]string { - return map[string]string{ - "vmiName": "The name of the VMI to perform the migration on. VMI must exist in the migration objects namespace", - } -} - -func (VirtualMachineInstanceMigrationStatus) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstanceMigration reprents information pertaining to a VMI's migration.", - } -} - -func (VirtualMachineInstancePreset) SwaggerDoc() map[string]string { - return map[string]string{ - "spec": "VirtualMachineInstance Spec contains the VirtualMachineInstance specification.", - } -} - -func (VirtualMachineInstancePresetList) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstancePresetList is a list of VirtualMachinePresets", - } -} - -func (VirtualMachineInstancePresetSpec) SwaggerDoc() map[string]string { - return map[string]string{ - "selector": "Selector is a label query over a set of VMIs.\nRequired.", - "domain": "Domain is the same object type as contained in VirtualMachineInstanceSpec", - } -} - -func (VirtualMachine) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachine handles the VirtualMachines that are not running\nor are in a stopped state\nThe VirtualMachine contains the template to create the\nVirtualMachineInstance. It also mirrors the running state of the created\nVirtualMachineInstance in its status.", - "spec": "Spec contains the specification of VirtualMachineInstance created", - "status": "Status holds the current state of the controller and brief information\nabout its associated VirtualMachineInstance", - } -} - -func (VirtualMachineList) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineList is a list of virtualmachines", - "items": "Items is a list of VirtualMachines", - } -} - -func (VirtualMachineSpec) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineSpec describes how the proper VirtualMachine\nshould look like", - "running": "Running controls whether the associatied VirtualMachineInstance is created or not\nMutually exclusive with RunStrategy", - "runStrategy": "Running state indicates the requested running state of the VirtualMachineInstance\nmutually exclusive with Running", - "template": "Template is the direct specification of VirtualMachineInstance", - "dataVolumeTemplates": "dataVolumeTemplates is a list of dataVolumes that the VirtualMachineInstance template can reference.\nDataVolumes in this list are dynamically created for the VirtualMachine and are tied to the VirtualMachine's life-cycle.", - } -} - -func (VirtualMachineStatus) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineStatus represents the status returned by the\ncontroller to describe how the VirtualMachine is doing", - "created": "Created indicates if the virtual machine is created in the cluster", - "ready": "Ready indicates if the virtual machine is running and ready", - "conditions": "Hold the state information of the VirtualMachine and its VirtualMachineInstance", - "stateChangeRequests": "StateChangeRequests indicates a list of actions that should be taken on a VMI\ne.g. stop a specific VMI then start a new one.", - } -} - -func (VirtualMachineStateChangeRequest) SwaggerDoc() map[string]string { - return map[string]string{ - "action": "Indicates the type of action that is requested. e.g. Start or Stop", - "uid": "Indicates the UUID of an existing Virtual Machine Instance that this change request applies to -- if applicable", - } -} - -func (VirtualMachineCondition) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineCondition represents the state of VirtualMachine", - } -} - -func (Handler) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Handler defines a specific action that should be taken", - "httpGet": "HTTPGet specifies the http request to perform.\n+optional", - "tcpSocket": "TCPSocket specifies an action involving a TCP port.\nTCP hooks not yet supported\n+optional", - } -} - -func (Probe) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Probe describes a health check to be performed against a VirtualMachineInstance to determine whether it is\nalive or ready to receive traffic.", - "initialDelaySeconds": "Number of seconds after the VirtualMachineInstance has started before liveness probes are initiated.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes\n+optional", - "timeoutSeconds": "Number of seconds after which the probe times out.\nDefaults to 1 second. Minimum value is 1.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes\n+optional", - "periodSeconds": "How often (in seconds) to perform the probe.\nDefault to 10 seconds. Minimum value is 1.\n+optional", - "successThreshold": "Minimum consecutive successes for the probe to be considered successful after having failed.\nDefaults to 1. Must be 1 for liveness. Minimum value is 1.\n+optional", - "failureThreshold": "Minimum consecutive failures for the probe to be considered failed after having succeeded.\nDefaults to 3. Minimum value is 1.\n+optional", - } -} - -func (KubeVirt) SwaggerDoc() map[string]string { - return map[string]string{ - "": "KubeVirt represents the object deploying all KubeVirt resources", - } -} - -func (KubeVirtList) SwaggerDoc() map[string]string { - return map[string]string{ - "": "KubeVirtList is a list of KubeVirts", - } -} - -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.", - } -} - -func (KubeVirtStatus) SwaggerDoc() map[string]string { - return map[string]string{ - "": "KubeVirtStatus represents information pertaining to a KubeVirt deployment.", - } -} - -func (KubeVirtCondition) SwaggerDoc() map[string]string { - return map[string]string{ - "": "KubeVirtCondition represents a condition of a KubeVirt deployment", - } -} 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 deleted file mode 100644 index a08b855cfd37..000000000000 --- a/vendor/kubevirt.io/client-go/api/v1/zz_generated.defaults.go +++ /dev/null @@ -1,459 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2019 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. -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. -*/ - -// Code generated by defaulter-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// RegisterDefaults adds defaulters functions to the given scheme. -// Public to allow building arbitrary schemes. -// All generated defaulters are covering - they call all nested defaulters. -func RegisterDefaults(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&VirtualMachine{}, func(obj interface{}) { SetObjectDefaults_VirtualMachine(obj.(*VirtualMachine)) }) - scheme.AddTypeDefaultingFunc(&VirtualMachineInstance{}, func(obj interface{}) { SetObjectDefaults_VirtualMachineInstance(obj.(*VirtualMachineInstance)) }) - scheme.AddTypeDefaultingFunc(&VirtualMachineInstanceList{}, func(obj interface{}) { SetObjectDefaults_VirtualMachineInstanceList(obj.(*VirtualMachineInstanceList)) }) - scheme.AddTypeDefaultingFunc(&VirtualMachineInstancePreset{}, func(obj interface{}) { - SetObjectDefaults_VirtualMachineInstancePreset(obj.(*VirtualMachineInstancePreset)) - }) - scheme.AddTypeDefaultingFunc(&VirtualMachineInstancePresetList{}, func(obj interface{}) { - SetObjectDefaults_VirtualMachineInstancePresetList(obj.(*VirtualMachineInstancePresetList)) - }) - scheme.AddTypeDefaultingFunc(&VirtualMachineInstanceReplicaSet{}, func(obj interface{}) { - SetObjectDefaults_VirtualMachineInstanceReplicaSet(obj.(*VirtualMachineInstanceReplicaSet)) - }) - scheme.AddTypeDefaultingFunc(&VirtualMachineInstanceReplicaSetList{}, func(obj interface{}) { - SetObjectDefaults_VirtualMachineInstanceReplicaSetList(obj.(*VirtualMachineInstanceReplicaSetList)) - }) - scheme.AddTypeDefaultingFunc(&VirtualMachineList{}, func(obj interface{}) { SetObjectDefaults_VirtualMachineList(obj.(*VirtualMachineList)) }) - return nil -} - -func SetObjectDefaults_VirtualMachine(in *VirtualMachine) { - if in.Spec.Template != nil { - if in.Spec.Template.Spec.Domain.Firmware != nil { - SetDefaults_Firmware(in.Spec.Template.Spec.Domain.Firmware) - } - if in.Spec.Template.Spec.Domain.Clock != nil { - if in.Spec.Template.Spec.Domain.Clock.Timer != nil { - if in.Spec.Template.Spec.Domain.Clock.Timer.HPET != nil { - SetDefaults_HPETTimer(in.Spec.Template.Spec.Domain.Clock.Timer.HPET) - } - if in.Spec.Template.Spec.Domain.Clock.Timer.KVM != nil { - SetDefaults_KVMTimer(in.Spec.Template.Spec.Domain.Clock.Timer.KVM) - } - if in.Spec.Template.Spec.Domain.Clock.Timer.PIT != nil { - SetDefaults_PITTimer(in.Spec.Template.Spec.Domain.Clock.Timer.PIT) - } - if in.Spec.Template.Spec.Domain.Clock.Timer.RTC != nil { - SetDefaults_RTCTimer(in.Spec.Template.Spec.Domain.Clock.Timer.RTC) - } - if in.Spec.Template.Spec.Domain.Clock.Timer.Hyperv != nil { - SetDefaults_HypervTimer(in.Spec.Template.Spec.Domain.Clock.Timer.Hyperv) - } - } - } - if in.Spec.Template.Spec.Domain.Features != nil { - SetDefaults_FeatureState(&in.Spec.Template.Spec.Domain.Features.ACPI) - if in.Spec.Template.Spec.Domain.Features.APIC != nil { - SetDefaults_FeatureAPIC(in.Spec.Template.Spec.Domain.Features.APIC) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv != nil { - if in.Spec.Template.Spec.Domain.Features.Hyperv.Relaxed != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.Relaxed) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.VAPIC != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.VAPIC) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.Spinlocks != nil { - SetDefaults_FeatureSpinlocks(in.Spec.Template.Spec.Domain.Features.Hyperv.Spinlocks) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.VPIndex != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.VPIndex) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.Runtime != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.Runtime) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.SyNIC != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.SyNIC) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.SyNICTimer != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.SyNICTimer) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.Reset != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.Reset) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.VendorID != nil { - SetDefaults_FeatureVendorID(in.Spec.Template.Spec.Domain.Features.Hyperv.VendorID) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.Frequencies != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.Frequencies) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.Reenlightenment != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.Reenlightenment) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.TLBFlush != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.TLBFlush) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.IPI != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.IPI) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.EVMCS != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.EVMCS) - } - } - if in.Spec.Template.Spec.Domain.Features.SMM != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.SMM) - } - } - for i := range in.Spec.Template.Spec.Domain.Devices.Disks { - a := &in.Spec.Template.Spec.Domain.Devices.Disks[i] - SetDefaults_DiskDevice(&a.DiskDevice) - if a.DiskDevice.Floppy != nil { - SetDefaults_FloppyTarget(a.DiskDevice.Floppy) - } - if a.DiskDevice.CDRom != nil { - SetDefaults_CDRomTarget(a.DiskDevice.CDRom) - } - } - if in.Spec.Template.Spec.Domain.Devices.Watchdog != nil { - SetDefaults_Watchdog(in.Spec.Template.Spec.Domain.Devices.Watchdog) - if in.Spec.Template.Spec.Domain.Devices.Watchdog.WatchdogDevice.I6300ESB != nil { - SetDefaults_I6300ESBWatchdog(in.Spec.Template.Spec.Domain.Devices.Watchdog.WatchdogDevice.I6300ESB) - } - } - } -} - -func SetObjectDefaults_VirtualMachineInstance(in *VirtualMachineInstance) { - SetDefaults_VirtualMachineInstance(in) - if in.Spec.Domain.Firmware != nil { - SetDefaults_Firmware(in.Spec.Domain.Firmware) - } - if in.Spec.Domain.Clock != nil { - if in.Spec.Domain.Clock.Timer != nil { - if in.Spec.Domain.Clock.Timer.HPET != nil { - SetDefaults_HPETTimer(in.Spec.Domain.Clock.Timer.HPET) - } - if in.Spec.Domain.Clock.Timer.KVM != nil { - SetDefaults_KVMTimer(in.Spec.Domain.Clock.Timer.KVM) - } - if in.Spec.Domain.Clock.Timer.PIT != nil { - SetDefaults_PITTimer(in.Spec.Domain.Clock.Timer.PIT) - } - if in.Spec.Domain.Clock.Timer.RTC != nil { - SetDefaults_RTCTimer(in.Spec.Domain.Clock.Timer.RTC) - } - if in.Spec.Domain.Clock.Timer.Hyperv != nil { - SetDefaults_HypervTimer(in.Spec.Domain.Clock.Timer.Hyperv) - } - } - } - if in.Spec.Domain.Features != nil { - SetDefaults_FeatureState(&in.Spec.Domain.Features.ACPI) - if in.Spec.Domain.Features.APIC != nil { - SetDefaults_FeatureAPIC(in.Spec.Domain.Features.APIC) - } - if in.Spec.Domain.Features.Hyperv != nil { - if in.Spec.Domain.Features.Hyperv.Relaxed != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.Relaxed) - } - if in.Spec.Domain.Features.Hyperv.VAPIC != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.VAPIC) - } - if in.Spec.Domain.Features.Hyperv.Spinlocks != nil { - SetDefaults_FeatureSpinlocks(in.Spec.Domain.Features.Hyperv.Spinlocks) - } - if in.Spec.Domain.Features.Hyperv.VPIndex != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.VPIndex) - } - if in.Spec.Domain.Features.Hyperv.Runtime != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.Runtime) - } - if in.Spec.Domain.Features.Hyperv.SyNIC != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.SyNIC) - } - if in.Spec.Domain.Features.Hyperv.SyNICTimer != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.SyNICTimer) - } - if in.Spec.Domain.Features.Hyperv.Reset != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.Reset) - } - if in.Spec.Domain.Features.Hyperv.VendorID != nil { - SetDefaults_FeatureVendorID(in.Spec.Domain.Features.Hyperv.VendorID) - } - if in.Spec.Domain.Features.Hyperv.Frequencies != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.Frequencies) - } - if in.Spec.Domain.Features.Hyperv.Reenlightenment != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.Reenlightenment) - } - if in.Spec.Domain.Features.Hyperv.TLBFlush != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.TLBFlush) - } - if in.Spec.Domain.Features.Hyperv.IPI != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.IPI) - } - if in.Spec.Domain.Features.Hyperv.EVMCS != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.EVMCS) - } - } - if in.Spec.Domain.Features.SMM != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.SMM) - } - } - for i := range in.Spec.Domain.Devices.Disks { - a := &in.Spec.Domain.Devices.Disks[i] - SetDefaults_DiskDevice(&a.DiskDevice) - if a.DiskDevice.Floppy != nil { - SetDefaults_FloppyTarget(a.DiskDevice.Floppy) - } - if a.DiskDevice.CDRom != nil { - SetDefaults_CDRomTarget(a.DiskDevice.CDRom) - } - } - if in.Spec.Domain.Devices.Watchdog != nil { - SetDefaults_Watchdog(in.Spec.Domain.Devices.Watchdog) - if in.Spec.Domain.Devices.Watchdog.WatchdogDevice.I6300ESB != nil { - SetDefaults_I6300ESBWatchdog(in.Spec.Domain.Devices.Watchdog.WatchdogDevice.I6300ESB) - } - } -} - -func SetObjectDefaults_VirtualMachineInstanceList(in *VirtualMachineInstanceList) { - for i := range in.Items { - a := &in.Items[i] - SetObjectDefaults_VirtualMachineInstance(a) - } -} - -func SetObjectDefaults_VirtualMachineInstancePreset(in *VirtualMachineInstancePreset) { - if in.Spec.Domain != nil { - if in.Spec.Domain.Firmware != nil { - SetDefaults_Firmware(in.Spec.Domain.Firmware) - } - if in.Spec.Domain.Clock != nil { - if in.Spec.Domain.Clock.Timer != nil { - if in.Spec.Domain.Clock.Timer.HPET != nil { - SetDefaults_HPETTimer(in.Spec.Domain.Clock.Timer.HPET) - } - if in.Spec.Domain.Clock.Timer.KVM != nil { - SetDefaults_KVMTimer(in.Spec.Domain.Clock.Timer.KVM) - } - if in.Spec.Domain.Clock.Timer.PIT != nil { - SetDefaults_PITTimer(in.Spec.Domain.Clock.Timer.PIT) - } - if in.Spec.Domain.Clock.Timer.RTC != nil { - SetDefaults_RTCTimer(in.Spec.Domain.Clock.Timer.RTC) - } - if in.Spec.Domain.Clock.Timer.Hyperv != nil { - SetDefaults_HypervTimer(in.Spec.Domain.Clock.Timer.Hyperv) - } - } - } - if in.Spec.Domain.Features != nil { - SetDefaults_FeatureState(&in.Spec.Domain.Features.ACPI) - if in.Spec.Domain.Features.APIC != nil { - SetDefaults_FeatureAPIC(in.Spec.Domain.Features.APIC) - } - if in.Spec.Domain.Features.Hyperv != nil { - if in.Spec.Domain.Features.Hyperv.Relaxed != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.Relaxed) - } - if in.Spec.Domain.Features.Hyperv.VAPIC != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.VAPIC) - } - if in.Spec.Domain.Features.Hyperv.Spinlocks != nil { - SetDefaults_FeatureSpinlocks(in.Spec.Domain.Features.Hyperv.Spinlocks) - } - if in.Spec.Domain.Features.Hyperv.VPIndex != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.VPIndex) - } - if in.Spec.Domain.Features.Hyperv.Runtime != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.Runtime) - } - if in.Spec.Domain.Features.Hyperv.SyNIC != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.SyNIC) - } - if in.Spec.Domain.Features.Hyperv.SyNICTimer != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.SyNICTimer) - } - if in.Spec.Domain.Features.Hyperv.Reset != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.Reset) - } - if in.Spec.Domain.Features.Hyperv.VendorID != nil { - SetDefaults_FeatureVendorID(in.Spec.Domain.Features.Hyperv.VendorID) - } - if in.Spec.Domain.Features.Hyperv.Frequencies != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.Frequencies) - } - if in.Spec.Domain.Features.Hyperv.Reenlightenment != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.Reenlightenment) - } - if in.Spec.Domain.Features.Hyperv.TLBFlush != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.TLBFlush) - } - if in.Spec.Domain.Features.Hyperv.IPI != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.IPI) - } - if in.Spec.Domain.Features.Hyperv.EVMCS != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.Hyperv.EVMCS) - } - } - if in.Spec.Domain.Features.SMM != nil { - SetDefaults_FeatureState(in.Spec.Domain.Features.SMM) - } - } - for i := range in.Spec.Domain.Devices.Disks { - a := &in.Spec.Domain.Devices.Disks[i] - SetDefaults_DiskDevice(&a.DiskDevice) - if a.DiskDevice.Floppy != nil { - SetDefaults_FloppyTarget(a.DiskDevice.Floppy) - } - if a.DiskDevice.CDRom != nil { - SetDefaults_CDRomTarget(a.DiskDevice.CDRom) - } - } - if in.Spec.Domain.Devices.Watchdog != nil { - SetDefaults_Watchdog(in.Spec.Domain.Devices.Watchdog) - if in.Spec.Domain.Devices.Watchdog.WatchdogDevice.I6300ESB != nil { - SetDefaults_I6300ESBWatchdog(in.Spec.Domain.Devices.Watchdog.WatchdogDevice.I6300ESB) - } - } - } -} - -func SetObjectDefaults_VirtualMachineInstancePresetList(in *VirtualMachineInstancePresetList) { - for i := range in.Items { - a := &in.Items[i] - SetObjectDefaults_VirtualMachineInstancePreset(a) - } -} - -func SetObjectDefaults_VirtualMachineInstanceReplicaSet(in *VirtualMachineInstanceReplicaSet) { - if in.Spec.Template != nil { - if in.Spec.Template.Spec.Domain.Firmware != nil { - SetDefaults_Firmware(in.Spec.Template.Spec.Domain.Firmware) - } - if in.Spec.Template.Spec.Domain.Clock != nil { - if in.Spec.Template.Spec.Domain.Clock.Timer != nil { - if in.Spec.Template.Spec.Domain.Clock.Timer.HPET != nil { - SetDefaults_HPETTimer(in.Spec.Template.Spec.Domain.Clock.Timer.HPET) - } - if in.Spec.Template.Spec.Domain.Clock.Timer.KVM != nil { - SetDefaults_KVMTimer(in.Spec.Template.Spec.Domain.Clock.Timer.KVM) - } - if in.Spec.Template.Spec.Domain.Clock.Timer.PIT != nil { - SetDefaults_PITTimer(in.Spec.Template.Spec.Domain.Clock.Timer.PIT) - } - if in.Spec.Template.Spec.Domain.Clock.Timer.RTC != nil { - SetDefaults_RTCTimer(in.Spec.Template.Spec.Domain.Clock.Timer.RTC) - } - if in.Spec.Template.Spec.Domain.Clock.Timer.Hyperv != nil { - SetDefaults_HypervTimer(in.Spec.Template.Spec.Domain.Clock.Timer.Hyperv) - } - } - } - if in.Spec.Template.Spec.Domain.Features != nil { - SetDefaults_FeatureState(&in.Spec.Template.Spec.Domain.Features.ACPI) - if in.Spec.Template.Spec.Domain.Features.APIC != nil { - SetDefaults_FeatureAPIC(in.Spec.Template.Spec.Domain.Features.APIC) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv != nil { - if in.Spec.Template.Spec.Domain.Features.Hyperv.Relaxed != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.Relaxed) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.VAPIC != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.VAPIC) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.Spinlocks != nil { - SetDefaults_FeatureSpinlocks(in.Spec.Template.Spec.Domain.Features.Hyperv.Spinlocks) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.VPIndex != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.VPIndex) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.Runtime != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.Runtime) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.SyNIC != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.SyNIC) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.SyNICTimer != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.SyNICTimer) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.Reset != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.Reset) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.VendorID != nil { - SetDefaults_FeatureVendorID(in.Spec.Template.Spec.Domain.Features.Hyperv.VendorID) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.Frequencies != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.Frequencies) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.Reenlightenment != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.Reenlightenment) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.TLBFlush != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.TLBFlush) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.IPI != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.IPI) - } - if in.Spec.Template.Spec.Domain.Features.Hyperv.EVMCS != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.Hyperv.EVMCS) - } - } - if in.Spec.Template.Spec.Domain.Features.SMM != nil { - SetDefaults_FeatureState(in.Spec.Template.Spec.Domain.Features.SMM) - } - } - for i := range in.Spec.Template.Spec.Domain.Devices.Disks { - a := &in.Spec.Template.Spec.Domain.Devices.Disks[i] - SetDefaults_DiskDevice(&a.DiskDevice) - if a.DiskDevice.Floppy != nil { - SetDefaults_FloppyTarget(a.DiskDevice.Floppy) - } - if a.DiskDevice.CDRom != nil { - SetDefaults_CDRomTarget(a.DiskDevice.CDRom) - } - } - if in.Spec.Template.Spec.Domain.Devices.Watchdog != nil { - SetDefaults_Watchdog(in.Spec.Template.Spec.Domain.Devices.Watchdog) - if in.Spec.Template.Spec.Domain.Devices.Watchdog.WatchdogDevice.I6300ESB != nil { - SetDefaults_I6300ESBWatchdog(in.Spec.Template.Spec.Domain.Devices.Watchdog.WatchdogDevice.I6300ESB) - } - } - } -} - -func SetObjectDefaults_VirtualMachineInstanceReplicaSetList(in *VirtualMachineInstanceReplicaSetList) { - for i := range in.Items { - a := &in.Items[i] - SetObjectDefaults_VirtualMachineInstanceReplicaSet(a) - } -} - -func SetObjectDefaults_VirtualMachineList(in *VirtualMachineList) { - for i := range in.Items { - a := &in.Items[i] - SetObjectDefaults_VirtualMachine(a) - } -} diff --git a/vendor/kubevirt.io/client-go/kubecli/BUILD.bazel b/vendor/kubevirt.io/client-go/kubecli/BUILD.bazel deleted file mode 100644 index b528f1fb1003..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/BUILD.bazel +++ /dev/null @@ -1,79 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "generated_mock_kubevirt.go", - "handler.go", - "kubecli.go", - "kubevirt.go", - "kubevirt_test_utils.go", - "kv.go", - "migration.go", - "replicaset.go", - "version.go", - "vm.go", - "vmi.go", - "vmipreset.go", - ], - importmap = "kubevirt.io/kubevirt/vendor/kubevirt.io/client-go/kubecli", - importpath = "kubevirt.io/client-go/kubecli", - visibility = ["//visibility:public"], - deps = [ - "//vendor/github.com/golang/mock/gomock:go_default_library", - "//vendor/github.com/gorilla/websocket:go_default_library", - "//vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned:go_default_library", - "//vendor/github.com/openshift/client-go/security/clientset/versioned/typed/security/v1:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/k8s.io/api/autoscaling/v1:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/fields:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", - "//vendor/k8s.io/client-go/discovery:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/apps/v1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/authentication/v1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/authorization/v1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/batch/v1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/networking/v1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/rbac/v1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/storage/v1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1:go_default_library", - "//vendor/k8s.io/client-go/rest:go_default_library", - "//vendor/k8s.io/client-go/tools/clientcmd:go_default_library", - "//vendor/kubevirt.io/client-go/api/v1:go_default_library", - "//vendor/kubevirt.io/client-go/subresources:go_default_library", - "//vendor/kubevirt.io/client-go/version:go_default_library", - "//vendor/kubevirt.io/containerized-data-importer/pkg/client/clientset/versioned:go_default_library", - ], -) diff --git a/vendor/kubevirt.io/client-go/kubecli/generated_mock_kubevirt.go b/vendor/kubevirt.io/client-go/kubecli/generated_mock_kubevirt.go deleted file mode 100644 index 6152d8418b71..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/generated_mock_kubevirt.go +++ /dev/null @@ -1,1375 +0,0 @@ -// Automatically generated by MockGen. DO NOT EDIT! -// Source: kubevirt.go - -package kubecli - -import ( - time "time" - - gomock "github.com/golang/mock/gomock" - versioned "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned" - v1 "github.com/openshift/client-go/security/clientset/versioned/typed/security/v1" - v10 "k8s.io/api/autoscaling/v1" - clientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - v11 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - discovery "k8s.io/client-go/discovery" - v1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1" - v1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" - v12 "k8s.io/client-go/kubernetes/typed/apps/v1" - v1beta10 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" - v1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" - v1alpha10 "k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1" - v13 "k8s.io/client-go/kubernetes/typed/authentication/v1" - v1beta11 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" - v14 "k8s.io/client-go/kubernetes/typed/authorization/v1" - v1beta12 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" - v15 "k8s.io/client-go/kubernetes/typed/autoscaling/v1" - v2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1" - v2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2" - v16 "k8s.io/client-go/kubernetes/typed/batch/v1" - v1beta13 "k8s.io/client-go/kubernetes/typed/batch/v1beta1" - v2alpha1 "k8s.io/client-go/kubernetes/typed/batch/v2alpha1" - v1beta14 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" - v1beta15 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" - v17 "k8s.io/client-go/kubernetes/typed/core/v1" - v1beta16 "k8s.io/client-go/kubernetes/typed/events/v1beta1" - v1beta17 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" - v18 "k8s.io/client-go/kubernetes/typed/networking/v1" - v1beta18 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" - v19 "k8s.io/client-go/kubernetes/typed/rbac/v1" - v1alpha11 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" - v1beta19 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" - v1alpha12 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" - v1beta110 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" - v1alpha13 "k8s.io/client-go/kubernetes/typed/settings/v1alpha1" - v110 "k8s.io/client-go/kubernetes/typed/storage/v1" - v1alpha14 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" - v1beta111 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" - rest "k8s.io/client-go/rest" - - v111 "kubevirt.io/client-go/api/v1" - versioned0 "kubevirt.io/containerized-data-importer/pkg/client/clientset/versioned" -) - -// Mock of KubevirtClient interface -type MockKubevirtClient struct { - ctrl *gomock.Controller - recorder *_MockKubevirtClientRecorder -} - -// Recorder for MockKubevirtClient (not exported) -type _MockKubevirtClientRecorder struct { - mock *MockKubevirtClient -} - -func NewMockKubevirtClient(ctrl *gomock.Controller) *MockKubevirtClient { - mock := &MockKubevirtClient{ctrl: ctrl} - mock.recorder = &_MockKubevirtClientRecorder{mock} - return mock -} - -func (_m *MockKubevirtClient) EXPECT() *_MockKubevirtClientRecorder { - return _m.recorder -} - -func (_m *MockKubevirtClient) VirtualMachineInstance(namespace string) VirtualMachineInstanceInterface { - ret := _m.ctrl.Call(_m, "VirtualMachineInstance", namespace) - ret0, _ := ret[0].(VirtualMachineInstanceInterface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) VirtualMachineInstance(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "VirtualMachineInstance", arg0) -} - -func (_m *MockKubevirtClient) VirtualMachineInstanceMigration(namespace string) VirtualMachineInstanceMigrationInterface { - ret := _m.ctrl.Call(_m, "VirtualMachineInstanceMigration", namespace) - ret0, _ := ret[0].(VirtualMachineInstanceMigrationInterface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) VirtualMachineInstanceMigration(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "VirtualMachineInstanceMigration", arg0) -} - -func (_m *MockKubevirtClient) ReplicaSet(namespace string) ReplicaSetInterface { - ret := _m.ctrl.Call(_m, "ReplicaSet", namespace) - ret0, _ := ret[0].(ReplicaSetInterface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) ReplicaSet(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "ReplicaSet", arg0) -} - -func (_m *MockKubevirtClient) VirtualMachine(namespace string) VirtualMachineInterface { - ret := _m.ctrl.Call(_m, "VirtualMachine", namespace) - ret0, _ := ret[0].(VirtualMachineInterface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) VirtualMachine(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "VirtualMachine", arg0) -} - -func (_m *MockKubevirtClient) KubeVirt(namespace string) KubeVirtInterface { - ret := _m.ctrl.Call(_m, "KubeVirt", namespace) - ret0, _ := ret[0].(KubeVirtInterface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) KubeVirt(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "KubeVirt", arg0) -} - -func (_m *MockKubevirtClient) VirtualMachineInstancePreset(namespace string) VirtualMachineInstancePresetInterface { - ret := _m.ctrl.Call(_m, "VirtualMachineInstancePreset", namespace) - ret0, _ := ret[0].(VirtualMachineInstancePresetInterface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) VirtualMachineInstancePreset(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "VirtualMachineInstancePreset", arg0) -} - -func (_m *MockKubevirtClient) ServerVersion() *ServerVersion { - ret := _m.ctrl.Call(_m, "ServerVersion") - ret0, _ := ret[0].(*ServerVersion) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) ServerVersion() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "ServerVersion") -} - -func (_m *MockKubevirtClient) RestClient() *rest.RESTClient { - ret := _m.ctrl.Call(_m, "RestClient") - ret0, _ := ret[0].(*rest.RESTClient) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) RestClient() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "RestClient") -} - -func (_m *MockKubevirtClient) CdiClient() versioned0.Interface { - ret := _m.ctrl.Call(_m, "CdiClient") - ret0, _ := ret[0].(versioned0.Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) CdiClient() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "CdiClient") -} - -func (_m *MockKubevirtClient) NetworkClient() versioned.Interface { - ret := _m.ctrl.Call(_m, "NetworkClient") - ret0, _ := ret[0].(versioned.Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) NetworkClient() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "NetworkClient") -} - -func (_m *MockKubevirtClient) ExtensionsClient() clientset.Interface { - ret := _m.ctrl.Call(_m, "ExtensionsClient") - ret0, _ := ret[0].(clientset.Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) ExtensionsClient() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "ExtensionsClient") -} - -func (_m *MockKubevirtClient) SecClient() v1.SecurityV1Interface { - ret := _m.ctrl.Call(_m, "SecClient") - ret0, _ := ret[0].(v1.SecurityV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) SecClient() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "SecClient") -} - -func (_m *MockKubevirtClient) DiscoveryClient() discovery.DiscoveryInterface { - ret := _m.ctrl.Call(_m, "DiscoveryClient") - ret0, _ := ret[0].(discovery.DiscoveryInterface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) DiscoveryClient() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "DiscoveryClient") -} - -func (_m *MockKubevirtClient) Discovery() discovery.DiscoveryInterface { - ret := _m.ctrl.Call(_m, "Discovery") - ret0, _ := ret[0].(discovery.DiscoveryInterface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Discovery() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Discovery") -} - -func (_m *MockKubevirtClient) AdmissionregistrationV1alpha1() v1alpha1.AdmissionregistrationV1alpha1Interface { - ret := _m.ctrl.Call(_m, "AdmissionregistrationV1alpha1") - ret0, _ := ret[0].(v1alpha1.AdmissionregistrationV1alpha1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AdmissionregistrationV1alpha1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AdmissionregistrationV1alpha1") -} - -func (_m *MockKubevirtClient) AdmissionregistrationV1beta1() v1beta1.AdmissionregistrationV1beta1Interface { - ret := _m.ctrl.Call(_m, "AdmissionregistrationV1beta1") - ret0, _ := ret[0].(v1beta1.AdmissionregistrationV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AdmissionregistrationV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AdmissionregistrationV1beta1") -} - -func (_m *MockKubevirtClient) Admissionregistration() v1beta1.AdmissionregistrationV1beta1Interface { - ret := _m.ctrl.Call(_m, "Admissionregistration") - ret0, _ := ret[0].(v1beta1.AdmissionregistrationV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Admissionregistration() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Admissionregistration") -} - -func (_m *MockKubevirtClient) AppsV1beta1() v1beta10.AppsV1beta1Interface { - ret := _m.ctrl.Call(_m, "AppsV1beta1") - ret0, _ := ret[0].(v1beta10.AppsV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AppsV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AppsV1beta1") -} - -func (_m *MockKubevirtClient) AppsV1beta2() v1beta2.AppsV1beta2Interface { - ret := _m.ctrl.Call(_m, "AppsV1beta2") - ret0, _ := ret[0].(v1beta2.AppsV1beta2Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AppsV1beta2() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AppsV1beta2") -} - -func (_m *MockKubevirtClient) AppsV1() v12.AppsV1Interface { - ret := _m.ctrl.Call(_m, "AppsV1") - ret0, _ := ret[0].(v12.AppsV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AppsV1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AppsV1") -} - -func (_m *MockKubevirtClient) Apps() v12.AppsV1Interface { - ret := _m.ctrl.Call(_m, "Apps") - ret0, _ := ret[0].(v12.AppsV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Apps() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Apps") -} - -func (_m *MockKubevirtClient) AuditregistrationV1alpha1() v1alpha10.AuditregistrationV1alpha1Interface { - ret := _m.ctrl.Call(_m, "AuditregistrationV1alpha1") - ret0, _ := ret[0].(v1alpha10.AuditregistrationV1alpha1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AuditregistrationV1alpha1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AuditregistrationV1alpha1") -} - -func (_m *MockKubevirtClient) Auditregistration() v1alpha10.AuditregistrationV1alpha1Interface { - ret := _m.ctrl.Call(_m, "Auditregistration") - ret0, _ := ret[0].(v1alpha10.AuditregistrationV1alpha1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Auditregistration() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Auditregistration") -} - -func (_m *MockKubevirtClient) AuthenticationV1() v13.AuthenticationV1Interface { - ret := _m.ctrl.Call(_m, "AuthenticationV1") - ret0, _ := ret[0].(v13.AuthenticationV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AuthenticationV1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AuthenticationV1") -} - -func (_m *MockKubevirtClient) Authentication() v13.AuthenticationV1Interface { - ret := _m.ctrl.Call(_m, "Authentication") - ret0, _ := ret[0].(v13.AuthenticationV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Authentication() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Authentication") -} - -func (_m *MockKubevirtClient) AuthenticationV1beta1() v1beta11.AuthenticationV1beta1Interface { - ret := _m.ctrl.Call(_m, "AuthenticationV1beta1") - ret0, _ := ret[0].(v1beta11.AuthenticationV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AuthenticationV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AuthenticationV1beta1") -} - -func (_m *MockKubevirtClient) AuthorizationV1() v14.AuthorizationV1Interface { - ret := _m.ctrl.Call(_m, "AuthorizationV1") - ret0, _ := ret[0].(v14.AuthorizationV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AuthorizationV1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AuthorizationV1") -} - -func (_m *MockKubevirtClient) Authorization() v14.AuthorizationV1Interface { - ret := _m.ctrl.Call(_m, "Authorization") - ret0, _ := ret[0].(v14.AuthorizationV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Authorization() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Authorization") -} - -func (_m *MockKubevirtClient) AuthorizationV1beta1() v1beta12.AuthorizationV1beta1Interface { - ret := _m.ctrl.Call(_m, "AuthorizationV1beta1") - ret0, _ := ret[0].(v1beta12.AuthorizationV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AuthorizationV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AuthorizationV1beta1") -} - -func (_m *MockKubevirtClient) AutoscalingV1() v15.AutoscalingV1Interface { - ret := _m.ctrl.Call(_m, "AutoscalingV1") - ret0, _ := ret[0].(v15.AutoscalingV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AutoscalingV1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AutoscalingV1") -} - -func (_m *MockKubevirtClient) Autoscaling() v15.AutoscalingV1Interface { - ret := _m.ctrl.Call(_m, "Autoscaling") - ret0, _ := ret[0].(v15.AutoscalingV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Autoscaling() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Autoscaling") -} - -func (_m *MockKubevirtClient) AutoscalingV2beta1() v2beta1.AutoscalingV2beta1Interface { - ret := _m.ctrl.Call(_m, "AutoscalingV2beta1") - ret0, _ := ret[0].(v2beta1.AutoscalingV2beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AutoscalingV2beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AutoscalingV2beta1") -} - -func (_m *MockKubevirtClient) AutoscalingV2beta2() v2beta2.AutoscalingV2beta2Interface { - ret := _m.ctrl.Call(_m, "AutoscalingV2beta2") - ret0, _ := ret[0].(v2beta2.AutoscalingV2beta2Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) AutoscalingV2beta2() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "AutoscalingV2beta2") -} - -func (_m *MockKubevirtClient) BatchV1() v16.BatchV1Interface { - ret := _m.ctrl.Call(_m, "BatchV1") - ret0, _ := ret[0].(v16.BatchV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) BatchV1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "BatchV1") -} - -func (_m *MockKubevirtClient) Batch() v16.BatchV1Interface { - ret := _m.ctrl.Call(_m, "Batch") - ret0, _ := ret[0].(v16.BatchV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Batch() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Batch") -} - -func (_m *MockKubevirtClient) BatchV1beta1() v1beta13.BatchV1beta1Interface { - ret := _m.ctrl.Call(_m, "BatchV1beta1") - ret0, _ := ret[0].(v1beta13.BatchV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) BatchV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "BatchV1beta1") -} - -func (_m *MockKubevirtClient) BatchV2alpha1() v2alpha1.BatchV2alpha1Interface { - ret := _m.ctrl.Call(_m, "BatchV2alpha1") - ret0, _ := ret[0].(v2alpha1.BatchV2alpha1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) BatchV2alpha1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "BatchV2alpha1") -} - -func (_m *MockKubevirtClient) CertificatesV1beta1() v1beta14.CertificatesV1beta1Interface { - ret := _m.ctrl.Call(_m, "CertificatesV1beta1") - ret0, _ := ret[0].(v1beta14.CertificatesV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) CertificatesV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "CertificatesV1beta1") -} - -func (_m *MockKubevirtClient) Certificates() v1beta14.CertificatesV1beta1Interface { - ret := _m.ctrl.Call(_m, "Certificates") - ret0, _ := ret[0].(v1beta14.CertificatesV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Certificates() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Certificates") -} - -func (_m *MockKubevirtClient) CoordinationV1beta1() v1beta15.CoordinationV1beta1Interface { - ret := _m.ctrl.Call(_m, "CoordinationV1beta1") - ret0, _ := ret[0].(v1beta15.CoordinationV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) CoordinationV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "CoordinationV1beta1") -} - -func (_m *MockKubevirtClient) Coordination() v1beta15.CoordinationV1beta1Interface { - ret := _m.ctrl.Call(_m, "Coordination") - ret0, _ := ret[0].(v1beta15.CoordinationV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Coordination() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Coordination") -} - -func (_m *MockKubevirtClient) CoreV1() v17.CoreV1Interface { - ret := _m.ctrl.Call(_m, "CoreV1") - ret0, _ := ret[0].(v17.CoreV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) CoreV1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "CoreV1") -} - -func (_m *MockKubevirtClient) Core() v17.CoreV1Interface { - ret := _m.ctrl.Call(_m, "Core") - ret0, _ := ret[0].(v17.CoreV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Core() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Core") -} - -func (_m *MockKubevirtClient) EventsV1beta1() v1beta16.EventsV1beta1Interface { - ret := _m.ctrl.Call(_m, "EventsV1beta1") - ret0, _ := ret[0].(v1beta16.EventsV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) EventsV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "EventsV1beta1") -} - -func (_m *MockKubevirtClient) Events() v1beta16.EventsV1beta1Interface { - ret := _m.ctrl.Call(_m, "Events") - ret0, _ := ret[0].(v1beta16.EventsV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Events() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Events") -} - -func (_m *MockKubevirtClient) ExtensionsV1beta1() v1beta17.ExtensionsV1beta1Interface { - ret := _m.ctrl.Call(_m, "ExtensionsV1beta1") - ret0, _ := ret[0].(v1beta17.ExtensionsV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) ExtensionsV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "ExtensionsV1beta1") -} - -func (_m *MockKubevirtClient) Extensions() v1beta17.ExtensionsV1beta1Interface { - ret := _m.ctrl.Call(_m, "Extensions") - ret0, _ := ret[0].(v1beta17.ExtensionsV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Extensions() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Extensions") -} - -func (_m *MockKubevirtClient) NetworkingV1() v18.NetworkingV1Interface { - ret := _m.ctrl.Call(_m, "NetworkingV1") - ret0, _ := ret[0].(v18.NetworkingV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) NetworkingV1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "NetworkingV1") -} - -func (_m *MockKubevirtClient) Networking() v18.NetworkingV1Interface { - ret := _m.ctrl.Call(_m, "Networking") - ret0, _ := ret[0].(v18.NetworkingV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Networking() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Networking") -} - -func (_m *MockKubevirtClient) PolicyV1beta1() v1beta18.PolicyV1beta1Interface { - ret := _m.ctrl.Call(_m, "PolicyV1beta1") - ret0, _ := ret[0].(v1beta18.PolicyV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) PolicyV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "PolicyV1beta1") -} - -func (_m *MockKubevirtClient) Policy() v1beta18.PolicyV1beta1Interface { - ret := _m.ctrl.Call(_m, "Policy") - ret0, _ := ret[0].(v1beta18.PolicyV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Policy() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Policy") -} - -func (_m *MockKubevirtClient) RbacV1() v19.RbacV1Interface { - ret := _m.ctrl.Call(_m, "RbacV1") - ret0, _ := ret[0].(v19.RbacV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) RbacV1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "RbacV1") -} - -func (_m *MockKubevirtClient) Rbac() v19.RbacV1Interface { - ret := _m.ctrl.Call(_m, "Rbac") - ret0, _ := ret[0].(v19.RbacV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Rbac() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Rbac") -} - -func (_m *MockKubevirtClient) RbacV1beta1() v1beta19.RbacV1beta1Interface { - ret := _m.ctrl.Call(_m, "RbacV1beta1") - ret0, _ := ret[0].(v1beta19.RbacV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) RbacV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "RbacV1beta1") -} - -func (_m *MockKubevirtClient) RbacV1alpha1() v1alpha11.RbacV1alpha1Interface { - ret := _m.ctrl.Call(_m, "RbacV1alpha1") - ret0, _ := ret[0].(v1alpha11.RbacV1alpha1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) RbacV1alpha1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "RbacV1alpha1") -} - -func (_m *MockKubevirtClient) SchedulingV1alpha1() v1alpha12.SchedulingV1alpha1Interface { - ret := _m.ctrl.Call(_m, "SchedulingV1alpha1") - ret0, _ := ret[0].(v1alpha12.SchedulingV1alpha1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) SchedulingV1alpha1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "SchedulingV1alpha1") -} - -func (_m *MockKubevirtClient) SchedulingV1beta1() v1beta110.SchedulingV1beta1Interface { - ret := _m.ctrl.Call(_m, "SchedulingV1beta1") - ret0, _ := ret[0].(v1beta110.SchedulingV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) SchedulingV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "SchedulingV1beta1") -} - -func (_m *MockKubevirtClient) Scheduling() v1beta110.SchedulingV1beta1Interface { - ret := _m.ctrl.Call(_m, "Scheduling") - ret0, _ := ret[0].(v1beta110.SchedulingV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Scheduling() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Scheduling") -} - -func (_m *MockKubevirtClient) SettingsV1alpha1() v1alpha13.SettingsV1alpha1Interface { - ret := _m.ctrl.Call(_m, "SettingsV1alpha1") - ret0, _ := ret[0].(v1alpha13.SettingsV1alpha1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) SettingsV1alpha1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "SettingsV1alpha1") -} - -func (_m *MockKubevirtClient) Settings() v1alpha13.SettingsV1alpha1Interface { - ret := _m.ctrl.Call(_m, "Settings") - ret0, _ := ret[0].(v1alpha13.SettingsV1alpha1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Settings() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Settings") -} - -func (_m *MockKubevirtClient) StorageV1beta1() v1beta111.StorageV1beta1Interface { - ret := _m.ctrl.Call(_m, "StorageV1beta1") - ret0, _ := ret[0].(v1beta111.StorageV1beta1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) StorageV1beta1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "StorageV1beta1") -} - -func (_m *MockKubevirtClient) StorageV1() v110.StorageV1Interface { - ret := _m.ctrl.Call(_m, "StorageV1") - ret0, _ := ret[0].(v110.StorageV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) StorageV1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "StorageV1") -} - -func (_m *MockKubevirtClient) Storage() v110.StorageV1Interface { - ret := _m.ctrl.Call(_m, "Storage") - ret0, _ := ret[0].(v110.StorageV1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Storage() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Storage") -} - -func (_m *MockKubevirtClient) StorageV1alpha1() v1alpha14.StorageV1alpha1Interface { - ret := _m.ctrl.Call(_m, "StorageV1alpha1") - ret0, _ := ret[0].(v1alpha14.StorageV1alpha1Interface) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) StorageV1alpha1() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "StorageV1alpha1") -} - -func (_m *MockKubevirtClient) Config() *rest.Config { - ret := _m.ctrl.Call(_m, "Config") - ret0, _ := ret[0].(*rest.Config) - return ret0 -} - -func (_mr *_MockKubevirtClientRecorder) Config() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Config") -} - -// Mock of StreamInterface interface -type MockStreamInterface struct { - ctrl *gomock.Controller - recorder *_MockStreamInterfaceRecorder -} - -// Recorder for MockStreamInterface (not exported) -type _MockStreamInterfaceRecorder struct { - mock *MockStreamInterface -} - -func NewMockStreamInterface(ctrl *gomock.Controller) *MockStreamInterface { - mock := &MockStreamInterface{ctrl: ctrl} - mock.recorder = &_MockStreamInterfaceRecorder{mock} - return mock -} - -func (_m *MockStreamInterface) EXPECT() *_MockStreamInterfaceRecorder { - return _m.recorder -} - -func (_m *MockStreamInterface) Stream(options StreamOptions) error { - ret := _m.ctrl.Call(_m, "Stream", options) - ret0, _ := ret[0].(error) - return ret0 -} - -func (_mr *_MockStreamInterfaceRecorder) Stream(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Stream", arg0) -} - -// Mock of VirtualMachineInstanceInterface interface -type MockVirtualMachineInstanceInterface struct { - ctrl *gomock.Controller - recorder *_MockVirtualMachineInstanceInterfaceRecorder -} - -// Recorder for MockVirtualMachineInstanceInterface (not exported) -type _MockVirtualMachineInstanceInterfaceRecorder struct { - mock *MockVirtualMachineInstanceInterface -} - -func NewMockVirtualMachineInstanceInterface(ctrl *gomock.Controller) *MockVirtualMachineInstanceInterface { - mock := &MockVirtualMachineInstanceInterface{ctrl: ctrl} - mock.recorder = &_MockVirtualMachineInstanceInterfaceRecorder{mock} - return mock -} - -func (_m *MockVirtualMachineInstanceInterface) EXPECT() *_MockVirtualMachineInstanceInterfaceRecorder { - return _m.recorder -} - -func (_m *MockVirtualMachineInstanceInterface) Get(name string, options *v11.GetOptions) (*v111.VirtualMachineInstance, error) { - ret := _m.ctrl.Call(_m, "Get", name, options) - ret0, _ := ret[0].(*v111.VirtualMachineInstance) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstanceInterfaceRecorder) Get(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Get", arg0, arg1) -} - -func (_m *MockVirtualMachineInstanceInterface) List(opts *v11.ListOptions) (*v111.VirtualMachineInstanceList, error) { - ret := _m.ctrl.Call(_m, "List", opts) - ret0, _ := ret[0].(*v111.VirtualMachineInstanceList) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstanceInterfaceRecorder) List(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "List", arg0) -} - -func (_m *MockVirtualMachineInstanceInterface) Create(instance *v111.VirtualMachineInstance) (*v111.VirtualMachineInstance, error) { - ret := _m.ctrl.Call(_m, "Create", instance) - ret0, _ := ret[0].(*v111.VirtualMachineInstance) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstanceInterfaceRecorder) Create(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Create", arg0) -} - -func (_m *MockVirtualMachineInstanceInterface) Update(_param0 *v111.VirtualMachineInstance) (*v111.VirtualMachineInstance, error) { - ret := _m.ctrl.Call(_m, "Update", _param0) - ret0, _ := ret[0].(*v111.VirtualMachineInstance) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstanceInterfaceRecorder) Update(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Update", arg0) -} - -func (_m *MockVirtualMachineInstanceInterface) Delete(name string, options *v11.DeleteOptions) error { - ret := _m.ctrl.Call(_m, "Delete", name, options) - ret0, _ := ret[0].(error) - return ret0 -} - -func (_mr *_MockVirtualMachineInstanceInterfaceRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Delete", arg0, arg1) -} - -func (_m *MockVirtualMachineInstanceInterface) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*v111.VirtualMachineInstance, error) { - _s := []interface{}{name, pt, data} - for _, _x := range subresources { - _s = append(_s, _x) - } - ret := _m.ctrl.Call(_m, "Patch", _s...) - ret0, _ := ret[0].(*v111.VirtualMachineInstance) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstanceInterfaceRecorder) Patch(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { - _s := append([]interface{}{arg0, arg1, arg2}, arg3...) - return _mr.mock.ctrl.RecordCall(_mr.mock, "Patch", _s...) -} - -func (_m *MockVirtualMachineInstanceInterface) SerialConsole(name string, timeout time.Duration) (StreamInterface, error) { - ret := _m.ctrl.Call(_m, "SerialConsole", name, timeout) - ret0, _ := ret[0].(StreamInterface) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstanceInterfaceRecorder) SerialConsole(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "SerialConsole", arg0, arg1) -} - -func (_m *MockVirtualMachineInstanceInterface) VNC(name string) (StreamInterface, error) { - ret := _m.ctrl.Call(_m, "VNC", name) - ret0, _ := ret[0].(StreamInterface) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstanceInterfaceRecorder) VNC(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "VNC", arg0) -} - -// Mock of ReplicaSetInterface interface -type MockReplicaSetInterface struct { - ctrl *gomock.Controller - recorder *_MockReplicaSetInterfaceRecorder -} - -// Recorder for MockReplicaSetInterface (not exported) -type _MockReplicaSetInterfaceRecorder struct { - mock *MockReplicaSetInterface -} - -func NewMockReplicaSetInterface(ctrl *gomock.Controller) *MockReplicaSetInterface { - mock := &MockReplicaSetInterface{ctrl: ctrl} - mock.recorder = &_MockReplicaSetInterfaceRecorder{mock} - return mock -} - -func (_m *MockReplicaSetInterface) EXPECT() *_MockReplicaSetInterfaceRecorder { - return _m.recorder -} - -func (_m *MockReplicaSetInterface) Get(name string, options v11.GetOptions) (*v111.VirtualMachineInstanceReplicaSet, error) { - ret := _m.ctrl.Call(_m, "Get", name, options) - ret0, _ := ret[0].(*v111.VirtualMachineInstanceReplicaSet) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockReplicaSetInterfaceRecorder) Get(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Get", arg0, arg1) -} - -func (_m *MockReplicaSetInterface) List(opts v11.ListOptions) (*v111.VirtualMachineInstanceReplicaSetList, error) { - ret := _m.ctrl.Call(_m, "List", opts) - ret0, _ := ret[0].(*v111.VirtualMachineInstanceReplicaSetList) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockReplicaSetInterfaceRecorder) List(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "List", arg0) -} - -func (_m *MockReplicaSetInterface) Create(_param0 *v111.VirtualMachineInstanceReplicaSet) (*v111.VirtualMachineInstanceReplicaSet, error) { - ret := _m.ctrl.Call(_m, "Create", _param0) - ret0, _ := ret[0].(*v111.VirtualMachineInstanceReplicaSet) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockReplicaSetInterfaceRecorder) Create(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Create", arg0) -} - -func (_m *MockReplicaSetInterface) Update(_param0 *v111.VirtualMachineInstanceReplicaSet) (*v111.VirtualMachineInstanceReplicaSet, error) { - ret := _m.ctrl.Call(_m, "Update", _param0) - ret0, _ := ret[0].(*v111.VirtualMachineInstanceReplicaSet) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockReplicaSetInterfaceRecorder) Update(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Update", arg0) -} - -func (_m *MockReplicaSetInterface) Delete(name string, options *v11.DeleteOptions) error { - ret := _m.ctrl.Call(_m, "Delete", name, options) - ret0, _ := ret[0].(error) - return ret0 -} - -func (_mr *_MockReplicaSetInterfaceRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Delete", arg0, arg1) -} - -func (_m *MockReplicaSetInterface) GetScale(replicaSetName string, options v11.GetOptions) (*v10.Scale, error) { - ret := _m.ctrl.Call(_m, "GetScale", replicaSetName, options) - ret0, _ := ret[0].(*v10.Scale) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockReplicaSetInterfaceRecorder) GetScale(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "GetScale", arg0, arg1) -} - -func (_m *MockReplicaSetInterface) UpdateScale(replicaSetName string, scale *v10.Scale) (*v10.Scale, error) { - ret := _m.ctrl.Call(_m, "UpdateScale", replicaSetName, scale) - ret0, _ := ret[0].(*v10.Scale) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockReplicaSetInterfaceRecorder) UpdateScale(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "UpdateScale", arg0, arg1) -} - -func (_m *MockReplicaSetInterface) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*v111.VirtualMachineInstanceReplicaSet, error) { - _s := []interface{}{name, pt, data} - for _, _x := range subresources { - _s = append(_s, _x) - } - ret := _m.ctrl.Call(_m, "Patch", _s...) - ret0, _ := ret[0].(*v111.VirtualMachineInstanceReplicaSet) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockReplicaSetInterfaceRecorder) Patch(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { - _s := append([]interface{}{arg0, arg1, arg2}, arg3...) - return _mr.mock.ctrl.RecordCall(_mr.mock, "Patch", _s...) -} - -// Mock of VirtualMachineInstancePresetInterface interface -type MockVirtualMachineInstancePresetInterface struct { - ctrl *gomock.Controller - recorder *_MockVirtualMachineInstancePresetInterfaceRecorder -} - -// Recorder for MockVirtualMachineInstancePresetInterface (not exported) -type _MockVirtualMachineInstancePresetInterfaceRecorder struct { - mock *MockVirtualMachineInstancePresetInterface -} - -func NewMockVirtualMachineInstancePresetInterface(ctrl *gomock.Controller) *MockVirtualMachineInstancePresetInterface { - mock := &MockVirtualMachineInstancePresetInterface{ctrl: ctrl} - mock.recorder = &_MockVirtualMachineInstancePresetInterfaceRecorder{mock} - return mock -} - -func (_m *MockVirtualMachineInstancePresetInterface) EXPECT() *_MockVirtualMachineInstancePresetInterfaceRecorder { - return _m.recorder -} - -func (_m *MockVirtualMachineInstancePresetInterface) Get(name string, options v11.GetOptions) (*v111.VirtualMachineInstancePreset, error) { - ret := _m.ctrl.Call(_m, "Get", name, options) - ret0, _ := ret[0].(*v111.VirtualMachineInstancePreset) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstancePresetInterfaceRecorder) Get(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Get", arg0, arg1) -} - -func (_m *MockVirtualMachineInstancePresetInterface) List(opts v11.ListOptions) (*v111.VirtualMachineInstancePresetList, error) { - ret := _m.ctrl.Call(_m, "List", opts) - ret0, _ := ret[0].(*v111.VirtualMachineInstancePresetList) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstancePresetInterfaceRecorder) List(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "List", arg0) -} - -func (_m *MockVirtualMachineInstancePresetInterface) Create(_param0 *v111.VirtualMachineInstancePreset) (*v111.VirtualMachineInstancePreset, error) { - ret := _m.ctrl.Call(_m, "Create", _param0) - ret0, _ := ret[0].(*v111.VirtualMachineInstancePreset) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstancePresetInterfaceRecorder) Create(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Create", arg0) -} - -func (_m *MockVirtualMachineInstancePresetInterface) Update(_param0 *v111.VirtualMachineInstancePreset) (*v111.VirtualMachineInstancePreset, error) { - ret := _m.ctrl.Call(_m, "Update", _param0) - ret0, _ := ret[0].(*v111.VirtualMachineInstancePreset) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstancePresetInterfaceRecorder) Update(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Update", arg0) -} - -func (_m *MockVirtualMachineInstancePresetInterface) Delete(name string, options *v11.DeleteOptions) error { - ret := _m.ctrl.Call(_m, "Delete", name, options) - ret0, _ := ret[0].(error) - return ret0 -} - -func (_mr *_MockVirtualMachineInstancePresetInterfaceRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Delete", arg0, arg1) -} - -func (_m *MockVirtualMachineInstancePresetInterface) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*v111.VirtualMachineInstancePreset, error) { - _s := []interface{}{name, pt, data} - for _, _x := range subresources { - _s = append(_s, _x) - } - ret := _m.ctrl.Call(_m, "Patch", _s...) - ret0, _ := ret[0].(*v111.VirtualMachineInstancePreset) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstancePresetInterfaceRecorder) Patch(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { - _s := append([]interface{}{arg0, arg1, arg2}, arg3...) - return _mr.mock.ctrl.RecordCall(_mr.mock, "Patch", _s...) -} - -// Mock of VirtualMachineInterface interface -type MockVirtualMachineInterface struct { - ctrl *gomock.Controller - recorder *_MockVirtualMachineInterfaceRecorder -} - -// Recorder for MockVirtualMachineInterface (not exported) -type _MockVirtualMachineInterfaceRecorder struct { - mock *MockVirtualMachineInterface -} - -func NewMockVirtualMachineInterface(ctrl *gomock.Controller) *MockVirtualMachineInterface { - mock := &MockVirtualMachineInterface{ctrl: ctrl} - mock.recorder = &_MockVirtualMachineInterfaceRecorder{mock} - return mock -} - -func (_m *MockVirtualMachineInterface) EXPECT() *_MockVirtualMachineInterfaceRecorder { - return _m.recorder -} - -func (_m *MockVirtualMachineInterface) Get(name string, options *v11.GetOptions) (*v111.VirtualMachine, error) { - ret := _m.ctrl.Call(_m, "Get", name, options) - ret0, _ := ret[0].(*v111.VirtualMachine) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInterfaceRecorder) Get(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Get", arg0, arg1) -} - -func (_m *MockVirtualMachineInterface) List(opts *v11.ListOptions) (*v111.VirtualMachineList, error) { - ret := _m.ctrl.Call(_m, "List", opts) - ret0, _ := ret[0].(*v111.VirtualMachineList) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInterfaceRecorder) List(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "List", arg0) -} - -func (_m *MockVirtualMachineInterface) Create(_param0 *v111.VirtualMachine) (*v111.VirtualMachine, error) { - ret := _m.ctrl.Call(_m, "Create", _param0) - ret0, _ := ret[0].(*v111.VirtualMachine) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInterfaceRecorder) Create(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Create", arg0) -} - -func (_m *MockVirtualMachineInterface) Update(_param0 *v111.VirtualMachine) (*v111.VirtualMachine, error) { - ret := _m.ctrl.Call(_m, "Update", _param0) - ret0, _ := ret[0].(*v111.VirtualMachine) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInterfaceRecorder) Update(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Update", arg0) -} - -func (_m *MockVirtualMachineInterface) Delete(name string, options *v11.DeleteOptions) error { - ret := _m.ctrl.Call(_m, "Delete", name, options) - ret0, _ := ret[0].(error) - return ret0 -} - -func (_mr *_MockVirtualMachineInterfaceRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Delete", arg0, arg1) -} - -func (_m *MockVirtualMachineInterface) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*v111.VirtualMachine, error) { - _s := []interface{}{name, pt, data} - for _, _x := range subresources { - _s = append(_s, _x) - } - ret := _m.ctrl.Call(_m, "Patch", _s...) - ret0, _ := ret[0].(*v111.VirtualMachine) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInterfaceRecorder) Patch(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { - _s := append([]interface{}{arg0, arg1, arg2}, arg3...) - return _mr.mock.ctrl.RecordCall(_mr.mock, "Patch", _s...) -} - -func (_m *MockVirtualMachineInterface) Restart(name string) error { - ret := _m.ctrl.Call(_m, "Restart", name) - ret0, _ := ret[0].(error) - return ret0 -} - -func (_mr *_MockVirtualMachineInterfaceRecorder) Restart(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Restart", arg0) -} - -func (_m *MockVirtualMachineInterface) Start(name string) error { - ret := _m.ctrl.Call(_m, "Start", name) - ret0, _ := ret[0].(error) - return ret0 -} - -func (_mr *_MockVirtualMachineInterfaceRecorder) Start(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Start", arg0) -} - -func (_m *MockVirtualMachineInterface) Stop(name string) error { - ret := _m.ctrl.Call(_m, "Stop", name) - ret0, _ := ret[0].(error) - return ret0 -} - -func (_mr *_MockVirtualMachineInterfaceRecorder) Stop(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Stop", arg0) -} - -// Mock of VirtualMachineInstanceMigrationInterface interface -type MockVirtualMachineInstanceMigrationInterface struct { - ctrl *gomock.Controller - recorder *_MockVirtualMachineInstanceMigrationInterfaceRecorder -} - -// Recorder for MockVirtualMachineInstanceMigrationInterface (not exported) -type _MockVirtualMachineInstanceMigrationInterfaceRecorder struct { - mock *MockVirtualMachineInstanceMigrationInterface -} - -func NewMockVirtualMachineInstanceMigrationInterface(ctrl *gomock.Controller) *MockVirtualMachineInstanceMigrationInterface { - mock := &MockVirtualMachineInstanceMigrationInterface{ctrl: ctrl} - mock.recorder = &_MockVirtualMachineInstanceMigrationInterfaceRecorder{mock} - return mock -} - -func (_m *MockVirtualMachineInstanceMigrationInterface) EXPECT() *_MockVirtualMachineInstanceMigrationInterfaceRecorder { - return _m.recorder -} - -func (_m *MockVirtualMachineInstanceMigrationInterface) Get(name string, options *v11.GetOptions) (*v111.VirtualMachineInstanceMigration, error) { - ret := _m.ctrl.Call(_m, "Get", name, options) - ret0, _ := ret[0].(*v111.VirtualMachineInstanceMigration) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstanceMigrationInterfaceRecorder) Get(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Get", arg0, arg1) -} - -func (_m *MockVirtualMachineInstanceMigrationInterface) List(opts *v11.ListOptions) (*v111.VirtualMachineInstanceMigrationList, error) { - ret := _m.ctrl.Call(_m, "List", opts) - ret0, _ := ret[0].(*v111.VirtualMachineInstanceMigrationList) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstanceMigrationInterfaceRecorder) List(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "List", arg0) -} - -func (_m *MockVirtualMachineInstanceMigrationInterface) Create(_param0 *v111.VirtualMachineInstanceMigration) (*v111.VirtualMachineInstanceMigration, error) { - ret := _m.ctrl.Call(_m, "Create", _param0) - ret0, _ := ret[0].(*v111.VirtualMachineInstanceMigration) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstanceMigrationInterfaceRecorder) Create(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Create", arg0) -} - -func (_m *MockVirtualMachineInstanceMigrationInterface) Update(_param0 *v111.VirtualMachineInstanceMigration) (*v111.VirtualMachineInstanceMigration, error) { - ret := _m.ctrl.Call(_m, "Update", _param0) - ret0, _ := ret[0].(*v111.VirtualMachineInstanceMigration) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstanceMigrationInterfaceRecorder) Update(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Update", arg0) -} - -func (_m *MockVirtualMachineInstanceMigrationInterface) Delete(name string, options *v11.DeleteOptions) error { - ret := _m.ctrl.Call(_m, "Delete", name, options) - ret0, _ := ret[0].(error) - return ret0 -} - -func (_mr *_MockVirtualMachineInstanceMigrationInterfaceRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Delete", arg0, arg1) -} - -func (_m *MockVirtualMachineInstanceMigrationInterface) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*v111.VirtualMachineInstanceMigration, error) { - _s := []interface{}{name, pt, data} - for _, _x := range subresources { - _s = append(_s, _x) - } - ret := _m.ctrl.Call(_m, "Patch", _s...) - ret0, _ := ret[0].(*v111.VirtualMachineInstanceMigration) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockVirtualMachineInstanceMigrationInterfaceRecorder) Patch(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { - _s := append([]interface{}{arg0, arg1, arg2}, arg3...) - return _mr.mock.ctrl.RecordCall(_mr.mock, "Patch", _s...) -} - -// Mock of KubeVirtInterface interface -type MockKubeVirtInterface struct { - ctrl *gomock.Controller - recorder *_MockKubeVirtInterfaceRecorder -} - -// Recorder for MockKubeVirtInterface (not exported) -type _MockKubeVirtInterfaceRecorder struct { - mock *MockKubeVirtInterface -} - -func NewMockKubeVirtInterface(ctrl *gomock.Controller) *MockKubeVirtInterface { - mock := &MockKubeVirtInterface{ctrl: ctrl} - mock.recorder = &_MockKubeVirtInterfaceRecorder{mock} - return mock -} - -func (_m *MockKubeVirtInterface) EXPECT() *_MockKubeVirtInterfaceRecorder { - return _m.recorder -} - -func (_m *MockKubeVirtInterface) Get(name string, options *v11.GetOptions) (*v111.KubeVirt, error) { - ret := _m.ctrl.Call(_m, "Get", name, options) - ret0, _ := ret[0].(*v111.KubeVirt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockKubeVirtInterfaceRecorder) Get(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Get", arg0, arg1) -} - -func (_m *MockKubeVirtInterface) List(opts *v11.ListOptions) (*v111.KubeVirtList, error) { - ret := _m.ctrl.Call(_m, "List", opts) - ret0, _ := ret[0].(*v111.KubeVirtList) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockKubeVirtInterfaceRecorder) List(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "List", arg0) -} - -func (_m *MockKubeVirtInterface) Create(instance *v111.KubeVirt) (*v111.KubeVirt, error) { - ret := _m.ctrl.Call(_m, "Create", instance) - ret0, _ := ret[0].(*v111.KubeVirt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockKubeVirtInterfaceRecorder) Create(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Create", arg0) -} - -func (_m *MockKubeVirtInterface) Update(_param0 *v111.KubeVirt) (*v111.KubeVirt, error) { - ret := _m.ctrl.Call(_m, "Update", _param0) - ret0, _ := ret[0].(*v111.KubeVirt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockKubeVirtInterfaceRecorder) Update(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Update", arg0) -} - -func (_m *MockKubeVirtInterface) Delete(name string, options *v11.DeleteOptions) error { - ret := _m.ctrl.Call(_m, "Delete", name, options) - ret0, _ := ret[0].(error) - return ret0 -} - -func (_mr *_MockKubeVirtInterfaceRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Delete", arg0, arg1) -} - -func (_m *MockKubeVirtInterface) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*v111.KubeVirt, error) { - _s := []interface{}{name, pt, data} - for _, _x := range subresources { - _s = append(_s, _x) - } - ret := _m.ctrl.Call(_m, "Patch", _s...) - ret0, _ := ret[0].(*v111.KubeVirt) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -func (_mr *_MockKubeVirtInterfaceRecorder) Patch(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { - _s := append([]interface{}{arg0, arg1, arg2}, arg3...) - return _mr.mock.ctrl.RecordCall(_mr.mock, "Patch", _s...) -} diff --git a/vendor/kubevirt.io/client-go/kubecli/handler.go b/vendor/kubevirt.io/client-go/kubecli/handler.go deleted file mode 100644 index 7c9f9be9e13e..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/handler.go +++ /dev/null @@ -1,107 +0,0 @@ -package kubecli - -import ( - "fmt" - "net/url" - - v1 "k8s.io/api/core/v1" - k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - - virtv1 "kubevirt.io/client-go/api/v1" -) - -func NewVirtHandlerClient(client KubevirtClient) VirtHandlerClient { - return &virtHandler{client} -} - -type VirtHandlerClient interface { - ForNode(nodeName string) VirtHandlerConn -} - -type VirtHandlerConn interface { - ConnectionDetails() (ip string, port string, err error) - ConsoleURI(vmi *virtv1.VirtualMachineInstance) (*url.URL, error) - Pod() (pod *v1.Pod, err error) -} - -type virtHandler struct { - client KubevirtClient -} - -type virtHandlerConn struct { - client KubevirtClient - pod *v1.Pod - err error -} - -func (v *virtHandler) ForNode(nodeName string) VirtHandlerConn { - pod, found, err := v.getVirtHandler(nodeName) - conn := &virtHandlerConn{} - if !found { - conn.err = fmt.Errorf("No virt-handler on node %s found", nodeName) - } - if err != nil { - conn.err = err - } - conn.pod = pod - conn.client = v.client - return conn -} - -func (v *virtHandler) getVirtHandler(nodeName string) (*v1.Pod, bool, error) { - - handlerNodeSelector := fields.ParseSelectorOrDie("spec.nodeName=" + nodeName) - labelSelector, err := labels.Parse(virtv1.AppLabel + " in (virt-handler)") - if err != nil { - return nil, false, err - } - pods, err := v.client.CoreV1().Pods(v1.NamespaceAll).List( - k8smetav1.ListOptions{ - FieldSelector: handlerNodeSelector.String(), - LabelSelector: labelSelector.String()}) - if err != nil { - return nil, false, err - } - if len(pods.Items) > 1 { - return nil, false, fmt.Errorf("Expected to find one Pod, found %d Pods", len(pods.Items)) - } - - if len(pods.Items) == 0 { - return nil, false, nil - } - return &pods.Items[0], true, nil -} - -func (v *virtHandlerConn) ConnectionDetails() (ip string, port string, err error) { - if v.err != nil { - err = v.err - return - } - // TODO depending on in which network namespace virt-handler runs, we might have to choose the NodeIPt d - ip = v.pod.Status.PodIP - // TODO get rid of the hardcoded port - port = "8185" - return -} - -//TODO move the actual ws handling in here, and work with channels -func (v *virtHandlerConn) ConsoleURI(vmi *virtv1.VirtualMachineInstance) (*url.URL, error) { - ip, port, err := v.ConnectionDetails() - if err != nil { - return nil, err - } - return &url.URL{ - Path: fmt.Sprintf("/api/v1/namespaces/%s/virtualmachineinstances/%s/console", vmi.ObjectMeta.Namespace, vmi.ObjectMeta.Name), - Host: ip + ":" + port, - }, nil -} - -func (v *virtHandlerConn) Pod() (pod *v1.Pod, err error) { - if v.err != nil { - err = v.err - return - } - return v.pod, err -} diff --git a/vendor/kubevirt.io/client-go/kubecli/kubecli.go b/vendor/kubevirt.io/client-go/kubecli/kubecli.go deleted file mode 100644 index 24d0fdcefda7..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/kubecli.go +++ /dev/null @@ -1,277 +0,0 @@ -/* - * 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 2018 Red Hat, Inc. - * Copyright 2018 The Kubernetes Authors. - * - */ - -package kubecli - -import ( - "flag" - "os" - "sync" - - secv1 "github.com/openshift/client-go/security/clientset/versioned/typed/security/v1" - "github.com/spf13/pflag" - extclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/client-go/discovery" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - - networkclient "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned" - - v1 "kubevirt.io/client-go/api/v1" - cdiclient "kubevirt.io/containerized-data-importer/pkg/client/clientset/versioned" -) - -var ( - kubeconfig string - master string -) - -var virtclient KubevirtClient -var once sync.Once - -func init() { - flag.StringVar(&kubeconfig, "kubeconfig", "", "absolute path to the kubeconfig file") - flag.StringVar(&master, "master", "", "master url") -} - -func GetKubevirtSubresourceClientFromFlags(master string, kubeconfig string) (KubevirtClient, error) { - config, err := clientcmd.BuildConfigFromFlags(master, kubeconfig) - if err != nil { - return nil, err - } - - config.GroupVersion = &v1.SubresourceGroupVersion - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - config.APIPath = "/apis" - config.ContentType = runtime.ContentTypeJSON - - restClient, err := rest.RESTClientFor(config) - if err != nil { - return nil, err - } - - coreClient, err := kubernetes.NewForConfig(config) - if err != nil { - return nil, err - } - - cdiClient, err := cdiclient.NewForConfig(config) - if err != nil { - return nil, err - } - - networkClient, err := networkclient.NewForConfig(config) - if err != nil { - return nil, err - } - - extensionsClient, err := extclient.NewForConfig(config) - if err != nil { - return nil, err - } - - secClient, err := secv1.NewForConfig(config) - if err != nil { - return nil, err - } - - discoveryClient, err := discovery.NewDiscoveryClientForConfig(config) - if err != nil { - return nil, err - } - - return &kubevirt{ - master, - kubeconfig, - restClient, - config, - cdiClient, - networkClient, - extensionsClient, - secClient, - discoveryClient, - coreClient, - }, nil -} - -// DefaultClientConfig creates a clientcmd.ClientConfig with the following hierarchy: -// 1. Use the kubeconfig builder. The number of merges and overrides here gets a little crazy. Stay with me. -// 1. Merge the kubeconfig itself. This is done with the following hierarchy rules: -// 1. CommandLineLocation - this parsed from the command line, so it must be late bound. If you specify this, -// then no other kubeconfig files are merged. This file must exist. -// 2. If $KUBECONFIG is set, then it is treated as a list of files that should be merged. -// 3. HomeDirectoryLocation -// Empty filenames are ignored. Files with non-deserializable content produced errors. -// The first file to set a particular value or map key wins and the value or map key is never changed. -// This means that the first file to set CurrentContext will have its context preserved. It also means -// that if two files specify a "red-user", only values from the first file's red-user are used. Even -// non-conflicting entries from the second file's "red-user" are discarded. -// 2. Determine the context to use based on the first hit in this chain -// 1. command line argument - again, parsed from the command line, so it must be late bound -// 2. CurrentContext from the merged kubeconfig file -// 3. Empty is allowed at this stage -// 3. Determine the cluster info and auth info to use. At this point, we may or may not have a context. They -// are built based on the first hit in this chain. (run it twice, once for auth, once for cluster) -// 1. command line argument -// 2. If context is present, then use the context value -// 3. Empty is allowed -// 4. Determine the actual cluster info to use. At this point, we may or may not have a cluster info. Build -// each piece of the cluster info based on the chain: -// 1. command line argument -// 2. If cluster info is present and a value for the attribute is present, use it. -// 3. If you don't have a server location, bail. -// 5. Auth info is build using the same rules as cluster info, EXCEPT that you can only have one authentication -// technique per auth info. The following conditions result in an error: -// 1. If there are two conflicting techniques specified from the command line, fail. -// 2. If the command line does not specify one, and the auth info has conflicting techniques, fail. -// 3. If the command line specifies one and the auth info specifies another, honor the command line technique. -// 2. Use default values and potentially prompt for auth information -// -// However, if it appears that we're running in a kubernetes cluster -// container environment, then run with the auth info kubernetes mounted for -// us. Specifically: -// The env vars KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT are -// set, and the file /var/run/secrets/kubernetes.io/serviceaccount/token -// exists and is not a directory. -// Initially copied from https://github.com/kubernetes/kubernetes/blob/09f321c80bfc9bca63a5530b56d7a1a3ba80ba9b/pkg/kubectl/cmd/util/factory_client_access.go#L174 -func DefaultClientConfig(flags *pflag.FlagSet) clientcmd.ClientConfig { - loadingRules := clientcmd.NewDefaultClientConfigLoadingRules() - // use the standard defaults for this client command - // DEPRECATED: remove and replace with something more accurate - loadingRules.DefaultClientConfig = &clientcmd.DefaultClientConfig - - flags.StringVar(&loadingRules.ExplicitPath, "kubeconfig", "", "Path to the kubeconfig file to use for CLI requests.") - - overrides := &clientcmd.ConfigOverrides{ClusterDefaults: clientcmd.ClusterDefaults} - - flagNames := clientcmd.RecommendedConfigOverrideFlags("") - // short flagnames are disabled by default. These are here for compatibility with existing scripts - flagNames.ClusterOverrideFlags.APIServer.ShortName = "s" - - clientcmd.BindOverrideFlags(overrides, flags, flagNames) - clientConfig := clientcmd.NewInteractiveDeferredLoadingClientConfig(loadingRules, overrides, os.Stdin) - - return clientConfig -} - -// this function is defined as a closure so iut could be overwritten by unit tests -var GetKubevirtClientFromClientConfig = func(cmdConfig clientcmd.ClientConfig) (KubevirtClient, error) { - config, err := cmdConfig.ClientConfig() - if err != nil { - return nil, err - } - return GetKubevirtClientFromRESTConfig(config) - -} - -func GetKubevirtClientFromRESTConfig(config *rest.Config) (KubevirtClient, error) { - config.GroupVersion = &v1.GroupVersion - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: v1.Codecs} - config.APIPath = "/apis" - config.ContentType = runtime.ContentTypeJSON - if config.UserAgent == "" { - config.UserAgent = restclient.DefaultKubernetesUserAgent() - } - - restClient, err := rest.RESTClientFor(config) - if err != nil { - return nil, err - } - - coreClient, err := kubernetes.NewForConfig(config) - if err != nil { - return nil, err - } - - cdiClient, err := cdiclient.NewForConfig(config) - if err != nil { - return nil, err - } - - networkClient, err := networkclient.NewForConfig(config) - if err != nil { - return nil, err - } - - extensionsClient, err := extclient.NewForConfig(config) - if err != nil { - return nil, err - } - - secClient, err := secv1.NewForConfig(config) - if err != nil { - return nil, err - } - - discoveryClient, err := discovery.NewDiscoveryClientForConfig(config) - if err != nil { - return nil, err - } - - return &kubevirt{ - master, - kubeconfig, - restClient, - config, - cdiClient, - networkClient, - extensionsClient, - secClient, - discoveryClient, - coreClient, - }, nil -} - -func GetKubevirtClientFromFlags(master string, kubeconfig string) (KubevirtClient, error) { - config, err := clientcmd.BuildConfigFromFlags(master, kubeconfig) - if err != nil { - return nil, err - } - return GetKubevirtClientFromRESTConfig(config) -} - -func GetKubevirtClient() (KubevirtClient, error) { - var err error - once.Do(func() { - virtclient, err = GetKubevirtClientFromFlags(master, kubeconfig) - }) - return virtclient, err -} - -func GetKubevirtSubresourceClient() (KubevirtClient, error) { - return GetKubevirtSubresourceClientFromFlags(master, kubeconfig) -} - -func GetConfig() (*restclient.Config, error) { - return clientcmd.BuildConfigFromFlags(master, kubeconfig) -} - -func GetKubevirtClientConfig() (*rest.Config, error) { - config, err := clientcmd.BuildConfigFromFlags(master, kubeconfig) - if err != nil { - return nil, err - } - return config, nil -} diff --git a/vendor/kubevirt.io/client-go/kubecli/kubevirt.go b/vendor/kubevirt.io/client-go/kubecli/kubevirt.go deleted file mode 100644 index e58cc736ff98..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/kubevirt.go +++ /dev/null @@ -1,176 +0,0 @@ -/* - * 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 2018 Red Hat, Inc. - * - */ - -package kubecli - -//go:generate mockgen -source $GOFILE -package=$GOPACKAGE -destination=generated_mock_$GOFILE - -/* - ATTENTION: Rerun code generators when interface signatures are modified. -*/ - -import ( - "io" - "time" - - secv1 "github.com/openshift/client-go/security/clientset/versioned/typed/security/v1" - autov1 "k8s.io/api/autoscaling/v1" - extclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/discovery" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - - networkclient "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned" - - v1 "kubevirt.io/client-go/api/v1" - cdiclient "kubevirt.io/containerized-data-importer/pkg/client/clientset/versioned" -) - -type KubevirtClient interface { - VirtualMachineInstance(namespace string) VirtualMachineInstanceInterface - VirtualMachineInstanceMigration(namespace string) VirtualMachineInstanceMigrationInterface - ReplicaSet(namespace string) ReplicaSetInterface - VirtualMachine(namespace string) VirtualMachineInterface - KubeVirt(namespace string) KubeVirtInterface - VirtualMachineInstancePreset(namespace string) VirtualMachineInstancePresetInterface - ServerVersion() *ServerVersion - RestClient() *rest.RESTClient - CdiClient() cdiclient.Interface - NetworkClient() networkclient.Interface - ExtensionsClient() extclient.Interface - SecClient() secv1.SecurityV1Interface - DiscoveryClient() discovery.DiscoveryInterface - kubernetes.Interface - Config() *rest.Config -} - -type kubevirt struct { - master string - kubeconfig string - restClient *rest.RESTClient - config *rest.Config - cdiClient *cdiclient.Clientset - networkClient *networkclient.Clientset - extensionsClient *extclient.Clientset - secClient *secv1.SecurityV1Client - discoveryClient *discovery.DiscoveryClient - *kubernetes.Clientset -} - -func (k kubevirt) Config() *rest.Config { - return k.config -} - -func (k kubevirt) CdiClient() cdiclient.Interface { - return k.cdiClient -} - -func (k kubevirt) NetworkClient() networkclient.Interface { - return k.networkClient -} - -func (k kubevirt) ExtensionsClient() extclient.Interface { - return k.extensionsClient -} - -func (k kubevirt) SecClient() secv1.SecurityV1Interface { - return k.secClient -} - -func (k kubevirt) DiscoveryClient() discovery.DiscoveryInterface { - return k.discoveryClient -} - -func (k kubevirt) RestClient() *rest.RESTClient { - return k.restClient -} - -type StreamOptions struct { - In io.Reader - Out io.Writer -} - -type StreamInterface interface { - Stream(options StreamOptions) error -} - -type VirtualMachineInstanceInterface interface { - Get(name string, options *k8smetav1.GetOptions) (*v1.VirtualMachineInstance, error) - List(opts *k8smetav1.ListOptions) (*v1.VirtualMachineInstanceList, error) - Create(instance *v1.VirtualMachineInstance) (*v1.VirtualMachineInstance, error) - Update(*v1.VirtualMachineInstance) (*v1.VirtualMachineInstance, error) - Delete(name string, options *k8smetav1.DeleteOptions) error - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VirtualMachineInstance, err error) - SerialConsole(name string, timeout time.Duration) (StreamInterface, error) - VNC(name string) (StreamInterface, error) -} - -type ReplicaSetInterface interface { - Get(name string, options k8smetav1.GetOptions) (*v1.VirtualMachineInstanceReplicaSet, error) - List(opts k8smetav1.ListOptions) (*v1.VirtualMachineInstanceReplicaSetList, error) - Create(*v1.VirtualMachineInstanceReplicaSet) (*v1.VirtualMachineInstanceReplicaSet, error) - Update(*v1.VirtualMachineInstanceReplicaSet) (*v1.VirtualMachineInstanceReplicaSet, error) - Delete(name string, options *k8smetav1.DeleteOptions) error - GetScale(replicaSetName string, options k8smetav1.GetOptions) (*autov1.Scale, error) - UpdateScale(replicaSetName string, scale *autov1.Scale) (*autov1.Scale, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VirtualMachineInstanceReplicaSet, err error) -} - -type VirtualMachineInstancePresetInterface interface { - Get(name string, options k8smetav1.GetOptions) (*v1.VirtualMachineInstancePreset, error) - List(opts k8smetav1.ListOptions) (*v1.VirtualMachineInstancePresetList, error) - Create(*v1.VirtualMachineInstancePreset) (*v1.VirtualMachineInstancePreset, error) - Update(*v1.VirtualMachineInstancePreset) (*v1.VirtualMachineInstancePreset, error) - Delete(name string, options *k8smetav1.DeleteOptions) error - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VirtualMachineInstancePreset, err error) -} - -// VirtualMachineInterface provides convenience methods to work with -// virtual machines inside the cluster -type VirtualMachineInterface interface { - Get(name string, options *k8smetav1.GetOptions) (*v1.VirtualMachine, error) - List(opts *k8smetav1.ListOptions) (*v1.VirtualMachineList, error) - Create(*v1.VirtualMachine) (*v1.VirtualMachine, error) - Update(*v1.VirtualMachine) (*v1.VirtualMachine, error) - Delete(name string, options *k8smetav1.DeleteOptions) error - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VirtualMachine, err error) - Restart(name string) error - Start(name string) error - Stop(name string) error -} - -type VirtualMachineInstanceMigrationInterface interface { - Get(name string, options *k8smetav1.GetOptions) (*v1.VirtualMachineInstanceMigration, error) - List(opts *k8smetav1.ListOptions) (*v1.VirtualMachineInstanceMigrationList, error) - Create(*v1.VirtualMachineInstanceMigration) (*v1.VirtualMachineInstanceMigration, error) - Update(*v1.VirtualMachineInstanceMigration) (*v1.VirtualMachineInstanceMigration, error) - Delete(name string, options *k8smetav1.DeleteOptions) error - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VirtualMachineInstanceMigration, err error) -} - -type KubeVirtInterface interface { - Get(name string, options *k8smetav1.GetOptions) (*v1.KubeVirt, error) - List(opts *k8smetav1.ListOptions) (*v1.KubeVirtList, error) - Create(instance *v1.KubeVirt) (*v1.KubeVirt, error) - Update(*v1.KubeVirt) (*v1.KubeVirt, error) - Delete(name string, options *k8smetav1.DeleteOptions) error - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.KubeVirt, err error) -} diff --git a/vendor/kubevirt.io/client-go/kubecli/kubevirt_test_utils.go b/vendor/kubevirt.io/client-go/kubecli/kubevirt_test_utils.go deleted file mode 100644 index d4e3d77829c8..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/kubevirt_test_utils.go +++ /dev/null @@ -1,73 +0,0 @@ -package kubecli - -import ( - "errors" - - k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/tools/clientcmd" - - v1 "kubevirt.io/client-go/api/v1" -) - -// GetMockKubevirtClientFromClientConfig, MockKubevirtClientInstance are used to create a mechanism -// for overriding the actual kubevirt client access. This is useful when the unit tested code invokes GetKubevirtClientFromClientConfig() -// and therefore the unit test code cannot generate the mock client directly. In such a case following steps are needed: -// (1) Override the GetKubevirtClientFromClientConfig() closure with GetMockKubevirtClientFromClientConfig() or -// GetInvalidKubevirtClientFromClientConfig() -// (2) Then create the instance of the client, and assign into MockKubevirtClientInstance before the tests start: -// ctrl := gomock.NewController(GinkgoT()) -// kubecli.MockKubevirtClientInstance = kubecli.NewMockKubevirtClient(ctrl) -// (3) Rest of the kubevirt mocking is automatically generated in generated_mock_kubevirt.go - -// MockKubevirtClientInstance is a reference to the kubevirt client that could be manipulated by the test code -var MockKubevirtClientInstance *MockKubevirtClient - -// GetMockKubevirtClientFromClientConfig is an entry point for testing, could be used to override GetKubevirtClientFromClientConfig -func GetMockKubevirtClientFromClientConfig(cmdConfig clientcmd.ClientConfig) (KubevirtClient, error) { - return MockKubevirtClientInstance, nil -} - -// GetInvalidKubevirtClientFromClientConfig is an entry point for testing case where client should be invalid -func GetInvalidKubevirtClientFromClientConfig(cmdConfig clientcmd.ClientConfig) (KubevirtClient, error) { - return nil, errors.New("invalid fake client") -} - -func NewMinimalMigration(name string) *v1.VirtualMachineInstanceMigration { - return &v1.VirtualMachineInstanceMigration{TypeMeta: k8smetav1.TypeMeta{APIVersion: v1.GroupVersion.String(), Kind: "VirtualMachineInstanceMigration"}, ObjectMeta: k8smetav1.ObjectMeta{Name: name}} -} - -func NewMinimalVM(name string) *v1.VirtualMachine { - return &v1.VirtualMachine{TypeMeta: k8smetav1.TypeMeta{APIVersion: v1.GroupVersion.String(), Kind: "VirtualMachine"}, ObjectMeta: k8smetav1.ObjectMeta{Name: name}} -} - -func NewMigrationList(migrations ...v1.VirtualMachineInstanceMigration) *v1.VirtualMachineInstanceMigrationList { - return &v1.VirtualMachineInstanceMigrationList{TypeMeta: k8smetav1.TypeMeta{APIVersion: v1.GroupVersion.String(), Kind: "VirtualMachineInstanceMigrationList"}, Items: migrations} -} - -func NewVMList(vms ...v1.VirtualMachine) *v1.VirtualMachineList { - return &v1.VirtualMachineList{TypeMeta: k8smetav1.TypeMeta{APIVersion: v1.GroupVersion.String(), Kind: "VirtualMachineList"}, Items: vms} -} - -func NewVirtualMachineInstanceReplicaSetList(rss ...v1.VirtualMachineInstanceReplicaSet) *v1.VirtualMachineInstanceReplicaSetList { - return &v1.VirtualMachineInstanceReplicaSetList{TypeMeta: k8smetav1.TypeMeta{APIVersion: v1.GroupVersion.String(), Kind: "VirtualMachineInstanceReplicaSetList"}, Items: rss} -} - -func NewMinimalVirtualMachineInstanceReplicaSet(name string) *v1.VirtualMachineInstanceReplicaSet { - return &v1.VirtualMachineInstanceReplicaSet{TypeMeta: k8smetav1.TypeMeta{APIVersion: v1.GroupVersion.String(), Kind: "VirtualMachineInstanceReplicaSet"}, ObjectMeta: k8smetav1.ObjectMeta{Name: name}} -} - -func NewMinimalKubeVirt(name string) *v1.KubeVirt { - return &v1.KubeVirt{TypeMeta: k8smetav1.TypeMeta{APIVersion: v1.GroupVersion.String(), Kind: "KubeVirt"}, ObjectMeta: k8smetav1.ObjectMeta{Name: name}} -} - -func NewKubeVirtList(kubevirts ...v1.KubeVirt) *v1.KubeVirtList { - return &v1.KubeVirtList{TypeMeta: k8smetav1.TypeMeta{APIVersion: v1.GroupVersion.String(), Kind: "KubeVirtList"}, Items: kubevirts} -} - -func NewVirtualMachineInstancePresetList(rss ...v1.VirtualMachineInstancePreset) *v1.VirtualMachineInstancePresetList { - return &v1.VirtualMachineInstancePresetList{TypeMeta: k8smetav1.TypeMeta{APIVersion: v1.GroupVersion.String(), Kind: "VirtualMachineInstancePresetList"}, Items: rss} -} - -func NewMinimalVirtualMachineInstancePreset(name string) *v1.VirtualMachineInstancePreset { - return &v1.VirtualMachineInstancePreset{TypeMeta: k8smetav1.TypeMeta{APIVersion: v1.GroupVersion.String(), Kind: "VirtualMachineInstancePreset"}, ObjectMeta: k8smetav1.ObjectMeta{Name: name}} -} diff --git a/vendor/kubevirt.io/client-go/kubecli/kv.go b/vendor/kubevirt.io/client-go/kubecli/kv.go deleted file mode 100644 index 190c6f36d327..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/kv.go +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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 2018 Red Hat, Inc. - * - */ - -package kubecli - -import ( - k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - - v1 "kubevirt.io/client-go/api/v1" -) - -func (k *kubevirt) KubeVirt(namespace string) KubeVirtInterface { - return &kv{ - restClient: k.restClient, - namespace: namespace, - resource: "kubevirts", - } -} - -type kv struct { - restClient *rest.RESTClient - namespace string - resource string -} - -// Create new KubeVirt in the cluster to specified namespace -func (o *kv) Create(vm *v1.KubeVirt) (*v1.KubeVirt, error) { - newKv := &v1.KubeVirt{} - err := o.restClient.Post(). - Resource(o.resource). - Namespace(o.namespace). - Body(vm). - Do(). - Into(newKv) - - newKv.SetGroupVersionKind(v1.KubeVirtGroupVersionKind) - - return newKv, err -} - -// Get the KubeVirt from the cluster by its name and namespace -func (o *kv) Get(name string, options *k8smetav1.GetOptions) (*v1.KubeVirt, error) { - newKv := &v1.KubeVirt{} - err := o.restClient.Get(). - Resource(o.resource). - Namespace(o.namespace). - Name(name). - VersionedParams(options, scheme.ParameterCodec). - Do(). - Into(newKv) - - newKv.SetGroupVersionKind(v1.KubeVirtGroupVersionKind) - - return newKv, err -} - -// Update the KubeVirt instance in the cluster in given namespace -func (o *kv) Update(vm *v1.KubeVirt) (*v1.KubeVirt, error) { - updatedVm := &v1.KubeVirt{} - err := o.restClient.Put(). - Resource(o.resource). - Namespace(o.namespace). - Name(vm.Name). - Body(vm). - Do(). - Into(updatedVm) - - updatedVm.SetGroupVersionKind(v1.KubeVirtGroupVersionKind) - - return updatedVm, err -} - -// Delete the defined KubeVirt in the cluster in defined namespace -func (o *kv) Delete(name string, options *k8smetav1.DeleteOptions) error { - err := o.restClient.Delete(). - Resource(o.resource). - Namespace(o.namespace). - Name(name). - Body(options). - Do(). - Error() - - return err -} - -// List all KubeVirts in given namespace -func (o *kv) List(options *k8smetav1.ListOptions) (*v1.KubeVirtList, error) { - newKvList := &v1.KubeVirtList{} - err := o.restClient.Get(). - Resource(o.resource). - Namespace(o.namespace). - VersionedParams(options, scheme.ParameterCodec). - Do(). - Into(newKvList) - - for _, vm := range newKvList.Items { - vm.SetGroupVersionKind(v1.KubeVirtGroupVersionKind) - } - - return newKvList, err -} - -func (v *kv) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.KubeVirt, err error) { - result = &v1.KubeVirt{} - err = v.restClient.Patch(pt). - Namespace(v.namespace). - Resource(v.resource). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return result, err -} diff --git a/vendor/kubevirt.io/client-go/kubecli/migration.go b/vendor/kubevirt.io/client-go/kubecli/migration.go deleted file mode 100644 index 397be60e5784..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/migration.go +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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 2018 Red Hat, Inc. - * - */ - -package kubecli - -import ( - k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - - v1 "kubevirt.io/client-go/api/v1" -) - -func (k *kubevirt) VirtualMachineInstanceMigration(namespace string) VirtualMachineInstanceMigrationInterface { - return &migration{ - restClient: k.restClient, - namespace: namespace, - resource: "virtualmachineinstancemigrations", - } -} - -type migration struct { - restClient *rest.RESTClient - namespace string - resource string -} - -// Create new VirtualMachineInstanceMigration in the cluster to specified namespace -func (o *migration) Create(newMigration *v1.VirtualMachineInstanceMigration) (*v1.VirtualMachineInstanceMigration, error) { - newMigrationResult := &v1.VirtualMachineInstanceMigration{} - err := o.restClient.Post(). - Resource(o.resource). - Namespace(o.namespace). - Body(newMigration). - Do(). - Into(newMigrationResult) - - newMigrationResult.SetGroupVersionKind(v1.VirtualMachineInstanceMigrationGroupVersionKind) - - return newMigrationResult, err -} - -// Get the VirtualMachineInstanceMigration from the cluster by its name and namespace -func (o *migration) Get(name string, options *k8smetav1.GetOptions) (*v1.VirtualMachineInstanceMigration, error) { - newVm := &v1.VirtualMachineInstanceMigration{} - err := o.restClient.Get(). - Resource(o.resource). - Namespace(o.namespace). - Name(name). - VersionedParams(options, scheme.ParameterCodec). - Do(). - Into(newVm) - - newVm.SetGroupVersionKind(v1.VirtualMachineInstanceMigrationGroupVersionKind) - - return newVm, err -} - -// Update the VirtualMachineInstanceMigration instance in the cluster in given namespace -func (o *migration) Update(migration *v1.VirtualMachineInstanceMigration) (*v1.VirtualMachineInstanceMigration, error) { - updatedVm := &v1.VirtualMachineInstanceMigration{} - err := o.restClient.Put(). - Resource(o.resource). - Namespace(o.namespace). - Name(migration.Name). - Body(migration). - Do(). - Into(updatedVm) - - updatedVm.SetGroupVersionKind(v1.VirtualMachineInstanceMigrationGroupVersionKind) - - return updatedVm, err -} - -// Delete the defined VirtualMachineInstanceMigration in the cluster in defined namespace -func (o *migration) Delete(name string, options *k8smetav1.DeleteOptions) error { - err := o.restClient.Delete(). - Resource(o.resource). - Namespace(o.namespace). - Name(name). - Body(options). - Do(). - Error() - - return err -} - -// List all VirtualMachineInstanceMigrations in given namespace -func (o *migration) List(options *k8smetav1.ListOptions) (*v1.VirtualMachineInstanceMigrationList, error) { - newVmList := &v1.VirtualMachineInstanceMigrationList{} - err := o.restClient.Get(). - Resource(o.resource). - Namespace(o.namespace). - VersionedParams(options, scheme.ParameterCodec). - Do(). - Into(newVmList) - - for _, migration := range newVmList.Items { - migration.SetGroupVersionKind(v1.VirtualMachineInstanceMigrationGroupVersionKind) - } - - return newVmList, err -} - -func (v *migration) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VirtualMachineInstanceMigration, err error) { - result = &v1.VirtualMachineInstanceMigration{} - err = v.restClient.Patch(pt). - Namespace(v.namespace). - Resource(v.resource). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return result, err -} diff --git a/vendor/kubevirt.io/client-go/kubecli/replicaset.go b/vendor/kubevirt.io/client-go/kubecli/replicaset.go deleted file mode 100644 index 27db2ca81f0a..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/replicaset.go +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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 2017 Red Hat, Inc. - * - */ - -package kubecli - -import ( - autov1 "k8s.io/api/autoscaling/v1" - k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - - v1 "kubevirt.io/client-go/api/v1" -) - -func (k *kubevirt) ReplicaSet(namespace string) ReplicaSetInterface { - return &rc{k.restClient, namespace, "virtualmachineinstancereplicasets"} -} - -type rc struct { - restClient *rest.RESTClient - namespace string - resource string -} - -func (v *rc) GetScale(replicaSetName string, options k8smetav1.GetOptions) (result *autov1.Scale, err error) { - result = &autov1.Scale{} - err = v.restClient.Get(). - Namespace(v.namespace). - Resource(v.resource). - Name(replicaSetName). - SubResource("scale"). - Do(). - Into(result) - return -} - -func (v *rc) UpdateScale(replicaSetName string, scale *autov1.Scale) (result *autov1.Scale, err error) { - result = &autov1.Scale{} - err = v.restClient.Put(). - Namespace(v.namespace). - Resource(v.resource). - Name(replicaSetName). - SubResource("scale"). - Body(scale). - Do(). - Into(result) - return -} - -func (v *rc) Get(name string, options k8smetav1.GetOptions) (replicaset *v1.VirtualMachineInstanceReplicaSet, err error) { - replicaset = &v1.VirtualMachineInstanceReplicaSet{} - err = v.restClient.Get(). - Resource(v.resource). - Namespace(v.namespace). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(replicaset) - replicaset.SetGroupVersionKind(v1.VirtualMachineInstanceReplicaSetGroupVersionKind) - return -} - -func (v *rc) List(options k8smetav1.ListOptions) (replicasetList *v1.VirtualMachineInstanceReplicaSetList, err error) { - replicasetList = &v1.VirtualMachineInstanceReplicaSetList{} - err = v.restClient.Get(). - Resource(v.resource). - Namespace(v.namespace). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(replicasetList) - for _, replicaset := range replicasetList.Items { - replicaset.SetGroupVersionKind(v1.VirtualMachineInstanceReplicaSetGroupVersionKind) - } - - return -} - -func (v *rc) Create(replicaset *v1.VirtualMachineInstanceReplicaSet) (result *v1.VirtualMachineInstanceReplicaSet, err error) { - result = &v1.VirtualMachineInstanceReplicaSet{} - err = v.restClient.Post(). - Namespace(v.namespace). - Resource(v.resource). - Body(replicaset). - Do(). - Into(result) - result.SetGroupVersionKind(v1.VirtualMachineInstanceReplicaSetGroupVersionKind) - return -} - -func (v *rc) Update(replicaset *v1.VirtualMachineInstanceReplicaSet) (result *v1.VirtualMachineInstanceReplicaSet, err error) { - result = &v1.VirtualMachineInstanceReplicaSet{} - err = v.restClient.Put(). - Name(replicaset.ObjectMeta.Name). - Namespace(v.namespace). - Resource(v.resource). - Body(replicaset). - Do(). - Into(result) - result.SetGroupVersionKind(v1.VirtualMachineInstanceReplicaSetGroupVersionKind) - return -} - -func (v *rc) Delete(name string, options *k8smetav1.DeleteOptions) error { - return v.restClient.Delete(). - Namespace(v.namespace). - Resource(v.resource). - Name(name). - Body(options). - Do(). - Error() -} - -func (v *rc) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VirtualMachineInstanceReplicaSet, err error) { - result = &v1.VirtualMachineInstanceReplicaSet{} - err = v.restClient.Patch(pt). - Namespace(v.namespace). - Resource(v.resource). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/vendor/kubevirt.io/client-go/kubecli/version.go b/vendor/kubevirt.io/client-go/kubecli/version.go deleted file mode 100644 index 53e195a0ad93..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/version.go +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 2018 Red Hat, Inc. - * - */ - -package kubecli - -import ( - "encoding/json" - "fmt" - "net/url" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/rest" - - v1 "kubevirt.io/client-go/api/v1" - "kubevirt.io/client-go/version" -) - -const ( - ApiGroupName = "/apis/" + v1.SubresourceGroupName -) - -func (k *kubevirt) ServerVersion() *ServerVersion { - return &ServerVersion{ - restClient: k.restClient, - resource: "version", - } -} - -type ServerVersion struct { - restClient *rest.RESTClient - resource string -} - -func (v *ServerVersion) Get() (*version.Info, error) { - - var group metav1.APIGroup - // First, find out which version to query - uri := ApiGroupName - result := v.restClient.Get().RequestURI(uri).Do() - if data, err := result.Raw(); err != nil { - connErr, isConnectionErr := err.(*url.Error) - - if isConnectionErr { - return nil, connErr.Err - } - - return nil, err - } else if err = json.Unmarshal(data, &group); err != nil { - return nil, err - } - - // Now, query the preferred version - uri = fmt.Sprintf("/apis/%s/version", group.PreferredVersion.GroupVersion) - var serverInfo version.Info - - result = v.restClient.Get().RequestURI(uri).Do() - if data, err := result.Raw(); err != nil { - connErr, isConnectionErr := err.(*url.Error) - - if isConnectionErr { - return nil, connErr.Err - } - - return nil, err - } else if err = json.Unmarshal(data, &serverInfo); err != nil { - return nil, err - } - return &serverInfo, nil -} diff --git a/vendor/kubevirt.io/client-go/kubecli/vm.go b/vendor/kubevirt.io/client-go/kubecli/vm.go deleted file mode 100644 index 05dd2fdb6d5d..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/vm.go +++ /dev/null @@ -1,152 +0,0 @@ -/* - * 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 2018 Red Hat, Inc. - * - */ - -package kubecli - -import ( - "fmt" - - k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - - v1 "kubevirt.io/client-go/api/v1" -) - -const vmSubresourceURL = "/apis/subresources.kubevirt.io/v1alpha3/namespaces/%s/virtualmachines/%s/%s" - -func (k *kubevirt) VirtualMachine(namespace string) VirtualMachineInterface { - return &vm{ - restClient: k.restClient, - namespace: namespace, - resource: "virtualmachines", - } -} - -type vm struct { - restClient *rest.RESTClient - namespace string - resource string -} - -// Create new VirtualMachine in the cluster to specified namespace -func (o *vm) Create(vm *v1.VirtualMachine) (*v1.VirtualMachine, error) { - newVm := &v1.VirtualMachine{} - err := o.restClient.Post(). - Resource(o.resource). - Namespace(o.namespace). - Body(vm). - Do(). - Into(newVm) - - newVm.SetGroupVersionKind(v1.VirtualMachineGroupVersionKind) - - return newVm, err -} - -// Get the Virtual machine from the cluster by its name and namespace -func (o *vm) Get(name string, options *k8smetav1.GetOptions) (*v1.VirtualMachine, error) { - newVm := &v1.VirtualMachine{} - err := o.restClient.Get(). - Resource(o.resource). - Namespace(o.namespace). - Name(name). - VersionedParams(options, scheme.ParameterCodec). - Do(). - Into(newVm) - - newVm.SetGroupVersionKind(v1.VirtualMachineGroupVersionKind) - - return newVm, err -} - -// Update the VirtualMachine instance in the cluster in given namespace -func (o *vm) Update(vm *v1.VirtualMachine) (*v1.VirtualMachine, error) { - updatedVm := &v1.VirtualMachine{} - err := o.restClient.Put(). - Resource(o.resource). - Namespace(o.namespace). - Name(vm.Name). - Body(vm). - Do(). - Into(updatedVm) - - updatedVm.SetGroupVersionKind(v1.VirtualMachineGroupVersionKind) - - return updatedVm, err -} - -// Delete the defined VirtualMachine in the cluster in defined namespace -func (o *vm) Delete(name string, options *k8smetav1.DeleteOptions) error { - err := o.restClient.Delete(). - Resource(o.resource). - Namespace(o.namespace). - Name(name). - Body(options). - Do(). - Error() - - return err -} - -// List all VirtualMachines in given namespace -func (o *vm) List(options *k8smetav1.ListOptions) (*v1.VirtualMachineList, error) { - newVmList := &v1.VirtualMachineList{} - err := o.restClient.Get(). - Resource(o.resource). - Namespace(o.namespace). - VersionedParams(options, scheme.ParameterCodec). - Do(). - Into(newVmList) - - for _, vm := range newVmList.Items { - vm.SetGroupVersionKind(v1.VirtualMachineGroupVersionKind) - } - - return newVmList, err -} - -func (v *vm) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VirtualMachine, err error) { - result = &v1.VirtualMachine{} - err = v.restClient.Patch(pt). - Namespace(v.namespace). - Resource(v.resource). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return result, err -} - -func (v *vm) Restart(name string) error { - uri := fmt.Sprintf(vmSubresourceURL, v.namespace, name, "restart") - return v.restClient.Put().RequestURI(uri).Do().Error() -} - -func (v *vm) Start(name string) error { - uri := fmt.Sprintf(vmSubresourceURL, v.namespace, name, "start") - return v.restClient.Put().RequestURI(uri).Do().Error() -} - -func (v *vm) Stop(name string) error { - uri := fmt.Sprintf(vmSubresourceURL, v.namespace, name, "stop") - return v.restClient.Put().RequestURI(uri).Do().Error() -} diff --git a/vendor/kubevirt.io/client-go/kubecli/vmi.go b/vendor/kubevirt.io/client-go/kubecli/vmi.go deleted file mode 100644 index a906bd9b0f33..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/vmi.go +++ /dev/null @@ -1,443 +0,0 @@ -/* - * 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 2017 Red Hat, Inc. - * - */ - -package kubecli - -import ( - "bytes" - "fmt" - "io" - "net/http" - "net/url" - "time" - - "github.com/gorilla/websocket" - k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - - v1 "kubevirt.io/client-go/api/v1" - "kubevirt.io/client-go/subresources" -) - -const ( - WebsocketMessageBufferSize = 10240 -) - -func (k *kubevirt) VirtualMachineInstance(namespace string) VirtualMachineInstanceInterface { - return &vmis{ - restClient: k.restClient, - config: k.config, - clientSet: k.Clientset, - namespace: namespace, - resource: "virtualmachineinstances", - } -} - -type vmis struct { - restClient *rest.RESTClient - config *rest.Config - clientSet *kubernetes.Clientset - namespace string - resource string - master string - kubeconfig string -} - -type BinaryReadWriter struct { - Conn *websocket.Conn -} - -func (s *BinaryReadWriter) Write(p []byte) (int, error) { - wsFrameHeaderSize := 2 + 8 + 4 // Fixed header + length + mask (RFC 6455) - // our websocket package has an issue where it truncates messages - // when the message+header is greater than the buffer size we allocate. - // because of this, we have to chunk messages - chunkSize := WebsocketMessageBufferSize - wsFrameHeaderSize - bytesWritten := 0 - - for i := 0; i < len(p); i += chunkSize { - w, err := s.Conn.NextWriter(websocket.BinaryMessage) - if err != nil { - return bytesWritten, s.err(err) - } - defer w.Close() - - end := i + chunkSize - if end > len(p) { - end = len(p) - } - n, err := w.Write(p[i:end]) - if err != nil { - return bytesWritten, err - } - - bytesWritten = n + bytesWritten - } - return bytesWritten, nil - -} - -func (s *BinaryReadWriter) Read(p []byte) (int, error) { - for { - msgType, r, err := s.Conn.NextReader() - if err != nil { - return 0, s.err(err) - } - - switch msgType { - case websocket.BinaryMessage: - n, err := r.Read(p) - return n, s.err(err) - - case websocket.CloseMessage: - return 0, io.EOF - } - } -} - -func (s *BinaryReadWriter) err(err error) error { - if err == nil { - return nil - } - if e, ok := err.(*websocket.CloseError); ok { - if e.Code == websocket.CloseNormalClosure { - return io.EOF - } - } - return err -} - -type RoundTripCallback func(conn *websocket.Conn, resp *http.Response, err error) error - -type WebsocketRoundTripper struct { - Dialer *websocket.Dialer - Do RoundTripCallback -} - -func (d *WebsocketRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { - conn, resp, err := d.Dialer.Dial(r.URL.String(), r.Header) - if err == nil { - defer conn.Close() - } - return resp, d.Do(conn, resp, err) -} - -type asyncWSRoundTripper struct { - Done chan struct{} - Connection chan *websocket.Conn -} - -func (aws *asyncWSRoundTripper) WebsocketCallback(ws *websocket.Conn, resp *http.Response, err error) error { - - if err != nil { - if resp != nil && resp.StatusCode != http.StatusOK { - buf := new(bytes.Buffer) - buf.ReadFrom(resp.Body) - return fmt.Errorf("Can't connect to websocket (%d): %s\n", resp.StatusCode, buf.String()) - } - return fmt.Errorf("Can't connect to websocket: %s\n", err.Error()) - } - aws.Connection <- ws - - // Keep the roundtripper open until we are done with the stream - <-aws.Done - return nil -} - -func roundTripperFromConfig(config *rest.Config, callback RoundTripCallback) (http.RoundTripper, error) { - - // Configure TLS - tlsConfig, err := rest.TLSConfigFor(config) - if err != nil { - return nil, err - } - - // Configure the websocket dialer - dialer := &websocket.Dialer{ - Proxy: http.ProxyFromEnvironment, - TLSClientConfig: tlsConfig, - WriteBufferSize: WebsocketMessageBufferSize, - ReadBufferSize: WebsocketMessageBufferSize, - Subprotocols: []string{subresources.PlainStreamProtocolName}, - } - - // Create a roundtripper which will pass in the final underlying websocket connection to a callback - rt := &WebsocketRoundTripper{ - Do: callback, - Dialer: dialer, - } - - // Make sure we inherit all relevant security headers - return rest.HTTPWrappersForConfig(config, rt) -} - -func RequestFromConfig(config *rest.Config, vmi string, namespace string, resource string) (*http.Request, error) { - - u, err := url.Parse(config.Host) - if err != nil { - return nil, err - } - - switch u.Scheme { - case "https": - u.Scheme = "wss" - case "http": - u.Scheme = "ws" - default: - return nil, fmt.Errorf("Unsupported Protocol %s", u.Scheme) - } - - u.Path = fmt.Sprintf("/apis/subresources.kubevirt.io/v1alpha3/namespaces/%s/virtualmachineinstances/%s/%s", namespace, vmi, resource) - req := &http.Request{ - Method: http.MethodGet, - URL: u, - } - - return req, nil -} - -type wsStreamer struct { - conn *websocket.Conn - done chan struct{} -} - -func (ws *wsStreamer) streamDone() { - close(ws.done) -} - -func (ws *wsStreamer) Stream(options StreamOptions) error { - wsReadWriter := &BinaryReadWriter{Conn: ws.conn} - - copyErr := make(chan error, 1) - - go func() { - _, err := io.Copy(wsReadWriter, options.In) - copyErr <- err - }() - - go func() { - _, err := io.Copy(options.Out, wsReadWriter) - copyErr <- err - }() - - defer ws.streamDone() - return <-copyErr -} - -func (v *vmis) VNC(name string) (StreamInterface, error) { - return v.asyncSubresourceHelper(name, "vnc") -} - -type connectionStruct struct { - con StreamInterface - err error -} - -func (v *vmis) SerialConsole(name string, timeout time.Duration) (StreamInterface, error) { - timeoutChan := time.Tick(timeout) - connectionChan := make(chan connectionStruct) - - go func() { - for { - - select { - case <-timeoutChan: - connectionChan <- connectionStruct{ - con: nil, - err: fmt.Errorf("Timeout trying to connect to the virtual machine instance"), - } - return - default: - } - - con, err := v.asyncSubresourceHelper(name, "console") - if err != nil { - asyncSubresourceError, ok := err.(*AsyncSubresourceError) - // return if response status code does not equal to 400 - if !ok || asyncSubresourceError.GetStatusCode() != http.StatusBadRequest { - connectionChan <- connectionStruct{con: nil, err: err} - return - } - - time.Sleep(1 * time.Second) - continue - } - - connectionChan <- connectionStruct{con: con, err: nil} - return - } - }() - - conStruct := <-connectionChan - return conStruct.con, conStruct.err -} - -type AsyncSubresourceError struct { - err string - StatusCode int -} - -func (a *AsyncSubresourceError) Error() string { - return a.err -} - -func (a *AsyncSubresourceError) GetStatusCode() int { - return a.StatusCode -} - -func (v *vmis) asyncSubresourceHelper(name string, resource string) (StreamInterface, error) { - - done := make(chan struct{}) - - aws := &asyncWSRoundTripper{ - Connection: make(chan *websocket.Conn), - Done: done, - } - // Create a round tripper with all necessary kubernetes security details - wrappedRoundTripper, err := roundTripperFromConfig(v.config, aws.WebsocketCallback) - if err != nil { - return nil, fmt.Errorf("unable to create round tripper for remote execution: %v", err) - } - - // Create a request out of config and the query parameters - req, err := RequestFromConfig(v.config, name, v.namespace, resource) - if err != nil { - return nil, fmt.Errorf("unable to create request for remote execution: %v", err) - } - - errChan := make(chan error, 1) - - go func() { - // Send the request and let the callback do its work - response, err := wrappedRoundTripper.RoundTrip(req) - - if err != nil { - statusCode := 0 - if response != nil { - statusCode = response.StatusCode - } - errChan <- &AsyncSubresourceError{err: err.Error(), StatusCode: statusCode} - return - } - - if response != nil { - switch response.StatusCode { - case http.StatusOK: - case http.StatusNotFound: - err = &AsyncSubresourceError{err: "Virtual Machine not found.", StatusCode: response.StatusCode} - case http.StatusInternalServerError: - err = &AsyncSubresourceError{err: "Websocket failed due to internal server error.", StatusCode: response.StatusCode} - default: - err = &AsyncSubresourceError{err: fmt.Sprintf("Websocket failed with http status: %s", response.Status), StatusCode: response.StatusCode} - } - } else { - err = &AsyncSubresourceError{err: "no response received"} - } - errChan <- err - }() - - select { - case err = <-errChan: - return nil, err - case ws := <-aws.Connection: - return &wsStreamer{ - conn: ws, - done: done, - }, nil - } -} - -func (v *vmis) Get(name string, options *k8smetav1.GetOptions) (vmi *v1.VirtualMachineInstance, err error) { - vmi = &v1.VirtualMachineInstance{} - err = v.restClient.Get(). - Resource(v.resource). - Namespace(v.namespace). - Name(name). - VersionedParams(options, scheme.ParameterCodec). - Do(). - Into(vmi) - vmi.SetGroupVersionKind(v1.VirtualMachineInstanceGroupVersionKind) - return -} - -func (v *vmis) List(options *k8smetav1.ListOptions) (vmiList *v1.VirtualMachineInstanceList, err error) { - vmiList = &v1.VirtualMachineInstanceList{} - err = v.restClient.Get(). - Resource(v.resource). - Namespace(v.namespace). - VersionedParams(options, scheme.ParameterCodec). - Do(). - Into(vmiList) - for _, vmi := range vmiList.Items { - vmi.SetGroupVersionKind(v1.VirtualMachineInstanceGroupVersionKind) - } - - return -} - -func (v *vmis) Create(vmi *v1.VirtualMachineInstance) (result *v1.VirtualMachineInstance, err error) { - result = &v1.VirtualMachineInstance{} - err = v.restClient.Post(). - Namespace(v.namespace). - Resource(v.resource). - Body(vmi). - Do(). - Into(result) - result.SetGroupVersionKind(v1.VirtualMachineInstanceGroupVersionKind) - return -} - -func (v *vmis) Update(vmi *v1.VirtualMachineInstance) (result *v1.VirtualMachineInstance, err error) { - result = &v1.VirtualMachineInstance{} - err = v.restClient.Put(). - Name(vmi.ObjectMeta.Name). - Namespace(v.namespace). - Resource(v.resource). - Body(vmi). - Do(). - Into(result) - result.SetGroupVersionKind(v1.VirtualMachineInstanceGroupVersionKind) - return -} - -func (v *vmis) Delete(name string, options *k8smetav1.DeleteOptions) error { - return v.restClient.Delete(). - Namespace(v.namespace). - Resource(v.resource). - Name(name). - Body(options). - Do(). - Error() -} - -func (v *vmis) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VirtualMachineInstance, err error) { - result = &v1.VirtualMachineInstance{} - err = v.restClient.Patch(pt). - Namespace(v.namespace). - Resource(v.resource). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/vendor/kubevirt.io/client-go/kubecli/vmipreset.go b/vendor/kubevirt.io/client-go/kubecli/vmipreset.go deleted file mode 100644 index 6924926d115e..000000000000 --- a/vendor/kubevirt.io/client-go/kubecli/vmipreset.go +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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 2017 Red Hat, Inc. - * - */ - -package kubecli - -import ( - k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - - v1 "kubevirt.io/client-go/api/v1" -) - -func (k *kubevirt) VirtualMachineInstancePreset(namespace string) VirtualMachineInstancePresetInterface { - return &vmiPresets{k.restClient, namespace, "virtualmachineinstancepresets"} -} - -type vmiPresets struct { - restClient *rest.RESTClient - namespace string - resource string -} - -func (v *vmiPresets) Get(name string, options k8smetav1.GetOptions) (vmi *v1.VirtualMachineInstancePreset, err error) { - vmi = &v1.VirtualMachineInstancePreset{} - err = v.restClient.Get(). - Resource(v.resource). - Namespace(v.namespace). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(vmi) - vmi.SetGroupVersionKind(v1.VirtualMachineInstancePresetGroupVersionKind) - return -} - -func (v *vmiPresets) List(options k8smetav1.ListOptions) (vmiList *v1.VirtualMachineInstancePresetList, err error) { - vmiList = &v1.VirtualMachineInstancePresetList{} - err = v.restClient.Get(). - Resource(v.resource). - Namespace(v.namespace). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(vmiList) - for _, vmi := range vmiList.Items { - vmi.SetGroupVersionKind(v1.VirtualMachineInstancePresetGroupVersionKind) - } - - return -} - -func (v *vmiPresets) Create(vmi *v1.VirtualMachineInstancePreset) (result *v1.VirtualMachineInstancePreset, err error) { - result = &v1.VirtualMachineInstancePreset{} - err = v.restClient.Post(). - Namespace(v.namespace). - Resource(v.resource). - Body(vmi). - Do(). - Into(result) - result.SetGroupVersionKind(v1.VirtualMachineInstancePresetGroupVersionKind) - return -} - -func (v *vmiPresets) Update(vmi *v1.VirtualMachineInstancePreset) (result *v1.VirtualMachineInstancePreset, err error) { - result = &v1.VirtualMachineInstancePreset{} - err = v.restClient.Put(). - Name(vmi.ObjectMeta.Name). - Namespace(v.namespace). - Resource(v.resource). - Body(vmi). - Do(). - Into(result) - result.SetGroupVersionKind(v1.VirtualMachineInstancePresetGroupVersionKind) - return -} - -func (v *vmiPresets) Delete(name string, options *k8smetav1.DeleteOptions) error { - return v.restClient.Delete(). - Namespace(v.namespace). - Resource(v.resource). - Name(name). - Body(options). - Do(). - Error() -} - -func (v *vmiPresets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VirtualMachineInstancePreset, err error) { - result = &v1.VirtualMachineInstancePreset{} - err = v.restClient.Patch(pt). - Namespace(v.namespace). - Resource(v.resource). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/vendor/kubevirt.io/client-go/log/BUILD.bazel b/vendor/kubevirt.io/client-go/log/BUILD.bazel deleted file mode 100644 index b37fa2e7376c..000000000000 --- a/vendor/kubevirt.io/client-go/log/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["log.go"], - importmap = "kubevirt.io/kubevirt/vendor/kubevirt.io/client-go/log", - importpath = "kubevirt.io/client-go/log", - visibility = ["//visibility:public"], - deps = [ - "//vendor/github.com/go-kit/kit/log:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/k8s.io/api/core/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", - "//vendor/k8s.io/client-go/tools/cache:go_default_library", - ], -) diff --git a/vendor/kubevirt.io/client-go/log/log.go b/vendor/kubevirt.io/client-go/log/log.go deleted file mode 100644 index 2922f6be3b1d..000000000000 --- a/vendor/kubevirt.io/client-go/log/log.go +++ /dev/null @@ -1,404 +0,0 @@ -/* - * 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 2017 Red Hat, Inc. - * - */ - -package log - -import ( - "errors" - goflag "flag" - "fmt" - "io" - "os" - "path/filepath" - "runtime" - "strconv" - "strings" - "sync" - "time" - - "github.com/go-kit/kit/log" - "github.com/golang/glog" - flag "github.com/spf13/pflag" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - k8sruntime "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/tools/cache" -) - -const ( - libvirtTimestampFormat = "2006-01-02 15:04:05.999-0700" -) - -type LogLevel int32 - -const ( - INFO LogLevel = iota - WARNING - ERROR - FATAL -) - -var LogLevelNames = map[LogLevel]string{ - INFO: "info", - WARNING: "warning", - ERROR: "error", - FATAL: "fatal", -} - -var lock sync.Mutex - -type LoggableObject interface { - metav1.ObjectMetaAccessor - k8sruntime.Object -} - -type FilteredLogger struct { - logContext *log.Context - component string - filterLevel LogLevel - currentLogLevel LogLevel - verbosityLevel int - currentVerbosityLevel int - err error -} - -var Log = DefaultLogger() - -func InitializeLogging(comp string) { - defaultComponent = comp - Log = DefaultLogger() - glog.CopyStandardLogTo(LogLevelNames[INFO]) - goflag.CommandLine.Set("component", comp) - goflag.CommandLine.Set("logtostderr", "true") -} - -func getDefaultVerbosity() int { - if verbosityFlag := flag.Lookup("v"); verbosityFlag != nil { - defaultVerbosity, _ := strconv.Atoi(verbosityFlag.Value.String()) - return defaultVerbosity - } else { - // "the practical default level is V(2)" - // see https://github.com/kubernetes/community/blob/master/contributors/devel/logging.md - return 2 - } -} - -// Wrap a go-kit logger in a FilteredLogger. Not cached -func MakeLogger(logger log.Logger) *FilteredLogger { - defaultLogLevel := INFO - - defaultVerbosity = getDefaultVerbosity() - // This verbosity will be used for info logs without setting a custom verbosity level - defaultCurrentVerbosity := 2 - - return &FilteredLogger{ - logContext: log.NewContext(logger), - component: defaultComponent, - filterLevel: defaultLogLevel, - currentLogLevel: defaultLogLevel, - verbosityLevel: defaultVerbosity, - currentVerbosityLevel: defaultCurrentVerbosity, - } -} - -type NullLogger struct{} - -func (n NullLogger) Log(params ...interface{}) error { return nil } - -var loggers = make(map[string]*FilteredLogger) -var defaultComponent = "" -var defaultVerbosity = 0 - -func createLogger(component string) { - lock.Lock() - defer lock.Unlock() - _, ok := loggers[component] - if ok == false { - logger := log.NewJSONLogger(os.Stderr) - log := MakeLogger(logger) - log.component = component - loggers[component] = log - } -} - -func Logger(component string) *FilteredLogger { - _, ok := loggers[component] - if ok == false { - createLogger(component) - } - return loggers[component] -} - -func DefaultLogger() *FilteredLogger { - return Logger(defaultComponent) -} - -// SetIOWriter is meant to be used for testing. "log" and "glog" logs are sent to /dev/nil. -// KubeVirt related log messages will be sent to this writer -func (l *FilteredLogger) SetIOWriter(w io.Writer) { - l.logContext = log.NewContext(log.NewJSONLogger(w)) - goflag.CommandLine.Set("logtostderr", "false") -} - -func (l *FilteredLogger) SetLogger(logger log.Logger) *FilteredLogger { - l.logContext = log.NewContext(logger) - return l -} - -type LogError struct { - message string -} - -func (e LogError) Error() string { - return e.message -} - -func (l FilteredLogger) msg(msg interface{}) { - l.log(3, "msg", msg) -} - -func (l FilteredLogger) msgf(msg string, args ...interface{}) { - l.log(3, "msg", fmt.Sprintf(msg, args...)) -} - -func (l FilteredLogger) Log(params ...interface{}) error { - return l.log(2, params...) -} - -func (l FilteredLogger) log(skipFrames int, params ...interface{}) error { - // messages should be logged if any of these conditions are met: - // The log filtering level is info and verbosity checks match - // The log message priority is warning or higher - if l.currentLogLevel >= WARNING || (l.filterLevel == INFO && - (l.currentLogLevel == l.filterLevel) && - (l.currentVerbosityLevel <= l.verbosityLevel)) { - now := time.Now().UTC() - _, fileName, lineNumber, _ := runtime.Caller(skipFrames) - logParams := make([]interface{}, 0, 8) - - logParams = append(logParams, - "level", LogLevelNames[l.currentLogLevel], - "timestamp", now.Format("2006-01-02T15:04:05.000000Z"), - "pos", fmt.Sprintf("%s:%d", filepath.Base(fileName), lineNumber), - "component", l.component, - ) - if l.err != nil { - l.logContext = l.logContext.With("reason", l.err) - } - return l.logContext.WithPrefix(logParams...).Log(params...) - } - return nil -} -func (l FilteredLogger) Key(key string, kind string) *FilteredLogger { - if key == "" { - return &l - - } - name, namespace, err := cache.SplitMetaNamespaceKey(key) - if err != nil { - return &l - } - logParams := make([]interface{}, 0) - if namespace != "" { - logParams = append(logParams, "namespace", namespace) - } - logParams = append(logParams, "name", name) - logParams = append(logParams, "kind", kind) - l.With(logParams...) - return &l -} - -func (l FilteredLogger) Object(obj LoggableObject) *FilteredLogger { - - name := obj.GetObjectMeta().GetName() - namespace := obj.GetObjectMeta().GetNamespace() - uid := obj.GetObjectMeta().GetUID() - kind := obj.GetObjectKind().GroupVersionKind().Kind - - logParams := make([]interface{}, 0) - if namespace != "" { - logParams = append(logParams, "namespace", namespace) - } - logParams = append(logParams, "name", name) - logParams = append(logParams, "kind", kind) - logParams = append(logParams, "uid", uid) - - l.With(logParams...) - return &l -} - -func (l FilteredLogger) ObjectRef(obj *v1.ObjectReference) *FilteredLogger { - - if obj == nil { - return &l - } - - logParams := make([]interface{}, 0) - if obj.Namespace != "" { - logParams = append(logParams, "namespace", obj.Namespace) - } - logParams = append(logParams, "name", obj.Name) - logParams = append(logParams, "kind", obj.Kind) - logParams = append(logParams, "uid", obj.UID) - - l.With(logParams...) - return &l -} - -func (l *FilteredLogger) With(obj ...interface{}) *FilteredLogger { - l.logContext = l.logContext.With(obj...) - return l -} - -func (l *FilteredLogger) WithPrefix(obj ...interface{}) *FilteredLogger { - l.logContext = l.logContext.WithPrefix(obj...) - return l -} - -func (l *FilteredLogger) SetLogLevel(filterLevel LogLevel) error { - if (filterLevel >= INFO) && (filterLevel <= FATAL) { - l.filterLevel = filterLevel - return nil - } - return fmt.Errorf("Log level %d does not exist", filterLevel) -} - -func (l *FilteredLogger) SetVerbosityLevel(level int) error { - if level >= 0 { - l.verbosityLevel = level - } else { - return errors.New("Verbosity setting must not be negative") - } - return nil -} - -// It would be consistent to return an error from this function, but -// a multi-value function would break the primary use case: log.V(2).Info().... -func (l FilteredLogger) V(level int) *FilteredLogger { - if level >= 0 { - l.currentVerbosityLevel = level - } - return &l -} - -func (l FilteredLogger) Reason(err error) *FilteredLogger { - l.err = err - return &l -} - -func (l FilteredLogger) Level(level LogLevel) *FilteredLogger { - l.currentLogLevel = level - return &l -} - -func (l FilteredLogger) Info(msg string) { - l.Level(INFO).msg(msg) -} - -func (l FilteredLogger) Infof(msg string, args ...interface{}) { - l.Level(INFO).msgf(msg, args...) -} - -func (l FilteredLogger) Warning(msg string) { - l.Level(WARNING).msg(msg) -} - -func (l FilteredLogger) Warningf(msg string, args ...interface{}) { - l.Level(WARNING).msgf(msg, args...) -} - -func (l FilteredLogger) Error(msg string) { - l.Level(ERROR).msg(msg) -} - -func (l FilteredLogger) Errorf(msg string, args ...interface{}) { - l.Level(ERROR).msgf(msg, args...) -} - -func (l FilteredLogger) Critical(msg string) { - l.Level(FATAL).msg(msg) -} - -func (l FilteredLogger) Criticalf(msg string, args ...interface{}) { - l.Level(FATAL).msgf(msg, args...) -} - -func LogLibvirtLogLine(logger *FilteredLogger, line string) { - - if len(strings.TrimSpace(line)) == 0 { - return - } - - fragments := strings.SplitN(line, ": ", 5) - if len(fragments) < 4 { - now := time.Now() - logger.logContext.Log( - "level", "info", - "timestamp", now.Format("2006-01-02T15:04:05.000000Z"), - "component", logger.component, - "subcomponent", "libvirt", - "msg", line, - ) - return - } - severity := strings.ToLower(strings.TrimSpace(fragments[2])) - - if severity == "debug" { - severity = "info" - } - - t, err := time.Parse(libvirtTimestampFormat, strings.TrimSpace(fragments[0])) - if err != nil { - fmt.Println(err) - return - } - thread := strings.TrimSpace(fragments[1]) - pos := strings.TrimSpace(fragments[3]) - msg := strings.TrimSpace(fragments[4]) - - // check if we really got a position - isPos := false - if split := strings.Split(pos, ":"); len(split) == 2 { - if _, err := strconv.Atoi(split[1]); err == nil { - isPos = true - } - } - - if !isPos { - msg = strings.TrimSpace(fragments[3] + ": " + fragments[4]) - logger.logContext.Log( - "level", severity, - "timestamp", t.Format("2006-01-02T15:04:05.000000Z"), - "component", logger.component, - "subcomponent", "libvirt", - "thread", thread, - "msg", msg, - ) - } else { - logger.logContext.Log( - "level", severity, - "timestamp", t.Format("2006-01-02T15:04:05.000000Z"), - "pos", pos, - "component", logger.component, - "subcomponent", "libvirt", - "thread", thread, - "msg", msg, - ) - } -} diff --git a/vendor/kubevirt.io/client-go/precond/BUILD.bazel b/vendor/kubevirt.io/client-go/precond/BUILD.bazel deleted file mode 100644 index e5533aa6bbe7..000000000000 --- a/vendor/kubevirt.io/client-go/precond/BUILD.bazel +++ /dev/null @@ -1,9 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["precond.go"], - importmap = "kubevirt.io/kubevirt/vendor/kubevirt.io/client-go/precond", - importpath = "kubevirt.io/client-go/precond", - visibility = ["//visibility:public"], -) diff --git a/vendor/kubevirt.io/client-go/precond/precond.go b/vendor/kubevirt.io/client-go/precond/precond.go deleted file mode 100644 index 44fc624fbdd2..000000000000 --- a/vendor/kubevirt.io/client-go/precond/precond.go +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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 2017 Red Hat, Inc. - * - */ - -package precond - -import ( - "fmt" -) - -type PreconditionError struct { - msg string -} - -func (e *PreconditionError) Error() string { - return e.msg -} - -func MustNotBeEmpty(str string, msg ...interface{}) string { - panicOnError(CheckNotEmpty(str, msg...)) - return str -} - -func MustNotBeNil(obj interface{}, msg ...interface{}) interface{} { - panicOnError(CheckNotNil(obj, msg...)) - return obj -} - -func MustBeTrue(b bool, msg ...interface{}) { - panicOnError(CheckTrue(b, msg...)) -} - -func CheckNotEmpty(str string, msg ...interface{}) error { - if str == "" { - return newError("String must not be empty", msg...) - } - return nil -} - -func CheckNotNil(obj interface{}, msg ...interface{}) error { - if obj == nil { - return newError("Object must not be nil", msg...) - } - return nil -} - -func CheckTrue(b bool, msg ...interface{}) error { - if b == false { - return newError("Expression must be true", msg...) - } - return nil -} - -func panicOnError(e error) { - if e != nil { - panic(e) - } -} - -func newError(defaultMsg string, msg ...interface{}) *PreconditionError { - return &PreconditionError{msg: newErrMsg(defaultMsg, msg...)} -} - -func newErrMsg(defaultMsg string, msg ...interface{}) string { - if msg != nil { - switch t := msg[0].(type) { - case string: - return fmt.Sprintf(t, msg[1:]...) - default: - return fmt.Sprint(msg...) - } - } - return defaultMsg -} diff --git a/vendor/kubevirt.io/client-go/subresources/BUILD.bazel b/vendor/kubevirt.io/client-go/subresources/BUILD.bazel deleted file mode 100644 index 90465a320b75..000000000000 --- a/vendor/kubevirt.io/client-go/subresources/BUILD.bazel +++ /dev/null @@ -1,9 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["constants.go"], - importmap = "kubevirt.io/kubevirt/vendor/kubevirt.io/client-go/subresources", - importpath = "kubevirt.io/client-go/subresources", - visibility = ["//visibility:public"], -) diff --git a/vendor/kubevirt.io/client-go/subresources/constants.go b/vendor/kubevirt.io/client-go/subresources/constants.go deleted file mode 100644 index d60d224ab3ff..000000000000 --- a/vendor/kubevirt.io/client-go/subresources/constants.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 2018 The KubeVirt Authors - * - */ - -package subresources - -// PlainStreamProtocolName is a subprotocol which indicates a plain websocket stream. -// Mostly useful for browser connections which need to use the websocket subprotocol -// field to pass credentials. As a consequence they need to get a subprotocol back. -const PlainStreamProtocolName = "plain.kubevirt.io" diff --git a/vendor/kubevirt.io/client-go/version/BUILD.bazel b/vendor/kubevirt.io/client-go/version/BUILD.bazel deleted file mode 100644 index 9afdf1c6abdd..000000000000 --- a/vendor/kubevirt.io/client-go/version/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "base.go", - "types.go", - "version.go", - ], - importmap = "kubevirt.io/kubevirt/vendor/kubevirt.io/client-go/version", - importpath = "kubevirt.io/client-go/version", - visibility = ["//visibility:public"], -) diff --git a/vendor/kubevirt.io/client-go/version/base.go b/vendor/kubevirt.io/client-go/version/base.go deleted file mode 100644 index bd933defa4d6..000000000000 --- a/vendor/kubevirt.io/client-go/version/base.go +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 2018 Red Hat, Inc. - * - */ - -package version - -var ( - gitVersion = "v0.0.0-master+$Format:%h$" - gitCommit = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD) - gitTreeState = "" // state of git tree, either "clean" or "dirty" - - buildDate = "1970-01-01T00:00:00Z" // build date in ISO8601 format, output of $(date -u +'%Y-%m-%dT%H:%M:%SZ') -) diff --git a/vendor/kubevirt.io/client-go/version/def.bzl b/vendor/kubevirt.io/client-go/version/def.bzl deleted file mode 100644 index 0a5703932a51..000000000000 --- a/vendor/kubevirt.io/client-go/version/def.bzl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2017 The Kubernetes Authors. -# -# 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. - -# Implements hack/version.sh's kube::version::ldflags() for Bazel. -def version_x_defs(): - # This should match the list of packages in kube::version::ldflag - stamp_pkgs = [ - "kubevirt.io/client-go/version", - ] - - # This should match the list of vars in kube::version::ldflags - # It should also match the list of vars set in hack/print-workspace-status.sh. - stamp_vars = [ - "buildDate", - "gitCommit", - "gitTreeState", - "gitVersion", - ] - - # Generate the cross-product. - x_defs = {} - for pkg in stamp_pkgs: - for var in stamp_vars: - x_defs["%s.%s" % (pkg, var)] = "{%s}" % var - return x_defs diff --git a/vendor/kubevirt.io/client-go/version/types.go b/vendor/kubevirt.io/client-go/version/types.go deleted file mode 100644 index e90fb07d5943..000000000000 --- a/vendor/kubevirt.io/client-go/version/types.go +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 2018 Red Hat, Inc. - * - */ -package version - -type Info struct { - GitVersion string `json:"gitVersion"` - GitCommit string `json:"gitCommit"` - GitTreeState string `json:"gitTreeState"` - BuildDate string `json:"buildDate"` - GoVersion string `json:"goVersion"` - Compiler string `json:"compiler"` - Platform string `json:"platform"` -} - -// String returns info as a human-friendly version string. -func (info Info) String() string { - return info.GitVersion -} diff --git a/vendor/kubevirt.io/client-go/version/version.go b/vendor/kubevirt.io/client-go/version/version.go deleted file mode 100644 index 209a302c90e5..000000000000 --- a/vendor/kubevirt.io/client-go/version/version.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 2018 Red Hat, Inc. - * - */ - -package version - -import ( - "fmt" - "runtime" -) - -func Get() Info { - return Info{ - GitVersion: gitVersion, - GitCommit: gitCommit, - GitTreeState: gitTreeState, - BuildDate: buildDate, - GoVersion: runtime.Version(), - Compiler: runtime.Compiler, - Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), - } -}