diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES index 2b94cd18392..3b2c20fc289 100644 --- a/OWNERS_ALIASES +++ b/OWNERS_ALIASES @@ -88,18 +88,6 @@ aliases: - Gal-Zaidman - eslutsky - janosdebugs - kubevirt-approvers: - - nirarg - - bardielle - - ravidbro - - rgolangh - - chenyosef - kubevirt-reviewers: - - nirarg - - bardielle - - ravidbro - - rgolangh - - chenyosef ibmcloud-approvers: - bobbyradford - hasueki diff --git a/cmd/openshift-install/destroy.go b/cmd/openshift-install/destroy.go index 568a4b7c507..aa6978e4dea 100644 --- a/cmd/openshift-install/destroy.go +++ b/cmd/openshift-install/destroy.go @@ -16,7 +16,6 @@ import ( "github.com/openshift/installer/pkg/destroy/bootstrap" _ "github.com/openshift/installer/pkg/destroy/gcp" _ "github.com/openshift/installer/pkg/destroy/ibmcloud" - _ "github.com/openshift/installer/pkg/destroy/kubevirt" _ "github.com/openshift/installer/pkg/destroy/libvirt" _ "github.com/openshift/installer/pkg/destroy/openstack" _ "github.com/openshift/installer/pkg/destroy/ovirt" diff --git a/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template b/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template index 349b60a2d8b..b0b85af1d72 100755 --- a/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template +++ b/data/data/bootstrap/files/usr/local/bin/bootkube.sh.template @@ -337,7 +337,6 @@ then copy_static_resources_for openstack copy_static_resources_for ovirt copy_static_resources_for vsphere - copy_static_resources_for kubevirt cp mco-bootstrap/manifests/* manifests/ diff --git a/data/data/bootstrap/kubevirt/OWNERS b/data/data/bootstrap/kubevirt/OWNERS deleted file mode 100644 index c81b62d00a3..00000000000 --- a/data/data/bootstrap/kubevirt/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md -# This file just uses aliases defined in OWNERS_ALIASES. - -approvers: - - kubevirt-approvers -reviewers: - - kubevirt-reviewers diff --git a/data/data/bootstrap/kubevirt/README.md b/data/data/bootstrap/kubevirt/README.md deleted file mode 100644 index 72c8786a6a1..00000000000 --- a/data/data/bootstrap/kubevirt/README.md +++ /dev/null @@ -1,2 +0,0 @@ -KubeVirt needs the same assets during setup except for ironic. -Please refer to https://github.com/openshift/installer/tree/master/data/data/bootstrap/baremetal diff --git a/data/data/bootstrap/kubevirt/files/etc/NetworkManager/dispatcher.d/30-local-dns-prepender b/data/data/bootstrap/kubevirt/files/etc/NetworkManager/dispatcher.d/30-local-dns-prepender deleted file mode 100755 index 5ec300f6bf3..00000000000 --- a/data/data/bootstrap/kubevirt/files/etc/NetworkManager/dispatcher.d/30-local-dns-prepender +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -IFACE=$1 -STATUS=$2 -case "$STATUS" in - up|dhcp4-change|dhcp6-change) - logger -s "NM local-dns-prepender triggered by ${1} ${2}." - DNS_IP="127.0.0.1" - set +e - logger -s "NM local-dns-prepender: Checking if local DNS IP is the first entry in resolv.conf" - if grep nameserver /etc/resolv.conf | head -n 1 | grep -q "$DNS_IP" ; then - logger -s "NM local-dns-prepender: local DNS IP already is the first entry in resolv.conf" - exit 0 - else - logger -s "NM local-dns-prepender: Looking for '# Generated by NetworkManager' in /etc/resolv.conf to place 'nameserver $DNS_IP'" - sed -i "/^# Generated by.*$/a nameserver $DNS_IP" /etc/resolv.conf - fi - ;; - *) - ;; -esac diff --git a/data/data/install.openshift.io_installconfigs.yaml b/data/data/install.openshift.io_installconfigs.yaml index 6d58be6dba1..91a45536654 100644 --- a/data/data/install.openshift.io_installconfigs.yaml +++ b/data/data/install.openshift.io_installconfigs.yaml @@ -269,23 +269,6 @@ spec: type: string type: array type: object - kubevirt: - description: Kubevirt is the configuration used when installing - on Kubevirt. - properties: - cpu: - description: CPU is the amount of CPUs used. - format: int32 - type: integer - memory: - description: 'Memory is the size of a VM''s memory. Format: - https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go' - type: string - storageSize: - description: 'StorageSize is the size of VM''s boot volume. - Format: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go' - type: string - type: object libvirt: description: Libvirt is the configuration used when installing on libvirt. @@ -694,23 +677,6 @@ spec: type: string type: array type: object - kubevirt: - description: Kubevirt is the configuration used when installing - on Kubevirt. - properties: - cpu: - description: CPU is the amount of CPUs used. - format: int32 - type: integer - memory: - description: 'Memory is the size of a VM''s memory. Format: - https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go' - type: string - storageSize: - description: 'StorageSize is the size of VM''s boot volume. - Format: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go' - type: string - type: object libvirt: description: Libvirt is the configuration used when installing on libvirt. @@ -1654,65 +1620,6 @@ spec: required: - region type: object - kubevirt: - description: Kubevirt is the configuration used when installing on - kubevirt. - properties: - apiVIP: - description: APIVIP is the virtual IP address for the api endpoint. - format: ip - type: string - defaultMachinePlatform: - description: DefaultMachinePlatform is the default configuration - used when installing on Kubevirt for machine pools which do - not define their own platform configuration. - properties: - cpu: - description: CPU is the amount of CPUs used. - format: int32 - type: integer - memory: - description: 'Memory is the size of a VM''s memory. Format: - https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go' - type: string - storageSize: - description: 'StorageSize is the size of VM''s boot volume. - Format: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go' - type: string - type: object - ingressVIP: - description: IngressIP is an external IP which routes to the default - ingress controller. - format: ip - type: string - interfaceBindingMethod: - description: InterfaceBindingMethod is the the interface binding - method of the nodes of the tenantcluster (Bridge | SRIOV). - type: string - namespace: - description: Namespace is the namespace in the infra cluster, - which the control plane (master vms) and the compute (worker - vms) are installed in. - type: string - networkName: - description: NetworkName is the target network of all the network - interfaces of the nodes. - type: string - persistentVolumeAccessMode: - default: ReadWriteMany - description: PersistentVolumeAccessMode is the access mode should - be use with the persistent volumes. - type: string - storageClass: - description: StorageClass is the Storage Class used in the infra - cluster. - type: string - required: - - apiVIP - - ingressVIP - - namespace - - networkName - type: object libvirt: description: Libvirt is the configuration used when installing on libvirt. diff --git a/data/data/kubevirt/OWNERS b/data/data/kubevirt/OWNERS deleted file mode 100644 index c81b62d00a3..00000000000 --- a/data/data/kubevirt/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md -# This file just uses aliases defined in OWNERS_ALIASES. - -approvers: - - kubevirt-approvers -reviewers: - - kubevirt-reviewers diff --git a/data/data/kubevirt/bootstrap/main.tf b/data/data/kubevirt/bootstrap/main.tf deleted file mode 100644 index d55f9061476..00000000000 --- a/data/data/kubevirt/bootstrap/main.tf +++ /dev/null @@ -1,135 +0,0 @@ -data "ignition_file" "hostname" { - mode = "420" - path = "/etc/hostname" - - content { - content = < - Prerequisite for Kubernetes: - - [KubeVirt](https://kubevirt.io/) installed in the cluster - - [Multus-cni](https://01.org/kubernetes/building-blocks/multus-cni) plugin installed in the cluster
- - prerequisite for OpenShift: - - [OpenShift Virtualization](https://www.openshift.com/learn/topics/virtualization/) - -2. Create a Namespace/Project, where the tenant cluster resources will be created in
- Make sure that the following instructions are fulfilled: - - Enable support for KubeMacPool feature for the namespace (virtual machine NICs in that namespace are allocated MAC addresses from a MAC address pool. This ensures that virtual machine instances created from that virtual machine retain the assigned MAC address across reboots).
- In order to do that, add the KubeMacPool label to the namespace:
- `oc label namespace mutatevirtualmachines.kubemacpool.io=allocate`
- For more information, refer to [OpenShift docs](https://docs.openshift.com/container-platform/4.6/virt/virtual_machines/vm_networking/virt-using-mac-address-pool-for-vms.html) - - Make sure that the user running the installer has the [minimum rules](./role.yaml) inside the namespace - -3. Create the network that would be used by the tenant cluster: - - Create a bridge on the infra cluster nodes - - Create multus network (Network Attachment Definition) on the bridge - -4. Allocate 2 IPs within the cluster network: - - IP for the internal kubernetes api, that all components will interact with - - IP for the Ingress, the load balancer in front of the cluster apps - - To work with this provider, one must provide 2 IPs that are not reserved to any MAC address in the environment, where the cluster will run. These 2 IPs will be used and monitored by keepalived, initially on the bootstrap machine, and then on the masters (after a fail-over, when the bootstrap is killed). - -5. Name resolution of `api_vip` from your installation machine -The installer must resolve the `api_vip` during the installation, to follow the cluster installation progress. - - -## Minimal resources - -The default master/worker: -- 4 CPUs -- 16 RAM -- 120 GB disk - -For 3 masters/3 workers, the target Cluster **must have at least**: -- 96RAM -- 24vCPUs -- 720GiB storage - -> Worker count can be reduced to 2 in `install-config.yaml` in case needed. - -The installer will create by default 1 bootstrap, 3 masters, and 3 workers machines. -By the time the first worker is up the bootstrap VM should be destroyed, and this is included in the minimum resources calculation. - - -## Install - -### Minimum permission for installation - -In order to be able to complete full installation process, the user running the installer must have minimum permission.
-Please refer the the [Role yaml](./role.yml) to view the list of the required permissions.
-This role can be added to the cluster, and then binded to the user which running the installer, it can be done using the following ways: -- Create RoleBinding which bind the role to the user in the specific namespace -- If using Openshift as InfraCluster, run:
-`oc adm policy add-role-to-user -n ` - - -### kubevirt-credentials - -Before you start the tenant cluster installation, make sure to login to the infra cluster.
-For configuration, kubectl looks for a file named config in the $HOME/.kube directory. You can specify other kubeconfig files by setting the KUBECONFIG environment variable or by setting the --kubeconfig flag.
-Make sure to use kubeconfig credentials without expiration date, as those credentials are going to be used by the -tenantcluster for the infrastructure management. - - -### Install using the wizard - -At this stage, as the Kubevirt provider defined a dev preview, the installer can't be started using the wizard, please refer to [Install using Install Config yaml](#instal-using-install-config-yaml) - - -### Install using Install Config yaml - -- Copy the example [install-config.yaml](./install-config.yaml) file to `install_dir` -- Change the following values ->- [baseDomain](./install-config.yaml#L2) - Enter the base domain that would be used for this cluster ->- Update the machines resources (cpu, memory and storage size), in case you want to override the defaults (optional fields)
->>> Should be following to this structure (remove `{}`):
->>> ```console ->>> kubevirt: ->>> cpu: 4 ->>> memory: 16G ->>> storageSize: 120Gi ->>> ``` ->>> Set different values for compute machines (workers) and for control plan machines (masters): ->>>- [workers](./install-config.yaml#L7) ->>>- [masters](./install-config.yaml#L13) ->- Change the [workerReplicas](./install-config.yaml#L8) - to customize the number of workers ->- Change the [masterReplicas](./install-config.yaml#L14) - to customize the number of masters ->- Change the [Machine Network CIDR](./install-config.yaml#L23) to the network range defined in the Network Attachment Definition ->- Set the [Platform](./install-config.yaml#L27) values, according to the values in the Infra cluster ->>> Should be following to this structure:
->>> ```console ->>> kubevirt: ->>> apiVIP: x.x.x.y ->>> ingressVIP: x.x.x.z ->>> namespace: tenantcluster namespace ->>> ``` ->>> |Value name |Value type |Required|Description | ->>> |--- |--- |--- |---| ->>> |namespace |string |Yes |The namespace in the infra cluster, where the control plane (master vms) and the compute (worker vms) will be created in | ->>> |storageClass |string |No |The Storage Class used in the infra cluster | ->>> |networkName |string |Yes |The target network of all the network interfaces of the nodes | ->>> |networkType |string |No |The type of the network interfaces of the nodes of the tenantcluster ("Bridge" or "SRIOV"). Default: "Bridge". ->>> |apiVIP |IPV4 |Yes |The virtual IP address for the api endpoint | ->>> |ingressVIP |IPV4 |Yes |An external IP which routes to the default ingress controller | ->>> |persistentVolumeAccessMode |[ReadWriteMany,ReadWriteOnce] |No |The access mode should be use with the persistent volumes | ->- Set the [pullSecret](./install-config.yaml#L35), You can get this secret from https://cloud.redhat.com/openshift/install/pull-secret ->- Set the [sshKey](./install-config.yaml#L36) (content of ~/.ssh/id_rsa.pub) - -### Run the installer - -Start the installation using the install-config created in the folder `install_dir` - -```console -$ openshift-install create cluster --dir=install_dir -``` -### After installation is done - -After the installation is done, to access the cluster as the system:admin user: - -```console -$ export KUBECONFIG=$PWD/install_dir/auth/kubeconfig -$ oc get nodes -``` diff --git a/docs/user/kubevirt/role.yaml b/docs/user/kubevirt/role.yaml deleted file mode 100644 index f60a596da08..00000000000 --- a/docs/user/kubevirt/role.yaml +++ /dev/null @@ -1,40 +0,0 @@ -# Roles required for installation and also for applications running in the tenant cluster -# Changes here MUST be synched with pkg/asset/installconfig/kubevirt/validation.go ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: tenantcluster-installer - namespace: -rules: -- apiGroups: [""] - resources: ["secrets"] - verbs: ["get", "list", "create", "delete"] -- apiGroups: [""] - resources: ["namespaces"] - verbs: ["get"] -- apiGroups: ["kubevirt.io"] - resources: ["virtualmachines"] - verbs: ["get", "list", "create", "delete", "update"] -- apiGroups: ["kubevirt.io"] - resources: ["virtualmachineinstances"] - verbs: ["get", "list"] -- apiGroups: ["cdi.kubevirt.io"] - resources: ["datavolumes"] - verbs: ["get", "list", "create", "delete"] -- apiGroups: ["k8s.cni.cncf.io"] - resources: ["network-attachment-definitions"] - verbs: ["get"] -- apiGroups: ["subresources.kubevirt.io"] - resources: ["virtualmachineinstances/addvolume", "virtualmachineinstances/removevolume"] - verbs: ["update"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: tenantcluster-installer - namespace: openshift-cnv -rules: -- apiGroups: ["hco.kubevirt.io"] - resources: ["hyperconvergeds"] - verbs: ["get"] diff --git a/go.mod b/go.mod index b1603189d13..12bda64bbb3 100644 --- a/go.mod +++ b/go.mod @@ -51,8 +51,6 @@ require ( github.com/hashicorp/terraform-provider-vsphere v1.24.3 github.com/hashicorp/vault v1.3.0 // indirect github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c // indirect - github.com/k8snetworkplumbingwg/network-attachment-definition-client v0.0.0-20191119172530-79f836b90111 - github.com/kubevirt/terraform-provider-kubevirt v0.0.0-00010101000000-000000000000 github.com/libvirt/libvirt-go v5.10.0+incompatible github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 // indirect github.com/masterzen/winrm v0.0.0-20190308153735-1d17eaf15943 // indirect @@ -66,7 +64,6 @@ require ( github.com/openshift/cloud-credential-operator v0.0.0-20200316201045-d10080b52c9e github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20201203141909-4dc702fd57a5 github.com/openshift/cluster-api-provider-ibmcloud v0.0.0-20210702173623-676faba9895d - github.com/openshift/cluster-api-provider-kubevirt v0.0.0-20210719100556-9b8bc3666720 github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20191219173431-2336783d4603 github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20210817084941-2262c7c6cece github.com/openshift/library-go v0.0.0-20210408164723-7a65fdb398e2 @@ -114,8 +111,6 @@ require ( k8s.io/klog v1.0.0 k8s.io/klog/v2 v2.9.0 k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 - kubevirt.io/client-go v0.29.0 - kubevirt.io/containerized-data-importer v1.10.9 sigs.k8s.io/cluster-api-provider-aws v0.0.0 sigs.k8s.io/cluster-api-provider-azure v0.0.0 sigs.k8s.io/cluster-api-provider-openstack v0.0.0 @@ -129,7 +124,6 @@ replace ( github.com/hashicorp/terraform => github.com/openshift/terraform v0.12.20-openshift-4 // Pin to fork with deduplicated rpc types v0.12.20-openshift-4 github.com/hashicorp/terraform-plugin-sdk => github.com/openshift/hashicorp-terraform-plugin-sdk v1.14.0-openshift // Pin to fork with public rpc types github.com/hashicorp/terraform-provider-vsphere => github.com/openshift/terraform-provider-vsphere v1.24.3-openshift - github.com/kubevirt/terraform-provider-kubevirt => github.com/nirarg/terraform-provider-kubevirt v0.0.0-20201222125919-101cee051ed3 github.com/metal3-io/baremetal-operator => github.com/openshift/baremetal-operator v0.0.0-20210706141527-5240e42f012a // Use OpenShift fork github.com/metal3-io/baremetal-operator/apis => github.com/openshift/baremetal-operator/apis v0.0.0-20210706141527-5240e42f012a // Use OpenShift fork github.com/metal3-io/cluster-api-provider-baremetal => github.com/openshift/cluster-api-provider-baremetal v0.0.0-20190821174549-a2a477909c1d // Pin OpenShift fork @@ -142,7 +136,6 @@ replace ( k8s.io/client-go => k8s.io/client-go v0.22.0 k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 // Pinned due to kubevirt.io downstream dependencies k8s.io/kubectl => k8s.io/kubectl v0.21.0-rc.0 - kubevirt.io/client-go => kubevirt.io/client-go v0.29.0 sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20210121023454-5ffc5f422a80 sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20210626224711-5d94c794092f sigs.k8s.io/cluster-api-provider-openstack => github.com/openshift/cluster-api-provider-openstack v0.0.0-20210302164104-8498241fa4bd diff --git a/go.sum b/go.sum index fc73c3d2614..34a6ea4296e 100644 --- a/go.sum +++ b/go.sum @@ -306,7 +306,6 @@ github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2 github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/brancz/gojsontoyaml v0.0.0-20190425155809-e8bd32d46b3d/go.mod h1:IyUJYN1gvWjtLF5ZuygmxbnsAyP3aJS6cHzIuZY50B0= github.com/briankassouf/jose v0.9.2-0.20180619214549-d2569464773f/go.mod h1:HQhVmdUf7dBNwIIdBTivnCDxcf6IZY3/zrb+uKSJz6Y= github.com/btubbs/datetime v0.1.0/go.mod h1:n2BZ/2ltnRzNiz27aE3wUb2onNttQdC+WFxAoks5jJM= github.com/btubbs/datetime v0.1.1 h1:KuV+F9tyq/hEnezmKZNGk8dzqMVsId6EpFVrQCfA3To= @@ -314,7 +313,6 @@ github.com/btubbs/datetime v0.1.1/go.mod h1:n2BZ/2ltnRzNiz27aE3wUb2onNttQdC+WFxA github.com/c4milo/gotoolkit v0.0.0-20170704181456-e37eeabad07e/go.mod h1:txokOny9wavBtq2PWuHmj1P+eFwpCsj+gQeNNANChfU= github.com/c4milo/gotoolkit v0.0.0-20190525173301-67483a18c17a h1:+uvtaGSLJh0YpLLHCQ9F+UVGy4UOS542hsjj8wBjvH0= github.com/c4milo/gotoolkit v0.0.0-20190525173301-67483a18c17a/go.mod h1:txokOny9wavBtq2PWuHmj1P+eFwpCsj+gQeNNANChfU= -github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -361,7 +359,6 @@ github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containers/image v3.0.2+incompatible h1:B1lqAE8MUPCrsBLE86J0gnXleeRq8zJnQryhiiGQNyE= github.com/containers/image v3.0.2+incompatible/go.mod h1:8Vtij257IWSanUQKe1tAeNOm2sRVkSqQTVQ1IlwI3+M= github.com/containers/image/v5 v5.5.1/go.mod h1:4PyNYR0nwlGq/ybVJD9hWlhmIsNra4Q8uOQX2s6E2uM= @@ -371,12 +368,10 @@ github.com/containers/storage v1.20.2/go.mod h1:oOB9Ie8OVPojvoaKWEGSEtHbXUAs+tSy github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/container-linux-config-transpiler v0.9.0/go.mod h1:SlcxXZQ2c42knj8pezMiQsM1f+ADxFMjGetuMKR/YSQ= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.15+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.17+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/fcct v0.5.0/go.mod h1:cbE+j77YSQwFB2fozWVB3qsI2Pi3YiVEbDz/b6Yywdo= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-json v0.0.0-20170920214419-6a2fe990e083/go.mod h1:FmxyHfvrCFfCsXRylD4QQRlQmvzl+DG6iTHyEEykPfU= @@ -408,7 +403,6 @@ github.com/coreos/ignition/v2 v2.9.0/go.mod h1:A5lFFzA2/zvZQPVEvI1lR5WPLWRb7KZ7Q github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/prometheus-operator v0.35.0/go.mod h1:XHYZUStZWcwd1yk/1DjZv/fywqKIyAJ6pSwvIr+v9BQ= github.com/coreos/stream-metadata-go v0.0.0-20210225230131-70edb9eb47b3 h1:0JspqV66RwYqYfvi8lCUoL5zUZMh9uN4hx/J5+NRXIE= github.com/coreos/stream-metadata-go v0.0.0-20210225230131-70edb9eb47b3/go.mod h1:RTjQyHgO/G37oJ3qnqYK6Z4TPZ5EsaabOtfMjVXmgko= github.com/coreos/vcontext v0.0.0-20190529201340-22b159166068/go.mod h1:E+6hug9bFSe0KZ2ZAzr8M9F5JlArJjv5D1JS7KSkPKE= @@ -497,12 +491,10 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb github.com/emicklei/go-restful v2.9.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.10.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.14.2+incompatible h1:uyx8VgUCryEkh7qbr8rEtrA0rGDEJ73F5lOJdB5m3V8= github.com/emicklei/go-restful v2.14.2+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.1.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -561,7 +553,6 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-ldap/ldap/v3 v3.1.3/go.mod h1:3rbOH3jRS2u6jg2rJnKAMLE/xQyCKIveG2Sa/Cohzb8= @@ -569,7 +560,6 @@ github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTD github.com/go-log/log v0.1.1-0.20181211034820-a514cf01a3eb/go.mod h1:4mBwpdRMFLiuXZDCwU2lKQFsoSCo72j3HqBK9d81N2M= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= @@ -624,7 +614,6 @@ github.com/go-openapi/strfmt v0.20.1/go.mod h1:43urheQI9dNtE5lTZQfuFJvjYJKPrxicA github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.4/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= @@ -710,13 +699,10 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -879,14 +865,11 @@ github.com/gostaticanalysis/comment v1.3.0/go.mod h1:xMicKDx7XRXYdVwY9f9wQpDJVnq github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.4.1/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= @@ -1070,13 +1053,11 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.0.0-20171009183408-7fe0c75c13ab/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/improbable-eng/thanos v0.3.2/go.mod h1:GZewVGILKuJVPNRn7L4Zw+7X96qzFOwj63b22xYGXBE= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb v0.0.0-20190411212539-d24b7ba8c4c4/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= @@ -1115,7 +1096,6 @@ github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFF github.com/joyent/triton-go v0.0.0-20180628001255-830d2b111e62/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/joyent/triton-go v0.0.0-20190112182421-51ffac552869/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -1125,7 +1105,6 @@ github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jsonnet-bundler/jsonnet-bundler v0.1.0/go.mod h1:YKsSFc9VFhhLITkJS3X2PrRqWG9u2Jq99udTdDjQLfM= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -1133,8 +1112,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/k8snetworkplumbingwg/network-attachment-definition-client v0.0.0-20191119172530-79f836b90111 h1:Lq6HJa0JqSg5ko/mkizFWlpIrY7845g9Dzz9qeD5aXI= -github.com/k8snetworkplumbingwg/network-attachment-definition-client v0.0.0-20191119172530-79f836b90111/go.mod h1:MP2HbArq3QT+oVp8pmtHNZnSnkhdkHtDnc7h6nJXmBU= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= @@ -1240,7 +1217,6 @@ github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.6/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= @@ -1295,7 +1271,6 @@ github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZX github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -1358,8 +1333,6 @@ github.com/nicksnyder/go-i18n v1.10.0 h1:5AzlPKvXBH4qBzmZ09Ua9Gipyruv6uApMcrNZdo github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2xBGjv0j365Q= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nirarg/terraform-provider-kubevirt v0.0.0-20201222125919-101cee051ed3 h1:X+6Iial/2VHkDJvtdJiSdJq/RnTDlvdX7WscLXS+z0U= -github.com/nirarg/terraform-provider-kubevirt v0.0.0-20201222125919-101cee051ed3/go.mod h1:FMugN9a6XOJm9mLFEV/+F4IJzdZmpLn/OaNRa8S/Ens= github.com/nishanths/exhaustive v0.0.0-20200811152831-6cf413ae40e0/go.mod h1:wBEpHwM2OdmeNpdCvRPUlkEbBuaFmcK4Wv8Q7FuGW3c= github.com/nishanths/exhaustive v0.1.0/go.mod h1:S1j9110vxV1ECdCudXRkeMnFQ/DQk9ajLT0Uf2MYZQQ= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= @@ -1421,7 +1394,6 @@ github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.m github.com/opencontainers/selinux v1.5.2/go.mod h1:yTcKuYAh6R95iDpefGLQaPaRwJFwyzAJufJyiTt7s0g= github.com/openshift-metal3/terraform-provider-ironic v0.2.6 h1:R48DOxq2z6NpFkRs/OHzbkWA8aLZMIXljMK2aq1VvbM= github.com/openshift-metal3/terraform-provider-ironic v0.2.6/go.mod h1:ux2W6gsCIYsY/fX5N0V0ZgwFEBNN7P8g6RlH6ACi97k= -github.com/openshift/api v0.0.0-20191219222812-2987a591a72c/go.mod h1:dh9o4Fs58gpFXGSYfnVxGR9PnV53I8TW84pQaJDdGiY= github.com/openshift/api v0.0.0-20200326160804-ecb9283fe820/go.mod h1:RKMJ5CBnljLfnej+BJ/xnOWc3kZDvJUaIAEq2oKSPtE= github.com/openshift/api v0.0.0-20200424083944-0422dc17083e/go.mod h1:VnbEzX8SAaRj7Yfl836NykdQIlbEjfL6/CD+AaJQg5Q= github.com/openshift/api v0.0.0-20200827090112-c05698d102cf/go.mod h1:M3xexPhgM8DISzzRpuFUy+jfPjQPIcs9yqEYj17mXV8= @@ -1468,8 +1440,6 @@ github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20201203141909-4dc702fd57 github.com/openshift/cluster-api-provider-gcp v0.0.1-0.20201203141909-4dc702fd57a5/go.mod h1:/XjFaKnqBc8K/jcRXHO7tau39CmzNinqmpxYaQGRvnE= github.com/openshift/cluster-api-provider-ibmcloud v0.0.0-20210702173623-676faba9895d h1:FD/0xn/h8Do//QkPGhsf1pgXkH8nUkfIUmQ16bRU6TQ= github.com/openshift/cluster-api-provider-ibmcloud v0.0.0-20210702173623-676faba9895d/go.mod h1:hIEdP3ZudO/l2J8+gm8IFW0KMHn0YURvMSTZy9luK7w= -github.com/openshift/cluster-api-provider-kubevirt v0.0.0-20210719100556-9b8bc3666720 h1:+7K3weJLiXzIlUfdKbJ34QaAROrQMxXuEMi0ozmMyZY= -github.com/openshift/cluster-api-provider-kubevirt v0.0.0-20210719100556-9b8bc3666720/go.mod h1:jiZXnZ50S7oYVnLIKp9K2RExM2zTtPpoCVSGtsmotqc= github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20191219173431-2336783d4603 h1:MC6BSZYxFPoqqKj9PdlGjHGVKcMsvn6Kv1NiVzQErZ8= github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20191219173431-2336783d4603/go.mod h1:7pQ9Bzha+ug/5zd+0ufbDEcnn2OnNlPwRwYrzhXk4NM= github.com/openshift/cluster-api-provider-openstack v0.0.0-20210302164104-8498241fa4bd h1:5mq9/JftiO9u/RknQ5iR9Nkd09R1XFfUPS1nO11Wth0= @@ -1477,8 +1447,6 @@ github.com/openshift/cluster-api-provider-openstack v0.0.0-20210302164104-849824 github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20210817084941-2262c7c6cece h1:w32C7hy52lkIpDvJqz/tRyYCIZmhE/8bSIVt+L0c9Mg= github.com/openshift/cluster-api-provider-ovirt v0.1.1-0.20210817084941-2262c7c6cece/go.mod h1:lrKTKMpd3OERMlQgVJi6VKcE57EvtUORGSFIoE7BEAs= github.com/openshift/cluster-autoscaler-operator v0.0.0-20190521201101-62768a6ba480/go.mod h1:/XmV44Fh28Vo3Ye93qFrxAbcFJ/Uy+7LPD+jGjmfJYc= -github.com/openshift/custom-resource-status v0.0.0-20190822192428-e62f2f3b79f3 h1:XuAys09+XqT5/FjdR23G/UtbBLII89dFe9XIi73EKIQ= -github.com/openshift/custom-resource-status v0.0.0-20190822192428-e62f2f3b79f3/go.mod h1:GDjWl0tX6FNIj82vIxeudWeSx2Ff6nDZ8uJn0ohUFvo= github.com/openshift/hashicorp-terraform-plugin-sdk v1.14.0-openshift h1:CuH9qNELLH3y0QoSaLchdG+7We75AO4kNBy6P3+oLug= github.com/openshift/hashicorp-terraform-plugin-sdk v1.14.0-openshift/go.mod h1:t62Xy+m7Zjq5tA2vrs8Wuo/TQ0sc9Mx9MjXL3+7MHBQ= github.com/openshift/library-go v0.0.0-20191003152030-97c62d8a2901/go.mod h1:NBttNjZpWwup/nthuLbPAPSYC8Qyo+BBK5bCtFoyYjo= @@ -1502,7 +1470,6 @@ github.com/openshift/machine-api-operator v0.2.1-0.20210505133115-b7ef098180db h github.com/openshift/machine-api-operator v0.2.1-0.20210505133115-b7ef098180db/go.mod h1:DFZBMPtC2TYZH5NE9+2JQIpbZAnruqc9F26QmbOm9pw= github.com/openshift/machine-config-operator v0.0.1-0.20201009041932-4fe8559913b8 h1:C4gCipkWTDp0B9jb0wZdLgB+HWC7EzVVwQOeNaKnTRA= github.com/openshift/machine-config-operator v0.0.1-0.20201009041932-4fe8559913b8/go.mod h1:fjKreLaKEeUKsyIkT4wlzIQwUVJ2ZKDUh3CI73ckYIY= -github.com/openshift/prom-label-proxy v0.1.1-0.20191016113035-b8153a7f39f1/go.mod h1:p5MuxzsYP1JPsNGwtjtcgRHHlGziCJJfztff91nNixw= github.com/openshift/runtime-utils v0.0.0-20200415173359-c45d4ff3f912/go.mod h1:0OXNy7VoqFexkxKqyQbHJLPwn1MFp1/CxRJAgKHM+/o= github.com/openshift/terraform v0.12.20-openshift-4 h1:1v7cIei84p26eqbD4LiTZOH0ecXbL7Qss0sy4BFeWhY= github.com/openshift/terraform v0.12.20-openshift-4/go.mod h1:R/dUWEZVB5itR8fNzx3g8QZMIwwWuI8rcwF8SbL1sq4= @@ -1630,9 +1597,7 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/prometheus v2.3.2+incompatible/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/prometheus/tsdb v0.8.0/go.mod h1:fSI0j+IUQrDd7+ZtR9WKIGtoYAYAJUKcKhYLG25tN4g= github.com/qri-io/starlib v0.4.2-0.20200213133954-ff2e8cd5ef8d/go.mod h1:7DPO4domFU579Ga6E61sB9VFNaniPVwJP5C4bBCu3wA= github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= github.com/quasilyte/go-ruleguard v0.2.0/go.mod h1:2RT/tf0Ce0UDj5y243iWKosQogJd8+1G3Rs2fxmlYnw= @@ -1714,7 +1679,6 @@ github.com/softlayer/softlayer-go v1.0.3 h1:9FONm5xzQ9belQtbdryR6gBg4EF6hX6lrjNK github.com/softlayer/softlayer-go v1.0.3/go.mod h1:6HepcfAXROz0Rf63krk5hPZyHT6qyx2MNvYyHof7ik4= github.com/softlayer/xmlrpc v0.0.0-20200409220501-5f089df7cb7e h1:3OgWYFw7jxCZPcvAg+4R8A50GZ+CCkARF10lxu2qDsQ= github.com/softlayer/xmlrpc v0.0.0-20200409220501-5f089df7cb7e/go.mod h1:fKZCUVdirrxrBpwd9wb+lSoVixvpwAu8eHzbQB2tums= -github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= @@ -1893,7 +1857,6 @@ github.com/zclconf/go-cty v1.1.1/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLE github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.4.0/go.mod h1:nHzOclRkoj++EU9ZjSrZvRG0BXIWt8c7loYc0qXAFGQ= -github.com/zclconf/go-cty v1.5.1/go.mod h1:nHzOclRkoj++EU9ZjSrZvRG0BXIWt8c7loYc0qXAFGQ= github.com/zclconf/go-cty v1.6.1 h1:wHtZ+LSSQVwUSb+XIJ5E9hgAQxyWATZsAWT+ESJ9dQ0= github.com/zclconf/go-cty v1.6.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= @@ -1924,7 +1887,6 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.starlark.net v0.0.0-20190528202925-30ae18b8564f/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= -go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1932,13 +1894,11 @@ go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= @@ -1971,7 +1931,6 @@ golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= -golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -2049,7 +2008,6 @@ golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -2082,7 +2040,6 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 h1:ADo5wSpq2gqaCGQWzk7S5vd//0iyyLeAratkEoG5dLE= golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190130055435-99b60b757ec1/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190319182350-c85d3e98c914/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2119,7 +2076,6 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2142,7 +2098,6 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190927073244-c990c680b611/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2211,7 +2166,6 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2339,7 +2293,6 @@ google.golang.org/api v0.25.0 h1:LodzhlzZEUfhXzNUMIfVlf9Gr6Ua5MMtoFWh7+f47qA= google.golang.org/api v0.25.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -2415,10 +2368,8 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.1.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -2446,12 +2397,8 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.6 h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc= honnef.co/go/tools v0.0.1-2020.1.6/go.mod h1:pyyisuGw24ruLjrr1ddx39WE0y9OooInRzEYLhQB2YY= -k8s.io/api v0.0.0-20181115043458-b799cb063522/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190409092523-d687e77c8ae9/go.mod h1:FQEUn50aaytlU65qqBn/w+5ugllHwrBzKm7DzbnXdzE= -k8s.io/api v0.0.0-20190725062911-6607c48751ae/go.mod h1:1O0xzX/RAtnm7l+5VEUxZ1ysO2ghatfq/OZED4zM9kA= -k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= -k8s.io/api v0.16.4/go.mod h1:AtzMnsR45tccQss5q8RnF+W8L81DH6XwXwo/joEx9u0= k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= k8s.io/api v0.18.0-beta.2/go.mod h1:2oeNnWEqcSmaM/ibSh3t7xcIqbkGXhzZdn4ezV9T4m0= k8s.io/api v0.18.0/go.mod h1:q2HRQkfDzHMBZL9l/y9rH63PkQl4vae0xRT+8prbrK8= @@ -2467,8 +2414,6 @@ k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= k8s.io/api v0.22.1 h1:ISu3tD/jRhYfSW8jI/Q1e+lRxkR7w9UwQEZ7FgslrwY= k8s.io/api v0.22.1/go.mod h1:bh13rkTp3F1XEaLGykbyRD2QaTTzPm0e/BMd8ptFONY= -k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783/go.mod h1:xvae1SZB3E17UpV59AWc271W/Ph25N+bjPyR63X6tPY= -k8s.io/apiextensions-apiserver v0.16.4/go.mod h1:HYQwjujEkXmQNhap2C9YDdIVOSskGZ3et0Mvjcyjbto= k8s.io/apiextensions-apiserver v0.18.0-beta.2/go.mod h1:Hnrg5jx8/PbxRbUoqDGxtQkULjwx8FDW4WYJaKNK+fk= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.19.0/go.mod h1:znfQxNpjqz/ZehvbfMg5N6fvBJW5Lqu5HVLTJQdP4Fs= @@ -2477,12 +2422,8 @@ k8s.io/apiextensions-apiserver v0.20.0/go.mod h1:ZH+C33L2Bh1LY1+HphoRmN1IQVLTShV k8s.io/apiextensions-apiserver v0.21.0-beta.1/go.mod h1:vluMqsJ5+hPgM9UtBhkFSGrfD86KUac9yeKVqpGBZz0= k8s.io/apiextensions-apiserver v0.21.0-rc.0 h1:gxeak4PvTBhuiZagZRFv9WyNnAdG39/VCmI9XTwVCRk= k8s.io/apiextensions-apiserver v0.21.0-rc.0/go.mod h1:ItIoMBJU1gy93Qwr/B2699r4b0VmZqAOU+15BvozxMY= -k8s.io/apimachinery v0.0.0-20181110190943-2a7c93004028/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20190409092423-760d1845f48b/go.mod h1:FW86P8YXVLsbuplGMZeb20J3jYHscrDqw4jELaFJvRU= -k8s.io/apimachinery v0.0.0-20190719140911-bfcf53abc9f8/go.mod h1:sBJWIJZfxLhp7mRsRyuAE/NfKTr3kXGR1iaqg8O0gJo= -k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655/go.mod h1:nL6pwRT8NgfF8TT68DBI8uEePRt89cSvoXUVqbkWHq4= -k8s.io/apimachinery v0.16.4/go.mod h1:llRdnznGEAqC3DcNm6yEj472xaFVfLM7hnYofMb12tQ= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= k8s.io/apimachinery v0.17.3/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0g= k8s.io/apimachinery v0.18.0-beta.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= @@ -2500,8 +2441,6 @@ k8s.io/apimachinery v0.21.1/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswP k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apimachinery v0.22.1 h1:DTARnyzmdHMz7bFWFDDm22AM4pLWTQECMpRTFu2d2OM= k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad/go.mod h1:XPCXEwhjaFN29a8NldXA901ElnKeKLrLtREO9ZhFyhg= -k8s.io/apiserver v0.16.4/go.mod h1:kbLJOak655g6W7C+muqu1F76u9wnEycfKMqbVaXIdAc= k8s.io/apiserver v0.18.0-beta.2/go.mod h1:bnblMkMoCFnIfVnVftd0SXJPzyvrk3RtaqSbblphF/A= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.19.0/go.mod h1:XvzqavYj73931x7FLtyagh8WibHpePJ1QwWrSJs2CLk= @@ -2516,11 +2455,7 @@ k8s.io/cli-runtime v0.21.0-rc.0/go.mod h1:Gp9Njd5Z9IayPHKL8AKVVMrdzHrMHN+WnGMHYC k8s.io/client-go v0.22.0 h1:sD6o9O6tCwUKCENw8v+HFsuAbq2jCu8cWC61/ydwA50= k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= k8s.io/cluster-bootstrap v0.0.0-20190202014938-c9acc0c1bea2/go.mod h1:iBSm2nwo3OaiuW8VDvc3ySDXK5SKfUrxwPvBloKG7zg= -k8s.io/code-generator v0.0.0-20181114232248-ae218e241252/go.mod h1:IPqxl/YHk05nodzupwjke6ctMjyNRdV2zZ5/j3/F204= -k8s.io/code-generator v0.0.0-20190717022600-77f3a1fe56bb/go.mod h1:cDx5jQmWH25Ff74daM7NVYty9JWw9dvIS9zT9eIubCY= -k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269/go.mod h1:V5BD6M4CyaN5m+VthcclXWsVcT1Hu+glwa1bi3MIsyE= k8s.io/code-generator v0.0.0-20191003035328-700b1226c0bd/go.mod h1:HC9p4y3SBN+txSs8x57qmNPXFZ/CxdCHiDTNnocCSEw= -k8s.io/code-generator v0.16.4/go.mod h1:mJUgkl06XV4kstAnLHAIzJPVCOzVR+ZcfPIv4fUsFCY= k8s.io/code-generator v0.18.0-beta.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.0/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= @@ -2532,8 +2467,6 @@ k8s.io/code-generator v0.21.0-beta.1/go.mod h1:IpCUojpiKp25KNB3/UbEeElznqpQUMvhA k8s.io/code-generator v0.21.0-rc.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/code-generator v0.21.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/code-generator v0.22.1/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o= -k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090/go.mod h1:933PBGtQFJky3TEwYx4aEPZ4IxqhWh3R6DCmzqIn1hA= -k8s.io/component-base v0.16.4/go.mod h1:GYQ+4hlkEwdlpAp59Ztc4gYuFhdoZqiAJD1unYDJ3FM= k8s.io/component-base v0.18.0-beta.2/go.mod h1:HVk5FpRnyzQ/MjBr9//e/yEBjTVa2qjGXCTuUzcD7ks= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.19.0/go.mod h1:dKsY8BxkA+9dZIAh2aWJLL/UdASFDNtGYTCItL4LM7Y= @@ -2545,8 +2478,6 @@ k8s.io/component-base v0.21.0-rc.0/go.mod h1:XlP0bM7QJFWRGZYPc5NmphkvsYQ+o7804HW k8s.io/component-base v0.21.0 h1:tLLGp4BBjQaCpS/KiuWh7m2xqvAdsxLm4ATxHSe5Zpg= k8s.io/component-base v0.21.0/go.mod h1:qvtjz6X0USWXbgmbfXR+Agik4RZ3jv2Bgr5QnZzdPYw= k8s.io/component-helpers v0.21.0-rc.0/go.mod h1:A8RfzdPEZoysfI5C0RExdjy7Zy/RZET3tcUmt7BMWdc= -k8s.io/gengo v0.0.0-20181106084056-51747d6e00da/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190907103519-ebc107f98eab/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -2556,8 +2487,6 @@ k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAE k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20190306015804-8e90cee79f82/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.4.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= @@ -2583,7 +2512,6 @@ k8s.io/kubectl v0.21.0-rc.0/go.mod h1:eOKzb5p2/9pNzt2TQpVSzfB/41W6ZMm0JbJEIvyH08 k8s.io/kubelet v0.19.0/go.mod h1:cGds22piF/LnFzfAaIT+efvOYBHVYdunqka6NVuNw9g= k8s.io/metrics v0.21.0-rc.0/go.mod h1:iCF67TNbrhChr/eb99uHt0H1hE7Rd1EC2Ic/yknzIE4= k8s.io/utils v0.0.0-20190529001817-6999998975a7/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200229041039-0a110f9eb7ab/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200327001022-6496210b90e8/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= @@ -2593,11 +2521,6 @@ k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 h1:imL9YgXQ9p7xmPzHFm/vVd/cF78jad+n4wK1ABwYtMM= k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -kubevirt.io/client-go v0.29.0 h1:s8TwjVgELtg5fJ18ipFmwuR17G4p8fOb+u0EJvjj5zk= -kubevirt.io/client-go v0.29.0/go.mod h1:JY7hQq+SUT0aLvleXrW/+28fDfZ6BPe4E6f8FyC8jkY= -kubevirt.io/containerized-data-importer v1.10.6/go.mod h1:qF594BtRRkruyrqLwt3zbLCWdPIQNs1qWh4LR1cOzy0= -kubevirt.io/containerized-data-importer v1.10.9 h1:wYCPyMbCLdn5tlZWW/lPYTMPtIOSfdXDevyWw9rxl2s= -kubevirt.io/containerized-data-importer v1.10.9/go.mod h1:qF594BtRRkruyrqLwt3zbLCWdPIQNs1qWh4LR1cOzy0= layeh.com/radius v0.0.0-20190322222518-890bc1058917/go.mod h1:fywZKyu//X7iRzaxLgPWsvc0L26IUpVvE/aeIL2JtIQ= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= @@ -2634,9 +2557,6 @@ sigs.k8s.io/kustomize/kustomize/v4 v4.0.5/go.mod h1:C7rYla7sI8EnxHE/xEhRBSHMNfcL sigs.k8s.io/kustomize/kyaml v0.9.1/go.mod h1:UTm64bSWVdBUA8EQoYCxVOaBQxUdIOr5LKWxA4GNbkw= sigs.k8s.io/kustomize/kyaml v0.10.15 h1:dSLgG78KyaxN4HylPXdK+7zB3k7sW6q3IcCmcfKA+aI= sigs.k8s.io/kustomize/kyaml v0.10.15/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg= -sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= -sigs.k8s.io/structured-merge-diff v1.0.1 h1:LOs1LZWMsz1xs77Phr/pkB4LFaavH7IVq/3+WTN9XTA= -sigs.k8s.io/structured-merge-diff v1.0.1/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= diff --git a/pkg/asset/cluster/kubevirt/OWNERS b/pkg/asset/cluster/kubevirt/OWNERS deleted file mode 100644 index c81b62d00a3..00000000000 --- a/pkg/asset/cluster/kubevirt/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md -# This file just uses aliases defined in OWNERS_ALIASES. - -approvers: - - kubevirt-approvers -reviewers: - - kubevirt-reviewers diff --git a/pkg/asset/cluster/kubevirt/kubevirt.go b/pkg/asset/cluster/kubevirt/kubevirt.go deleted file mode 100644 index 98071a4196e..00000000000 --- a/pkg/asset/cluster/kubevirt/kubevirt.go +++ /dev/null @@ -1,17 +0,0 @@ -// Package kubevirt extracts Kubevirt metadata from install configurations. -package kubevirt - -import ( - kubevirtutils "github.com/openshift/cluster-api-provider-kubevirt/pkg/utils" - "github.com/openshift/installer/pkg/types" - "github.com/openshift/installer/pkg/types/kubevirt" -) - -// Metadata converts an install configuration to kubevirt metadata. -func Metadata(infraID string, config *types.InstallConfig) *kubevirt.Metadata { - labels := kubevirtutils.BuildLabels(infraID) - return &kubevirt.Metadata{ - Namespace: config.Kubevirt.Namespace, - Labels: labels, - } -} diff --git a/pkg/asset/cluster/metadata.go b/pkg/asset/cluster/metadata.go index 06c1ee9682f..1d27379af58 100644 --- a/pkg/asset/cluster/metadata.go +++ b/pkg/asset/cluster/metadata.go @@ -13,7 +13,6 @@ import ( "github.com/openshift/installer/pkg/asset/cluster/baremetal" "github.com/openshift/installer/pkg/asset/cluster/gcp" "github.com/openshift/installer/pkg/asset/cluster/ibmcloud" - "github.com/openshift/installer/pkg/asset/cluster/kubevirt" "github.com/openshift/installer/pkg/asset/cluster/libvirt" "github.com/openshift/installer/pkg/asset/cluster/openstack" "github.com/openshift/installer/pkg/asset/cluster/ovirt" @@ -26,7 +25,6 @@ import ( baremetaltypes "github.com/openshift/installer/pkg/types/baremetal" gcptypes "github.com/openshift/installer/pkg/types/gcp" ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud" - kubevirttypes "github.com/openshift/installer/pkg/types/kubevirt" libvirttypes "github.com/openshift/installer/pkg/types/libvirt" nonetypes "github.com/openshift/installer/pkg/types/none" openstacktypes "github.com/openshift/installer/pkg/types/openstack" @@ -91,8 +89,6 @@ func (m *Metadata) Generate(parents asset.Parents) (err error) { metadata.ClusterPlatformMetadata.Ovirt = ovirt.Metadata(installConfig.Config) case vspheretypes.Name: metadata.ClusterPlatformMetadata.VSphere = vsphere.Metadata(installConfig.Config) - case kubevirttypes.Name: - metadata.ClusterPlatformMetadata.Kubevirt = kubevirt.Metadata(clusterID.InfraID, installConfig.Config) case nonetypes.Name: default: return errors.Errorf("no known platform") diff --git a/pkg/asset/cluster/tfvars.go b/pkg/asset/cluster/tfvars.go index ad9835d8473..6bc5f7edc62 100644 --- a/pkg/asset/cluster/tfvars.go +++ b/pkg/asset/cluster/tfvars.go @@ -12,8 +12,6 @@ import ( "github.com/ghodss/yaml" gcpprovider "github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1" ibmcloudprovider "github.com/openshift/cluster-api-provider-ibmcloud/pkg/apis/ibmcloudprovider/v1beta1" - kubevirtprovider "github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1" - kubevirtutils "github.com/openshift/cluster-api-provider-kubevirt/pkg/utils" libvirtprovider "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1beta1" ovirtprovider "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" vsphereprovider "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" @@ -43,7 +41,6 @@ import ( baremetaltfvars "github.com/openshift/installer/pkg/tfvars/baremetal" gcptfvars "github.com/openshift/installer/pkg/tfvars/gcp" ibmcloudtfvars "github.com/openshift/installer/pkg/tfvars/ibmcloud" - kubevirttfvars "github.com/openshift/installer/pkg/tfvars/kubevirt" libvirttfvars "github.com/openshift/installer/pkg/tfvars/libvirt" openstacktfvars "github.com/openshift/installer/pkg/tfvars/openstack" ovirttfvars "github.com/openshift/installer/pkg/tfvars/ovirt" @@ -54,7 +51,6 @@ import ( "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" "github.com/openshift/installer/pkg/types/ibmcloud" - "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/none" "github.com/openshift/installer/pkg/types/openstack" @@ -637,32 +633,6 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error { Filename: fmt.Sprintf(TfPlatformVarsFileName, platform), Data: data, }) - case kubevirt.Name: - masters, err := mastersAsset.Machines() - if err != nil { - return err - } - masterSpecs := make([]*kubevirtprovider.KubevirtMachineProviderSpec, len(masters)) - for i, m := range masters { - masterSpecs[i] = m.Spec.ProviderSpec.Value.Object.(*kubevirtprovider.KubevirtMachineProviderSpec) - } - - labels := kubevirtutils.BuildLabels(clusterID.InfraID) - data, err := kubevirttfvars.TFVars( - kubevirttfvars.TFVarsSources{ - MasterSpecs: masterSpecs, - ImageURL: string(*rhcosImage), - Namespace: installConfig.Config.Kubevirt.Namespace, - ResourcesLabels: labels, - }, - ) - if err != nil { - return errors.Wrapf(err, "failed to get %s Terraform variables", platform) - } - t.FileList = append(t.FileList, &asset.File{ - Filename: fmt.Sprintf(TfPlatformVarsFileName, platform), - Data: data, - }) default: logrus.Warnf("unrecognized platform %s", platform) diff --git a/pkg/asset/ignition/bootstrap/common.go b/pkg/asset/ignition/bootstrap/common.go index f9ee0a26a5d..ad26e4388ef 100644 --- a/pkg/asset/ignition/bootstrap/common.go +++ b/pkg/asset/ignition/bootstrap/common.go @@ -641,8 +641,6 @@ func apiVIP(p *types.Platform) string { return p.VSphere.APIVIP case p.Ovirt != nil: return p.Ovirt.APIVIP - case p.Kubevirt != nil: - return p.Kubevirt.APIVIP default: return "" } diff --git a/pkg/asset/ignition/machine/node.go b/pkg/asset/ignition/machine/node.go index 2bdadd5cabd..0fc05c1d8e7 100644 --- a/pkg/asset/ignition/machine/node.go +++ b/pkg/asset/ignition/machine/node.go @@ -13,7 +13,6 @@ import ( "github.com/openshift/installer/pkg/asset/ignition" "github.com/openshift/installer/pkg/types" baremetaltypes "github.com/openshift/installer/pkg/types/baremetal" - kubevirttypes "github.com/openshift/installer/pkg/types/kubevirt" openstacktypes "github.com/openshift/installer/pkg/types/openstack" ovirttypes "github.com/openshift/installer/pkg/types/ovirt" vspheretypes "github.com/openshift/installer/pkg/types/vsphere" @@ -42,8 +41,6 @@ func pointerIgnitionConfig(installConfig *types.InstallConfig, rootCA []byte, ro if installConfig.VSphere.APIVIP != "" { ignitionHost = net.JoinHostPort(installConfig.VSphere.APIVIP, "22623") } - case kubevirttypes.Name: - ignitionHost = net.JoinHostPort(installConfig.Kubevirt.APIVIP, "22623") } return &igntypes.Config{ Ignition: igntypes.Ignition{ diff --git a/pkg/asset/installconfig/installconfig.go b/pkg/asset/installconfig/installconfig.go index 100862595cc..10257264a45 100644 --- a/pkg/asset/installconfig/installconfig.go +++ b/pkg/asset/installconfig/installconfig.go @@ -14,7 +14,6 @@ import ( icazure "github.com/openshift/installer/pkg/asset/installconfig/azure" icgcp "github.com/openshift/installer/pkg/asset/installconfig/gcp" icibmcloud "github.com/openshift/installer/pkg/asset/installconfig/ibmcloud" - ickubevirt "github.com/openshift/installer/pkg/asset/installconfig/kubevirt" icopenstack "github.com/openshift/installer/pkg/asset/installconfig/openstack" icovirt "github.com/openshift/installer/pkg/asset/installconfig/ovirt" icvsphere "github.com/openshift/installer/pkg/asset/installconfig/vsphere" @@ -94,7 +93,6 @@ func (a *InstallConfig) Generate(parents asset.Parents) error { a.Config.IBMCloud = platform.IBMCloud a.Config.BareMetal = platform.BareMetal a.Config.Ovirt = platform.Ovirt - a.Config.Kubevirt = platform.Kubevirt return a.finish("") } @@ -208,12 +206,5 @@ func (a *InstallConfig) platformValidation() error { if a.Config.Platform.OpenStack != nil { return icopenstack.Validate(a.Config) } - if a.Config.Platform.Kubevirt != nil { - client, err := ickubevirt.NewClient() - if err != nil { - return err - } - return ickubevirt.Validate(a.Config, client) - } return field.ErrorList{}.ToAggregate() } diff --git a/pkg/asset/installconfig/kubevirt/OWNERS b/pkg/asset/installconfig/kubevirt/OWNERS deleted file mode 100644 index c81b62d00a3..00000000000 --- a/pkg/asset/installconfig/kubevirt/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md -# This file just uses aliases defined in OWNERS_ALIASES. - -approvers: - - kubevirt-approvers -reviewers: - - kubevirt-reviewers diff --git a/pkg/asset/installconfig/kubevirt/client.go b/pkg/asset/installconfig/kubevirt/client.go deleted file mode 100644 index 9e72b06d45f..00000000000 --- a/pkg/asset/installconfig/kubevirt/client.go +++ /dev/null @@ -1,262 +0,0 @@ -package kubevirt - -import ( - "context" - "fmt" - - nadv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" - "github.com/pkg/errors" - authv1 "k8s.io/api/authorization/v1" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/client-go/dynamic" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" - cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1" -) - -//go:generate mockgen -source=./client.go -destination=./mock/client_generated.go -package=mock - -// Client is a wrapper object for actual infra-cluster clients: kubernetes and the kubevirt -type Client interface { - GetVirtualMachine(ctx context.Context, namespace string, name string) (*kubevirtapiv1.VirtualMachine, error) - ListVirtualMachine(ctx context.Context, namespace string, opts metav1.ListOptions) (*kubevirtapiv1.VirtualMachineList, error) - DeleteVirtualMachine(ctx context.Context, namespace string, name string) error - GetDataVolume(ctx context.Context, namespace string, name string) (*cdiv1.DataVolume, error) - ListDataVolume(ctx context.Context, namespace string, opts metav1.ListOptions) (*cdiv1.DataVolumeList, error) - DeleteDataVolume(ctx context.Context, namespace string, name string) error - GetSecret(ctx context.Context, namespace string, name string) (*corev1.Secret, error) - ListSecret(ctx context.Context, namespace string, opts metav1.ListOptions) (*corev1.SecretList, error) - DeleteSecret(ctx context.Context, namespace string, name string) error - GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error) - GetStorageClass(ctx context.Context, name string) (*storagev1.StorageClass, error) - GetNetworkAttachmentDefinition(ctx context.Context, name string, namespace string) (*unstructured.Unstructured, error) - CreateSelfSubjectAccessReview(ctx context.Context, reviewObj *authv1.SelfSubjectAccessReview) (*authv1.SelfSubjectAccessReview, error) - GetKubeVirt(ctx context.Context, name string, namespace string) (*unstructured.Unstructured, error) -} - -type client struct { - kubernetesClient *kubernetes.Clientset - dynamicClient dynamic.Interface -} - -var ( - vmRes = schema.GroupVersionResource{ - Group: kubevirtapiv1.GroupVersion.Group, - Version: kubevirtapiv1.GroupVersion.Version, - Resource: "virtualmachines", - } - - dvRes = schema.GroupVersionResource{ - Group: cdiv1.SchemeGroupVersion.Group, - Version: cdiv1.SchemeGroupVersion.Version, - Resource: "datavolumes", - } -) - -// LoadKubeConfigContent returns the kubeconfig file content -func LoadKubeConfigContent() ([]byte, error) { - loadingRules := clientcmd.NewDefaultClientConfigLoadingRules() - configOverrides := &clientcmd.ConfigOverrides{} - clientConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, configOverrides) - rawConfig, err := clientConfig.RawConfig() - if err != nil { - return nil, err - } - - // Remove anything that is not related to the current context from the result rawConfig - currentContextValue := rawConfig.Contexts[rawConfig.CurrentContext] - if currentContextValue == nil { - return nil, fmt.Errorf("currentContext is not included in rawConfig.Contexts") - } - - rawConfig.Contexts = map[string]*clientcmdapi.Context{ - rawConfig.CurrentContext: currentContextValue, - } - - if v, ok := rawConfig.Clusters[currentContextValue.Cluster]; ok { - rawConfig.Clusters = map[string]*clientcmdapi.Cluster{ - currentContextValue.Cluster: v, - } - } - - if v, ok := rawConfig.AuthInfos[currentContextValue.AuthInfo]; ok { - rawConfig.AuthInfos = map[string]*clientcmdapi.AuthInfo{ - currentContextValue.AuthInfo: v, - } - } - - return clientcmd.Write(rawConfig) -} - -// NewClient creates our client wrapper object for the actual kubeVirt and kubernetes clients we use. -func NewClient() (Client, error) { - loadingRules := clientcmd.NewDefaultClientConfigLoadingRules() - configOverrides := &clientcmd.ConfigOverrides{} - - kubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, configOverrides) - restClientConfig, err := kubeConfig.ClientConfig() - if err != nil { - return nil, err - } - - kubernetesClient, err := kubernetes.NewForConfig(restClientConfig) - if err != nil { - return nil, err - } - dynamicClient, err := dynamic.NewForConfig(restClientConfig) - if err != nil { - return nil, err - } - - return &client{ - kubernetesClient: kubernetesClient, - dynamicClient: dynamicClient, - }, nil -} - -func (c *client) GetVirtualMachine(ctx context.Context, namespace string, name string) (*kubevirtapiv1.VirtualMachine, error) { - resp, err := c.getResource(ctx, namespace, name, vmRes) - if err != nil { - if apierrors.IsNotFound(err) { - return nil, err - } - return nil, errors.Wrap(err, "failed to get VirtualMachine") - } - var vm kubevirtapiv1.VirtualMachine - err = c.fromUnstructedToInterface(*resp, &vm, "VirtualMachine") - return &vm, err -} - -func (c *client) ListVirtualMachine(ctx context.Context, namespace string, opts metav1.ListOptions) (*kubevirtapiv1.VirtualMachineList, error) { - resp, err := c.listResource(ctx, namespace, vmRes, opts) - if err != nil { - return nil, errors.Wrap(err, "failed to list VirtualMachine") - } - var vmList kubevirtapiv1.VirtualMachineList - err = c.fromUnstructedListToInterface(*resp, &vmList, "VirtualMachineList") - return &vmList, err -} - -func (c *client) DeleteVirtualMachine(ctx context.Context, namespace string, name string) error { - return c.deleteResource(ctx, namespace, name, vmRes) -} - -func (c *client) GetDataVolume(ctx context.Context, namespace string, name string) (*cdiv1.DataVolume, error) { - resp, err := c.getResource(ctx, namespace, name, dvRes) - if err != nil { - if apierrors.IsNotFound(err) { - return nil, err - } - return nil, errors.Wrap(err, "failed to get DataVolume") - } - var dv cdiv1.DataVolume - err = c.fromUnstructedToInterface(*resp, &dv, "DataVolume") - return &dv, err -} - -func (c *client) ListDataVolume(ctx context.Context, namespace string, opts metav1.ListOptions) (*cdiv1.DataVolumeList, error) { - resp, err := c.listResource(ctx, namespace, dvRes, opts) - if err != nil { - return nil, errors.Wrap(err, "failed to list DataVolume") - } - var dvList cdiv1.DataVolumeList - err = c.fromUnstructedListToInterface(*resp, &dvList, "DataVolumeList") - return &dvList, err -} - -func (c *client) DeleteDataVolume(ctx context.Context, namespace string, name string) error { - return c.deleteResource(ctx, namespace, name, dvRes) -} - -func (c *client) GetSecret(ctx context.Context, namespace string, name string) (*corev1.Secret, error) { - return c.kubernetesClient.CoreV1().Secrets(namespace).Get(ctx, name, metav1.GetOptions{}) -} - -func (c *client) ListSecret(ctx context.Context, namespace string, opts metav1.ListOptions) (*corev1.SecretList, error) { - return c.kubernetesClient.CoreV1().Secrets(namespace).List(ctx, opts) -} - -func (c *client) DeleteSecret(ctx context.Context, namespace string, name string) error { - return c.kubernetesClient.CoreV1().Secrets(namespace).Delete(ctx, name, metav1.DeleteOptions{}) -} - -func (c *client) GetNamespace(ctx context.Context, name string) (*corev1.Namespace, error) { - return c.kubernetesClient.CoreV1().Namespaces().Get(ctx, name, metav1.GetOptions{}) -} - -func (c *client) GetStorageClass(ctx context.Context, name string) (*storagev1.StorageClass, error) { - return c.kubernetesClient.StorageV1().StorageClasses().Get(ctx, name, metav1.GetOptions{}) -} - -func (c *client) GetNetworkAttachmentDefinition(ctx context.Context, name string, namespace string) (*unstructured.Unstructured, error) { - nadRes := schema.GroupVersionResource{ - Group: nadv1.SchemeGroupVersion.Group, - Version: nadv1.SchemeGroupVersion.Version, - Resource: "network-attachment-definitions", - } - return c.getResource(ctx, namespace, name, nadRes) -} - -func (c *client) CreateSelfSubjectAccessReview(ctx context.Context, reviewObj *authv1.SelfSubjectAccessReview) (*authv1.SelfSubjectAccessReview, error) { - return c.kubernetesClient.AuthorizationV1().SelfSubjectAccessReviews().Create(ctx, reviewObj, metav1.CreateOptions{}) -} - -func (c *client) GetKubeVirt(ctx context.Context, name string, namespace string) (*unstructured.Unstructured, error) { - resource := schema.GroupVersionResource{ - Group: "kubevirt.io", - Version: "v1alpha3", - Resource: "kubevirts", - } - return c.getResource(ctx, namespace, name, resource) -} - -func (c *client) createResource(ctx context.Context, obj interface{}, namespace string, resource schema.GroupVersionResource) error { - resultMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj) - if err != nil { - return errors.Wrapf(err, "failed to translate %s to Unstructed (for create operation)", resource.Resource) - } - input := unstructured.Unstructured{} - input.SetUnstructuredContent(resultMap) - resp, err := c.dynamicClient.Resource(resource).Namespace(namespace).Create(ctx, &input, metav1.CreateOptions{}) - if err != nil { - return errors.Wrapf(err, "failed to create %s", resource.Resource) - } - unstructured := resp.UnstructuredContent() - return runtime.DefaultUnstructuredConverter.FromUnstructured(unstructured, obj) -} - -func (c *client) getResource(ctx context.Context, namespace string, name string, resource schema.GroupVersionResource) (*unstructured.Unstructured, error) { - return c.dynamicClient.Resource(resource).Namespace(namespace).Get(ctx, name, metav1.GetOptions{}) -} - -func (c *client) deleteResource(ctx context.Context, namespace string, name string, resource schema.GroupVersionResource) error { - return c.dynamicClient.Resource(resource).Namespace(namespace).Delete(ctx, name, metav1.DeleteOptions{}) -} - -func (c *client) listResource(ctx context.Context, namespace string, resource schema.GroupVersionResource, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { - return c.dynamicClient.Resource(resource).Namespace(namespace).List(ctx, opts) -} - -func (c *client) fromUnstructedToInterface(src unstructured.Unstructured, dst interface{}, interfaceType string) error { - unstructured := src.UnstructuredContent() - if err := runtime.DefaultUnstructuredConverter.FromUnstructured(unstructured, dst); err != nil { - return errors.Wrapf(err, "failed to translate unstructed to %s", interfaceType) - } - return nil -} - -func (c *client) fromUnstructedListToInterface(src unstructured.UnstructuredList, dst interface{}, interfaceType string) error { - unstructured := src.UnstructuredContent() - if err := runtime.DefaultUnstructuredConverter.FromUnstructured(unstructured, dst); err != nil { - return errors.Wrapf(err, "failed to translate unstructed to %s", interfaceType) - } - return nil -} diff --git a/pkg/asset/installconfig/kubevirt/kubevirt.go b/pkg/asset/installconfig/kubevirt/kubevirt.go deleted file mode 100644 index 64586c1d402..00000000000 --- a/pkg/asset/installconfig/kubevirt/kubevirt.go +++ /dev/null @@ -1,98 +0,0 @@ -package kubevirt - -import ( - "github.com/AlecAivazis/survey/v2" - - "github.com/openshift/installer/pkg/types/kubevirt" -) - -// Platform collects kubevirt-specific configuration. -func Platform() (*kubevirt.Platform, error) { - var ( - namespace, apiVIP, ingressVIP, networkName string - err error - ) - - if namespace, err = selectNamespace(); err != nil { - return nil, err - } - - if apiVIP, err = selectAPIVIP(); err != nil { - return nil, err - } - - if ingressVIP, err = selectIngressVIP(); err != nil { - return nil, err - } - - if networkName, err = selectNetworkName(); err != nil { - return nil, err - } - - return &kubevirt.Platform{ - Namespace: namespace, - APIVIP: apiVIP, - IngressVIP: ingressVIP, - NetworkName: networkName, - }, nil -} - -func selectNamespace() (string, error) { - var selectedNamespace string - - err := survey.Ask([]*survey.Question{ - { - Prompt: &survey.Input{ - Message: "Namespace", - Help: "The namespace, in the infracluster, where all the resources of the tenantcluster would be created.", - }, - }, - }, &selectedNamespace) - - return selectedNamespace, err -} - -func selectAPIVIP() (string, error) { - var selectedAPIVIP string - - err := survey.Ask([]*survey.Question{ - { - Prompt: &survey.Input{ - Message: "API VIP", - Help: "The Virtual IP address used for external access to the OpenShift API.", - }, - }, - }, &selectedAPIVIP) - - return selectedAPIVIP, err -} - -func selectIngressVIP() (string, error) { - var selectedIngressVIP string - - err := survey.Ask([]*survey.Question{ - { - Prompt: &survey.Input{ - Message: "Ingress VIP", - Help: "An external IP which routes to the default ingress controller.", - }, - }, - }, &selectedIngressVIP) - - return selectedIngressVIP, err -} - -func selectNetworkName() (string, error) { - var selectedNetworkName string - - err := survey.Ask([]*survey.Question{ - { - Prompt: &survey.Input{ - Message: "Network Name", - Help: "The target network of all the network interfaces of the nodes.", - }, - }, - }, &selectedNetworkName) - - return selectedNetworkName, err -} diff --git a/pkg/asset/installconfig/kubevirt/mock/client_generated.go b/pkg/asset/installconfig/kubevirt/mock/client_generated.go deleted file mode 100644 index 3dbd01b9f51..00000000000 --- a/pkg/asset/installconfig/kubevirt/mock/client_generated.go +++ /dev/null @@ -1,248 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: ./client.go - -// Package mock is a generated GoMock package. -package mock - -import ( - context "context" - gomock "github.com/golang/mock/gomock" - v1 "k8s.io/api/authorization/v1" - v10 "k8s.io/api/core/v1" - v11 "k8s.io/api/storage/v1" - v12 "k8s.io/apimachinery/pkg/apis/meta/v1" - unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - v13 "kubevirt.io/client-go/api/v1" - v1alpha1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1" - reflect "reflect" -) - -// MockClient is a mock of Client interface -type MockClient struct { - ctrl *gomock.Controller - recorder *MockClientMockRecorder -} - -// MockClientMockRecorder is the mock recorder for MockClient -type MockClientMockRecorder struct { - mock *MockClient -} - -// NewMockClient creates a new mock instance -func NewMockClient(ctrl *gomock.Controller) *MockClient { - mock := &MockClient{ctrl: ctrl} - mock.recorder = &MockClientMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockClient) EXPECT() *MockClientMockRecorder { - return m.recorder -} - -// GetVirtualMachine mocks base method -func (m *MockClient) GetVirtualMachine(ctx context.Context, namespace, name string) (*v13.VirtualMachine, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetVirtualMachine", ctx, namespace, name) - ret0, _ := ret[0].(*v13.VirtualMachine) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetVirtualMachine indicates an expected call of GetVirtualMachine -func (mr *MockClientMockRecorder) GetVirtualMachine(ctx, namespace, name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVirtualMachine", reflect.TypeOf((*MockClient)(nil).GetVirtualMachine), ctx, namespace, name) -} - -// ListVirtualMachine mocks base method -func (m *MockClient) ListVirtualMachine(ctx context.Context, namespace string, opts v12.ListOptions) (*v13.VirtualMachineList, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListVirtualMachine", ctx, namespace, opts) - ret0, _ := ret[0].(*v13.VirtualMachineList) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListVirtualMachine indicates an expected call of ListVirtualMachine -func (mr *MockClientMockRecorder) ListVirtualMachine(ctx, namespace, opts interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListVirtualMachine", reflect.TypeOf((*MockClient)(nil).ListVirtualMachine), ctx, namespace, opts) -} - -// DeleteVirtualMachine mocks base method -func (m *MockClient) DeleteVirtualMachine(ctx context.Context, namespace, name string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteVirtualMachine", ctx, namespace, name) - ret0, _ := ret[0].(error) - return ret0 -} - -// DeleteVirtualMachine indicates an expected call of DeleteVirtualMachine -func (mr *MockClientMockRecorder) DeleteVirtualMachine(ctx, namespace, name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVirtualMachine", reflect.TypeOf((*MockClient)(nil).DeleteVirtualMachine), ctx, namespace, name) -} - -// GetDataVolume mocks base method -func (m *MockClient) GetDataVolume(ctx context.Context, namespace, name string) (*v1alpha1.DataVolume, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetDataVolume", ctx, namespace, name) - ret0, _ := ret[0].(*v1alpha1.DataVolume) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetDataVolume indicates an expected call of GetDataVolume -func (mr *MockClientMockRecorder) GetDataVolume(ctx, namespace, name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDataVolume", reflect.TypeOf((*MockClient)(nil).GetDataVolume), ctx, namespace, name) -} - -// ListDataVolume mocks base method -func (m *MockClient) ListDataVolume(ctx context.Context, namespace string, opts v12.ListOptions) (*v1alpha1.DataVolumeList, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListDataVolume", ctx, namespace, opts) - ret0, _ := ret[0].(*v1alpha1.DataVolumeList) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListDataVolume indicates an expected call of ListDataVolume -func (mr *MockClientMockRecorder) ListDataVolume(ctx, namespace, opts interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListDataVolume", reflect.TypeOf((*MockClient)(nil).ListDataVolume), ctx, namespace, opts) -} - -// DeleteDataVolume mocks base method -func (m *MockClient) DeleteDataVolume(ctx context.Context, namespace, name string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteDataVolume", ctx, namespace, name) - ret0, _ := ret[0].(error) - return ret0 -} - -// DeleteDataVolume indicates an expected call of DeleteDataVolume -func (mr *MockClientMockRecorder) DeleteDataVolume(ctx, namespace, name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDataVolume", reflect.TypeOf((*MockClient)(nil).DeleteDataVolume), ctx, namespace, name) -} - -// GetSecret mocks base method -func (m *MockClient) GetSecret(ctx context.Context, namespace, name string) (*v10.Secret, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSecret", ctx, namespace, name) - ret0, _ := ret[0].(*v10.Secret) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetSecret indicates an expected call of GetSecret -func (mr *MockClientMockRecorder) GetSecret(ctx, namespace, name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSecret", reflect.TypeOf((*MockClient)(nil).GetSecret), ctx, namespace, name) -} - -// ListSecret mocks base method -func (m *MockClient) ListSecret(ctx context.Context, namespace string, opts v12.ListOptions) (*v10.SecretList, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListSecret", ctx, namespace, opts) - ret0, _ := ret[0].(*v10.SecretList) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ListSecret indicates an expected call of ListSecret -func (mr *MockClientMockRecorder) ListSecret(ctx, namespace, opts interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSecret", reflect.TypeOf((*MockClient)(nil).ListSecret), ctx, namespace, opts) -} - -// DeleteSecret mocks base method -func (m *MockClient) DeleteSecret(ctx context.Context, namespace, name string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteSecret", ctx, namespace, name) - ret0, _ := ret[0].(error) - return ret0 -} - -// DeleteSecret indicates an expected call of DeleteSecret -func (mr *MockClientMockRecorder) DeleteSecret(ctx, namespace, name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSecret", reflect.TypeOf((*MockClient)(nil).DeleteSecret), ctx, namespace, name) -} - -// GetNamespace mocks base method -func (m *MockClient) GetNamespace(ctx context.Context, name string) (*v10.Namespace, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetNamespace", ctx, name) - ret0, _ := ret[0].(*v10.Namespace) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetNamespace indicates an expected call of GetNamespace -func (mr *MockClientMockRecorder) GetNamespace(ctx, name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNamespace", reflect.TypeOf((*MockClient)(nil).GetNamespace), ctx, name) -} - -// GetStorageClass mocks base method -func (m *MockClient) GetStorageClass(ctx context.Context, name string) (*v11.StorageClass, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetStorageClass", ctx, name) - ret0, _ := ret[0].(*v11.StorageClass) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetStorageClass indicates an expected call of GetStorageClass -func (mr *MockClientMockRecorder) GetStorageClass(ctx, name interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageClass", reflect.TypeOf((*MockClient)(nil).GetStorageClass), ctx, name) -} - -// GetNetworkAttachmentDefinition mocks base method -func (m *MockClient) GetNetworkAttachmentDefinition(ctx context.Context, name, namespace string) (*unstructured.Unstructured, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetNetworkAttachmentDefinition", ctx, name, namespace) - ret0, _ := ret[0].(*unstructured.Unstructured) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetNetworkAttachmentDefinition indicates an expected call of GetNetworkAttachmentDefinition -func (mr *MockClientMockRecorder) GetNetworkAttachmentDefinition(ctx, name, namespace interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNetworkAttachmentDefinition", reflect.TypeOf((*MockClient)(nil).GetNetworkAttachmentDefinition), ctx, name, namespace) -} - -// CreateSelfSubjectAccessReview mocks base method -func (m *MockClient) CreateSelfSubjectAccessReview(ctx context.Context, reviewObj *v1.SelfSubjectAccessReview) (*v1.SelfSubjectAccessReview, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreateSelfSubjectAccessReview", ctx, reviewObj) - ret0, _ := ret[0].(*v1.SelfSubjectAccessReview) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CreateSelfSubjectAccessReview indicates an expected call of CreateSelfSubjectAccessReview -func (mr *MockClientMockRecorder) CreateSelfSubjectAccessReview(ctx, reviewObj interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSelfSubjectAccessReview", reflect.TypeOf((*MockClient)(nil).CreateSelfSubjectAccessReview), ctx, reviewObj) -} - -// GetKubeVirt mocks base method -func (m *MockClient) GetKubeVirt(ctx context.Context, name, namespace string) (*unstructured.Unstructured, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetKubeVirt", ctx, name, namespace) - ret0, _ := ret[0].(*unstructured.Unstructured) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetKubeVirt indicates an expected call of GetKubeVirt -func (mr *MockClientMockRecorder) GetKubeVirt(ctx, name, namespace interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetKubeVirt", reflect.TypeOf((*MockClient)(nil).GetKubeVirt), ctx, name, namespace) -} diff --git a/pkg/asset/installconfig/kubevirt/validation.go b/pkg/asset/installconfig/kubevirt/validation.go deleted file mode 100644 index ef98db931e6..00000000000 --- a/pkg/asset/installconfig/kubevirt/validation.go +++ /dev/null @@ -1,368 +0,0 @@ -package kubevirt - -import ( - "context" - "fmt" - "strings" - - "github.com/openshift/installer/pkg/types" - authv1 "k8s.io/api/authorization/v1" - unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/util/validation/field" -) - -// Validate executes kubevirt specific validation -func Validate(ic *types.InstallConfig, client Client) error { - allErrs := field.ErrorList{} - fldPath := field.NewPath("platform", "kubevirt") - kubevirtPlatform := ic.Platform.Kubevirt - - allErrs = append(allErrs, validateNamespace(kubevirtPlatform.Namespace, client, fldPath.Child("namespace"))...) - allErrs = append(allErrs, validateStorageClassExistsInInfraCluster(kubevirtPlatform.StorageClass, client, fldPath.Child("storageClass"))...) - allErrs = append(allErrs, validateNetworkAttachmentDefinitionExistsInNamespace(kubevirtPlatform.NetworkName, kubevirtPlatform.Namespace, client, fldPath.Child("networkName"))...) - - return allErrs.ToAggregate() -} - -// ValidatePermissions tests that the current user has the required permissions -// Some permissions are required for the installation -// In addition, the current user is used for accessing the kubevirt/platfrom cluster from tenant cluster. E.g. list VMIs -func ValidatePermissions(client Client, ic *types.InstallConfig) error { - // Prepare requests for permissions check - reviewObjs := createReviewObjs(ic.Platform.Kubevirt.Namespace) - - // Collection of missing permissions - var notAllowedObjs []*authv1.SelfSubjectAccessReview - - // Test each permission - for _, reviewObj := range reviewObjs { - reviewObjPointer, err := client.CreateSelfSubjectAccessReview(context.Background(), &reviewObj) - if err != nil { - return err - } - - if !reviewObjPointer.Status.Allowed { - notAllowedObjs = append(notAllowedObjs, reviewObjPointer) - } - } - - // Put all missing permissions in one error message - if len(notAllowedObjs) > 0 { - var notAllowed []string - for _, obj := range notAllowedObjs { - notAllowed = append(notAllowed, fmt.Sprintf("%+v", *obj.Spec.ResourceAttributes)) - } - - return fmt.Errorf("the user is missing the following permissions: %s", strings.Join(notAllowed, ", ")) - } - - return nil -} - -// ValidateForProvisioning is called by PlatformProvisionCheck -func ValidateForProvisioning(client Client) error { - kvUnstructured, err := client.GetKubeVirt(context.Background(), "kubevirt-kubevirt-hyperconverged", "openshift-cnv") - if err != nil { - return fmt.Errorf("failed to get resource openshift-cnv/kubevirt-kubevirt-hyperconverged, with error: %v", err) - } - - fgSlice, found, err := unstructured.NestedStringSlice(kvUnstructured.Object, "spec", "configuration", "developerConfiguration", "featureGates") - if err != nil { - return fmt.Errorf("failed to read list of enabled feature gates 'spec.configuration.developerConfiguration.featureGates' from KubeVirt resource openshift-cnv/kubevirt-kubevirt-hyperconverged, with error: %v", err) - } - - if !found || !contains(fgSlice, "HotplugVolumes") { - return fmt.Errorf("feature gate hotplugVolumes is either missing or not set to true. Review resource openshift-cnv/kubevirt-hyperconverged. Follow Kubevirt CSI driver documentation for setting the feature gate (https://github.com/openshift/kubevirt-csi-driver)") - } - - return nil -} - -func validateStorageClassExistsInInfraCluster(name string, client Client, fieldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - // StorageClass can be empty string, in this case will use default Storage Class - // Therefore, make the call to the cluster only if its not empty string - if name == "" { - return allErrs - } - if _, err := client.GetStorageClass(context.Background(), name); err != nil { - allErrs = append( - allErrs, - field.Invalid( - fieldPath, - name, - fmt.Sprintf("failed to get StorageClass from InfraCluster, with error: %v", err), - ), - ) - } - - return allErrs -} - -// validateNetworkAttachmentDefinitionExistsInNamespace validate the following: -// 1. The namespace exists -// 2. The network-attachment-definition exists -func validateNetworkAttachmentDefinitionExistsInNamespace(name string, namespace string, client Client, fieldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if _, err := client.GetNetworkAttachmentDefinition(context.Background(), name, namespace); err != nil { - allErrs = append( - allErrs, - field.Invalid( - fieldPath, - name, - fmt.Sprintf("failed to get network-attachment-definition from InfraCluster, with error: %v", err), - ), - ) - } - - return allErrs -} - -func validateNamespace(namespace string, client Client, fieldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - ns, err := client.GetNamespace(context.Background(), namespace) - if err != nil { - allErrs = append( - allErrs, - field.Invalid( - fieldPath, - namespace, - fmt.Sprintf("failed to get namepsace, with error: %v", err), - ), - ) - return allErrs - } - labelRequiredKey := "mutatevirtualmachines.kubemacpool.io" - labelRequiredVal := "allocate" - labelVal, ok := ns.Labels[labelRequiredKey] - if !ok || labelVal != labelRequiredVal { - allErrs = append( - allErrs, - field.Invalid( - fieldPath, - namespace, - fmt.Sprintf("KubeMacPool component is not enabled for the namespace, the namespace must have label \"%s: %s\"", labelRequiredKey, labelRequiredVal), - ), - ) - } - - return allErrs -} - -// createReviewObjs creates requests for testing user permissions -func createReviewObjs(namespace string) []authv1.SelfSubjectAccessReview { - return []authv1.SelfSubjectAccessReview{ - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: "openshift-cnv", - Group: "hco.kubevirt.io", - Resource: "hyperconvergeds", - Verb: "get", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "", - Resource: "secrets", - Verb: "get", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "", - Resource: "secrets", - Verb: "list", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "", - Resource: "secrets", - Verb: "create", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "", - Resource: "secrets", - Verb: "delete", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "", - Resource: "namespaces", - Verb: "get", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "kubevirt.io", - Resource: "virtualmachines", - Verb: "get", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "kubevirt.io", - Resource: "virtualmachines", - Verb: "list", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "kubevirt.io", - Resource: "virtualmachines", - Verb: "create", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "kubevirt.io", - Resource: "virtualmachines", - Verb: "delete", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "kubevirt.io", - Resource: "virtualmachines", - Verb: "update", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "kubevirt.io", - Resource: "virtualmachineinstances", - Verb: "get", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "kubevirt.io", - Resource: "virtualmachineinstances", - Verb: "list", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "cdi.kubevirt.io", - Resource: "datavolumes", - Verb: "get", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "cdi.kubevirt.io", - Resource: "datavolumes", - Verb: "list", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "cdi.kubevirt.io", - Resource: "datavolumes", - Verb: "create", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "cdi.kubevirt.io", - Resource: "datavolumes", - Verb: "delete", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "k8s.cni.cncf.io", - Resource: "network-attachment-definitions", - Verb: "get", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "subresources.kubevirt.io", - Resource: "virtualmachineinstances/addvolume", - Verb: "update", - }, - }, - }, - { - Spec: authv1.SelfSubjectAccessReviewSpec{ - ResourceAttributes: &authv1.ResourceAttributes{ - Namespace: namespace, - Group: "subresources.kubevirt.io", - Resource: "virtualmachineinstances/removevolume", - Verb: "update", - }, - }, - }, - } -} - -func contains(slice []string, target string) bool { - for _, item := range slice { - if item == target { - return true - } - } - return false -} diff --git a/pkg/asset/installconfig/kubevirt/validation_test.go b/pkg/asset/installconfig/kubevirt/validation_test.go deleted file mode 100644 index 0867d004eb3..00000000000 --- a/pkg/asset/installconfig/kubevirt/validation_test.go +++ /dev/null @@ -1,338 +0,0 @@ -package kubevirt - -import ( - "context" - "fmt" - "testing" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/assert" - - "github.com/openshift/installer/pkg/asset/installconfig/kubevirt/mock" - "github.com/openshift/installer/pkg/ipnet" - "github.com/openshift/installer/pkg/types" - "github.com/openshift/installer/pkg/types/kubevirt" - authv1 "k8s.io/api/authorization/v1" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -var ( - validNamespace = "valid-namespace" - validStorageClass = "valid-storage-class" - validNetworkName = "valid-network-name" - validAPIVIP = "192.168.123.15" - validIngressVIP = "192.168.123.20" - validAccessMode = "valid-access-mode" - validMachineCIDR = "192.168.123.0/24" - invalidKubeconfigPath = "invalid-kubeconfig-path" - invalidNamespace = "invalid-namespace" - invalidStorageClass = "invalid-storage-class" - invalidNetworkName = "invalid-network-name" - invalidAPIVIP = "invalid-api-vip" - invalidIngressVIP = "invalid-ingress-vip" - invalidAccessMode = "invalid-access-mode" - invalidMachineCIDR = "10.0.0.0/16" - namespaceStruct = &corev1.Namespace{} - kubeMacPoolLabels = map[string]string{"mutatevirtualmachines.kubemacpool.io": "allocate"} - kvNamespace = "openshift-cnv" - kvCrName = "kubevirt-kubevirt-hyperconverged" - kvValidCr = unstructured.Unstructured{} - kvInvalidCr = unstructured.Unstructured{} -) - -func validInstallConfig() *types.InstallConfig { - return &types.InstallConfig{ - Networking: &types.Networking{ - MachineNetwork: []types.MachineNetworkEntry{ - {CIDR: *ipnet.MustParseCIDR(invalidMachineCIDR)}, - {CIDR: *ipnet.MustParseCIDR(validMachineCIDR)}, - {CIDR: *ipnet.MustParseCIDR(invalidMachineCIDR)}, - }, - }, - Platform: types.Platform{ - Kubevirt: &kubevirt.Platform{ - Namespace: validNamespace, - StorageClass: validStorageClass, - NetworkName: validNetworkName, - APIVIP: validAPIVIP, - IngressVIP: validIngressVIP, - PersistentVolumeAccessMode: validAccessMode, - }, - }, - } -} - -func TestKubevirtInstallConfigValidation(t *testing.T) { - cases := []struct { - name string - edit func(ic *types.InstallConfig) - expectedError bool - expectedErrMsg string - expectClient func(kubevirtClient *mock.MockClient) - }{ - { - name: "valid", - edit: nil, - expectedError: false, - expectedErrMsg: "", - expectClient: func(kubevirtClient *mock.MockClient) { - kubevirtClient.EXPECT().GetNetworkAttachmentDefinition(gomock.Any(), validNetworkName, validNamespace).Return(nil, nil).AnyTimes() - kubevirtClient.EXPECT().GetStorageClass(gomock.Any(), validStorageClass).Return(nil, nil).AnyTimes() - namespaceStruct.Labels = kubeMacPoolLabels - kubevirtClient.EXPECT().GetNamespace(gomock.Any(), validNamespace).Return(namespaceStruct, nil).AnyTimes() - }, - }, - { - name: "valid one machine network", - edit: func(ic *types.InstallConfig) { - ic.Networking.MachineNetwork = []types.MachineNetworkEntry{ - {CIDR: *ipnet.MustParseCIDR(validMachineCIDR)}, - } - }, - expectedError: false, - expectedErrMsg: "", - expectClient: func(kubevirtClient *mock.MockClient) { - kubevirtClient.EXPECT().GetNetworkAttachmentDefinition(gomock.Any(), validNetworkName, validNamespace).Return(nil, nil).AnyTimes() - kubevirtClient.EXPECT().GetStorageClass(gomock.Any(), validStorageClass).Return(nil, nil).AnyTimes() - namespaceStruct.Labels = kubeMacPoolLabels - kubevirtClient.EXPECT().GetNamespace(gomock.Any(), validNamespace).Return(namespaceStruct, nil).AnyTimes() - }, - }, - { - name: "invalid storage class", - edit: func(ic *types.InstallConfig) { ic.Platform.Kubevirt.StorageClass = invalidStorageClass }, - expectedError: true, - expectedErrMsg: "platform.kubevirt.storageClass: Invalid value: \"invalid-storage-class\": failed to get StorageClass from InfraCluster, with error: test", - expectClient: func(kubevirtClient *mock.MockClient) { - kubevirtClient.EXPECT().GetNetworkAttachmentDefinition(gomock.Any(), validNetworkName, validNamespace).Return(nil, nil).AnyTimes() - kubevirtClient.EXPECT().GetStorageClass(gomock.Any(), invalidStorageClass).Return(nil, fmt.Errorf("test")).AnyTimes() - namespaceStruct.Labels = kubeMacPoolLabels - kubevirtClient.EXPECT().GetNamespace(gomock.Any(), validNamespace).Return(namespaceStruct, nil).AnyTimes() - }, - }, - { - name: "invalid network name", - edit: func(ic *types.InstallConfig) { ic.Platform.Kubevirt.NetworkName = invalidNetworkName }, - expectedError: true, - expectedErrMsg: "platform.kubevirt.networkName: Invalid value: \"invalid-network-name\": failed to get network-attachment-definition from InfraCluster, with error: test", - expectClient: func(kubevirtClient *mock.MockClient) { - kubevirtClient.EXPECT().GetNetworkAttachmentDefinition(gomock.Any(), invalidNetworkName, validNamespace).Return(nil, fmt.Errorf("test")).AnyTimes() - kubevirtClient.EXPECT().GetStorageClass(gomock.Any(), validStorageClass).Return(nil, nil).AnyTimes() - namespaceStruct.Labels = kubeMacPoolLabels - kubevirtClient.EXPECT().GetNamespace(gomock.Any(), validNamespace).Return(namespaceStruct, nil).AnyTimes() - }, - }, - { - name: "invalid kubemacpool namespace not found", - edit: nil, - expectedError: true, - expectedErrMsg: "platform.kubevirt.namespace: Invalid value: \"valid-namespace\": failed to get namepsace, with error: test", - expectClient: func(kubevirtClient *mock.MockClient) { - kubevirtClient.EXPECT().GetNetworkAttachmentDefinition(gomock.Any(), validNetworkName, validNamespace).Return(nil, nil).AnyTimes() - kubevirtClient.EXPECT().GetStorageClass(gomock.Any(), validStorageClass).Return(nil, nil).AnyTimes() - namespaceStruct.Labels = kubeMacPoolLabels - kubevirtClient.EXPECT().GetNamespace(gomock.Any(), validNamespace).Return(nil, fmt.Errorf("test")).AnyTimes() - }, - }, - { - name: "invalid kubemacpool Labels nil", - edit: nil, - expectedError: true, - expectedErrMsg: "platform.kubevirt.namespace: Invalid value: \"valid-namespace\": KubeMacPool component is not enabled for the namespace, the namespace must have label \"mutatevirtualmachines.kubemacpool.io: allocate\"", - expectClient: func(kubevirtClient *mock.MockClient) { - kubevirtClient.EXPECT().GetNetworkAttachmentDefinition(gomock.Any(), validNetworkName, validNamespace).Return(nil, nil).AnyTimes() - kubevirtClient.EXPECT().GetStorageClass(gomock.Any(), validStorageClass).Return(nil, nil).AnyTimes() - namespaceStruct.Labels = nil - kubevirtClient.EXPECT().GetNamespace(gomock.Any(), validNamespace).Return(namespaceStruct, nil).AnyTimes() - }, - }, - { - name: "invalid kubemacpool Labels empty", - edit: nil, - expectedError: true, - expectedErrMsg: "platform.kubevirt.namespace: Invalid value: \"valid-namespace\": KubeMacPool component is not enabled for the namespace, the namespace must have label \"mutatevirtualmachines.kubemacpool.io: allocate\"", - expectClient: func(kubevirtClient *mock.MockClient) { - kubevirtClient.EXPECT().GetNetworkAttachmentDefinition(gomock.Any(), validNetworkName, validNamespace).Return(nil, nil).AnyTimes() - kubevirtClient.EXPECT().GetStorageClass(gomock.Any(), validStorageClass).Return(nil, nil).AnyTimes() - namespaceStruct.Labels = map[string]string{} - kubevirtClient.EXPECT().GetNamespace(gomock.Any(), validNamespace).Return(namespaceStruct, nil).AnyTimes() - }, - }, - { - name: "invalid kubemacpool wrong label val", - edit: nil, - expectedError: true, - expectedErrMsg: "platform.kubevirt.namespace: Invalid value: \"valid-namespace\": KubeMacPool component is not enabled for the namespace, the namespace must have label \"mutatevirtualmachines.kubemacpool.io: allocate\"", - expectClient: func(kubevirtClient *mock.MockClient) { - kubevirtClient.EXPECT().GetNetworkAttachmentDefinition(gomock.Any(), validNetworkName, validNamespace).Return(nil, nil).AnyTimes() - kubevirtClient.EXPECT().GetStorageClass(gomock.Any(), validStorageClass).Return(nil, nil).AnyTimes() - namespaceStruct.Labels = map[string]string{"mutatevirtualmachines.kubemacpool.io": "wrong value"} - kubevirtClient.EXPECT().GetNamespace(gomock.Any(), validNamespace).Return(namespaceStruct, nil).AnyTimes() - }, - }, - } - - mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - installConfig := validInstallConfig() - if tc.edit != nil { - tc.edit(installConfig) - } - - kubevirtClient := mock.NewMockClient(mockCtrl) - if tc.expectClient != nil { - tc.expectClient(kubevirtClient) - } - - errs := Validate(installConfig, kubevirtClient) - if tc.expectedError { - assert.Regexp(t, tc.expectedErrMsg, errs) - } else { - assert.Empty(t, errs) - } - }) - } -} - -func TestValidatePermissions(t *testing.T) { - mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() - - t.Run("All permissions are set", func(t *testing.T) { - client := mock.NewMockClient(mockCtrl) - client.EXPECT().CreateSelfSubjectAccessReview(gomock.Any(), gomock.Any()).DoAndReturn( - func(ctx context.Context, reviewObj *authv1.SelfSubjectAccessReview) (*authv1.SelfSubjectAccessReview, error) { - reviewObj.Status.Allowed = true - return reviewObj, nil - }, - ).AnyTimes() - err := ValidatePermissions(client, validInstallConfig()) - assert.Nil(t, err) - }) - - t.Run("Get VMI permission is missing", func(t *testing.T) { - client := mock.NewMockClient(mockCtrl) - client.EXPECT().CreateSelfSubjectAccessReview(gomock.Any(), gomock.Any()).DoAndReturn( - func(ctx context.Context, reviewObj *authv1.SelfSubjectAccessReview) (*authv1.SelfSubjectAccessReview, error) { - if reviewObj.Spec.ResourceAttributes.Resource == "virtualmachineinstances" && - reviewObj.Spec.ResourceAttributes.Verb == "get" { - reviewObj.Status.Allowed = false - } else { - reviewObj.Status.Allowed = true - } - - return reviewObj, nil - }, - ).AnyTimes() - err := ValidatePermissions(client, validInstallConfig()) - assert.NotNil(t, err) - }) -} - -func TestValidationForProvisioning(t *testing.T) { - createKvObjects() - - mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() - - // HotplugVolumes feature is always enabled by HCO in version 4.8.0. - // For backward compitability, we are now checking that kubevirt CR is configured - // with hotPlugVolumes feature gate. - t.Run("Missing Kubevirt CR", func(t *testing.T) { - client := mock.NewMockClient(mockCtrl) - client.EXPECT().GetKubeVirt(gomock.Any(), kvCrName, kvNamespace).Return(nil, fmt.Errorf("test")).AnyTimes() - err := ValidateForProvisioning(client) - assert.NotNil(t, err) - }) - - t.Run("HotplugVolumes feature gate is NOT set on KubeVirt CR", func(t *testing.T) { - client := mock.NewMockClient(mockCtrl) - client.EXPECT().GetKubeVirt(gomock.Any(), kvCrName, kvNamespace).Return(&kvInvalidCr, nil).AnyTimes() - err := ValidateForProvisioning(client) - assert.NotNil(t, err) - }) - - t.Run("HotplugVolumes feature gate is set on KubeVirt CR", func(t *testing.T) { - client := mock.NewMockClient(mockCtrl) - client.EXPECT().GetKubeVirt(gomock.Any(), kvCrName, kvNamespace).Return(&kvValidCr, nil).AnyTimes() - err := ValidateForProvisioning(client) - assert.Nil(t, err) - }) -} - -func createKvObjects() { - kvValidCrJSON := `{ - "apiVersion": "kubevirt.io/v1", - "kind": "KubeVirt", - "metadata": { - "name": "kubevirt-kubevirt-hyperconverged", - "namespace": "openshift-cnv" - }, - "spec": { - "configuration": { - "developerConfiguration": { - "featureGates": [ - "DataVolumes", - "SRIOV", - "LiveMigration", - "CPUManager", - "CPUNodeDiscovery", - "Snapshot", - "HotplugVolumes", - "GPU", - "HostDevices", - "WithHostModelCPU", - "HypervStrictCheck" - ] - } - }, - "customizeComponents": {}, - "infra": {}, - "uninstallStrategy": "BlockUninstallIfWorkloadsExist", - "workloadUpdateStrategy": {} - } - }` - - kvInvalidCrJSON := `{ - "apiVersion": "kubevirt.io/v1", - "kind": "KubeVirt", - "metadata": { - "name": "kubevirt-kubevirt-hyperconverged", - "namespace": "openshift-cnv" - }, - "spec": { - "configuration": { - "developerConfiguration": { - "featureGates": [ - "DataVolumes", - "SRIOV", - "LiveMigration", - "CPUManager", - "CPUNodeDiscovery", - "Snapshot", - "GPU", - "HostDevices", - "WithHostModelCPU", - "HypervStrictCheck" - ] - } - }, - "customizeComponents": {}, - "infra": {}, - "uninstallStrategy": "BlockUninstallIfWorkloadsExist", - "workloadUpdateStrategy": {} - } - }` - err := kvValidCr.UnmarshalJSON([]byte(kvValidCrJSON)) - if err != nil { - panic(err) - } - err = kvInvalidCr.UnmarshalJSON([]byte(kvInvalidCrJSON)) - if err != nil { - panic(err) - } -} diff --git a/pkg/asset/installconfig/networking.go b/pkg/asset/installconfig/networking.go index e035ca92909..510646fc78b 100644 --- a/pkg/asset/installconfig/networking.go +++ b/pkg/asset/installconfig/networking.go @@ -4,9 +4,7 @@ import ( survey "github.com/AlecAivazis/survey/v2" "github.com/openshift/installer/pkg/asset" - "github.com/openshift/installer/pkg/ipnet" "github.com/openshift/installer/pkg/types" - "github.com/openshift/installer/pkg/types/kubevirt" ) type networking struct { @@ -26,21 +24,6 @@ func (a *networking) Dependencies() []asset.Asset { func (a *networking) Generate(parents asset.Parents) error { platform := &platform{} parents.Get(platform) - - switch platform.CurrentName() { - case kubevirt.Name: - selectedCIDR, err := selectMachineNetworkCIDR() - if err != nil { - return err - } - CIDR, err := ipnet.ParseCIDR(selectedCIDR) - if err != nil { - return err - } - a.machineNetwork = []types.MachineNetworkEntry{ - {CIDR: *CIDR}, - } - } return nil } diff --git a/pkg/asset/installconfig/platform.go b/pkg/asset/installconfig/platform.go index 322bc6bfc3a..9ae0a27096b 100644 --- a/pkg/asset/installconfig/platform.go +++ b/pkg/asset/installconfig/platform.go @@ -14,7 +14,6 @@ import ( baremetalconfig "github.com/openshift/installer/pkg/asset/installconfig/baremetal" gcpconfig "github.com/openshift/installer/pkg/asset/installconfig/gcp" ibmcloudconfig "github.com/openshift/installer/pkg/asset/installconfig/ibmcloud" - kubevirtconfig "github.com/openshift/installer/pkg/asset/installconfig/kubevirt" libvirtconfig "github.com/openshift/installer/pkg/asset/installconfig/libvirt" openstackconfig "github.com/openshift/installer/pkg/asset/installconfig/openstack" ovirtconfig "github.com/openshift/installer/pkg/asset/installconfig/ovirt" @@ -25,7 +24,6 @@ import ( "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" "github.com/openshift/installer/pkg/types/ibmcloud" - "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/none" "github.com/openshift/installer/pkg/types/openstack" @@ -101,11 +99,6 @@ func (a *platform) Generate(asset.Parents) error { if err != nil { return err } - case kubevirt.Name: - a.Kubevirt, err = kubevirtconfig.Platform() - if err != nil { - return err - } default: return fmt.Errorf("unknown platform type %q", platform) } diff --git a/pkg/asset/installconfig/platformcredscheck.go b/pkg/asset/installconfig/platformcredscheck.go index 62a58b5913d..919dc00abd7 100644 --- a/pkg/asset/installconfig/platformcredscheck.go +++ b/pkg/asset/installconfig/platformcredscheck.go @@ -9,7 +9,6 @@ import ( "github.com/openshift/installer/pkg/asset" gcpconfig "github.com/openshift/installer/pkg/asset/installconfig/gcp" ibmcloudconfig "github.com/openshift/installer/pkg/asset/installconfig/ibmcloud" - kubevirtconfig "github.com/openshift/installer/pkg/asset/installconfig/kubevirt" openstackconfig "github.com/openshift/installer/pkg/asset/installconfig/openstack" ovirtconfig "github.com/openshift/installer/pkg/asset/installconfig/ovirt" "github.com/openshift/installer/pkg/types/aws" @@ -17,13 +16,11 @@ import ( "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" "github.com/openshift/installer/pkg/types/ibmcloud" - "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/none" "github.com/openshift/installer/pkg/types/openstack" "github.com/openshift/installer/pkg/types/ovirt" "github.com/openshift/installer/pkg/types/vsphere" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // PlatformCredsCheck is an asset that checks the platform credentials, asks for them or errors out if invalid @@ -85,15 +82,6 @@ func (a *PlatformCredsCheck) Generate(dependencies asset.Parents) error { if err != nil { return errors.Wrap(err, "testing Engine connection") } - case kubevirt.Name: - client, err := kubevirtconfig.NewClient() - if err != nil { - return errors.Wrap(err, "creating KubeVirt client") - } - // Test the connection to InfraCluster by calling ListVM API - if _, err = client.ListVirtualMachine(context.Background(), ic.Config.Platform.Kubevirt.Namespace, metav1.ListOptions{}); err != nil { - return errors.Wrap(err, "testing KubeVirt connection") - } default: err = fmt.Errorf("unknown platform type %q", platform) } diff --git a/pkg/asset/installconfig/platformpermscheck.go b/pkg/asset/installconfig/platformpermscheck.go index 14242115b5a..f8953c04ee8 100644 --- a/pkg/asset/installconfig/platformpermscheck.go +++ b/pkg/asset/installconfig/platformpermscheck.go @@ -9,13 +9,11 @@ import ( "github.com/openshift/installer/pkg/asset" awsconfig "github.com/openshift/installer/pkg/asset/installconfig/aws" gcpconfig "github.com/openshift/installer/pkg/asset/installconfig/gcp" - kubevirtconfig "github.com/openshift/installer/pkg/asset/installconfig/kubevirt" "github.com/openshift/installer/pkg/types/aws" "github.com/openshift/installer/pkg/types/azure" "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" "github.com/openshift/installer/pkg/types/ibmcloud" - "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/none" "github.com/openshift/installer/pkg/types/openstack" @@ -88,16 +86,6 @@ func (a *PlatformPermsCheck) Generate(dependencies asset.Parents) error { } case ibmcloud.Name: // TODO: IBM[#90]: platformpermscheck - case kubevirt.Name: - client, err := kubevirtconfig.NewClient() - if err != nil { - return err - } - - err = kubevirtconfig.ValidatePermissions(client, ic.Config) - if err != nil { - return errors.Wrap(err, "Kubevirt permissions validation failed") - } case azure.Name, baremetal.Name, libvirt.Name, none.Name, openstack.Name, ovirt.Name, vsphere.Name: // no permissions to check default: diff --git a/pkg/asset/installconfig/platformprovisioncheck.go b/pkg/asset/installconfig/platformprovisioncheck.go index 3aa02edce28..55de0396c6f 100644 --- a/pkg/asset/installconfig/platformprovisioncheck.go +++ b/pkg/asset/installconfig/platformprovisioncheck.go @@ -10,7 +10,6 @@ import ( bmconfig "github.com/openshift/installer/pkg/asset/installconfig/baremetal" gcpconfig "github.com/openshift/installer/pkg/asset/installconfig/gcp" ibmcloudconfig "github.com/openshift/installer/pkg/asset/installconfig/ibmcloud" - kubevirtconfig "github.com/openshift/installer/pkg/asset/installconfig/kubevirt" osconfig "github.com/openshift/installer/pkg/asset/installconfig/openstack" ovirtconfig "github.com/openshift/installer/pkg/asset/installconfig/ovirt" vsconfig "github.com/openshift/installer/pkg/asset/installconfig/vsphere" @@ -19,7 +18,6 @@ import ( "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" "github.com/openshift/installer/pkg/types/ibmcloud" - "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/none" "github.com/openshift/installer/pkg/types/openstack" @@ -101,15 +99,6 @@ func (a *PlatformProvisionCheck) Generate(dependencies asset.Parents) error { if err != nil { return err } - case kubevirt.Name: - client, err := kubevirtconfig.NewClient() - if err != nil { - return err - } - err = kubevirtconfig.ValidateForProvisioning(client) - if err != nil { - return err - } case ovirt.Name: err = ovirtconfig.ValidateForProvisioning(ic.Config) if err != nil { diff --git a/pkg/asset/machines/kubevirt/OWNERS b/pkg/asset/machines/kubevirt/OWNERS deleted file mode 100644 index c81b62d00a3..00000000000 --- a/pkg/asset/machines/kubevirt/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md -# This file just uses aliases defined in OWNERS_ALIASES. - -approvers: - - kubevirt-approvers -reviewers: - - kubevirt-reviewers diff --git a/pkg/asset/machines/kubevirt/machines.go b/pkg/asset/machines/kubevirt/machines.go deleted file mode 100644 index 0507acc9ee3..00000000000 --- a/pkg/asset/machines/kubevirt/machines.go +++ /dev/null @@ -1,82 +0,0 @@ -// Package kubevirt generates Machine objects for kubevirt. -package kubevirt - -import ( - "fmt" - - machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - - "github.com/openshift/installer/pkg/types" - "github.com/openshift/installer/pkg/types/kubevirt" - - kubevirtprovider "github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1" -) - -// Machines returns a list of machines for a machinepool. -func Machines(clusterID string, config *types.InstallConfig, pool *types.MachinePool, osImage, role, userDataSecret string) ([]machineapi.Machine, error) { - if configPlatform := config.Platform.Name(); configPlatform != kubevirt.Name { - return nil, fmt.Errorf("non-kubevirt configuration: %q", configPlatform) - } - if poolPlatform := pool.Platform.Name(); poolPlatform != kubevirt.Name { - return nil, fmt.Errorf("non-kubevirt machine-pool: %q", poolPlatform) - } - platform := config.Platform.Kubevirt - - total := int64(1) - if pool.Replicas != nil { - total = *pool.Replicas - } - provider := provider(clusterID, platform, pool, userDataSecret, config) - var machines []machineapi.Machine - for idx := int64(0); idx < total; idx++ { - machine := machineapi.Machine{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "machine.openshift.io/v1beta1", - Kind: "Machine", - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: "openshift-machine-api", - Name: fmt.Sprintf("%s-%s-%d", clusterID, pool.Name, idx), - Labels: map[string]string{ - "machine.openshift.io/cluster-api-cluster": clusterID, - "machine.openshift.io/cluster-api-machine-role": role, - "machine.openshift.io/cluster-api-machine-type": role, - }, - }, - Spec: machineapi.MachineSpec{ - ProviderSpec: machineapi.ProviderSpec{ - Value: &runtime.RawExtension{Object: provider}, - }, - // we don't need to set Versions, because we control those via cluster operators. - }, - } - machines = append(machines, machine) - } - - return machines, nil -} - -func provider(clusterID string, platform *kubevirt.Platform, pool *types.MachinePool, userDataSecret string, config *types.InstallConfig) *kubevirtprovider.KubevirtMachineProviderSpec { - interfaceBindingMethod := "InterfaceBridge" - if config.Kubevirt.InterfaceBindingMethod != "" { - interfaceBindingMethod = "Interface" + config.Kubevirt.InterfaceBindingMethod - } - spec := kubevirtprovider.KubevirtMachineProviderSpec{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "kubevirtproviderconfig.openshift.io/v1alpha1", - Kind: "KubevirtMachineProviderSpec", - }, - SourcePvcName: fmt.Sprintf("%s-source-pvc", clusterID), - RequestedMemory: pool.Platform.Kubevirt.Memory, - RequestedCPU: pool.Platform.Kubevirt.CPU, - RequestedStorage: pool.Platform.Kubevirt.StorageSize, - StorageClassName: platform.StorageClass, - IgnitionSecretName: userDataSecret, - NetworkName: platform.NetworkName, - InterfaceBindingMethod: interfaceBindingMethod, - PersistentVolumeAccessMode: platform.PersistentVolumeAccessMode, - } - return &spec -} diff --git a/pkg/asset/machines/kubevirt/machinesets.go b/pkg/asset/machines/kubevirt/machinesets.go deleted file mode 100644 index f6198bfeb95..00000000000 --- a/pkg/asset/machines/kubevirt/machinesets.go +++ /dev/null @@ -1,77 +0,0 @@ -// Package kubevirt generates Machine objects for kubevirt. -package kubevirt - -import ( - "fmt" - - machineapi "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/utils/pointer" - - "github.com/openshift/installer/pkg/types" - "github.com/openshift/installer/pkg/types/kubevirt" -) - -// MachineSets returns a list of machinesets for a machinepool. -func MachineSets(clusterID string, config *types.InstallConfig, pool *types.MachinePool, osImage, role, - userDataSecret string) ([]*machineapi.MachineSet, error) { - - if configPlatform := config.Platform.Name(); configPlatform != kubevirt.Name { - return nil, fmt.Errorf("non-kubevirt configuration: %q", configPlatform) - } - if poolPlatform := pool.Platform.Name(); poolPlatform != kubevirt.Name { - return nil, fmt.Errorf("non-kubevirt machine-pool: %q", poolPlatform) - } - platform := config.Platform.Kubevirt - - total := int64(0) - if pool.Replicas != nil { - total = *pool.Replicas - } - - provider := provider(clusterID, platform, pool, userDataSecret, config) - name := fmt.Sprintf("%s-%s", clusterID, pool.Name) - mset := &machineapi.MachineSet{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "machine.openshift.io/v1beta1", - Kind: "MachineSet", - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: "openshift-machine-api", - Name: name, - Labels: map[string]string{ - "machine.openshift.io/cluster-api-cluster": clusterID, - "machine.openshift.io/cluster-api-machine-role": role, - "machine.openshift.io/cluster-api-machine-type": role, - }, - }, - Spec: machineapi.MachineSetSpec{ - Replicas: pointer.Int32Ptr(int32(total)), - Selector: metav1.LabelSelector{ - MatchLabels: map[string]string{ - "machine.openshift.io/cluster-api-machineset": name, - "machine.openshift.io/cluster-api-cluster": clusterID, - }, - }, - Template: machineapi.MachineTemplateSpec{ - ObjectMeta: machineapi.ObjectMeta{ - Labels: map[string]string{ - "machine.openshift.io/cluster-api-machineset": name, - "machine.openshift.io/cluster-api-cluster": clusterID, - "machine.openshift.io/cluster-api-machine-role": role, - "machine.openshift.io/cluster-api-machine-type": role, - }, - }, - Spec: machineapi.MachineSpec{ - ProviderSpec: machineapi.ProviderSpec{ - Value: &runtime.RawExtension{Object: provider}, - }, - // we don't need to set Versions, because we control those via cluster operators. - }, - }, - }, - } - - return []*machineapi.MachineSet{mset}, nil -} diff --git a/pkg/asset/machines/master.go b/pkg/asset/machines/master.go index d711b62bebe..19a980a5540 100644 --- a/pkg/asset/machines/master.go +++ b/pkg/asset/machines/master.go @@ -14,8 +14,6 @@ import ( gcpprovider "github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1" ibmcloudapi "github.com/openshift/cluster-api-provider-ibmcloud/pkg/apis" ibmcloudprovider "github.com/openshift/cluster-api-provider-ibmcloud/pkg/apis/ibmcloudprovider/v1beta1" - kubevirtproviderapi "github.com/openshift/cluster-api-provider-kubevirt/pkg/apis" - kubevirtprovider "github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1" libvirtapi "github.com/openshift/cluster-api-provider-libvirt/pkg/apis" libvirtprovider "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1beta1" ovirtproviderapi "github.com/openshift/cluster-api-provider-ovirt/pkg/apis" @@ -43,7 +41,6 @@ import ( "github.com/openshift/installer/pkg/asset/machines/baremetal" "github.com/openshift/installer/pkg/asset/machines/gcp" "github.com/openshift/installer/pkg/asset/machines/ibmcloud" - "github.com/openshift/installer/pkg/asset/machines/kubevirt" "github.com/openshift/installer/pkg/asset/machines/libvirt" "github.com/openshift/installer/pkg/asset/machines/machineconfig" "github.com/openshift/installer/pkg/asset/machines/openstack" @@ -59,7 +56,6 @@ import ( baremetaltypes "github.com/openshift/installer/pkg/types/baremetal" gcptypes "github.com/openshift/installer/pkg/types/gcp" ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud" - kubevirttypes "github.com/openshift/installer/pkg/types/kubevirt" libvirttypes "github.com/openshift/installer/pkg/types/libvirt" nonetypes "github.com/openshift/installer/pkg/types/none" openstacktypes "github.com/openshift/installer/pkg/types/openstack" @@ -390,18 +386,6 @@ func (m *Master) Generate(dependencies asset.Parents) error { return errors.Wrap(err, "failed to create master machine objects") } vsphere.ConfigMasters(machines, clusterID.InfraID) - case kubevirttypes.Name: - mpool := defaultKubevirtMachinePoolPlatform() - mpool.Set(ic.Platform.Kubevirt.DefaultMachinePlatform) - mpool.Set(pool.Platform.Kubevirt) - pool.Platform.Kubevirt = &mpool - - imageName, _ := rhcosutils.GenerateOpenStackImageName(string(*rhcosImage), clusterID.InfraID) - - machines, err = kubevirt.Machines(clusterID.InfraID, ic, &pool, imageName, "master", "master-user-data") - if err != nil { - return errors.Wrap(err, "failed to create master machine objects for kubevirt provider") - } case nonetypes.Name: default: return fmt.Errorf("invalid Platform") @@ -531,7 +515,6 @@ func (m *Master) Machines() ([]machineapi.Machine, error) { openstackapi.AddToScheme(scheme) ovirtproviderapi.AddToScheme(scheme) vsphereapi.AddToScheme(scheme) - kubevirtproviderapi.AddToScheme(scheme) decoder := serializer.NewCodecFactory(scheme).UniversalDecoder( awsprovider.SchemeGroupVersion, azureprovider.SchemeGroupVersion, @@ -542,7 +525,6 @@ func (m *Master) Machines() ([]machineapi.Machine, error) { openstackprovider.SchemeGroupVersion, vsphereprovider.SchemeGroupVersion, ovirtprovider.SchemeGroupVersion, - kubevirtprovider.SchemeGroupVersion, ) machines := []machineapi.Machine{} diff --git a/pkg/asset/machines/worker.go b/pkg/asset/machines/worker.go index b7bca7f0d39..97148e16595 100644 --- a/pkg/asset/machines/worker.go +++ b/pkg/asset/machines/worker.go @@ -14,8 +14,6 @@ import ( gcpprovider "github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1" ibmcloudapi "github.com/openshift/cluster-api-provider-ibmcloud/pkg/apis" ibmcloudprovider "github.com/openshift/cluster-api-provider-ibmcloud/pkg/apis/ibmcloudprovider/v1beta1" - kubevirtproviderapi "github.com/openshift/cluster-api-provider-kubevirt/pkg/apis" - kubevirtprovider "github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1" libvirtapi "github.com/openshift/cluster-api-provider-libvirt/pkg/apis" libvirtprovider "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1beta1" ovirtproviderapi "github.com/openshift/cluster-api-provider-ovirt/pkg/apis" @@ -43,7 +41,6 @@ import ( "github.com/openshift/installer/pkg/asset/machines/baremetal" "github.com/openshift/installer/pkg/asset/machines/gcp" "github.com/openshift/installer/pkg/asset/machines/ibmcloud" - "github.com/openshift/installer/pkg/asset/machines/kubevirt" "github.com/openshift/installer/pkg/asset/machines/libvirt" "github.com/openshift/installer/pkg/asset/machines/machineconfig" "github.com/openshift/installer/pkg/asset/machines/openstack" @@ -59,7 +56,6 @@ import ( baremetaltypes "github.com/openshift/installer/pkg/types/baremetal" gcptypes "github.com/openshift/installer/pkg/types/gcp" ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud" - kubevirttypes "github.com/openshift/installer/pkg/types/kubevirt" libvirttypes "github.com/openshift/installer/pkg/types/libvirt" nonetypes "github.com/openshift/installer/pkg/types/none" openstacktypes "github.com/openshift/installer/pkg/types/openstack" @@ -155,14 +151,6 @@ func defaultVSphereMachinePoolPlatform() vspheretypes.MachinePool { } } -func defaultKubevirtMachinePoolPlatform() kubevirttypes.MachinePool { - return kubevirttypes.MachinePool{ - CPU: 4, - Memory: "16G", - StorageSize: "120Gi", - } -} - func awsDefaultWorkerMachineTypes(region string, arch types.Architecture) []string { classes := awsdefaults.InstanceClasses(region, arch) types := make([]string, len(classes)) @@ -442,21 +430,6 @@ func (w *Worker) Generate(dependencies asset.Parents) error { for _, set := range sets { machineSets = append(machineSets, set) } - case kubevirttypes.Name: - mpool := defaultKubevirtMachinePoolPlatform() - mpool.Set(ic.Platform.Kubevirt.DefaultMachinePlatform) - mpool.Set(pool.Platform.Kubevirt) - pool.Platform.Kubevirt = &mpool - - imageName, _ := rhcosutils.GenerateOpenStackImageName(string(*rhcosImage), clusterID.InfraID) - - sets, err := kubevirt.MachineSets(clusterID.InfraID, ic, &pool, imageName, "worker", "worker-user-data") - if err != nil { - return errors.Wrap(err, "failed to create worker machine objects for kubevirt provider") - } - for _, set := range sets { - machineSets = append(machineSets, set) - } case nonetypes.Name: default: return fmt.Errorf("invalid Platform") @@ -542,7 +515,6 @@ func (w *Worker) MachineSets() ([]machineapi.MachineSet, error) { openstackapi.AddToScheme(scheme) ovirtproviderapi.AddToScheme(scheme) vsphereproviderapi.AddToScheme(scheme) - kubevirtproviderapi.AddToScheme(scheme) decoder := serializer.NewCodecFactory(scheme).UniversalDecoder( awsprovider.SchemeGroupVersion, azureprovider.SchemeGroupVersion, @@ -553,7 +525,6 @@ func (w *Worker) MachineSets() ([]machineapi.MachineSet, error) { openstackprovider.SchemeGroupVersion, ovirtprovider.SchemeGroupVersion, vsphereprovider.SchemeGroupVersion, - kubevirtprovider.SchemeGroupVersion, ) machineSets := []machineapi.MachineSet{} diff --git a/pkg/asset/manifests/cloudproviderconfig.go b/pkg/asset/manifests/cloudproviderconfig.go index d17641f16fc..b5d22708c15 100644 --- a/pkg/asset/manifests/cloudproviderconfig.go +++ b/pkg/asset/manifests/cloudproviderconfig.go @@ -18,7 +18,6 @@ import ( "github.com/openshift/installer/pkg/asset/manifests/azure" gcpmanifests "github.com/openshift/installer/pkg/asset/manifests/gcp" ibmcloudmanifests "github.com/openshift/installer/pkg/asset/manifests/ibmcloud" - kubevirtmanifests "github.com/openshift/installer/pkg/asset/manifests/kubevirt" openstackmanifests "github.com/openshift/installer/pkg/asset/manifests/openstack" vspheremanifests "github.com/openshift/installer/pkg/asset/manifests/vsphere" awstypes "github.com/openshift/installer/pkg/types/aws" @@ -26,7 +25,6 @@ import ( baremetaltypes "github.com/openshift/installer/pkg/types/baremetal" gcptypes "github.com/openshift/installer/pkg/types/gcp" ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud" - kubevirttypes "github.com/openshift/installer/pkg/types/kubevirt" libvirttypes "github.com/openshift/installer/pkg/types/libvirt" nonetypes "github.com/openshift/installer/pkg/types/none" openstacktypes "github.com/openshift/installer/pkg/types/openstack" @@ -211,15 +209,6 @@ func (cpc *CloudProviderConfig) Generate(dependencies asset.Parents) error { return errors.Wrap(err, "could not create cloud provider config") } cm.Data[cloudProviderConfigDataKey] = vsphereConfig - case kubevirttypes.Name: - kubevirtConfig, err := kubevirtmanifests.CloudProviderConfig{ - Namespace: installConfig.Config.Platform.Kubevirt.Namespace, - InfraID: clusterID.InfraID, - }.JSON() - if err != nil { - return errors.Wrap(err, "could not create cloud provider config") - } - cm.Data[cloudProviderConfigDataKey] = kubevirtConfig default: return errors.New("invalid Platform") } diff --git a/pkg/asset/manifests/dns.go b/pkg/asset/manifests/dns.go index 4e5eed5c298..bb6cee653cb 100644 --- a/pkg/asset/manifests/dns.go +++ b/pkg/asset/manifests/dns.go @@ -23,7 +23,6 @@ import ( baremetaltypes "github.com/openshift/installer/pkg/types/baremetal" gcptypes "github.com/openshift/installer/pkg/types/gcp" ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud" - kubevirttypes "github.com/openshift/installer/pkg/types/kubevirt" libvirttypes "github.com/openshift/installer/pkg/types/libvirt" nonetypes "github.com/openshift/installer/pkg/types/none" openstacktypes "github.com/openshift/installer/pkg/types/openstack" @@ -146,7 +145,7 @@ func (d *DNS) Generate(dependencies asset.Parents) error { config.Spec.PrivateZone = &configv1.DNSZone{ ID: zoneID, } - case libvirttypes.Name, openstacktypes.Name, baremetaltypes.Name, nonetypes.Name, vspheretypes.Name, ovirttypes.Name, kubevirttypes.Name: + case libvirttypes.Name, openstacktypes.Name, baremetaltypes.Name, nonetypes.Name, vspheretypes.Name, ovirttypes.Name: default: return errors.New("invalid Platform") } diff --git a/pkg/asset/manifests/infrastructure.go b/pkg/asset/manifests/infrastructure.go index ca0b52cee74..6eccc9beead 100644 --- a/pkg/asset/manifests/infrastructure.go +++ b/pkg/asset/manifests/infrastructure.go @@ -18,7 +18,6 @@ import ( "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" "github.com/openshift/installer/pkg/types/ibmcloud" - "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/none" "github.com/openshift/installer/pkg/types/openstack" @@ -205,12 +204,6 @@ func (i *Infrastructure) Generate(dependencies asset.Parents) error { APIServerInternalIP: installConfig.Config.Ovirt.APIVIP, IngressIP: installConfig.Config.Ovirt.IngressVIP, } - case kubevirt.Name: - config.Spec.PlatformSpec.Type = configv1.KubevirtPlatformType - config.Status.PlatformStatus.Kubevirt = &configv1.KubevirtPlatformStatus{ - APIServerInternalIP: installConfig.Config.Kubevirt.APIVIP, - IngressIP: installConfig.Config.Kubevirt.IngressVIP, - } default: config.Spec.PlatformSpec.Type = configv1.NonePlatformType } diff --git a/pkg/asset/manifests/kubevirt/OWNERS b/pkg/asset/manifests/kubevirt/OWNERS deleted file mode 100644 index c81b62d00a3..00000000000 --- a/pkg/asset/manifests/kubevirt/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md -# This file just uses aliases defined in OWNERS_ALIASES. - -approvers: - - kubevirt-approvers -reviewers: - - kubevirt-reviewers diff --git a/pkg/asset/manifests/kubevirt/cloudproviderconfig.go b/pkg/asset/manifests/kubevirt/cloudproviderconfig.go deleted file mode 100644 index 9328ee08c53..00000000000 --- a/pkg/asset/manifests/kubevirt/cloudproviderconfig.go +++ /dev/null @@ -1,24 +0,0 @@ -package kubevirt - -import ( - "bytes" - "encoding/json" -) - -// CloudProviderConfig is the kubevirt cloud provider config -type CloudProviderConfig struct { - // The namespace in the infra cluster that the cluster resources are created in - Namespace string `json:"namespace"` - InfraID string `json:"infraID"` -} - -// JSON generates the cloud provider json config for the kubevirt platform. -func (params CloudProviderConfig) JSON() (string, error) { - buff := &bytes.Buffer{} - encoder := json.NewEncoder(buff) - encoder.SetIndent("", "\t") - if err := encoder.Encode(params); err != nil { - return "", err - } - return buff.String(), nil -} diff --git a/pkg/asset/manifests/openshift.go b/pkg/asset/manifests/openshift.go index 032f66fe0fa..21a97cd4e05 100644 --- a/pkg/asset/manifests/openshift.go +++ b/pkg/asset/manifests/openshift.go @@ -17,7 +17,6 @@ import ( installconfigaws "github.com/openshift/installer/pkg/asset/installconfig/aws" "github.com/openshift/installer/pkg/asset/installconfig/gcp" "github.com/openshift/installer/pkg/asset/installconfig/ibmcloud" - kubeconfig "github.com/openshift/installer/pkg/asset/installconfig/kubevirt" "github.com/openshift/installer/pkg/asset/installconfig/ovirt" "github.com/openshift/installer/pkg/asset/machines" osmachine "github.com/openshift/installer/pkg/asset/machines/openstack" @@ -32,7 +31,6 @@ import ( baremetaltypes "github.com/openshift/installer/pkg/types/baremetal" gcptypes "github.com/openshift/installer/pkg/types/gcp" ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud" - kubevirttypes "github.com/openshift/installer/pkg/types/kubevirt" openstacktypes "github.com/openshift/installer/pkg/types/openstack" ovirttypes "github.com/openshift/installer/pkg/types/ovirt" vspheretypes "github.com/openshift/installer/pkg/types/vsphere" @@ -214,16 +212,6 @@ func (o *Openshift) Generate(dependencies asset.Parents) error { Base64encodeCABundle: base64.StdEncoding.EncodeToString([]byte(conf.CABundle)), }, } - case kubevirttypes.Name: - kubeconfigContent, err := kubeconfig.LoadKubeConfigContent() - if err != nil { - return err - } - cloudCreds = cloudCredsSecretData{ - Kubevirt: &KubevirtCredsSecretData{ - Base64encodedKubeconfig: base64.StdEncoding.EncodeToString(kubeconfigContent), - }, - } } templateData := &openshiftTemplateData{ @@ -249,7 +237,7 @@ func (o *Openshift) Generate(dependencies asset.Parents) error { } switch platform { - case awstypes.Name, openstacktypes.Name, vspheretypes.Name, azuretypes.Name, gcptypes.Name, ibmcloudtypes.Name, ovirttypes.Name, kubevirttypes.Name: + case awstypes.Name, openstacktypes.Name, vspheretypes.Name, azuretypes.Name, gcptypes.Name, ibmcloudtypes.Name, ovirttypes.Name: if installConfig.Config.CredentialsMode != types.ManualCredentialsMode { assetData["99_cloud-creds-secret.yaml"] = applyTemplateData(cloudCredsSecret.Files()[0].Data, templateData) } diff --git a/pkg/asset/manifests/operators.go b/pkg/asset/manifests/operators.go index 66fa9682753..79e7530d35d 100644 --- a/pkg/asset/manifests/operators.go +++ b/pkg/asset/manifests/operators.go @@ -70,7 +70,6 @@ func (m *Manifests) Dependencies() []asset.Asset { &bootkube.MachineConfigServerTLSSecret{}, &bootkube.OpenshiftConfigSecretPullSecret{}, &bootkube.OpenshiftMachineConfigOperator{}, - &bootkube.KubevirtInfraNamespace{}, } } @@ -154,7 +153,6 @@ func (m *Manifests) generateBootKubeManifests(dependencies asset.Parents) []*ass &bootkube.MachineConfigServerTLSSecret{}, &bootkube.OpenshiftConfigSecretPullSecret{}, &bootkube.OpenshiftMachineConfigOperator{}, - &bootkube.KubevirtInfraNamespace{}, } { dependencies.Get(a) for _, f := range a.Files() { diff --git a/pkg/asset/manifests/template.go b/pkg/asset/manifests/template.go index 414d6569963..4e93d3b00d8 100644 --- a/pkg/asset/manifests/template.go +++ b/pkg/asset/manifests/template.go @@ -51,12 +51,6 @@ type OvirtCredsSecretData struct { Base64encodeCABundle string } -// KubevirtCredsSecretData holds the encoded kubeconfig for the infra cluster. -// It is used to generated cloud-creds secret. -type KubevirtCredsSecretData struct { - Base64encodedKubeconfig string -} - type cloudCredsSecretData struct { AWS *AwsCredsSecretData Azure *AzureCredsSecretData @@ -65,7 +59,6 @@ type cloudCredsSecretData struct { OpenStack *OpenStackCredsSecretData VSphere *VSphereCredsSecretData Ovirt *OvirtCredsSecretData - Kubevirt *KubevirtCredsSecretData } type bootkubeTemplateData struct { diff --git a/pkg/asset/quota/quota.go b/pkg/asset/quota/quota.go index e5a6ab9c044..98077345de1 100644 --- a/pkg/asset/quota/quota.go +++ b/pkg/asset/quota/quota.go @@ -26,7 +26,6 @@ import ( "github.com/openshift/installer/pkg/types/baremetal" typesgcp "github.com/openshift/installer/pkg/types/gcp" "github.com/openshift/installer/pkg/types/ibmcloud" - "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/none" typesopenstack "github.com/openshift/installer/pkg/types/openstack" @@ -141,7 +140,7 @@ func (a *PlatformQuotaCheck) Generate(dependencies asset.Parents) error { return summarizeFailingReport(reports) } summarizeReport(reports) - case azure.Name, baremetal.Name, ibmcloud.Name, libvirt.Name, none.Name, ovirt.Name, vsphere.Name, kubevirt.Name: + case azure.Name, baremetal.Name, ibmcloud.Name, libvirt.Name, none.Name, ovirt.Name, vsphere.Name: // no special provisioning requirements to check default: err = fmt.Errorf("unknown platform type %q", platform) diff --git a/pkg/asset/rhcos/image.go b/pkg/asset/rhcos/image.go index 251a6036069..05187f14d04 100644 --- a/pkg/asset/rhcos/image.go +++ b/pkg/asset/rhcos/image.go @@ -20,7 +20,6 @@ import ( "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" "github.com/openshift/installer/pkg/types/ibmcloud" - "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/none" "github.com/openshift/installer/pkg/types/openstack" @@ -114,7 +113,7 @@ func osImage(config *types.InstallConfig) (string, error) { return rhcos.FindArtifactURL(a) } return "", fmt.Errorf("%s: No qemu build found", st.FormatPrefix(archName)) - case ovirt.Name, kubevirt.Name, openstack.Name: + case ovirt.Name, openstack.Name: op := config.Platform.OpenStack if op != nil { if oi := op.ClusterOSImage; oi != "" { diff --git a/pkg/asset/targets/targets.go b/pkg/asset/targets/targets.go index 82114ec84ad..591a2745c27 100644 --- a/pkg/asset/targets/targets.go +++ b/pkg/asset/targets/targets.go @@ -37,7 +37,6 @@ var ( &bootkube.KubeSystemConfigmapRootCA{}, &bootkube.OpenshiftMachineConfigOperator{}, &bootkube.OpenshiftConfigSecretPullSecret{}, - &bootkube.KubevirtInfraNamespace{}, &openshift.CloudCredsSecret{}, &openshift.KubeadminPasswordSecret{}, &openshift.RoleCloudCredsSecretReader{}, diff --git a/pkg/asset/templates/content/bootkube/openshift-kubevirt-infra-namespace.go b/pkg/asset/templates/content/bootkube/openshift-kubevirt-infra-namespace.go deleted file mode 100644 index b956d364ad1..00000000000 --- a/pkg/asset/templates/content/bootkube/openshift-kubevirt-infra-namespace.go +++ /dev/null @@ -1,64 +0,0 @@ -package bootkube - -import ( - "os" - "path/filepath" - - "github.com/openshift/installer/pkg/asset" - "github.com/openshift/installer/pkg/asset/templates/content" -) - -const ( - kubevirtInfraNamespaceFileName = "openshift-kubevirt-infra-namespace.yaml" -) - -var _ asset.WritableAsset = (*KubevirtInfraNamespace)(nil) - -// KubevirtInfraNamespace is an asset for the openshift-kubevirt-infra namespace -type KubevirtInfraNamespace struct { - FileList []*asset.File -} - -// Dependencies returns all of the dependencies directly needed by the asset -func (t *KubevirtInfraNamespace) Dependencies() []asset.Asset { - return []asset.Asset{} -} - -// Name returns the human-friendly name of the asset. -func (t *KubevirtInfraNamespace) Name() string { - return "KubevirtInfraNamespace" -} - -// Generate generates the actual files by this asset -func (t *KubevirtInfraNamespace) Generate(parents asset.Parents) error { - fileName := kubevirtInfraNamespaceFileName - data, err := content.GetBootkubeTemplate(fileName) - if err != nil { - return err - } - t.FileList = []*asset.File{ - { - Filename: filepath.Join(content.TemplateDir, fileName), - Data: []byte(data), - }, - } - return nil -} - -// Files returns the files generated by the asset. -func (t *KubevirtInfraNamespace) Files() []*asset.File { - return t.FileList -} - -// Load returns the asset from disk. -func (t *KubevirtInfraNamespace) Load(f asset.FileFetcher) (bool, error) { - file, err := f.FetchByName(filepath.Join(content.TemplateDir, kubevirtInfraNamespaceFileName)) - if err != nil { - if os.IsNotExist(err) { - return false, nil - } - return false, err - } - t.FileList = []*asset.File{file} - return true, nil -} diff --git a/pkg/asset/tls/mcscertkey.go b/pkg/asset/tls/mcscertkey.go index 2611007ce3e..ac15113c0f7 100644 --- a/pkg/asset/tls/mcscertkey.go +++ b/pkg/asset/tls/mcscertkey.go @@ -8,7 +8,6 @@ import ( "github.com/openshift/installer/pkg/asset" "github.com/openshift/installer/pkg/asset/installconfig" baremetaltypes "github.com/openshift/installer/pkg/types/baremetal" - kubevirttypes "github.com/openshift/installer/pkg/types/kubevirt" openstacktypes "github.com/openshift/installer/pkg/types/openstack" ovirttypes "github.com/openshift/installer/pkg/types/ovirt" vspheretypes "github.com/openshift/installer/pkg/types/vsphere" @@ -61,9 +60,6 @@ func (a *MCSCertKey) Generate(dependencies asset.Parents) error { cfg.IPAddresses = []net.IP{net.ParseIP(installConfig.Config.VSphere.APIVIP)} cfg.DNSNames = append(cfg.DNSNames, installConfig.Config.VSphere.APIVIP) } - case kubevirttypes.Name: - cfg.IPAddresses = []net.IP{net.ParseIP(installConfig.Config.Kubevirt.APIVIP)} - cfg.DNSNames = []string{hostname, installConfig.Config.Kubevirt.APIVIP} default: cfg.DNSNames = []string{hostname} } diff --git a/pkg/destroy/kubevirt/OWNERS b/pkg/destroy/kubevirt/OWNERS deleted file mode 100644 index c81b62d00a3..00000000000 --- a/pkg/destroy/kubevirt/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md -# This file just uses aliases defined in OWNERS_ALIASES. - -approvers: - - kubevirt-approvers -reviewers: - - kubevirt-reviewers diff --git a/pkg/destroy/kubevirt/destroyer.go b/pkg/destroy/kubevirt/destroyer.go deleted file mode 100644 index e67b71d75de..00000000000 --- a/pkg/destroy/kubevirt/destroyer.go +++ /dev/null @@ -1,180 +0,0 @@ -package kubevirt - -import ( - "context" - "fmt" - "time" - - "github.com/sirupsen/logrus" - "k8s.io/apimachinery/pkg/api/errors" - apilabels "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/wait" - - ickubevirt "github.com/openshift/installer/pkg/asset/installconfig/kubevirt" - "github.com/openshift/installer/pkg/destroy/providers" - "github.com/openshift/installer/pkg/types" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// deleteFunc is the interface a function needs to implement to be delete resources. -type deleteFunc func(ctx context.Context, namespace string, listOpts metav1.ListOptions, kubevirtClient ickubevirt.Client) error - -// ClusterUninstaller holds the Metadata info needed to delete the tenantCluster resources from the infraCluster. -type ClusterUninstaller struct { - Metadata types.ClusterMetadata - Logger logrus.FieldLogger -} - -// New returns KubeVirt Uninstaller from ClusterMetadata. -func New(logger logrus.FieldLogger, metadata *types.ClusterMetadata) (providers.Destroyer, error) { - return &ClusterUninstaller{ - Metadata: *metadata, - Logger: logger, - }, nil -} - -// Run is the entrypoint to start the uninstall process. -func (uninstaller *ClusterUninstaller) Run() (*types.ClusterQuota, error) { - ctx := context.Background() - namespace := uninstaller.Metadata.Kubevirt.Namespace - - listOpts := metav1.ListOptions{LabelSelector: apilabels.FormatLabels(uninstaller.Metadata.Kubevirt.Labels)} - kubevirtClient, err := ickubevirt.NewClient() - if err != nil { - return nil, err - } - - deleteFuncs := []deleteFunc{uninstaller.deleteAllVMs, uninstaller.deleteAllDVs, uninstaller.deleteAllSecrets} - var results = make(chan error, len(deleteFuncs)) - for i, del := range deleteFuncs { - go func(index int, delFunc deleteFunc) { - for { - err := delFunc(ctx, namespace, listOpts, kubevirtClient) - if err == nil { - results <- err - break - } - time.Sleep(10 * time.Second) - } - - }(i, del) - } - - var resultMsg = "" - for i := len(deleteFuncs); i > 0; i-- { - err := <-results - if err != nil { - resultMsg = fmt.Sprintf("%s, %s", resultMsg, err.Error()) - } - } - if resultMsg != "" { - return nil, fmt.Errorf("destroy finished with errors: %s", resultMsg) - } - return nil, nil -} - -func (uninstaller *ClusterUninstaller) deleteAllVMs(ctx context.Context, namespace string, listOpts metav1.ListOptions, kubevirtClient ickubevirt.Client) error { - vmList, err := kubevirtClient.ListVirtualMachine(ctx, namespace, listOpts) - if err != nil { - uninstaller.Logger.Errorf("failed to delete VirtualMachines: %s", err) - return fmt.Errorf("failed to list VMs") - } - - if len(vmList.Items) == 0 { - uninstaller.Logger.Infof("There is no Virtual Machine to delete in namespace %s", namespace) - return nil - } - uninstaller.Logger.Infof("Found %d Virtual Machines to delete in namespace %s", len(vmList.Items), namespace) - for _, vm := range vmList.Items { - uninstaller.Logger.Infof("Delete Virtual Machine %s from Namespace %s", vm.Name, namespace) - if err := kubevirtClient.DeleteVirtualMachine(ctx, namespace, vm.Name); err != nil { - uninstaller.Logger.Errorf("failed to delete VirtualMachines: %s", err) - return fmt.Errorf("failed to delete VM") - } - if err := uninstaller.exponentialBackoff("Virtual Machine", func() error { - _, err := kubevirtClient.GetVirtualMachine(ctx, namespace, vm.Name) - return err - }); err != nil { - uninstaller.Logger.Errorf("failed to delete VirtualMachines: %s", err) - return fmt.Errorf("failed to validate VM deleted") - } - } - return nil -} - -func (uninstaller *ClusterUninstaller) deleteAllDVs(ctx context.Context, namespace string, listOpts metav1.ListOptions, kubevirtClient ickubevirt.Client) error { - dvList, err := kubevirtClient.ListDataVolume(ctx, namespace, listOpts) - if err != nil { - uninstaller.Logger.Errorf("failed to delete DataVolumes: %s", err) - return fmt.Errorf("failed to list DVs") - } - - if len(dvList.Items) == 0 { - uninstaller.Logger.Infof("There is no Data Volume to delete in namespace %s", namespace) - return nil - } - uninstaller.Logger.Infof("Found %d Data Volumes to delete in namespace %s", len(dvList.Items), namespace) - for _, dv := range dvList.Items { - uninstaller.Logger.Infof("Delete Data Volume %s from Namespace %s", dv.Name, namespace) - if err := kubevirtClient.DeleteDataVolume(ctx, namespace, dv.Name); err != nil { - uninstaller.Logger.Errorf("failed to delete DataVolumes: %s", err) - return fmt.Errorf("failed to delete DV") - } - if err := uninstaller.exponentialBackoff("Data Volume", func() error { - _, err := kubevirtClient.GetDataVolume(ctx, namespace, dv.Name) - return err - }); err != nil { - uninstaller.Logger.Errorf("failed to delete DataVolumes: %s", err) - return fmt.Errorf("failed to validate DV deleted") - } - } - return nil -} - -func (uninstaller *ClusterUninstaller) deleteAllSecrets(ctx context.Context, namespace string, listOpts metav1.ListOptions, kubevirtClient ickubevirt.Client) error { - secretList, err := kubevirtClient.ListSecret(ctx, namespace, listOpts) - if err != nil { - uninstaller.Logger.Errorf("failed to delete Secrets: %s", err) - return fmt.Errorf("failed to list Secrets") - } - - if len(secretList.Items) == 0 { - uninstaller.Logger.Infof("There is no Secret to delete in namespace %s", namespace) - return nil - } - uninstaller.Logger.Infof("Found %d Secrets to delete in namespace %s", len(secretList.Items), namespace) - for _, secret := range secretList.Items { - uninstaller.Logger.Infof("Delete Secret %s from Namespace %s", secret.Name, namespace) - if err := kubevirtClient.DeleteSecret(ctx, namespace, secret.Name); err != nil { - uninstaller.Logger.Errorf("failed to delete Secrets: %s", err) - return fmt.Errorf("failed to delete Secret") - } - if err := uninstaller.exponentialBackoff("Secret", func() error { - _, err := kubevirtClient.GetVirtualMachine(ctx, namespace, secret.Name) - return err - }); err != nil { - uninstaller.Logger.Errorf("failed to delete Secrets: %s", err) - return fmt.Errorf("failed to validate Secret deleted") - } - } - return nil -} - -func (uninstaller *ClusterUninstaller) exponentialBackoff(resourceType string, tryGetFunc func() error) error { - backoff := wait.Backoff{ - Duration: 1 * time.Second, - Jitter: 0, - Factor: 2, - Steps: 5, - } - return wait.ExponentialBackoff(backoff, func() (done bool, err error) { - err = tryGetFunc() - if err != nil { - if errors.IsNotFound(err) { - return true, nil - } - return true, fmt.Errorf("failed to get %s, with error: %v", resourceType, err) - } - return false, nil - }) -} diff --git a/pkg/destroy/kubevirt/doc.go b/pkg/destroy/kubevirt/doc.go deleted file mode 100644 index 0983357c84c..00000000000 --- a/pkg/destroy/kubevirt/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package kubevirt provides a cluster-destroyer for kubevirt clusters. -package kubevirt diff --git a/pkg/destroy/kubevirt/register.go b/pkg/destroy/kubevirt/register.go deleted file mode 100644 index 7345ea0bf8a..00000000000 --- a/pkg/destroy/kubevirt/register.go +++ /dev/null @@ -1,7 +0,0 @@ -package kubevirt - -import "github.com/openshift/installer/pkg/destroy/providers" - -func init() { - providers.Registry["kubevirt"] = New -} diff --git a/pkg/explain/printer_test.go b/pkg/explain/printer_test.go index 05d987bc4a7..d8ef1e6c986 100644 --- a/pkg/explain/printer_test.go +++ b/pkg/explain/printer_test.go @@ -99,9 +99,6 @@ func Test_PrintFields(t *testing.T) { ibmcloud IBMCloud is the configuration used when installing on IBM Cloud. - kubevirt - Kubevirt is the configuration used when installing on kubevirt. - libvirt Libvirt is the configuration used when installing on libvirt. diff --git a/pkg/terraform/exec/plugins/kubevirt.go b/pkg/terraform/exec/plugins/kubevirt.go deleted file mode 100644 index 28ced25b098..00000000000 --- a/pkg/terraform/exec/plugins/kubevirt.go +++ /dev/null @@ -1,14 +0,0 @@ -package plugins - -import ( - "github.com/hashicorp/terraform-plugin-sdk/plugin" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt" -) - -func init() { - exec := func() { - plugin.Serve(&plugin.ServeOpts{ - ProviderFunc: kubevirt.Provider}) - } - KnownPlugins["terraform-provider-kubevirt"] = exec -} diff --git a/pkg/terraform/gather/kubevirt/OWNERS b/pkg/terraform/gather/kubevirt/OWNERS deleted file mode 100644 index c81b62d00a3..00000000000 --- a/pkg/terraform/gather/kubevirt/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md -# This file just uses aliases defined in OWNERS_ALIASES. - -approvers: - - kubevirt-approvers -reviewers: - - kubevirt-reviewers diff --git a/pkg/terraform/gather/kubevirt/ip.go b/pkg/terraform/gather/kubevirt/ip.go deleted file mode 100644 index d7e07312c74..00000000000 --- a/pkg/terraform/gather/kubevirt/ip.go +++ /dev/null @@ -1,18 +0,0 @@ -// Package kubevirt supply utilities to extract information from terraform state -package kubevirt - -import ( - "github.com/openshift/installer/pkg/terraform" -) - -// BootstrapIP returns the ip address for bootstrap host. -// still unsupported, because qemu-ga is not available - see https://bugzilla.redhat.com/show_bug.cgi?id=1764804 -func BootstrapIP(tfs *terraform.State) (string, error) { - return "", nil -} - -// ControlPlaneIPs returns the ip addresses for control plane hosts. -// still unsupported, because qemu-ga is not available - see https://bugzilla.redhat.com/show_bug.cgi?id=1764804 -func ControlPlaneIPs(tfs *terraform.State) ([]string, error) { - return []string{""}, nil -} diff --git a/pkg/terraform/stages/compat/stage.go b/pkg/terraform/stages/compat/stage.go index d7fde044fc7..858ef706d23 100644 --- a/pkg/terraform/stages/compat/stage.go +++ b/pkg/terraform/stages/compat/stage.go @@ -9,12 +9,10 @@ import ( "github.com/openshift/installer/pkg/terraform" gatherbaremetal "github.com/openshift/installer/pkg/terraform/gather/baremetal" - gatherkubevirt "github.com/openshift/installer/pkg/terraform/gather/kubevirt" gatheropenstack "github.com/openshift/installer/pkg/terraform/gather/openstack" gatherovirt "github.com/openshift/installer/pkg/terraform/gather/ovirt" "github.com/openshift/installer/pkg/types" baremetaltypes "github.com/openshift/installer/pkg/types/baremetal" - kubevirttypes "github.com/openshift/installer/pkg/types/kubevirt" openstacktypes "github.com/openshift/installer/pkg/types/openstack" ovirttypes "github.com/openshift/installer/pkg/types/ovirt" ) @@ -101,16 +99,6 @@ func extractHostAddresses(config *types.InstallConfig, tfstate *terraform.State) if err != nil { logrus.Error(err) } - - case kubevirttypes.Name: - bootstrap, err = gatherkubevirt.BootstrapIP(tfstate) - if err != nil { - return - } - masters, err = gatherkubevirt.ControlPlaneIPs(tfstate) - if err != nil { - logrus.Error(err) - } } return bootstrap, port, masters, nil } diff --git a/pkg/tfvars/kubevirt/OWNERS b/pkg/tfvars/kubevirt/OWNERS deleted file mode 100644 index c81b62d00a3..00000000000 --- a/pkg/tfvars/kubevirt/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md -# This file just uses aliases defined in OWNERS_ALIASES. - -approvers: - - kubevirt-approvers -reviewers: - - kubevirt-reviewers diff --git a/pkg/tfvars/kubevirt/kubevirt.go b/pkg/tfvars/kubevirt/kubevirt.go deleted file mode 100644 index dd463aac764..00000000000 --- a/pkg/tfvars/kubevirt/kubevirt.go +++ /dev/null @@ -1,52 +0,0 @@ -// Package kubevirt contains kubevirt-specific Terraform-variable logic. -package kubevirt - -import ( - "encoding/json" - - v1 "github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1" -) - -type config struct { - Namespace string `json:"kubevirt_namespace"` - ImageURL string `json:"kubevirt_image_url"` - SourcePVCName string `json:"kubevirt_source_pvc_name"` - Memory string `json:"kubevirt_master_memory"` - CPU uint32 `json:"kubevirt_master_cpu"` - Storage string `json:"kubevirt_master_storage"` - StorageClass string `json:"kubevirt_storage_class"` - NetworkName string `json:"kubevirt_network_name"` - InterfaceBindingMethod string `json:"kubevirt_interface_binding_method"` - PersistentVolumeAccessMode string `json:"kubevirt_pv_access_mode"` - ResourcesLabels map[string]string `json:"kubevirt_labels"` -} - -// TFVarsSources contains the parameters to be converted into Terraform variables -type TFVarsSources struct { - MasterSpecs []*v1.KubevirtMachineProviderSpec - ImageURL string - Namespace string - ResourcesLabels map[string]string -} - -// TFVars generates kubevirt-specific Terraform variables. -func TFVars(sources TFVarsSources) ([]byte, error) { - masterSpec := sources.MasterSpecs[0] - - // For optional parameters, set only if not nil - cfg := config{ - Namespace: sources.Namespace, - ImageURL: sources.ImageURL, - SourcePVCName: masterSpec.SourcePvcName, - Memory: masterSpec.RequestedMemory, - CPU: masterSpec.RequestedCPU, - Storage: masterSpec.RequestedStorage, - StorageClass: masterSpec.StorageClassName, - NetworkName: masterSpec.NetworkName, - InterfaceBindingMethod: masterSpec.InterfaceBindingMethod, - PersistentVolumeAccessMode: masterSpec.PersistentVolumeAccessMode, - ResourcesLabels: sources.ResourcesLabels, - } - - return json.MarshalIndent(cfg, "", " ") -} diff --git a/pkg/types/clustermetadata.go b/pkg/types/clustermetadata.go index 73c7486563c..9534b28a8b9 100644 --- a/pkg/types/clustermetadata.go +++ b/pkg/types/clustermetadata.go @@ -6,7 +6,6 @@ import ( "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" "github.com/openshift/installer/pkg/types/ibmcloud" - "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/openstack" "github.com/openshift/installer/pkg/types/ovirt" @@ -36,7 +35,6 @@ type ClusterPlatformMetadata struct { BareMetal *baremetal.Metadata `json:"baremetal,omitempty"` Ovirt *ovirt.Metadata `json:"ovirt,omitempty"` VSphere *vsphere.Metadata `json:"vsphere,omitempty"` - Kubevirt *kubevirt.Metadata `json:"kubevirt,omitempty"` } // Platform returns a string representation of the platform @@ -73,8 +71,5 @@ func (cpm *ClusterPlatformMetadata) Platform() string { if cpm.VSphere != nil { return vsphere.Name } - if cpm.Kubevirt != nil { - return kubevirt.Name - } return "" } diff --git a/pkg/types/defaults/installconfig.go b/pkg/types/defaults/installconfig.go index e7d2bcafaa8..ace0565aa01 100644 --- a/pkg/types/defaults/installconfig.go +++ b/pkg/types/defaults/installconfig.go @@ -10,7 +10,6 @@ import ( baremetaldefaults "github.com/openshift/installer/pkg/types/baremetal/defaults" gcpdefaults "github.com/openshift/installer/pkg/types/gcp/defaults" ibmclouddefaults "github.com/openshift/installer/pkg/types/ibmcloud/defaults" - kubevirtdefaults "github.com/openshift/installer/pkg/types/kubevirt/defaults" libvirtdefaults "github.com/openshift/installer/pkg/types/libvirt/defaults" nonedefaults "github.com/openshift/installer/pkg/types/none/defaults" openstackdefaults "github.com/openshift/installer/pkg/types/openstack/defaults" @@ -106,8 +105,6 @@ func SetInstallConfigDefaults(c *types.InstallConfig) { for i := range c.Compute { ovirtdefaults.SetComputeDefaults(c.Platform.Ovirt, &c.Compute[i]) } - case c.Platform.Kubevirt != nil: - kubevirtdefaults.SetPlatformDefaults(c.Platform.Kubevirt) case c.Platform.None != nil: nonedefaults.SetPlatformDefaults(c.Platform.None) } diff --git a/pkg/types/installconfig.go b/pkg/types/installconfig.go index 00bb8e294ad..0d1d59b8529 100644 --- a/pkg/types/installconfig.go +++ b/pkg/types/installconfig.go @@ -10,7 +10,6 @@ import ( "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" "github.com/openshift/installer/pkg/types/ibmcloud" - "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/none" "github.com/openshift/installer/pkg/types/openstack" @@ -45,7 +44,6 @@ var ( HiddenPlatformNames = []string{ baremetal.Name, ibmcloud.Name, - kubevirt.Name, none.Name, } @@ -207,10 +205,6 @@ type Platform struct { // Ovirt is the configuration used when installing on oVirt. // +optional Ovirt *ovirt.Platform `json:"ovirt,omitempty"` - - // Kubevirt is the configuration used when installing on kubevirt. - // +optional - Kubevirt *kubevirt.Platform `json:"kubevirt,omitempty"` } // Name returns a string representation of the platform (e.g. "aws" if @@ -240,8 +234,6 @@ func (p *Platform) Name() string { return vsphere.Name case p.Ovirt != nil: return ovirt.Name - case p.Kubevirt != nil: - return kubevirt.Name default: return "" } diff --git a/pkg/types/kubevirt/OWNERS b/pkg/types/kubevirt/OWNERS deleted file mode 100644 index c81b62d00a3..00000000000 --- a/pkg/types/kubevirt/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md -# This file just uses aliases defined in OWNERS_ALIASES. - -approvers: - - kubevirt-approvers -reviewers: - - kubevirt-reviewers diff --git a/pkg/types/kubevirt/defaults/platform.go b/pkg/types/kubevirt/defaults/platform.go deleted file mode 100644 index 267ed570366..00000000000 --- a/pkg/types/kubevirt/defaults/platform.go +++ /dev/null @@ -1,12 +0,0 @@ -package defaults - -import ( - "github.com/openshift/installer/pkg/types/kubevirt" -) - -// SetPlatformDefaults sets the defaults for the platform. -func SetPlatformDefaults(p *kubevirt.Platform) { - if p.PersistentVolumeAccessMode == "" { - p.PersistentVolumeAccessMode = "ReadWriteMany" - } -} diff --git a/pkg/types/kubevirt/doc.go b/pkg/types/kubevirt/doc.go deleted file mode 100644 index 3cf5f936878..00000000000 --- a/pkg/types/kubevirt/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Package kubevirt contains kubevirt-specific structures for -// installer configuration and management. -package kubevirt - -// Name is the name for the kubevirt platform. -const Name string = "kubevirt" diff --git a/pkg/types/kubevirt/machinepool.go b/pkg/types/kubevirt/machinepool.go deleted file mode 100644 index ad3544f61cf..00000000000 --- a/pkg/types/kubevirt/machinepool.go +++ /dev/null @@ -1,38 +0,0 @@ -package kubevirt - -// MachinePool stores the configuration for a machine pool installed -// on kubevirt. -type MachinePool struct { - // CPU is the amount of CPUs used. - // +optional - CPU uint32 `json:"cpu,omitempty"` - - // Memory is the size of a VM's memory. - // Format: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go - // +optional - Memory string `json:"memory,omitempty"` - - // StorageSize is the size of VM's boot volume. - // Format: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go - // +optional - StorageSize string `json:"storageSize,omitempty"` -} - -// Set sets the values from `required` to `p`. -func (p *MachinePool) Set(required *MachinePool) { - if required == nil || p == nil { - return - } - - if required.CPU != 0 { - p.CPU = required.CPU - } - - if required.Memory != "" { - p.Memory = required.Memory - } - - if required.StorageSize != "" { - p.StorageSize = required.StorageSize - } -} diff --git a/pkg/types/kubevirt/metadata.go b/pkg/types/kubevirt/metadata.go deleted file mode 100644 index c4952cf8ead..00000000000 --- a/pkg/types/kubevirt/metadata.go +++ /dev/null @@ -1,7 +0,0 @@ -package kubevirt - -// Metadata contains kubevirt metadata (e.g. for uninstalling the cluster). -type Metadata struct { - Namespace string `json:"namespace"` - Labels map[string]string `json:"labels"` -} diff --git a/pkg/types/kubevirt/platform.go b/pkg/types/kubevirt/platform.go deleted file mode 100644 index 02bc5238ea5..00000000000 --- a/pkg/types/kubevirt/platform.go +++ /dev/null @@ -1,38 +0,0 @@ -package kubevirt - -// Platform stores all the global configuration used by the kubevirt platform installation. -type Platform struct { - // Namespace is the namespace in the infra cluster, which the control plane (master vms) - // and the compute (worker vms) are installed in. - Namespace string `json:"namespace"` - - // StorageClass is the Storage Class used in the infra cluster. - // +optional - StorageClass string `json:"storageClass,omitempty"` - - // NetworkName is the target network of all the network interfaces of the nodes. - NetworkName string `json:"networkName"` - - // InterfaceBindingMethod is the the interface binding method of the nodes of the tenantcluster (Bridge | SRIOV). - // +optional - InterfaceBindingMethod string `json:"interfaceBindingMethod"` - - // APIVIP is the virtual IP address for the api endpoint. - // +kubebuilder:validation:Format=ip - APIVIP string `json:"apiVIP"` - - // IngressIP is an external IP which routes to the default ingress controller. - // +kubebuilder:validation:Format=ip - IngressVIP string `json:"ingressVIP"` - - // PersistentVolumeAccessMode is the access mode should be use with the persistent volumes. - // +kubebuilder:default="ReadWriteMany" - // +optional - PersistentVolumeAccessMode string `json:"persistentVolumeAccessMode,omitempty"` - - // DefaultMachinePlatform is the default configuration used when - // installing on Kubevirt for machine pools which do not define their own - // platform configuration. - // +optional - DefaultMachinePlatform *MachinePool `json:"defaultMachinePlatform,omitempty"` -} diff --git a/pkg/types/kubevirt/validation/machinepool.go b/pkg/types/kubevirt/validation/machinepool.go deleted file mode 100644 index 1f5853c1580..00000000000 --- a/pkg/types/kubevirt/validation/machinepool.go +++ /dev/null @@ -1,36 +0,0 @@ -package validation - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/util/validation/field" - - "github.com/openshift/installer/pkg/types/kubevirt" - "k8s.io/apimachinery/pkg/api/resource" -) - -// ValidateMachinePool checks that the specified machine pool is valid. -func ValidateMachinePool(p *kubevirt.MachinePool, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if p.StorageSize != "" { - storageQuantity, err := resource.ParseQuantity(p.StorageSize) - - if err != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("storageSize"), p.StorageSize, fmt.Sprintf("Storage size must be of Quantity type format, error: %s", err))) - } else if storageQuantity.Sign() != 1 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("storageSize"), p.StorageSize, "Storage size must be positive value")) - } - } - - if p.Memory != "" { - memoryQuantity, err := resource.ParseQuantity(p.Memory) - if err != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("memory"), p.Memory, fmt.Sprintf("Memory must be of Quantity type format, error: %s", err))) - } else if memoryQuantity.Sign() != 1 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("memory"), p.Memory, "Memory must be positive value")) - } - } - - return allErrs -} diff --git a/pkg/types/kubevirt/validation/machinepool_test.go b/pkg/types/kubevirt/validation/machinepool_test.go deleted file mode 100644 index d0adbae2d48..00000000000 --- a/pkg/types/kubevirt/validation/machinepool_test.go +++ /dev/null @@ -1,119 +0,0 @@ -package validation - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "k8s.io/apimachinery/pkg/util/validation/field" - - "github.com/openshift/installer/pkg/types/kubevirt" -) - -func TestValidateMachinePool(t *testing.T) { - cases := []struct { - name string - pool *kubevirt.MachinePool - valid bool - }{ - { - name: "valid", - pool: &kubevirt.MachinePool{ - CPU: 4, - Memory: "5G", - StorageSize: "100Gi", - }, - valid: true, - }, - { - name: "valid all empty", - pool: &kubevirt.MachinePool{ - CPU: 0, - Memory: "", - StorageSize: "", - }, - valid: true, - }, - { - name: "valid empty storageSize", - pool: &kubevirt.MachinePool{ - CPU: 4, - Memory: "5G", - StorageSize: "", - }, - valid: true, - }, - { - name: "invalid storageSize", - pool: &kubevirt.MachinePool{ - CPU: 4, - Memory: "5G", - StorageSize: "invalid string", - }, - valid: false, - }, - { - name: "invalid zero storageSize", - pool: &kubevirt.MachinePool{ - CPU: 4, - Memory: "5G", - StorageSize: "0Gi", - }, - valid: false, - }, - { - name: "invalid negative storageSize", - pool: &kubevirt.MachinePool{ - CPU: 4, - Memory: "5G", - StorageSize: "-9Gi", - }, - valid: false, - }, - { - name: "valid empty memory", - pool: &kubevirt.MachinePool{ - CPU: 4, - Memory: "", - StorageSize: "100Gi", - }, - valid: true, - }, - { - name: "invalid memory", - pool: &kubevirt.MachinePool{ - CPU: 4, - Memory: "invalid string", - StorageSize: "100Gi", - }, - valid: false, - }, - { - name: "invalid zero memory", - pool: &kubevirt.MachinePool{ - CPU: 4, - Memory: "0G", - StorageSize: "100Gi", - }, - valid: false, - }, - { - name: "invalid negative memory", - pool: &kubevirt.MachinePool{ - CPU: 4, - Memory: "-20G", - StorageSize: "100Gi", - }, - valid: false, - }, - } - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - err := ValidateMachinePool(tc.pool, field.NewPath("test-path")).ToAggregate() - if tc.valid { - assert.NoError(t, err) - } else { - assert.Error(t, err) - } - }) - } -} diff --git a/pkg/types/kubevirt/validation/platform.go b/pkg/types/kubevirt/validation/platform.go deleted file mode 100644 index 64ba00ac02f..00000000000 --- a/pkg/types/kubevirt/validation/platform.go +++ /dev/null @@ -1,54 +0,0 @@ -package validation - -import ( - "fmt" - "net" - - "k8s.io/apimachinery/pkg/util/validation/field" - - "github.com/openshift/installer/pkg/types" - "github.com/openshift/installer/pkg/types/kubevirt" - "github.com/openshift/installer/pkg/validate" -) - -// ValidatePlatform checks that the specified platform is valid. -func ValidatePlatform(p *kubevirt.Platform, fldPath *field.Path, c *types.InstallConfig) field.ErrorList { - allErrs := field.ErrorList{} - - if p.Namespace == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("namespace"), "namespace is required")) - } - - if p.NetworkName == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("networkName"), "networkName is required")) - } - - if p.InterfaceBindingMethod != "" && p.InterfaceBindingMethod != "Bridge" && p.InterfaceBindingMethod != "SRIOV" { - allErrs = append(allErrs, field.Invalid(fldPath.Child("interfaceBindingMethod"), p.InterfaceBindingMethod, - "interfaceBindingMethod must be either 'Bridge' or 'SRIOV'")) - } - - if err := validate.IP(p.APIVIP); err != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("apiVIP"), p.APIVIP, err.Error())) - } else if err := validateIPInMachineNetworkEntryList(c.MachineNetwork, p.APIVIP); err != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("apiVIP"), p.APIVIP, err.Error())) - } - - if err := validate.IP(p.IngressVIP); err != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("ingressVIP"), p.IngressVIP, err.Error())) - } else if err := validateIPInMachineNetworkEntryList(c.MachineNetwork, p.IngressVIP); err != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("ingressVIP"), p.IngressVIP, err.Error())) - } - - return allErrs -} - -func validateIPInMachineNetworkEntryList(machineNetworkEntryList []types.MachineNetworkEntry, ip string) error { - ipAddr := net.ParseIP(ip) - for _, machineNetworkEntry := range machineNetworkEntryList { - if machineNetworkEntry.CIDR.Contains(ipAddr) { - return nil - } - } - return fmt.Errorf("IP must be in machine network range, machineNetworkEntryList: %s", machineNetworkEntryList) -} diff --git a/pkg/types/kubevirt/validation/platform_test.go b/pkg/types/kubevirt/validation/platform_test.go deleted file mode 100644 index 8a40f1ed0a0..00000000000 --- a/pkg/types/kubevirt/validation/platform_test.go +++ /dev/null @@ -1,135 +0,0 @@ -package validation - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "k8s.io/apimachinery/pkg/util/validation/field" - - "github.com/openshift/installer/pkg/ipnet" - "github.com/openshift/installer/pkg/types" - "github.com/openshift/installer/pkg/types/kubevirt" -) - -func validPlatform() *kubevirt.Platform { - return &kubevirt.Platform{ - Namespace: "test-namespace", - StorageClass: "", - NetworkName: "test network", - APIVIP: "192.168.123.15", - IngressVIP: "192.168.123.16", - PersistentVolumeAccessMode: "ReadWriteMany", - } -} - -func TestValidatePlatform(t *testing.T) { - cases := []struct { - name string - platform *kubevirt.Platform - valid bool - }{ - { - name: "valid", - platform: validPlatform(), - valid: true, - }, - { - name: "empty namespace", - platform: func() *kubevirt.Platform { - p := validPlatform() - p.Namespace = "" - return p - }(), - valid: false, - }, - { - name: "empty network name", - platform: func() *kubevirt.Platform { - p := validPlatform() - p.NetworkName = "" - return p - }(), - valid: false, - }, - { - name: "empty API VIP", - platform: func() *kubevirt.Platform { - p := validPlatform() - p.APIVIP = "" - return p - }(), - valid: false, - }, - { - name: "invalid API VIP", - platform: func() *kubevirt.Platform { - p := validPlatform() - p.APIVIP = "invalid API VIP" - return p - }(), - valid: false, - }, - { - name: "API VIP not in CIDR", - platform: func() *kubevirt.Platform { - p := validPlatform() - p.APIVIP = "10.0.0.1" - return p - }(), - valid: false, - }, - { - name: "empty ingress VIP", - platform: func() *kubevirt.Platform { - p := validPlatform() - p.IngressVIP = "" - return p - }(), - valid: false, - }, - { - name: "invalid ingress VIP", - platform: func() *kubevirt.Platform { - p := validPlatform() - p.IngressVIP = "invalid ingress VIP" - return p - }(), - valid: false, - }, - { - name: "ingress VIP not in CIDR", - platform: func() *kubevirt.Platform { - p := validPlatform() - p.IngressVIP = "1.1.1.1" - return p - }(), - valid: false, - }, - { - name: "valid - empty access mode", - platform: func() *kubevirt.Platform { - p := validPlatform() - p.PersistentVolumeAccessMode = "" - return p - }(), - valid: true, - }, - } - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - ic := &types.InstallConfig{ - Networking: &types.Networking{ - MachineNetwork: []types.MachineNetworkEntry{ - {CIDR: *ipnet.MustParseCIDR("192.168.123.0/24")}, - }, - }, - } - err := ValidatePlatform(tc.platform, field.NewPath("test-path"), ic).ToAggregate() - if tc.valid { - assert.NoError(t, err) - } else { - assert.Error(t, err) - } - }) - } -} diff --git a/pkg/types/machinepools.go b/pkg/types/machinepools.go index 683981a20a8..390a2f9a9f0 100644 --- a/pkg/types/machinepools.go +++ b/pkg/types/machinepools.go @@ -6,7 +6,6 @@ import ( "github.com/openshift/installer/pkg/types/baremetal" "github.com/openshift/installer/pkg/types/gcp" "github.com/openshift/installer/pkg/types/ibmcloud" - "github.com/openshift/installer/pkg/types/kubevirt" "github.com/openshift/installer/pkg/types/libvirt" "github.com/openshift/installer/pkg/types/openstack" "github.com/openshift/installer/pkg/types/ovirt" @@ -97,9 +96,6 @@ type MachinePoolPlatform struct { // Ovirt is the configuration used when installing on oVirt. Ovirt *ovirt.MachinePool `json:"ovirt,omitempty"` - - // Kubevirt is the configuration used when installing on Kubevirt. - Kubevirt *kubevirt.MachinePool `json:"kubevirt,omitempty"` } // Name returns a string representation of the platform (e.g. "aws" if @@ -127,8 +123,6 @@ func (p *MachinePoolPlatform) Name() string { return vsphere.Name case p.Ovirt != nil: return ovirt.Name - case p.Kubevirt != nil: - return kubevirt.Name default: return "" } diff --git a/pkg/types/validation/installconfig.go b/pkg/types/validation/installconfig.go index eff0cca665b..304df4b953f 100644 --- a/pkg/types/validation/installconfig.go +++ b/pkg/types/validation/installconfig.go @@ -31,8 +31,6 @@ import ( gcpvalidation "github.com/openshift/installer/pkg/types/gcp/validation" "github.com/openshift/installer/pkg/types/ibmcloud" ibmcloudvalidation "github.com/openshift/installer/pkg/types/ibmcloud/validation" - "github.com/openshift/installer/pkg/types/kubevirt" - kubevirtvalidation "github.com/openshift/installer/pkg/types/kubevirt/validation" "github.com/openshift/installer/pkg/types/libvirt" libvirtvalidation "github.com/openshift/installer/pkg/types/libvirt/validation" "github.com/openshift/installer/pkg/types/openstack" @@ -478,11 +476,6 @@ func validatePlatform(platform *types.Platform, fldPath *field.Path, network *ty return ovirtvalidation.ValidatePlatform(platform.Ovirt, f) }) } - if platform.Kubevirt != nil { - validate(kubevirt.Name, platform.Kubevirt, func(f *field.Path) field.ErrorList { - return kubevirtvalidation.ValidatePlatform(platform.Kubevirt, f, c) - }) - } return allErrs } diff --git a/pkg/types/validation/installconfig_test.go b/pkg/types/validation/installconfig_test.go index c2cfcc90254..df99c1a7ec2 100644 --- a/pkg/types/validation/installconfig_test.go +++ b/pkg/types/validation/installconfig_test.go @@ -514,7 +514,7 @@ func TestValidateInstallConfig(t *testing.T) { c.Platform = types.Platform{} return c }(), - expectedError: `^platform: Invalid value: "": must specify one of the platforms \(aws, azure, baremetal, gcp, ibmcloud, kubevirt, none, openstack, ovirt, vsphere\)$`, + expectedError: `^platform: Invalid value: "": must specify one of the platforms \(aws, azure, baremetal, gcp, ibmcloud, none, openstack, ovirt, vsphere\)$`, }, { name: "multiple platforms", @@ -545,7 +545,7 @@ func TestValidateInstallConfig(t *testing.T) { } return c }(), - expectedError: `^platform: Invalid value: "libvirt": must specify one of the platforms \(aws, azure, baremetal, gcp, ibmcloud, kubevirt, none, openstack, ovirt, vsphere\)$`, + expectedError: `^platform: Invalid value: "libvirt": must specify one of the platforms \(aws, azure, baremetal, gcp, ibmcloud, none, openstack, ovirt, vsphere\)$`, }, { name: "invalid libvirt platform", @@ -557,7 +557,7 @@ func TestValidateInstallConfig(t *testing.T) { c.Platform.Libvirt.URI = "" return c }(), - expectedError: `^\[platform: Invalid value: "libvirt": must specify one of the platforms \(aws, azure, baremetal, gcp, ibmcloud, kubevirt, none, openstack, ovirt, vsphere\), platform\.libvirt\.uri: Invalid value: "": invalid URI "" \(no scheme\)]$`, + expectedError: `^\[platform: Invalid value: "libvirt": must specify one of the platforms \(aws, azure, baremetal, gcp, ibmcloud, none, openstack, ovirt, vsphere\), platform\.libvirt\.uri: Invalid value: "": invalid URI "" \(no scheme\)]$`, }, { name: "valid none platform", diff --git a/pkg/types/validation/machinepools.go b/pkg/types/validation/machinepools.go index d97562168fb..f14f8078113 100644 --- a/pkg/types/validation/machinepools.go +++ b/pkg/types/validation/machinepools.go @@ -16,8 +16,6 @@ import ( gcpvalidation "github.com/openshift/installer/pkg/types/gcp/validation" "github.com/openshift/installer/pkg/types/ibmcloud" ibmcloudvalidation "github.com/openshift/installer/pkg/types/ibmcloud/validation" - "github.com/openshift/installer/pkg/types/kubevirt" - kubevirtvalidation "github.com/openshift/installer/pkg/types/kubevirt/validation" "github.com/openshift/installer/pkg/types/libvirt" libvirtvalidation "github.com/openshift/installer/pkg/types/libvirt/validation" "github.com/openshift/installer/pkg/types/openstack" @@ -119,9 +117,6 @@ func validateMachinePoolPlatform(platform *types.Platform, p *types.MachinePoolP if p.Ovirt != nil { validate(ovirt.Name, p.Ovirt, func(f *field.Path) field.ErrorList { return ovirtvalidation.ValidateMachinePool(p.Ovirt, f) }) } - if p.Kubevirt != nil { - validate(kubevirt.Name, p.Kubevirt, func(f *field.Path) field.ErrorList { return kubevirtvalidation.ValidateMachinePool(p.Kubevirt, f) }) - } if p.OpenStack != nil { validate(openstack.Name, p.OpenStack, func(f *field.Path) field.ErrorList { return openstackvalidation.ValidateMachinePool(platform.OpenStack, p.OpenStack, pool.Name, f) diff --git a/vendor/github.com/emicklei/go-restful/.gitignore b/vendor/github.com/emicklei/go-restful/.gitignore deleted file mode 100644 index 446be09b4d0..00000000000 --- a/vendor/github.com/emicklei/go-restful/.gitignore +++ /dev/null @@ -1,71 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe - -restful.html - -*.out - -tmp.prof - -go-restful.test - -examples/restful-basic-authentication - -examples/restful-encoding-filter - -examples/restful-filters - -examples/restful-hello-world - -examples/restful-resource-functions - -examples/restful-serve-static - -examples/restful-user-service - -*.DS_Store -examples/restful-user-resource - -examples/restful-multi-containers - -examples/restful-form-handling - -examples/restful-CORS-filter - -examples/restful-options-filter - -examples/restful-curly-router - -examples/restful-cpuprofiler-service - -examples/restful-pre-post-filters - -curly.prof - -examples/restful-NCSA-logging - -examples/restful-html-template - -s.html -restful-path-tail -.idea diff --git a/vendor/github.com/emicklei/go-restful/.travis.yml b/vendor/github.com/emicklei/go-restful/.travis.yml deleted file mode 100644 index 3a0bf5ff1b8..00000000000 --- a/vendor/github.com/emicklei/go-restful/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go - -go: - - 1.x - -before_install: - - go test -v - -script: - - go test -race -coverprofile=coverage.txt -covermode=atomic - -after_success: - - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/CHANGES.md b/vendor/github.com/emicklei/go-restful/CHANGES.md deleted file mode 100644 index a69393d1ab7..00000000000 --- a/vendor/github.com/emicklei/go-restful/CHANGES.md +++ /dev/null @@ -1,306 +0,0 @@ -# Change history of go-restful - -## [v2.14.1] - 2020-08-31 - -- Added check on writer to prevent compression of response twice. #447 - -## [v2.14.0] - 2020-08-19 - -- Enable content encoding on Handle and ServeHTTP (#446) -- List available representations in 406 body (#437) -- Convert to string using rune() (#443) - -## [v2.13.0] - 2020-06-21 - -- 405 Method Not Allowed must have Allow header (#436) -- add field allowedMethodsWithoutContentType (#424) - -## v2.12.0 - -- support describing response headers (#426) -- fix openapi examples (#425) -- merge v3 fix (#422) - -## v2.11.1 - -- fix WriteError return value (#415) - -## v2.11.0 - -- allow prefix and suffix in path variable expression (#414) - -## v2.9.6 - -- support google custome verb (#413) - -## v2.9.5 - -- fix panic in Response.WriteError if err == nil - -## v2.9.4 - -- fix issue #400 , parsing mime type quality -- Route Builder added option for contentEncodingEnabled (#398) - -## v2.9.3 - -- Avoid return of 415 Unsupported Media Type when request body is empty (#396) - -## v2.9.2 - -- Reduce allocations in per-request methods to improve performance (#395) - -## v2.9.1 - -- Fix issue with default responses and invalid status code 0. (#393) - -## v2.9.0 - -- add per Route content encoding setting (overrides container setting) - -## v2.8.0 - -- add Request.QueryParameters() -- add json-iterator (via build tag) -- disable vgo module (until log is moved) - -## v2.7.1 - -- add vgo module - -## v2.6.1 - -- add JSONNewDecoderFunc to allow custom JSON Decoder usage (go 1.10+) - -## v2.6.0 - -- Make JSR 311 routing and path param processing consistent -- Adding description to RouteBuilder.Reads() -- Update example for Swagger12 and OpenAPI - -## 2017-09-13 - -- added route condition functions using `.If(func)` in route building. - -## 2017-02-16 - -- solved issue #304, make operation names unique - -## 2017-01-30 - - [IMPORTANT] For swagger users, change your import statement to: - swagger "github.com/emicklei/go-restful-swagger12" - -- moved swagger 1.2 code to go-restful-swagger12 -- created TAG 2.0.0 - -## 2017-01-27 - -- remove defer request body close -- expose Dispatch for testing filters and Routefunctions -- swagger response model cannot be array -- created TAG 1.0.0 - -## 2016-12-22 - -- (API change) Remove code related to caching request content. Removes SetCacheReadEntity(doCache bool) - -## 2016-11-26 - -- Default change! now use CurlyRouter (was RouterJSR311) -- Default change! no more caching of request content -- Default change! do not recover from panics - -## 2016-09-22 - -- fix the DefaultRequestContentType feature - -## 2016-02-14 - -- take the qualify factor of the Accept header mediatype into account when deciding the contentype of the response -- add constructors for custom entity accessors for xml and json - -## 2015-09-27 - -- rename new WriteStatusAnd... to WriteHeaderAnd... for consistency - -## 2015-09-25 - -- fixed problem with changing Header after WriteHeader (issue 235) - -## 2015-09-14 - -- changed behavior of WriteHeader (immediate write) and WriteEntity (no status write) -- added support for custom EntityReaderWriters. - -## 2015-08-06 - -- add support for reading entities from compressed request content -- use sync.Pool for compressors of http response and request body -- add Description to Parameter for documentation in Swagger UI - -## 2015-03-20 - -- add configurable logging - -## 2015-03-18 - -- if not specified, the Operation is derived from the Route function - -## 2015-03-17 - -- expose Parameter creation functions -- make trace logger an interface -- fix OPTIONSFilter -- customize rendering of ServiceError -- JSR311 router now handles wildcards -- add Notes to Route - -## 2014-11-27 - -- (api add) PrettyPrint per response. (as proposed in #167) - -## 2014-11-12 - -- (api add) ApiVersion(.) for documentation in Swagger UI - -## 2014-11-10 - -- (api change) struct fields tagged with "description" show up in Swagger UI - -## 2014-10-31 - -- (api change) ReturnsError -> Returns -- (api add) RouteBuilder.Do(aBuilder) for DRY use of RouteBuilder -- fix swagger nested structs -- sort Swagger response messages by code - -## 2014-10-23 - -- (api add) ReturnsError allows you to document Http codes in swagger -- fixed problem with greedy CurlyRouter -- (api add) Access-Control-Max-Age in CORS -- add tracing functionality (injectable) for debugging purposes -- support JSON parse 64bit int -- fix empty parameters for swagger -- WebServicesUrl is now optional for swagger -- fixed duplicate AccessControlAllowOrigin in CORS -- (api change) expose ServeMux in container -- (api add) added AllowedDomains in CORS -- (api add) ParameterNamed for detailed documentation - -## 2014-04-16 - -- (api add) expose constructor of Request for testing. - -## 2014-06-27 - -- (api add) ParameterNamed gives access to a Parameter definition and its data (for further specification). -- (api add) SetCacheReadEntity allow scontrol over whether or not the request body is being cached (default true for compatibility reasons). - -## 2014-07-03 - -- (api add) CORS can be configured with a list of allowed domains - -## 2014-03-12 - -- (api add) Route path parameters can use wildcard or regular expressions. (requires CurlyRouter) - -## 2014-02-26 - -- (api add) Request now provides information about the matched Route, see method SelectedRoutePath - -## 2014-02-17 - -- (api change) renamed parameter constants (go-lint checks) - -## 2014-01-10 - -- (api add) support for CloseNotify, see http://golang.org/pkg/net/http/#CloseNotifier - -## 2014-01-07 - -- (api change) Write* methods in Response now return the error or nil. -- added example of serving HTML from a Go template. -- fixed comparing Allowed headers in CORS (is now case-insensitive) - -## 2013-11-13 - -- (api add) Response knows how many bytes are written to the response body. - -## 2013-10-29 - -- (api add) RecoverHandler(handler RecoverHandleFunction) to change how panic recovery is handled. Default behavior is to log and return a stacktrace. This may be a security issue as it exposes sourcecode information. - -## 2013-10-04 - -- (api add) Response knows what HTTP status has been written -- (api add) Request can have attributes (map of string->interface, also called request-scoped variables - -## 2013-09-12 - -- (api change) Router interface simplified -- Implemented CurlyRouter, a Router that does not use|allow regular expressions in paths - -## 2013-08-05 - - add OPTIONS support - - add CORS support - -## 2013-08-27 - -- fixed some reported issues (see github) -- (api change) deprecated use of WriteError; use WriteErrorString instead - -## 2014-04-15 - -- (fix) v1.0.1 tag: fix Issue 111: WriteErrorString - -## 2013-08-08 - -- (api add) Added implementation Container: a WebServices collection with its own http.ServeMux allowing multiple endpoints per program. Existing uses of go-restful will register their services to the DefaultContainer. -- (api add) the swagger package has be extended to have a UI per container. -- if panic is detected then a small stack trace is printed (thanks to runner-mei) -- (api add) WriteErrorString to Response - -Important API changes: - -- (api remove) package variable DoNotRecover no longer works ; use restful.DefaultContainer.DoNotRecover(true) instead. -- (api remove) package variable EnableContentEncoding no longer works ; use restful.DefaultContainer.EnableContentEncoding(true) instead. - - -## 2013-07-06 - -- (api add) Added support for response encoding (gzip and deflate(zlib)). This feature is disabled on default (for backwards compatibility). Use restful.EnableContentEncoding = true in your initialization to enable this feature. - -## 2013-06-19 - -- (improve) DoNotRecover option, moved request body closer, improved ReadEntity - -## 2013-06-03 - -- (api change) removed Dispatcher interface, hide PathExpression -- changed receiver names of type functions to be more idiomatic Go - -## 2013-06-02 - -- (optimize) Cache the RegExp compilation of Paths. - -## 2013-05-22 - -- (api add) Added support for request/response filter functions - -## 2013-05-18 - - -- (api add) Added feature to change the default Http Request Dispatch function (travis cline) -- (api change) Moved Swagger Webservice to swagger package (see example restful-user) - -## [2012-11-14 .. 2013-05-18> - -- See https://github.com/emicklei/go-restful/commits - -## 2012-11-14 - -- Initial commit - - diff --git a/vendor/github.com/emicklei/go-restful/LICENSE b/vendor/github.com/emicklei/go-restful/LICENSE deleted file mode 100644 index ece7ec61eff..00000000000 --- a/vendor/github.com/emicklei/go-restful/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012,2013 Ernest Micklei - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/Makefile b/vendor/github.com/emicklei/go-restful/Makefile deleted file mode 100644 index b40081cc0e7..00000000000 --- a/vendor/github.com/emicklei/go-restful/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: test - -test: - go test -v . - -ex: - cd examples && ls *.go | xargs go build -o /tmp/ignore \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/README.md b/vendor/github.com/emicklei/go-restful/README.md deleted file mode 100644 index 4b4d26e72e9..00000000000 --- a/vendor/github.com/emicklei/go-restful/README.md +++ /dev/null @@ -1,111 +0,0 @@ -go-restful -========== -package for building REST-style Web Services using Google Go - -[![Build Status](https://travis-ci.org/emicklei/go-restful.png)](https://travis-ci.org/emicklei/go-restful) -[![Go Report Card](https://goreportcard.com/badge/github.com/emicklei/go-restful)](https://goreportcard.com/report/github.com/emicklei/go-restful) -[![GoDoc](https://godoc.org/github.com/emicklei/go-restful?status.svg)](https://pkg.go.dev/github.com/emicklei/go-restful) -[![codecov](https://codecov.io/gh/emicklei/go-restful/branch/master/graph/badge.svg)](https://codecov.io/gh/emicklei/go-restful) - -- [Code examples](https://github.com/emicklei/go-restful/tree/master/examples) - -REST asks developers to use HTTP methods explicitly and in a way that's consistent with the protocol definition. This basic REST design principle establishes a one-to-one mapping between create, read, update, and delete (CRUD) operations and HTTP methods. According to this mapping: - -- GET = Retrieve a representation of a resource -- POST = Create if you are sending content to the server to create a subordinate of the specified resource collection, using some server-side algorithm. -- PUT = Create if you are sending the full content of the specified resource (URI). -- PUT = Update if you are updating the full content of the specified resource. -- DELETE = Delete if you are requesting the server to delete the resource -- PATCH = Update partial content of a resource -- OPTIONS = Get information about the communication options for the request URI - -### Usage - -#### Without Go Modules - -All versions up to `v2.*.*` (on the master) are not supporting Go modules. - -``` -import ( - restful "github.com/emicklei/go-restful" -) -``` - -#### Using Go Modules - -As of version `v3.0.0` (on the v3 branch), this package supports Go modules. - -``` -import ( - restful "github.com/emicklei/go-restful/v3" -) -``` - -### Example - -```Go -ws := new(restful.WebService) -ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) - -ws.Route(ws.GET("/{user-id}").To(u.findUser). - Doc("get a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - Writes(User{})) -... - -func (u UserResource) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - ... -} -``` - -[Full API of a UserResource](https://github.com/emicklei/go-restful/tree/master/examples/restful-user-resource.go) - -### Features - -- Routes for request → function mapping with path parameter (e.g. {id} but also prefix_{var} and {var}_suffix) support -- Configurable router: - - (default) Fast routing algorithm that allows static elements, [google custom method](https://cloud.google.com/apis/design/custom_methods), regular expressions and dynamic parameters in the URL path (e.g. /resource/name:customVerb, /meetings/{id} or /static/{subpath:*}) - - Routing algorithm after [JSR311](http://jsr311.java.net/nonav/releases/1.1/spec/spec.html) that is implemented using (but does **not** accept) regular expressions -- Request API for reading structs from JSON/XML and accesing parameters (path,query,header) -- Response API for writing structs to JSON/XML and setting headers -- Customizable encoding using EntityReaderWriter registration -- Filters for intercepting the request → response flow on Service or Route level -- Request-scoped variables using attributes -- Containers for WebServices on different HTTP endpoints -- Content encoding (gzip,deflate) of request and response payloads -- Automatic responses on OPTIONS (using a filter) -- Automatic CORS request handling (using a filter) -- API declaration for Swagger UI ([go-restful-openapi](https://github.com/emicklei/go-restful-openapi), see [go-restful-swagger12](https://github.com/emicklei/go-restful-swagger12)) -- Panic recovery to produce HTTP 500, customizable using RecoverHandler(...) -- Route errors produce HTTP 404/405/406/415 errors, customizable using ServiceErrorHandler(...) -- Configurable (trace) logging -- Customizable gzip/deflate readers and writers using CompressorProvider registration - -## How to customize -There are several hooks to customize the behavior of the go-restful package. - -- Router algorithm -- Panic recovery -- JSON decoder -- Trace logging -- Compression -- Encoders for other serializers -- Use [jsoniter](https://github.com/json-iterator/go) by build this package using a tag, e.g. `go build -tags=jsoniter .` - -TODO: write examples of these. - -## Resources - -- [Example posted on blog](http://ernestmicklei.com/2012/11/go-restful-first-working-example/) -- [Design explained on blog](http://ernestmicklei.com/2012/11/go-restful-api-design/) -- [sourcegraph](https://sourcegraph.com/github.com/emicklei/go-restful) -- [showcase: Zazkia - tcp proxy for testing resiliency](https://github.com/emicklei/zazkia) -- [showcase: Mora - MongoDB REST Api server](https://github.com/emicklei/mora) - -Type ```git shortlog -s``` for a full list of contributors. - -© 2012 - 2020, http://ernestmicklei.com. MIT License. Contributions are welcome. diff --git a/vendor/github.com/emicklei/go-restful/Srcfile b/vendor/github.com/emicklei/go-restful/Srcfile deleted file mode 100644 index 16fd186892e..00000000000 --- a/vendor/github.com/emicklei/go-restful/Srcfile +++ /dev/null @@ -1 +0,0 @@ -{"SkipDirs": ["examples"]} diff --git a/vendor/github.com/emicklei/go-restful/bench_test.sh b/vendor/github.com/emicklei/go-restful/bench_test.sh deleted file mode 100644 index 47ffbe4ac9d..00000000000 --- a/vendor/github.com/emicklei/go-restful/bench_test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#go test -run=none -file bench_test.go -test.bench . -cpuprofile=bench_test.out - -go test -c -./go-restful.test -test.run=none -test.cpuprofile=tmp.prof -test.bench=BenchmarkMany -./go-restful.test -test.run=none -test.cpuprofile=curly.prof -test.bench=BenchmarkManyCurly - -#go tool pprof go-restful.test tmp.prof -go tool pprof go-restful.test curly.prof - - diff --git a/vendor/github.com/emicklei/go-restful/compress.go b/vendor/github.com/emicklei/go-restful/compress.go deleted file mode 100644 index 220b37712f5..00000000000 --- a/vendor/github.com/emicklei/go-restful/compress.go +++ /dev/null @@ -1,123 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bufio" - "compress/gzip" - "compress/zlib" - "errors" - "io" - "net" - "net/http" - "strings" -) - -// OBSOLETE : use restful.DefaultContainer.EnableContentEncoding(true) to change this setting. -var EnableContentEncoding = false - -// CompressingResponseWriter is a http.ResponseWriter that can perform content encoding (gzip and zlib) -type CompressingResponseWriter struct { - writer http.ResponseWriter - compressor io.WriteCloser - encoding string -} - -// Header is part of http.ResponseWriter interface -func (c *CompressingResponseWriter) Header() http.Header { - return c.writer.Header() -} - -// WriteHeader is part of http.ResponseWriter interface -func (c *CompressingResponseWriter) WriteHeader(status int) { - c.writer.WriteHeader(status) -} - -// Write is part of http.ResponseWriter interface -// It is passed through the compressor -func (c *CompressingResponseWriter) Write(bytes []byte) (int, error) { - if c.isCompressorClosed() { - return -1, errors.New("Compressing error: tried to write data using closed compressor") - } - return c.compressor.Write(bytes) -} - -// CloseNotify is part of http.CloseNotifier interface -func (c *CompressingResponseWriter) CloseNotify() <-chan bool { - return c.writer.(http.CloseNotifier).CloseNotify() -} - -// Close the underlying compressor -func (c *CompressingResponseWriter) Close() error { - if c.isCompressorClosed() { - return errors.New("Compressing error: tried to close already closed compressor") - } - - c.compressor.Close() - if ENCODING_GZIP == c.encoding { - currentCompressorProvider.ReleaseGzipWriter(c.compressor.(*gzip.Writer)) - } - if ENCODING_DEFLATE == c.encoding { - currentCompressorProvider.ReleaseZlibWriter(c.compressor.(*zlib.Writer)) - } - // gc hint needed? - c.compressor = nil - return nil -} - -func (c *CompressingResponseWriter) isCompressorClosed() bool { - return nil == c.compressor -} - -// Hijack implements the Hijacker interface -// This is especially useful when combining Container.EnabledContentEncoding -// in combination with websockets (for instance gorilla/websocket) -func (c *CompressingResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { - hijacker, ok := c.writer.(http.Hijacker) - if !ok { - return nil, nil, errors.New("ResponseWriter doesn't support Hijacker interface") - } - return hijacker.Hijack() -} - -// WantsCompressedResponse reads the Accept-Encoding header to see if and which encoding is requested. -func wantsCompressedResponse(httpRequest *http.Request) (bool, string) { - header := httpRequest.Header.Get(HEADER_AcceptEncoding) - gi := strings.Index(header, ENCODING_GZIP) - zi := strings.Index(header, ENCODING_DEFLATE) - // use in order of appearance - if gi == -1 { - return zi != -1, ENCODING_DEFLATE - } else if zi == -1 { - return gi != -1, ENCODING_GZIP - } else { - if gi < zi { - return true, ENCODING_GZIP - } - return true, ENCODING_DEFLATE - } -} - -// NewCompressingResponseWriter create a CompressingResponseWriter for a known encoding = {gzip,deflate} -func NewCompressingResponseWriter(httpWriter http.ResponseWriter, encoding string) (*CompressingResponseWriter, error) { - httpWriter.Header().Set(HEADER_ContentEncoding, encoding) - c := new(CompressingResponseWriter) - c.writer = httpWriter - var err error - if ENCODING_GZIP == encoding { - w := currentCompressorProvider.AcquireGzipWriter() - w.Reset(httpWriter) - c.compressor = w - c.encoding = ENCODING_GZIP - } else if ENCODING_DEFLATE == encoding { - w := currentCompressorProvider.AcquireZlibWriter() - w.Reset(httpWriter) - c.compressor = w - c.encoding = ENCODING_DEFLATE - } else { - return nil, errors.New("Unknown encoding:" + encoding) - } - return c, err -} diff --git a/vendor/github.com/emicklei/go-restful/compressor_cache.go b/vendor/github.com/emicklei/go-restful/compressor_cache.go deleted file mode 100644 index ee426010a2d..00000000000 --- a/vendor/github.com/emicklei/go-restful/compressor_cache.go +++ /dev/null @@ -1,103 +0,0 @@ -package restful - -// Copyright 2015 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "compress/gzip" - "compress/zlib" -) - -// BoundedCachedCompressors is a CompressorProvider that uses a cache with a fixed amount -// of writers and readers (resources). -// If a new resource is acquired and all are in use, it will return a new unmanaged resource. -type BoundedCachedCompressors struct { - gzipWriters chan *gzip.Writer - gzipReaders chan *gzip.Reader - zlibWriters chan *zlib.Writer - writersCapacity int - readersCapacity int -} - -// NewBoundedCachedCompressors returns a new, with filled cache, BoundedCachedCompressors. -func NewBoundedCachedCompressors(writersCapacity, readersCapacity int) *BoundedCachedCompressors { - b := &BoundedCachedCompressors{ - gzipWriters: make(chan *gzip.Writer, writersCapacity), - gzipReaders: make(chan *gzip.Reader, readersCapacity), - zlibWriters: make(chan *zlib.Writer, writersCapacity), - writersCapacity: writersCapacity, - readersCapacity: readersCapacity, - } - for ix := 0; ix < writersCapacity; ix++ { - b.gzipWriters <- newGzipWriter() - b.zlibWriters <- newZlibWriter() - } - for ix := 0; ix < readersCapacity; ix++ { - b.gzipReaders <- newGzipReader() - } - return b -} - -// AcquireGzipWriter returns an resettable *gzip.Writer. Needs to be released. -func (b *BoundedCachedCompressors) AcquireGzipWriter() *gzip.Writer { - var writer *gzip.Writer - select { - case writer, _ = <-b.gzipWriters: - default: - // return a new unmanaged one - writer = newGzipWriter() - } - return writer -} - -// ReleaseGzipWriter accepts a writer (does not have to be one that was cached) -// only when the cache has room for it. It will ignore it otherwise. -func (b *BoundedCachedCompressors) ReleaseGzipWriter(w *gzip.Writer) { - // forget the unmanaged ones - if len(b.gzipWriters) < b.writersCapacity { - b.gzipWriters <- w - } -} - -// AcquireGzipReader returns a *gzip.Reader. Needs to be released. -func (b *BoundedCachedCompressors) AcquireGzipReader() *gzip.Reader { - var reader *gzip.Reader - select { - case reader, _ = <-b.gzipReaders: - default: - // return a new unmanaged one - reader = newGzipReader() - } - return reader -} - -// ReleaseGzipReader accepts a reader (does not have to be one that was cached) -// only when the cache has room for it. It will ignore it otherwise. -func (b *BoundedCachedCompressors) ReleaseGzipReader(r *gzip.Reader) { - // forget the unmanaged ones - if len(b.gzipReaders) < b.readersCapacity { - b.gzipReaders <- r - } -} - -// AcquireZlibWriter returns an resettable *zlib.Writer. Needs to be released. -func (b *BoundedCachedCompressors) AcquireZlibWriter() *zlib.Writer { - var writer *zlib.Writer - select { - case writer, _ = <-b.zlibWriters: - default: - // return a new unmanaged one - writer = newZlibWriter() - } - return writer -} - -// ReleaseZlibWriter accepts a writer (does not have to be one that was cached) -// only when the cache has room for it. It will ignore it otherwise. -func (b *BoundedCachedCompressors) ReleaseZlibWriter(w *zlib.Writer) { - // forget the unmanaged ones - if len(b.zlibWriters) < b.writersCapacity { - b.zlibWriters <- w - } -} diff --git a/vendor/github.com/emicklei/go-restful/compressor_pools.go b/vendor/github.com/emicklei/go-restful/compressor_pools.go deleted file mode 100644 index d866ce64bba..00000000000 --- a/vendor/github.com/emicklei/go-restful/compressor_pools.go +++ /dev/null @@ -1,91 +0,0 @@ -package restful - -// Copyright 2015 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bytes" - "compress/gzip" - "compress/zlib" - "sync" -) - -// SyncPoolCompessors is a CompressorProvider that use the standard sync.Pool. -type SyncPoolCompessors struct { - GzipWriterPool *sync.Pool - GzipReaderPool *sync.Pool - ZlibWriterPool *sync.Pool -} - -// NewSyncPoolCompessors returns a new ("empty") SyncPoolCompessors. -func NewSyncPoolCompessors() *SyncPoolCompessors { - return &SyncPoolCompessors{ - GzipWriterPool: &sync.Pool{ - New: func() interface{} { return newGzipWriter() }, - }, - GzipReaderPool: &sync.Pool{ - New: func() interface{} { return newGzipReader() }, - }, - ZlibWriterPool: &sync.Pool{ - New: func() interface{} { return newZlibWriter() }, - }, - } -} - -func (s *SyncPoolCompessors) AcquireGzipWriter() *gzip.Writer { - return s.GzipWriterPool.Get().(*gzip.Writer) -} - -func (s *SyncPoolCompessors) ReleaseGzipWriter(w *gzip.Writer) { - s.GzipWriterPool.Put(w) -} - -func (s *SyncPoolCompessors) AcquireGzipReader() *gzip.Reader { - return s.GzipReaderPool.Get().(*gzip.Reader) -} - -func (s *SyncPoolCompessors) ReleaseGzipReader(r *gzip.Reader) { - s.GzipReaderPool.Put(r) -} - -func (s *SyncPoolCompessors) AcquireZlibWriter() *zlib.Writer { - return s.ZlibWriterPool.Get().(*zlib.Writer) -} - -func (s *SyncPoolCompessors) ReleaseZlibWriter(w *zlib.Writer) { - s.ZlibWriterPool.Put(w) -} - -func newGzipWriter() *gzip.Writer { - // create with an empty bytes writer; it will be replaced before using the gzipWriter - writer, err := gzip.NewWriterLevel(new(bytes.Buffer), gzip.BestSpeed) - if err != nil { - panic(err.Error()) - } - return writer -} - -func newGzipReader() *gzip.Reader { - // create with an empty reader (but with GZIP header); it will be replaced before using the gzipReader - // we can safely use currentCompressProvider because it is set on package initialization. - w := currentCompressorProvider.AcquireGzipWriter() - defer currentCompressorProvider.ReleaseGzipWriter(w) - b := new(bytes.Buffer) - w.Reset(b) - w.Flush() - w.Close() - reader, err := gzip.NewReader(bytes.NewReader(b.Bytes())) - if err != nil { - panic(err.Error()) - } - return reader -} - -func newZlibWriter() *zlib.Writer { - writer, err := zlib.NewWriterLevel(new(bytes.Buffer), gzip.BestSpeed) - if err != nil { - panic(err.Error()) - } - return writer -} diff --git a/vendor/github.com/emicklei/go-restful/compressors.go b/vendor/github.com/emicklei/go-restful/compressors.go deleted file mode 100644 index 9db4a8c8e97..00000000000 --- a/vendor/github.com/emicklei/go-restful/compressors.go +++ /dev/null @@ -1,54 +0,0 @@ -package restful - -// Copyright 2015 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "compress/gzip" - "compress/zlib" -) - -// CompressorProvider describes a component that can provider compressors for the std methods. -type CompressorProvider interface { - // Returns a *gzip.Writer which needs to be released later. - // Before using it, call Reset(). - AcquireGzipWriter() *gzip.Writer - - // Releases an acquired *gzip.Writer. - ReleaseGzipWriter(w *gzip.Writer) - - // Returns a *gzip.Reader which needs to be released later. - AcquireGzipReader() *gzip.Reader - - // Releases an acquired *gzip.Reader. - ReleaseGzipReader(w *gzip.Reader) - - // Returns a *zlib.Writer which needs to be released later. - // Before using it, call Reset(). - AcquireZlibWriter() *zlib.Writer - - // Releases an acquired *zlib.Writer. - ReleaseZlibWriter(w *zlib.Writer) -} - -// DefaultCompressorProvider is the actual provider of compressors (zlib or gzip). -var currentCompressorProvider CompressorProvider - -func init() { - currentCompressorProvider = NewSyncPoolCompessors() -} - -// CurrentCompressorProvider returns the current CompressorProvider. -// It is initialized using a SyncPoolCompessors. -func CurrentCompressorProvider() CompressorProvider { - return currentCompressorProvider -} - -// SetCompressorProvider sets the actual provider of compressors (zlib or gzip). -func SetCompressorProvider(p CompressorProvider) { - if p == nil { - panic("cannot set compressor provider to nil") - } - currentCompressorProvider = p -} diff --git a/vendor/github.com/emicklei/go-restful/constants.go b/vendor/github.com/emicklei/go-restful/constants.go deleted file mode 100644 index 203439c5e5f..00000000000 --- a/vendor/github.com/emicklei/go-restful/constants.go +++ /dev/null @@ -1,30 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -const ( - MIME_XML = "application/xml" // Accept or Content-Type used in Consumes() and/or Produces() - MIME_JSON = "application/json" // Accept or Content-Type used in Consumes() and/or Produces() - MIME_OCTET = "application/octet-stream" // If Content-Type is not present in request, use the default - - HEADER_Allow = "Allow" - HEADER_Accept = "Accept" - HEADER_Origin = "Origin" - HEADER_ContentType = "Content-Type" - HEADER_LastModified = "Last-Modified" - HEADER_AcceptEncoding = "Accept-Encoding" - HEADER_ContentEncoding = "Content-Encoding" - HEADER_AccessControlExposeHeaders = "Access-Control-Expose-Headers" - HEADER_AccessControlRequestMethod = "Access-Control-Request-Method" - HEADER_AccessControlRequestHeaders = "Access-Control-Request-Headers" - HEADER_AccessControlAllowMethods = "Access-Control-Allow-Methods" - HEADER_AccessControlAllowOrigin = "Access-Control-Allow-Origin" - HEADER_AccessControlAllowCredentials = "Access-Control-Allow-Credentials" - HEADER_AccessControlAllowHeaders = "Access-Control-Allow-Headers" - HEADER_AccessControlMaxAge = "Access-Control-Max-Age" - - ENCODING_GZIP = "gzip" - ENCODING_DEFLATE = "deflate" -) diff --git a/vendor/github.com/emicklei/go-restful/container.go b/vendor/github.com/emicklei/go-restful/container.go deleted file mode 100644 index a61e650a4a5..00000000000 --- a/vendor/github.com/emicklei/go-restful/container.go +++ /dev/null @@ -1,436 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bytes" - "errors" - "fmt" - "net/http" - "os" - "runtime" - "strings" - "sync" - - "github.com/emicklei/go-restful/log" -) - -// Container holds a collection of WebServices and a http.ServeMux to dispatch http requests. -// The requests are further dispatched to routes of WebServices using a RouteSelector -type Container struct { - webServicesLock sync.RWMutex - webServices []*WebService - ServeMux *http.ServeMux - isRegisteredOnRoot bool - containerFilters []FilterFunction - doNotRecover bool // default is true - recoverHandleFunc RecoverHandleFunction - serviceErrorHandleFunc ServiceErrorHandleFunction - router RouteSelector // default is a CurlyRouter (RouterJSR311 is a slower alternative) - contentEncodingEnabled bool // default is false -} - -// NewContainer creates a new Container using a new ServeMux and default router (CurlyRouter) -func NewContainer() *Container { - return &Container{ - webServices: []*WebService{}, - ServeMux: http.NewServeMux(), - isRegisteredOnRoot: false, - containerFilters: []FilterFunction{}, - doNotRecover: true, - recoverHandleFunc: logStackOnRecover, - serviceErrorHandleFunc: writeServiceError, - router: CurlyRouter{}, - contentEncodingEnabled: false} -} - -// RecoverHandleFunction declares functions that can be used to handle a panic situation. -// The first argument is what recover() returns. The second must be used to communicate an error response. -type RecoverHandleFunction func(interface{}, http.ResponseWriter) - -// RecoverHandler changes the default function (logStackOnRecover) to be called -// when a panic is detected. DoNotRecover must be have its default value (=false). -func (c *Container) RecoverHandler(handler RecoverHandleFunction) { - c.recoverHandleFunc = handler -} - -// ServiceErrorHandleFunction declares functions that can be used to handle a service error situation. -// The first argument is the service error, the second is the request that resulted in the error and -// the third must be used to communicate an error response. -type ServiceErrorHandleFunction func(ServiceError, *Request, *Response) - -// ServiceErrorHandler changes the default function (writeServiceError) to be called -// when a ServiceError is detected. -func (c *Container) ServiceErrorHandler(handler ServiceErrorHandleFunction) { - c.serviceErrorHandleFunc = handler -} - -// DoNotRecover controls whether panics will be caught to return HTTP 500. -// If set to true, Route functions are responsible for handling any error situation. -// Default value is true. -func (c *Container) DoNotRecover(doNot bool) { - c.doNotRecover = doNot -} - -// Router changes the default Router (currently CurlyRouter) -func (c *Container) Router(aRouter RouteSelector) { - c.router = aRouter -} - -// EnableContentEncoding (default=false) allows for GZIP or DEFLATE encoding of responses. -func (c *Container) EnableContentEncoding(enabled bool) { - c.contentEncodingEnabled = enabled -} - -// Add a WebService to the Container. It will detect duplicate root paths and exit in that case. -func (c *Container) Add(service *WebService) *Container { - c.webServicesLock.Lock() - defer c.webServicesLock.Unlock() - - // if rootPath was not set then lazy initialize it - if len(service.rootPath) == 0 { - service.Path("/") - } - - // cannot have duplicate root paths - for _, each := range c.webServices { - if each.RootPath() == service.RootPath() { - log.Printf("WebService with duplicate root path detected:['%v']", each) - os.Exit(1) - } - } - - // If not registered on root then add specific mapping - if !c.isRegisteredOnRoot { - c.isRegisteredOnRoot = c.addHandler(service, c.ServeMux) - } - c.webServices = append(c.webServices, service) - return c -} - -// addHandler may set a new HandleFunc for the serveMux -// this function must run inside the critical region protected by the webServicesLock. -// returns true if the function was registered on root ("/") -func (c *Container) addHandler(service *WebService, serveMux *http.ServeMux) bool { - pattern := fixedPrefixPath(service.RootPath()) - // check if root path registration is needed - if "/" == pattern || "" == pattern { - serveMux.HandleFunc("/", c.dispatch) - return true - } - // detect if registration already exists - alreadyMapped := false - for _, each := range c.webServices { - if each.RootPath() == service.RootPath() { - alreadyMapped = true - break - } - } - if !alreadyMapped { - serveMux.HandleFunc(pattern, c.dispatch) - if !strings.HasSuffix(pattern, "/") { - serveMux.HandleFunc(pattern+"/", c.dispatch) - } - } - return false -} - -func (c *Container) Remove(ws *WebService) error { - if c.ServeMux == http.DefaultServeMux { - errMsg := fmt.Sprintf("cannot remove a WebService from a Container using the DefaultServeMux: ['%v']", ws) - log.Print(errMsg) - return errors.New(errMsg) - } - c.webServicesLock.Lock() - defer c.webServicesLock.Unlock() - // build a new ServeMux and re-register all WebServices - newServeMux := http.NewServeMux() - newServices := []*WebService{} - newIsRegisteredOnRoot := false - for _, each := range c.webServices { - if each.rootPath != ws.rootPath { - // If not registered on root then add specific mapping - if !newIsRegisteredOnRoot { - newIsRegisteredOnRoot = c.addHandler(each, newServeMux) - } - newServices = append(newServices, each) - } - } - c.webServices, c.ServeMux, c.isRegisteredOnRoot = newServices, newServeMux, newIsRegisteredOnRoot - return nil -} - -// logStackOnRecover is the default RecoverHandleFunction and is called -// when DoNotRecover is false and the recoverHandleFunc is not set for the container. -// Default implementation logs the stacktrace and writes the stacktrace on the response. -// This may be a security issue as it exposes sourcecode information. -func logStackOnRecover(panicReason interface{}, httpWriter http.ResponseWriter) { - var buffer bytes.Buffer - buffer.WriteString(fmt.Sprintf("recover from panic situation: - %v\r\n", panicReason)) - for i := 2; ; i += 1 { - _, file, line, ok := runtime.Caller(i) - if !ok { - break - } - buffer.WriteString(fmt.Sprintf(" %s:%d\r\n", file, line)) - } - log.Print(buffer.String()) - httpWriter.WriteHeader(http.StatusInternalServerError) - httpWriter.Write(buffer.Bytes()) -} - -// writeServiceError is the default ServiceErrorHandleFunction and is called -// when a ServiceError is returned during route selection. Default implementation -// calls resp.WriteErrorString(err.Code, err.Message) -func writeServiceError(err ServiceError, req *Request, resp *Response) { - for header, values := range err.Header { - for _, value := range values { - resp.Header().Add(header, value) - } - } - resp.WriteErrorString(err.Code, err.Message) -} - -// Dispatch the incoming Http Request to a matching WebService. -func (c *Container) Dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) { - if httpWriter == nil { - panic("httpWriter cannot be nil") - } - if httpRequest == nil { - panic("httpRequest cannot be nil") - } - c.dispatch(httpWriter, httpRequest) -} - -// Dispatch the incoming Http Request to a matching WebService. -func (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) { - writer := httpWriter - - // CompressingResponseWriter should be closed after all operations are done - defer func() { - if compressWriter, ok := writer.(*CompressingResponseWriter); ok { - compressWriter.Close() - } - }() - - // Instal panic recovery unless told otherwise - if !c.doNotRecover { // catch all for 500 response - defer func() { - if r := recover(); r != nil { - c.recoverHandleFunc(r, writer) - return - } - }() - } - - // Find best match Route ; err is non nil if no match was found - var webService *WebService - var route *Route - var err error - func() { - c.webServicesLock.RLock() - defer c.webServicesLock.RUnlock() - webService, route, err = c.router.SelectRoute( - c.webServices, - httpRequest) - }() - - // Detect if compression is needed - // assume without compression, test for override - contentEncodingEnabled := c.contentEncodingEnabled - if route != nil && route.contentEncodingEnabled != nil { - contentEncodingEnabled = *route.contentEncodingEnabled - } - if contentEncodingEnabled { - doCompress, encoding := wantsCompressedResponse(httpRequest) - if doCompress { - var err error - writer, err = NewCompressingResponseWriter(httpWriter, encoding) - if err != nil { - log.Print("unable to install compressor: ", err) - httpWriter.WriteHeader(http.StatusInternalServerError) - return - } - } - } - - if err != nil { - // a non-200 response has already been written - // run container filters anyway ; they should not touch the response... - chain := FilterChain{Filters: c.containerFilters, Target: func(req *Request, resp *Response) { - switch err.(type) { - case ServiceError: - ser := err.(ServiceError) - c.serviceErrorHandleFunc(ser, req, resp) - } - // TODO - }} - chain.ProcessFilter(NewRequest(httpRequest), NewResponse(writer)) - return - } - pathProcessor, routerProcessesPath := c.router.(PathProcessor) - if !routerProcessesPath { - pathProcessor = defaultPathProcessor{} - } - pathParams := pathProcessor.ExtractParameters(route, webService, httpRequest.URL.Path) - wrappedRequest, wrappedResponse := route.wrapRequestResponse(writer, httpRequest, pathParams) - // pass through filters (if any) - if size := len(c.containerFilters) + len(webService.filters) + len(route.Filters); size > 0 { - // compose filter chain - allFilters := make([]FilterFunction, 0, size) - allFilters = append(allFilters, c.containerFilters...) - allFilters = append(allFilters, webService.filters...) - allFilters = append(allFilters, route.Filters...) - chain := FilterChain{Filters: allFilters, Target: route.Function} - chain.ProcessFilter(wrappedRequest, wrappedResponse) - } else { - // no filters, handle request by route - route.Function(wrappedRequest, wrappedResponse) - } -} - -// fixedPrefixPath returns the fixed part of the partspec ; it may include template vars {} -func fixedPrefixPath(pathspec string) string { - varBegin := strings.Index(pathspec, "{") - if -1 == varBegin { - return pathspec - } - return pathspec[:varBegin] -} - -// ServeHTTP implements net/http.Handler therefore a Container can be a Handler in a http.Server -func (c *Container) ServeHTTP(httpWriter http.ResponseWriter, httpRequest *http.Request) { - // Skip, if httpWriter is already an CompressingResponseWriter - if _, ok := httpWriter.(*CompressingResponseWriter); ok { - c.ServeMux.ServeHTTP(httpWriter, httpRequest) - return - } - - writer := httpWriter - // CompressingResponseWriter should be closed after all operations are done - defer func() { - if compressWriter, ok := writer.(*CompressingResponseWriter); ok { - compressWriter.Close() - } - }() - - if c.contentEncodingEnabled { - doCompress, encoding := wantsCompressedResponse(httpRequest) - if doCompress { - var err error - writer, err = NewCompressingResponseWriter(httpWriter, encoding) - if err != nil { - log.Print("unable to install compressor: ", err) - httpWriter.WriteHeader(http.StatusInternalServerError) - return - } - } - } - - c.ServeMux.ServeHTTP(writer, httpRequest) -} - -// Handle registers the handler for the given pattern. If a handler already exists for pattern, Handle panics. -func (c *Container) Handle(pattern string, handler http.Handler) { - c.ServeMux.Handle(pattern, http.HandlerFunc(func(httpWriter http.ResponseWriter, httpRequest *http.Request) { - // Skip, if httpWriter is already an CompressingResponseWriter - if _, ok := httpWriter.(*CompressingResponseWriter); ok { - handler.ServeHTTP(httpWriter, httpRequest) - return - } - - writer := httpWriter - - // CompressingResponseWriter should be closed after all operations are done - defer func() { - if compressWriter, ok := writer.(*CompressingResponseWriter); ok { - compressWriter.Close() - } - }() - - if c.contentEncodingEnabled { - doCompress, encoding := wantsCompressedResponse(httpRequest) - if doCompress { - var err error - writer, err = NewCompressingResponseWriter(httpWriter, encoding) - if err != nil { - log.Print("unable to install compressor: ", err) - httpWriter.WriteHeader(http.StatusInternalServerError) - return - } - } - } - - handler.ServeHTTP(writer, httpRequest) - })) -} - -// HandleWithFilter registers the handler for the given pattern. -// Container's filter chain is applied for handler. -// If a handler already exists for pattern, HandleWithFilter panics. -func (c *Container) HandleWithFilter(pattern string, handler http.Handler) { - f := func(httpResponse http.ResponseWriter, httpRequest *http.Request) { - if len(c.containerFilters) == 0 { - handler.ServeHTTP(httpResponse, httpRequest) - return - } - - chain := FilterChain{Filters: c.containerFilters, Target: func(req *Request, resp *Response) { - handler.ServeHTTP(resp, req.Request) - }} - chain.ProcessFilter(NewRequest(httpRequest), NewResponse(httpResponse)) - } - - c.Handle(pattern, http.HandlerFunc(f)) -} - -// Filter appends a container FilterFunction. These are called before dispatching -// a http.Request to a WebService from the container -func (c *Container) Filter(filter FilterFunction) { - c.containerFilters = append(c.containerFilters, filter) -} - -// RegisteredWebServices returns the collections of added WebServices -func (c *Container) RegisteredWebServices() []*WebService { - c.webServicesLock.RLock() - defer c.webServicesLock.RUnlock() - result := make([]*WebService, len(c.webServices)) - for ix := range c.webServices { - result[ix] = c.webServices[ix] - } - return result -} - -// computeAllowedMethods returns a list of HTTP methods that are valid for a Request -func (c *Container) computeAllowedMethods(req *Request) []string { - // Go through all RegisteredWebServices() and all its Routes to collect the options - methods := []string{} - requestPath := req.Request.URL.Path - for _, ws := range c.RegisteredWebServices() { - matches := ws.pathExpr.Matcher.FindStringSubmatch(requestPath) - if matches != nil { - finalMatch := matches[len(matches)-1] - for _, rt := range ws.Routes() { - matches := rt.pathExpr.Matcher.FindStringSubmatch(finalMatch) - if matches != nil { - lastMatch := matches[len(matches)-1] - if lastMatch == "" || lastMatch == "/" { // do not include if value is neither empty nor ‘/’. - methods = append(methods, rt.Method) - } - } - } - } - } - // methods = append(methods, "OPTIONS") not sure about this - return methods -} - -// newBasicRequestResponse creates a pair of Request,Response from its http versions. -// It is basic because no parameter or (produces) content-type information is given. -func newBasicRequestResponse(httpWriter http.ResponseWriter, httpRequest *http.Request) (*Request, *Response) { - resp := NewResponse(httpWriter) - resp.requestAccept = httpRequest.Header.Get(HEADER_Accept) - return NewRequest(httpRequest), resp -} diff --git a/vendor/github.com/emicklei/go-restful/cors_filter.go b/vendor/github.com/emicklei/go-restful/cors_filter.go deleted file mode 100644 index 1efeef072d0..00000000000 --- a/vendor/github.com/emicklei/go-restful/cors_filter.go +++ /dev/null @@ -1,202 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "regexp" - "strconv" - "strings" -) - -// CrossOriginResourceSharing is used to create a Container Filter that implements CORS. -// Cross-origin resource sharing (CORS) is a mechanism that allows JavaScript on a web page -// to make XMLHttpRequests to another domain, not the domain the JavaScript originated from. -// -// http://en.wikipedia.org/wiki/Cross-origin_resource_sharing -// http://enable-cors.org/server.html -// http://www.html5rocks.com/en/tutorials/cors/#toc-handling-a-not-so-simple-request -type CrossOriginResourceSharing struct { - ExposeHeaders []string // list of Header names - AllowedHeaders []string // list of Header names - AllowedDomains []string // list of allowed values for Http Origin. An allowed value can be a regular expression to support subdomain matching. If empty all are allowed. - AllowedMethods []string - MaxAge int // number of seconds before requiring new Options request - CookiesAllowed bool - Container *Container - - allowedOriginPatterns []*regexp.Regexp // internal field for origin regexp check. -} - -// Filter is a filter function that implements the CORS flow as documented on http://enable-cors.org/server.html -// and http://www.html5rocks.com/static/images/cors_server_flowchart.png -func (c CrossOriginResourceSharing) Filter(req *Request, resp *Response, chain *FilterChain) { - origin := req.Request.Header.Get(HEADER_Origin) - if len(origin) == 0 { - if trace { - traceLogger.Print("no Http header Origin set") - } - chain.ProcessFilter(req, resp) - return - } - if !c.isOriginAllowed(origin) { // check whether this origin is allowed - if trace { - traceLogger.Printf("HTTP Origin:%s is not part of %v, neither matches any part of %v", origin, c.AllowedDomains, c.allowedOriginPatterns) - } - chain.ProcessFilter(req, resp) - return - } - if req.Request.Method != "OPTIONS" { - c.doActualRequest(req, resp) - chain.ProcessFilter(req, resp) - return - } - if acrm := req.Request.Header.Get(HEADER_AccessControlRequestMethod); acrm != "" { - c.doPreflightRequest(req, resp) - } else { - c.doActualRequest(req, resp) - chain.ProcessFilter(req, resp) - return - } -} - -func (c CrossOriginResourceSharing) doActualRequest(req *Request, resp *Response) { - c.setOptionsHeaders(req, resp) - // continue processing the response -} - -func (c *CrossOriginResourceSharing) doPreflightRequest(req *Request, resp *Response) { - if len(c.AllowedMethods) == 0 { - if c.Container == nil { - c.AllowedMethods = DefaultContainer.computeAllowedMethods(req) - } else { - c.AllowedMethods = c.Container.computeAllowedMethods(req) - } - } - - acrm := req.Request.Header.Get(HEADER_AccessControlRequestMethod) - if !c.isValidAccessControlRequestMethod(acrm, c.AllowedMethods) { - if trace { - traceLogger.Printf("Http header %s:%s is not in %v", - HEADER_AccessControlRequestMethod, - acrm, - c.AllowedMethods) - } - return - } - acrhs := req.Request.Header.Get(HEADER_AccessControlRequestHeaders) - if len(acrhs) > 0 { - for _, each := range strings.Split(acrhs, ",") { - if !c.isValidAccessControlRequestHeader(strings.Trim(each, " ")) { - if trace { - traceLogger.Printf("Http header %s:%s is not in %v", - HEADER_AccessControlRequestHeaders, - acrhs, - c.AllowedHeaders) - } - return - } - } - } - resp.AddHeader(HEADER_AccessControlAllowMethods, strings.Join(c.AllowedMethods, ",")) - resp.AddHeader(HEADER_AccessControlAllowHeaders, acrhs) - c.setOptionsHeaders(req, resp) - - // return http 200 response, no body -} - -func (c CrossOriginResourceSharing) setOptionsHeaders(req *Request, resp *Response) { - c.checkAndSetExposeHeaders(resp) - c.setAllowOriginHeader(req, resp) - c.checkAndSetAllowCredentials(resp) - if c.MaxAge > 0 { - resp.AddHeader(HEADER_AccessControlMaxAge, strconv.Itoa(c.MaxAge)) - } -} - -func (c CrossOriginResourceSharing) isOriginAllowed(origin string) bool { - if len(origin) == 0 { - return false - } - if len(c.AllowedDomains) == 0 { - return true - } - - allowed := false - for _, domain := range c.AllowedDomains { - if domain == origin { - allowed = true - break - } - } - - if !allowed { - if len(c.allowedOriginPatterns) == 0 { - // compile allowed domains to allowed origin patterns - allowedOriginRegexps, err := compileRegexps(c.AllowedDomains) - if err != nil { - return false - } - c.allowedOriginPatterns = allowedOriginRegexps - } - - for _, pattern := range c.allowedOriginPatterns { - if allowed = pattern.MatchString(origin); allowed { - break - } - } - } - - return allowed -} - -func (c CrossOriginResourceSharing) setAllowOriginHeader(req *Request, resp *Response) { - origin := req.Request.Header.Get(HEADER_Origin) - if c.isOriginAllowed(origin) { - resp.AddHeader(HEADER_AccessControlAllowOrigin, origin) - } -} - -func (c CrossOriginResourceSharing) checkAndSetExposeHeaders(resp *Response) { - if len(c.ExposeHeaders) > 0 { - resp.AddHeader(HEADER_AccessControlExposeHeaders, strings.Join(c.ExposeHeaders, ",")) - } -} - -func (c CrossOriginResourceSharing) checkAndSetAllowCredentials(resp *Response) { - if c.CookiesAllowed { - resp.AddHeader(HEADER_AccessControlAllowCredentials, "true") - } -} - -func (c CrossOriginResourceSharing) isValidAccessControlRequestMethod(method string, allowedMethods []string) bool { - for _, each := range allowedMethods { - if each == method { - return true - } - } - return false -} - -func (c CrossOriginResourceSharing) isValidAccessControlRequestHeader(header string) bool { - for _, each := range c.AllowedHeaders { - if strings.ToLower(each) == strings.ToLower(header) { - return true - } - } - return false -} - -// Take a list of strings and compile them into a list of regular expressions. -func compileRegexps(regexpStrings []string) ([]*regexp.Regexp, error) { - regexps := []*regexp.Regexp{} - for _, regexpStr := range regexpStrings { - r, err := regexp.Compile(regexpStr) - if err != nil { - return regexps, err - } - regexps = append(regexps, r) - } - return regexps, nil -} diff --git a/vendor/github.com/emicklei/go-restful/coverage.sh b/vendor/github.com/emicklei/go-restful/coverage.sh deleted file mode 100644 index e27dbf1a913..00000000000 --- a/vendor/github.com/emicklei/go-restful/coverage.sh +++ /dev/null @@ -1,2 +0,0 @@ -go test -coverprofile=coverage.out -go tool cover -html=coverage.out \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/curly.go b/vendor/github.com/emicklei/go-restful/curly.go deleted file mode 100644 index ba1fc5d5f15..00000000000 --- a/vendor/github.com/emicklei/go-restful/curly.go +++ /dev/null @@ -1,173 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "net/http" - "regexp" - "sort" - "strings" -) - -// CurlyRouter expects Routes with paths that contain zero or more parameters in curly brackets. -type CurlyRouter struct{} - -// SelectRoute is part of the Router interface and returns the best match -// for the WebService and its Route for the given Request. -func (c CurlyRouter) SelectRoute( - webServices []*WebService, - httpRequest *http.Request) (selectedService *WebService, selected *Route, err error) { - - requestTokens := tokenizePath(httpRequest.URL.Path) - - detectedService := c.detectWebService(requestTokens, webServices) - if detectedService == nil { - if trace { - traceLogger.Printf("no WebService was found to match URL path:%s\n", httpRequest.URL.Path) - } - return nil, nil, NewError(http.StatusNotFound, "404: Page Not Found") - } - candidateRoutes := c.selectRoutes(detectedService, requestTokens) - if len(candidateRoutes) == 0 { - if trace { - traceLogger.Printf("no Route in WebService with path %s was found to match URL path:%s\n", detectedService.rootPath, httpRequest.URL.Path) - } - return detectedService, nil, NewError(http.StatusNotFound, "404: Page Not Found") - } - selectedRoute, err := c.detectRoute(candidateRoutes, httpRequest) - if selectedRoute == nil { - return detectedService, nil, err - } - return detectedService, selectedRoute, nil -} - -// selectRoutes return a collection of Route from a WebService that matches the path tokens from the request. -func (c CurlyRouter) selectRoutes(ws *WebService, requestTokens []string) sortableCurlyRoutes { - candidates := make(sortableCurlyRoutes, 0, 8) - for _, each := range ws.routes { - matches, paramCount, staticCount := c.matchesRouteByPathTokens(each.pathParts, requestTokens, each.hasCustomVerb) - if matches { - candidates.add(curlyRoute{each, paramCount, staticCount}) // TODO make sure Routes() return pointers? - } - } - sort.Sort(candidates) - return candidates -} - -// matchesRouteByPathTokens computes whether it matches, howmany parameters do match and what the number of static path elements are. -func (c CurlyRouter) matchesRouteByPathTokens(routeTokens, requestTokens []string, routeHasCustomVerb bool) (matches bool, paramCount int, staticCount int) { - if len(routeTokens) < len(requestTokens) { - // proceed in matching only if last routeToken is wildcard - count := len(routeTokens) - if count == 0 || !strings.HasSuffix(routeTokens[count-1], "*}") { - return false, 0, 0 - } - // proceed - } - for i, routeToken := range routeTokens { - if i == len(requestTokens) { - // reached end of request path - return false, 0, 0 - } - requestToken := requestTokens[i] - if routeHasCustomVerb && hasCustomVerb(routeToken){ - if !isMatchCustomVerb(routeToken, requestToken) { - return false, 0, 0 - } - staticCount++ - requestToken = removeCustomVerb(requestToken) - routeToken = removeCustomVerb(routeToken) - } - - if strings.HasPrefix(routeToken, "{") { - paramCount++ - if colon := strings.Index(routeToken, ":"); colon != -1 { - // match by regex - matchesToken, matchesRemainder := c.regularMatchesPathToken(routeToken, colon, requestToken) - if !matchesToken { - return false, 0, 0 - } - if matchesRemainder { - break - } - } - } else { // no { prefix - if requestToken != routeToken { - return false, 0, 0 - } - staticCount++ - } - } - return true, paramCount, staticCount -} - -// regularMatchesPathToken tests whether the regular expression part of routeToken matches the requestToken or all remaining tokens -// format routeToken is {someVar:someExpression}, e.g. {zipcode:[\d][\d][\d][\d][A-Z][A-Z]} -func (c CurlyRouter) regularMatchesPathToken(routeToken string, colon int, requestToken string) (matchesToken bool, matchesRemainder bool) { - regPart := routeToken[colon+1 : len(routeToken)-1] - if regPart == "*" { - if trace { - traceLogger.Printf("wildcard parameter detected in route token %s that matches %s\n", routeToken, requestToken) - } - return true, true - } - matched, err := regexp.MatchString(regPart, requestToken) - return (matched && err == nil), false -} - -var jsr311Router = RouterJSR311{} - -// detectRoute selectes from a list of Route the first match by inspecting both the Accept and Content-Type -// headers of the Request. See also RouterJSR311 in jsr311.go -func (c CurlyRouter) detectRoute(candidateRoutes sortableCurlyRoutes, httpRequest *http.Request) (*Route, error) { - // tracing is done inside detectRoute - return jsr311Router.detectRoute(candidateRoutes.routes(), httpRequest) -} - -// detectWebService returns the best matching webService given the list of path tokens. -// see also computeWebserviceScore -func (c CurlyRouter) detectWebService(requestTokens []string, webServices []*WebService) *WebService { - var best *WebService - score := -1 - for _, each := range webServices { - matches, eachScore := c.computeWebserviceScore(requestTokens, each.pathExpr.tokens) - if matches && (eachScore > score) { - best = each - score = eachScore - } - } - return best -} - -// computeWebserviceScore returns whether tokens match and -// the weighted score of the longest matching consecutive tokens from the beginning. -func (c CurlyRouter) computeWebserviceScore(requestTokens []string, tokens []string) (bool, int) { - if len(tokens) > len(requestTokens) { - return false, 0 - } - score := 0 - for i := 0; i < len(tokens); i++ { - each := requestTokens[i] - other := tokens[i] - if len(each) == 0 && len(other) == 0 { - score++ - continue - } - if len(other) > 0 && strings.HasPrefix(other, "{") { - // no empty match - if len(each) == 0 { - return false, score - } - score += 1 - } else { - // not a parameter - if each != other { - return false, score - } - score += (len(tokens) - i) * 10 //fuzzy - } - } - return true, score -} diff --git a/vendor/github.com/emicklei/go-restful/curly_route.go b/vendor/github.com/emicklei/go-restful/curly_route.go deleted file mode 100644 index 403dd3be947..00000000000 --- a/vendor/github.com/emicklei/go-restful/curly_route.go +++ /dev/null @@ -1,54 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// curlyRoute exits for sorting Routes by the CurlyRouter based on number of parameters and number of static path elements. -type curlyRoute struct { - route Route - paramCount int - staticCount int -} - -// sortableCurlyRoutes orders by most parameters and path elements first. -type sortableCurlyRoutes []curlyRoute - -func (s *sortableCurlyRoutes) add(route curlyRoute) { - *s = append(*s, route) -} - -func (s sortableCurlyRoutes) routes() (routes []Route) { - routes = make([]Route, 0, len(s)) - for _, each := range s { - routes = append(routes, each.route) // TODO change return type - } - return routes -} - -func (s sortableCurlyRoutes) Len() int { - return len(s) -} -func (s sortableCurlyRoutes) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} -func (s sortableCurlyRoutes) Less(i, j int) bool { - a := s[j] - b := s[i] - - // primary key - if a.staticCount < b.staticCount { - return true - } - if a.staticCount > b.staticCount { - return false - } - // secundary key - if a.paramCount < b.paramCount { - return true - } - if a.paramCount > b.paramCount { - return false - } - return a.route.Path < b.route.Path -} diff --git a/vendor/github.com/emicklei/go-restful/custom_verb.go b/vendor/github.com/emicklei/go-restful/custom_verb.go deleted file mode 100644 index bfc17efde80..00000000000 --- a/vendor/github.com/emicklei/go-restful/custom_verb.go +++ /dev/null @@ -1,29 +0,0 @@ -package restful - -import ( - "fmt" - "regexp" -) - -var ( - customVerbReg = regexp.MustCompile(":([A-Za-z]+)$") -) - -func hasCustomVerb(routeToken string) bool { - return customVerbReg.MatchString(routeToken) -} - -func isMatchCustomVerb(routeToken string, pathToken string) bool { - rs := customVerbReg.FindStringSubmatch(routeToken) - if len(rs) < 2 { - return false - } - - customVerb := rs[1] - specificVerbReg := regexp.MustCompile(fmt.Sprintf(":%s$", customVerb)) - return specificVerbReg.MatchString(pathToken) -} - -func removeCustomVerb(str string) string { - return customVerbReg.ReplaceAllString(str, "") -} diff --git a/vendor/github.com/emicklei/go-restful/doc.go b/vendor/github.com/emicklei/go-restful/doc.go deleted file mode 100644 index f7c16b01fee..00000000000 --- a/vendor/github.com/emicklei/go-restful/doc.go +++ /dev/null @@ -1,185 +0,0 @@ -/* -Package restful , a lean package for creating REST-style WebServices without magic. - -WebServices and Routes - -A WebService has a collection of Route objects that dispatch incoming Http Requests to a function calls. -Typically, a WebService has a root path (e.g. /users) and defines common MIME types for its routes. -WebServices must be added to a container (see below) in order to handler Http requests from a server. - -A Route is defined by a HTTP method, an URL path and (optionally) the MIME types it consumes (Content-Type) and produces (Accept). -This package has the logic to find the best matching Route and if found, call its Function. - - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_JSON, restful.MIME_XML). - Produces(restful.MIME_JSON, restful.MIME_XML) - - ws.Route(ws.GET("/{user-id}").To(u.findUser)) // u is a UserResource - - ... - - // GET http://localhost:8080/users/1 - func (u UserResource) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - ... - } - -The (*Request, *Response) arguments provide functions for reading information from the request and writing information back to the response. - -See the example https://github.com/emicklei/go-restful/blob/master/examples/restful-user-resource.go with a full implementation. - -Regular expression matching Routes - -A Route parameter can be specified using the format "uri/{var[:regexp]}" or the special version "uri/{var:*}" for matching the tail of the path. -For example, /persons/{name:[A-Z][A-Z]} can be used to restrict values for the parameter "name" to only contain capital alphabetic characters. -Regular expressions must use the standard Go syntax as described in the regexp package. (https://code.google.com/p/re2/wiki/Syntax) -This feature requires the use of a CurlyRouter. - -Containers - -A Container holds a collection of WebServices, Filters and a http.ServeMux for multiplexing http requests. -Using the statements "restful.Add(...) and restful.Filter(...)" will register WebServices and Filters to the Default Container. -The Default container of go-restful uses the http.DefaultServeMux. -You can create your own Container and create a new http.Server for that particular container. - - container := restful.NewContainer() - server := &http.Server{Addr: ":8081", Handler: container} - -Filters - -A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses. -You can use filters to perform generic logging, measurement, authentication, redirect, set response headers etc. -In the restful package there are three hooks into the request,response flow where filters can be added. -Each filter must define a FilterFunction: - - func (req *restful.Request, resp *restful.Response, chain *restful.FilterChain) - -Use the following statement to pass the request,response pair to the next filter or RouteFunction - - chain.ProcessFilter(req, resp) - -Container Filters - -These are processed before any registered WebService. - - // install a (global) filter for the default container (processed before any webservice) - restful.Filter(globalLogging) - -WebService Filters - -These are processed before any Route of a WebService. - - // install a webservice filter (processed before any route) - ws.Filter(webserviceLogging).Filter(measureTime) - - -Route Filters - -These are processed before calling the function associated with the Route. - - // install 2 chained route filters (processed before calling findUser) - ws.Route(ws.GET("/{user-id}").Filter(routeLogging).Filter(NewCountFilter().routeCounter).To(findUser)) - -See the example https://github.com/emicklei/go-restful/blob/master/examples/restful-filters.go with full implementations. - -Response Encoding - -Two encodings are supported: gzip and deflate. To enable this for all responses: - - restful.DefaultContainer.EnableContentEncoding(true) - -If a Http request includes the Accept-Encoding header then the response content will be compressed using the specified encoding. -Alternatively, you can create a Filter that performs the encoding and install it per WebService or Route. - -See the example https://github.com/emicklei/go-restful/blob/master/examples/restful-encoding-filter.go - -OPTIONS support - -By installing a pre-defined container filter, your Webservice(s) can respond to the OPTIONS Http request. - - Filter(OPTIONSFilter()) - -CORS - -By installing the filter of a CrossOriginResourceSharing (CORS), your WebService(s) can handle CORS requests. - - cors := CrossOriginResourceSharing{ExposeHeaders: []string{"X-My-Header"}, CookiesAllowed: false, Container: DefaultContainer} - Filter(cors.Filter) - -Error Handling - -Unexpected things happen. If a request cannot be processed because of a failure, your service needs to tell via the response what happened and why. -For this reason HTTP status codes exist and it is important to use the correct code in every exceptional situation. - - 400: Bad Request - -If path or query parameters are not valid (content or type) then use http.StatusBadRequest. - - 404: Not Found - -Despite a valid URI, the resource requested may not be available - - 500: Internal Server Error - -If the application logic could not process the request (or write the response) then use http.StatusInternalServerError. - - 405: Method Not Allowed - -The request has a valid URL but the method (GET,PUT,POST,...) is not allowed. - - 406: Not Acceptable - -The request does not have or has an unknown Accept Header set for this operation. - - 415: Unsupported Media Type - -The request does not have or has an unknown Content-Type Header set for this operation. - -ServiceError - -In addition to setting the correct (error) Http status code, you can choose to write a ServiceError message on the response. - -Performance options - -This package has several options that affect the performance of your service. It is important to understand them and how you can change it. - - restful.DefaultContainer.DoNotRecover(false) - -DoNotRecover controls whether panics will be caught to return HTTP 500. -If set to false, the container will recover from panics. -Default value is true - - restful.SetCompressorProvider(NewBoundedCachedCompressors(20, 20)) - -If content encoding is enabled then the default strategy for getting new gzip/zlib writers and readers is to use a sync.Pool. -Because writers are expensive structures, performance is even more improved when using a preloaded cache. You can also inject your own implementation. - -Trouble shooting - -This package has the means to produce detail logging of the complete Http request matching process and filter invocation. -Enabling this feature requires you to set an implementation of restful.StdLogger (e.g. log.Logger) instance such as: - - restful.TraceLogger(log.New(os.Stdout, "[restful] ", log.LstdFlags|log.Lshortfile)) - -Logging - -The restful.SetLogger() method allows you to override the logger used by the package. By default restful -uses the standard library `log` package and logs to stdout. Different logging packages are supported as -long as they conform to `StdLogger` interface defined in the `log` sub-package, writing an adapter for your -preferred package is simple. - -Resources - -[project]: https://github.com/emicklei/go-restful - -[examples]: https://github.com/emicklei/go-restful/blob/master/examples - -[design]: http://ernestmicklei.com/2012/11/11/go-restful-api-design/ - -[showcases]: https://github.com/emicklei/mora, https://github.com/emicklei/landskape - -(c) 2012-2015, http://ernestmicklei.com. MIT License -*/ -package restful diff --git a/vendor/github.com/emicklei/go-restful/entity_accessors.go b/vendor/github.com/emicklei/go-restful/entity_accessors.go deleted file mode 100644 index 66dfc824f55..00000000000 --- a/vendor/github.com/emicklei/go-restful/entity_accessors.go +++ /dev/null @@ -1,162 +0,0 @@ -package restful - -// Copyright 2015 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "encoding/xml" - "strings" - "sync" -) - -// EntityReaderWriter can read and write values using an encoding such as JSON,XML. -type EntityReaderWriter interface { - // Read a serialized version of the value from the request. - // The Request may have a decompressing reader. Depends on Content-Encoding. - Read(req *Request, v interface{}) error - - // Write a serialized version of the value on the response. - // The Response may have a compressing writer. Depends on Accept-Encoding. - // status should be a valid Http Status code - Write(resp *Response, status int, v interface{}) error -} - -// entityAccessRegistry is a singleton -var entityAccessRegistry = &entityReaderWriters{ - protection: new(sync.RWMutex), - accessors: map[string]EntityReaderWriter{}, -} - -// entityReaderWriters associates MIME to an EntityReaderWriter -type entityReaderWriters struct { - protection *sync.RWMutex - accessors map[string]EntityReaderWriter -} - -func init() { - RegisterEntityAccessor(MIME_JSON, NewEntityAccessorJSON(MIME_JSON)) - RegisterEntityAccessor(MIME_XML, NewEntityAccessorXML(MIME_XML)) -} - -// RegisterEntityAccessor add/overrides the ReaderWriter for encoding content with this MIME type. -func RegisterEntityAccessor(mime string, erw EntityReaderWriter) { - entityAccessRegistry.protection.Lock() - defer entityAccessRegistry.protection.Unlock() - entityAccessRegistry.accessors[mime] = erw -} - -// NewEntityAccessorJSON returns a new EntityReaderWriter for accessing JSON content. -// This package is already initialized with such an accessor using the MIME_JSON contentType. -func NewEntityAccessorJSON(contentType string) EntityReaderWriter { - return entityJSONAccess{ContentType: contentType} -} - -// NewEntityAccessorXML returns a new EntityReaderWriter for accessing XML content. -// This package is already initialized with such an accessor using the MIME_XML contentType. -func NewEntityAccessorXML(contentType string) EntityReaderWriter { - return entityXMLAccess{ContentType: contentType} -} - -// accessorAt returns the registered ReaderWriter for this MIME type. -func (r *entityReaderWriters) accessorAt(mime string) (EntityReaderWriter, bool) { - r.protection.RLock() - defer r.protection.RUnlock() - er, ok := r.accessors[mime] - if !ok { - // retry with reverse lookup - // more expensive but we are in an exceptional situation anyway - for k, v := range r.accessors { - if strings.Contains(mime, k) { - return v, true - } - } - } - return er, ok -} - -// entityXMLAccess is a EntityReaderWriter for XML encoding -type entityXMLAccess struct { - // This is used for setting the Content-Type header when writing - ContentType string -} - -// Read unmarshalls the value from XML -func (e entityXMLAccess) Read(req *Request, v interface{}) error { - return xml.NewDecoder(req.Request.Body).Decode(v) -} - -// Write marshalls the value to JSON and set the Content-Type Header. -func (e entityXMLAccess) Write(resp *Response, status int, v interface{}) error { - return writeXML(resp, status, e.ContentType, v) -} - -// writeXML marshalls the value to JSON and set the Content-Type Header. -func writeXML(resp *Response, status int, contentType string, v interface{}) error { - if v == nil { - resp.WriteHeader(status) - // do not write a nil representation - return nil - } - if resp.prettyPrint { - // pretty output must be created and written explicitly - output, err := xml.MarshalIndent(v, " ", " ") - if err != nil { - return err - } - resp.Header().Set(HEADER_ContentType, contentType) - resp.WriteHeader(status) - _, err = resp.Write([]byte(xml.Header)) - if err != nil { - return err - } - _, err = resp.Write(output) - return err - } - // not-so-pretty - resp.Header().Set(HEADER_ContentType, contentType) - resp.WriteHeader(status) - return xml.NewEncoder(resp).Encode(v) -} - -// entityJSONAccess is a EntityReaderWriter for JSON encoding -type entityJSONAccess struct { - // This is used for setting the Content-Type header when writing - ContentType string -} - -// Read unmarshalls the value from JSON -func (e entityJSONAccess) Read(req *Request, v interface{}) error { - decoder := NewDecoder(req.Request.Body) - decoder.UseNumber() - return decoder.Decode(v) -} - -// Write marshalls the value to JSON and set the Content-Type Header. -func (e entityJSONAccess) Write(resp *Response, status int, v interface{}) error { - return writeJSON(resp, status, e.ContentType, v) -} - -// write marshalls the value to JSON and set the Content-Type Header. -func writeJSON(resp *Response, status int, contentType string, v interface{}) error { - if v == nil { - resp.WriteHeader(status) - // do not write a nil representation - return nil - } - if resp.prettyPrint { - // pretty output must be created and written explicitly - output, err := MarshalIndent(v, "", " ") - if err != nil { - return err - } - resp.Header().Set(HEADER_ContentType, contentType) - resp.WriteHeader(status) - _, err = resp.Write(output) - return err - } - // not-so-pretty - resp.Header().Set(HEADER_ContentType, contentType) - resp.WriteHeader(status) - return NewEncoder(resp).Encode(v) -} diff --git a/vendor/github.com/emicklei/go-restful/filter.go b/vendor/github.com/emicklei/go-restful/filter.go deleted file mode 100644 index c23bfb591ad..00000000000 --- a/vendor/github.com/emicklei/go-restful/filter.go +++ /dev/null @@ -1,35 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// FilterChain is a request scoped object to process one or more filters before calling the target RouteFunction. -type FilterChain struct { - Filters []FilterFunction // ordered list of FilterFunction - Index int // index into filters that is currently in progress - Target RouteFunction // function to call after passing all filters -} - -// ProcessFilter passes the request,response pair through the next of Filters. -// Each filter can decide to proceed to the next Filter or handle the Response itself. -func (f *FilterChain) ProcessFilter(request *Request, response *Response) { - if f.Index < len(f.Filters) { - f.Index++ - f.Filters[f.Index-1](request, response, f) - } else { - f.Target(request, response) - } -} - -// FilterFunction definitions must call ProcessFilter on the FilterChain to pass on the control and eventually call the RouteFunction -type FilterFunction func(*Request, *Response, *FilterChain) - -// NoBrowserCacheFilter is a filter function to set HTTP headers that disable browser caching -// See examples/restful-no-cache-filter.go for usage -func NoBrowserCacheFilter(req *Request, resp *Response, chain *FilterChain) { - resp.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") // HTTP 1.1. - resp.Header().Set("Pragma", "no-cache") // HTTP 1.0. - resp.Header().Set("Expires", "0") // Proxies. - chain.ProcessFilter(req, resp) -} diff --git a/vendor/github.com/emicklei/go-restful/json.go b/vendor/github.com/emicklei/go-restful/json.go deleted file mode 100644 index 871165166a1..00000000000 --- a/vendor/github.com/emicklei/go-restful/json.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !jsoniter - -package restful - -import "encoding/json" - -var ( - MarshalIndent = json.MarshalIndent - NewDecoder = json.NewDecoder - NewEncoder = json.NewEncoder -) diff --git a/vendor/github.com/emicklei/go-restful/jsoniter.go b/vendor/github.com/emicklei/go-restful/jsoniter.go deleted file mode 100644 index 11b8f8ae7f1..00000000000 --- a/vendor/github.com/emicklei/go-restful/jsoniter.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build jsoniter - -package restful - -import "github.com/json-iterator/go" - -var ( - json = jsoniter.ConfigCompatibleWithStandardLibrary - MarshalIndent = json.MarshalIndent - NewDecoder = json.NewDecoder - NewEncoder = json.NewEncoder -) diff --git a/vendor/github.com/emicklei/go-restful/jsr311.go b/vendor/github.com/emicklei/go-restful/jsr311.go deleted file mode 100644 index 9cfd59a1ce6..00000000000 --- a/vendor/github.com/emicklei/go-restful/jsr311.go +++ /dev/null @@ -1,316 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "errors" - "fmt" - "net/http" - "sort" - "strings" -) - -// RouterJSR311 implements the flow for matching Requests to Routes (and consequently Resource Functions) -// as specified by the JSR311 http://jsr311.java.net/nonav/releases/1.1/spec/spec.html. -// RouterJSR311 implements the Router interface. -// Concept of locators is not implemented. -type RouterJSR311 struct{} - -// SelectRoute is part of the Router interface and returns the best match -// for the WebService and its Route for the given Request. -func (r RouterJSR311) SelectRoute( - webServices []*WebService, - httpRequest *http.Request) (selectedService *WebService, selectedRoute *Route, err error) { - - // Identify the root resource class (WebService) - dispatcher, finalMatch, err := r.detectDispatcher(httpRequest.URL.Path, webServices) - if err != nil { - return nil, nil, NewError(http.StatusNotFound, "") - } - // Obtain the set of candidate methods (Routes) - routes := r.selectRoutes(dispatcher, finalMatch) - if len(routes) == 0 { - return dispatcher, nil, NewError(http.StatusNotFound, "404: Page Not Found") - } - - // Identify the method (Route) that will handle the request - route, ok := r.detectRoute(routes, httpRequest) - return dispatcher, route, ok -} - -// ExtractParameters is used to obtain the path parameters from the route using the same matching -// engine as the JSR 311 router. -func (r RouterJSR311) ExtractParameters(route *Route, webService *WebService, urlPath string) map[string]string { - webServiceExpr := webService.pathExpr - webServiceMatches := webServiceExpr.Matcher.FindStringSubmatch(urlPath) - pathParameters := r.extractParams(webServiceExpr, webServiceMatches) - routeExpr := route.pathExpr - routeMatches := routeExpr.Matcher.FindStringSubmatch(webServiceMatches[len(webServiceMatches)-1]) - routeParams := r.extractParams(routeExpr, routeMatches) - for key, value := range routeParams { - pathParameters[key] = value - } - return pathParameters -} - -func (RouterJSR311) extractParams(pathExpr *pathExpression, matches []string) map[string]string { - params := map[string]string{} - for i := 1; i < len(matches); i++ { - if len(pathExpr.VarNames) >= i { - params[pathExpr.VarNames[i-1]] = matches[i] - } - } - return params -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 -func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*Route, error) { - candidates := make([]*Route, 0, 8) - for i, each := range routes { - ok := true - for _, fn := range each.If { - if !fn(httpRequest) { - ok = false - break - } - } - if ok { - candidates = append(candidates, &routes[i]) - } - } - if len(candidates) == 0 { - if trace { - traceLogger.Printf("no Route found (from %d) that passes conditional checks", len(routes)) - } - return nil, NewError(http.StatusNotFound, "404: Not Found") - } - - // http method - previous := candidates - candidates = candidates[:0] - for _, each := range previous { - if httpRequest.Method == each.Method { - candidates = append(candidates, each) - } - } - if len(candidates) == 0 { - if trace { - traceLogger.Printf("no Route found (in %d routes) that matches HTTP method %s\n", len(previous), httpRequest.Method) - } - allowed := []string{} - allowedLoop: - for _, candidate := range previous { - for _, method := range allowed { - if method == candidate.Method { - continue allowedLoop - } - } - allowed = append(allowed, candidate.Method) - } - header := http.Header{"Allow": []string{strings.Join(allowed, ", ")}} - return nil, NewErrorWithHeader(http.StatusMethodNotAllowed, "405: Method Not Allowed", header) - } - - // content-type - contentType := httpRequest.Header.Get(HEADER_ContentType) - previous = candidates - candidates = candidates[:0] - for _, each := range previous { - if each.matchesContentType(contentType) { - candidates = append(candidates, each) - } - } - if len(candidates) == 0 { - if trace { - traceLogger.Printf("no Route found (from %d) that matches HTTP Content-Type: %s\n", len(previous), contentType) - } - if httpRequest.ContentLength > 0 { - return nil, NewError(http.StatusUnsupportedMediaType, "415: Unsupported Media Type") - } - } - - // accept - previous = candidates - candidates = candidates[:0] - accept := httpRequest.Header.Get(HEADER_Accept) - if len(accept) == 0 { - accept = "*/*" - } - for _, each := range previous { - if each.matchesAccept(accept) { - candidates = append(candidates, each) - } - } - if len(candidates) == 0 { - if trace { - traceLogger.Printf("no Route found (from %d) that matches HTTP Accept: %s\n", len(previous), accept) - } - available := []string{} - for _, candidate := range previous { - available = append(available, candidate.Produces...) - } - return nil, NewError( - http.StatusNotAcceptable, - fmt.Sprintf("406: Not Acceptable\n\nAvailable representations: %s", strings.Join(available, ", ")), - ) - } - // return r.bestMatchByMedia(outputMediaOk, contentType, accept), nil - return candidates[0], nil -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 -// n/m > n/* > */* -func (r RouterJSR311) bestMatchByMedia(routes []Route, contentType string, accept string) *Route { - // TODO - return &routes[0] -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 (step 2) -func (r RouterJSR311) selectRoutes(dispatcher *WebService, pathRemainder string) []Route { - filtered := &sortableRouteCandidates{} - for _, each := range dispatcher.Routes() { - pathExpr := each.pathExpr - matches := pathExpr.Matcher.FindStringSubmatch(pathRemainder) - if matches != nil { - lastMatch := matches[len(matches)-1] - if len(lastMatch) == 0 || lastMatch == "/" { // do not include if value is neither empty nor ‘/’. - filtered.candidates = append(filtered.candidates, - routeCandidate{each, len(matches) - 1, pathExpr.LiteralCount, pathExpr.VarCount}) - } - } - } - if len(filtered.candidates) == 0 { - if trace { - traceLogger.Printf("WebService on path %s has no routes that match URL path remainder:%s\n", dispatcher.rootPath, pathRemainder) - } - return []Route{} - } - sort.Sort(sort.Reverse(filtered)) - - // select other routes from candidates whoes expression matches rmatch - matchingRoutes := []Route{filtered.candidates[0].route} - for c := 1; c < len(filtered.candidates); c++ { - each := filtered.candidates[c] - if each.route.pathExpr.Matcher.MatchString(pathRemainder) { - matchingRoutes = append(matchingRoutes, each.route) - } - } - return matchingRoutes -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 (step 1) -func (r RouterJSR311) detectDispatcher(requestPath string, dispatchers []*WebService) (*WebService, string, error) { - filtered := &sortableDispatcherCandidates{} - for _, each := range dispatchers { - matches := each.pathExpr.Matcher.FindStringSubmatch(requestPath) - if matches != nil { - filtered.candidates = append(filtered.candidates, - dispatcherCandidate{each, matches[len(matches)-1], len(matches), each.pathExpr.LiteralCount, each.pathExpr.VarCount}) - } - } - if len(filtered.candidates) == 0 { - if trace { - traceLogger.Printf("no WebService was found to match URL path:%s\n", requestPath) - } - return nil, "", errors.New("not found") - } - sort.Sort(sort.Reverse(filtered)) - return filtered.candidates[0].dispatcher, filtered.candidates[0].finalMatch, nil -} - -// Types and functions to support the sorting of Routes - -type routeCandidate struct { - route Route - matchesCount int // the number of capturing groups - literalCount int // the number of literal characters (means those not resulting from template variable substitution) - nonDefaultCount int // the number of capturing groups with non-default regular expressions (i.e. not ‘([^ /]+?)’) -} - -func (r routeCandidate) expressionToMatch() string { - return r.route.pathExpr.Source -} - -func (r routeCandidate) String() string { - return fmt.Sprintf("(m=%d,l=%d,n=%d)", r.matchesCount, r.literalCount, r.nonDefaultCount) -} - -type sortableRouteCandidates struct { - candidates []routeCandidate -} - -func (rcs *sortableRouteCandidates) Len() int { - return len(rcs.candidates) -} -func (rcs *sortableRouteCandidates) Swap(i, j int) { - rcs.candidates[i], rcs.candidates[j] = rcs.candidates[j], rcs.candidates[i] -} -func (rcs *sortableRouteCandidates) Less(i, j int) bool { - ci := rcs.candidates[i] - cj := rcs.candidates[j] - // primary key - if ci.literalCount < cj.literalCount { - return true - } - if ci.literalCount > cj.literalCount { - return false - } - // secundary key - if ci.matchesCount < cj.matchesCount { - return true - } - if ci.matchesCount > cj.matchesCount { - return false - } - // tertiary key - if ci.nonDefaultCount < cj.nonDefaultCount { - return true - } - if ci.nonDefaultCount > cj.nonDefaultCount { - return false - } - // quaternary key ("source" is interpreted as Path) - return ci.route.Path < cj.route.Path -} - -// Types and functions to support the sorting of Dispatchers - -type dispatcherCandidate struct { - dispatcher *WebService - finalMatch string - matchesCount int // the number of capturing groups - literalCount int // the number of literal characters (means those not resulting from template variable substitution) - nonDefaultCount int // the number of capturing groups with non-default regular expressions (i.e. not ‘([^ /]+?)’) -} -type sortableDispatcherCandidates struct { - candidates []dispatcherCandidate -} - -func (dc *sortableDispatcherCandidates) Len() int { - return len(dc.candidates) -} -func (dc *sortableDispatcherCandidates) Swap(i, j int) { - dc.candidates[i], dc.candidates[j] = dc.candidates[j], dc.candidates[i] -} -func (dc *sortableDispatcherCandidates) Less(i, j int) bool { - ci := dc.candidates[i] - cj := dc.candidates[j] - // primary key - if ci.matchesCount < cj.matchesCount { - return true - } - if ci.matchesCount > cj.matchesCount { - return false - } - // secundary key - if ci.literalCount < cj.literalCount { - return true - } - if ci.literalCount > cj.literalCount { - return false - } - // tertiary key - return ci.nonDefaultCount < cj.nonDefaultCount -} diff --git a/vendor/github.com/emicklei/go-restful/log/log.go b/vendor/github.com/emicklei/go-restful/log/log.go deleted file mode 100644 index 6cd44c7a5d7..00000000000 --- a/vendor/github.com/emicklei/go-restful/log/log.go +++ /dev/null @@ -1,34 +0,0 @@ -package log - -import ( - stdlog "log" - "os" -) - -// StdLogger corresponds to a minimal subset of the interface satisfied by stdlib log.Logger -type StdLogger interface { - Print(v ...interface{}) - Printf(format string, v ...interface{}) -} - -var Logger StdLogger - -func init() { - // default Logger - SetLogger(stdlog.New(os.Stderr, "[restful] ", stdlog.LstdFlags|stdlog.Lshortfile)) -} - -// SetLogger sets the logger for this package -func SetLogger(customLogger StdLogger) { - Logger = customLogger -} - -// Print delegates to the Logger -func Print(v ...interface{}) { - Logger.Print(v...) -} - -// Printf delegates to the Logger -func Printf(format string, v ...interface{}) { - Logger.Printf(format, v...) -} diff --git a/vendor/github.com/emicklei/go-restful/logger.go b/vendor/github.com/emicklei/go-restful/logger.go deleted file mode 100644 index 6595df00296..00000000000 --- a/vendor/github.com/emicklei/go-restful/logger.go +++ /dev/null @@ -1,32 +0,0 @@ -package restful - -// Copyright 2014 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. -import ( - "github.com/emicklei/go-restful/log" -) - -var trace bool = false -var traceLogger log.StdLogger - -func init() { - traceLogger = log.Logger // use the package logger by default -} - -// TraceLogger enables detailed logging of Http request matching and filter invocation. Default no logger is set. -// You may call EnableTracing() directly to enable trace logging to the package-wide logger. -func TraceLogger(logger log.StdLogger) { - traceLogger = logger - EnableTracing(logger != nil) -} - -// SetLogger exposes the setter for the global logger on the top-level package -func SetLogger(customLogger log.StdLogger) { - log.SetLogger(customLogger) -} - -// EnableTracing can be used to Trace logging on and off. -func EnableTracing(enabled bool) { - trace = enabled -} diff --git a/vendor/github.com/emicklei/go-restful/mime.go b/vendor/github.com/emicklei/go-restful/mime.go deleted file mode 100644 index 33014471b99..00000000000 --- a/vendor/github.com/emicklei/go-restful/mime.go +++ /dev/null @@ -1,50 +0,0 @@ -package restful - -import ( - "strconv" - "strings" -) - -type mime struct { - media string - quality float64 -} - -// insertMime adds a mime to a list and keeps it sorted by quality. -func insertMime(l []mime, e mime) []mime { - for i, each := range l { - // if current mime has lower quality then insert before - if e.quality > each.quality { - left := append([]mime{}, l[0:i]...) - return append(append(left, e), l[i:]...) - } - } - return append(l, e) -} - -const qFactorWeightingKey = "q" - -// sortedMimes returns a list of mime sorted (desc) by its specified quality. -// e.g. text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3 -func sortedMimes(accept string) (sorted []mime) { - for _, each := range strings.Split(accept, ",") { - typeAndQuality := strings.Split(strings.Trim(each, " "), ";") - if len(typeAndQuality) == 1 { - sorted = insertMime(sorted, mime{typeAndQuality[0], 1.0}) - } else { - // take factor - qAndWeight := strings.Split(typeAndQuality[1], "=") - if len(qAndWeight) == 2 && strings.Trim(qAndWeight[0], " ") == qFactorWeightingKey { - f, err := strconv.ParseFloat(qAndWeight[1], 64) - if err != nil { - traceLogger.Printf("unable to parse quality in %s, %v", each, err) - } else { - sorted = insertMime(sorted, mime{typeAndQuality[0], f}) - } - } else { - sorted = insertMime(sorted, mime{typeAndQuality[0], 1.0}) - } - } - } - return -} diff --git a/vendor/github.com/emicklei/go-restful/options_filter.go b/vendor/github.com/emicklei/go-restful/options_filter.go deleted file mode 100644 index 5c1b34251c1..00000000000 --- a/vendor/github.com/emicklei/go-restful/options_filter.go +++ /dev/null @@ -1,34 +0,0 @@ -package restful - -import "strings" - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method -// and provides the response with a set of allowed methods for the request URL Path. -// As for any filter, you can also install it for a particular WebService within a Container. -// Note: this filter is not needed when using CrossOriginResourceSharing (for CORS). -func (c *Container) OPTIONSFilter(req *Request, resp *Response, chain *FilterChain) { - if "OPTIONS" != req.Request.Method { - chain.ProcessFilter(req, resp) - return - } - - archs := req.Request.Header.Get(HEADER_AccessControlRequestHeaders) - methods := strings.Join(c.computeAllowedMethods(req), ",") - origin := req.Request.Header.Get(HEADER_Origin) - - resp.AddHeader(HEADER_Allow, methods) - resp.AddHeader(HEADER_AccessControlAllowOrigin, origin) - resp.AddHeader(HEADER_AccessControlAllowHeaders, archs) - resp.AddHeader(HEADER_AccessControlAllowMethods, methods) -} - -// OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method -// and provides the response with a set of allowed methods for the request URL Path. -// Note: this filter is not needed when using CrossOriginResourceSharing (for CORS). -func OPTIONSFilter() FilterFunction { - return DefaultContainer.OPTIONSFilter -} diff --git a/vendor/github.com/emicklei/go-restful/parameter.go b/vendor/github.com/emicklei/go-restful/parameter.go deleted file mode 100644 index e8793304b15..00000000000 --- a/vendor/github.com/emicklei/go-restful/parameter.go +++ /dev/null @@ -1,143 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -const ( - // PathParameterKind = indicator of Request parameter type "path" - PathParameterKind = iota - - // QueryParameterKind = indicator of Request parameter type "query" - QueryParameterKind - - // BodyParameterKind = indicator of Request parameter type "body" - BodyParameterKind - - // HeaderParameterKind = indicator of Request parameter type "header" - HeaderParameterKind - - // FormParameterKind = indicator of Request parameter type "form" - FormParameterKind - - // CollectionFormatCSV comma separated values `foo,bar` - CollectionFormatCSV = CollectionFormat("csv") - - // CollectionFormatSSV space separated values `foo bar` - CollectionFormatSSV = CollectionFormat("ssv") - - // CollectionFormatTSV tab separated values `foo\tbar` - CollectionFormatTSV = CollectionFormat("tsv") - - // CollectionFormatPipes pipe separated values `foo|bar` - CollectionFormatPipes = CollectionFormat("pipes") - - // CollectionFormatMulti corresponds to multiple parameter instances instead of multiple values for a single - // instance `foo=bar&foo=baz`. This is valid only for QueryParameters and FormParameters - CollectionFormatMulti = CollectionFormat("multi") -) - -type CollectionFormat string - -func (cf CollectionFormat) String() string { - return string(cf) -} - -// Parameter is for documententing the parameter used in a Http Request -// ParameterData kinds are Path,Query and Body -type Parameter struct { - data *ParameterData -} - -// ParameterData represents the state of a Parameter. -// It is made public to make it accessible to e.g. the Swagger package. -type ParameterData struct { - Name, Description, DataType, DataFormat string - Kind int - Required bool - AllowableValues map[string]string - AllowMultiple bool - DefaultValue string - CollectionFormat string -} - -// Data returns the state of the Parameter -func (p *Parameter) Data() ParameterData { - return *p.data -} - -// Kind returns the parameter type indicator (see const for valid values) -func (p *Parameter) Kind() int { - return p.data.Kind -} - -func (p *Parameter) bePath() *Parameter { - p.data.Kind = PathParameterKind - return p -} -func (p *Parameter) beQuery() *Parameter { - p.data.Kind = QueryParameterKind - return p -} -func (p *Parameter) beBody() *Parameter { - p.data.Kind = BodyParameterKind - return p -} - -func (p *Parameter) beHeader() *Parameter { - p.data.Kind = HeaderParameterKind - return p -} - -func (p *Parameter) beForm() *Parameter { - p.data.Kind = FormParameterKind - return p -} - -// Required sets the required field and returns the receiver -func (p *Parameter) Required(required bool) *Parameter { - p.data.Required = required - return p -} - -// AllowMultiple sets the allowMultiple field and returns the receiver -func (p *Parameter) AllowMultiple(multiple bool) *Parameter { - p.data.AllowMultiple = multiple - return p -} - -// AllowableValues sets the allowableValues field and returns the receiver -func (p *Parameter) AllowableValues(values map[string]string) *Parameter { - p.data.AllowableValues = values - return p -} - -// DataType sets the dataType field and returns the receiver -func (p *Parameter) DataType(typeName string) *Parameter { - p.data.DataType = typeName - return p -} - -// DataFormat sets the dataFormat field for Swagger UI -func (p *Parameter) DataFormat(formatName string) *Parameter { - p.data.DataFormat = formatName - return p -} - -// DefaultValue sets the default value field and returns the receiver -func (p *Parameter) DefaultValue(stringRepresentation string) *Parameter { - p.data.DefaultValue = stringRepresentation - return p -} - -// Description sets the description value field and returns the receiver -func (p *Parameter) Description(doc string) *Parameter { - p.data.Description = doc - return p -} - -// CollectionFormat sets the collection format for an array type -func (p *Parameter) CollectionFormat(format CollectionFormat) *Parameter { - p.data.CollectionFormat = format.String() - return p -} diff --git a/vendor/github.com/emicklei/go-restful/path_expression.go b/vendor/github.com/emicklei/go-restful/path_expression.go deleted file mode 100644 index 95a9a254500..00000000000 --- a/vendor/github.com/emicklei/go-restful/path_expression.go +++ /dev/null @@ -1,74 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bytes" - "fmt" - "regexp" - "strings" -) - -// PathExpression holds a compiled path expression (RegExp) needed to match against -// Http request paths and to extract path parameter values. -type pathExpression struct { - LiteralCount int // the number of literal characters (means those not resulting from template variable substitution) - VarNames []string // the names of parameters (enclosed by {}) in the path - VarCount int // the number of named parameters (enclosed by {}) in the path - Matcher *regexp.Regexp - Source string // Path as defined by the RouteBuilder - tokens []string -} - -// NewPathExpression creates a PathExpression from the input URL path. -// Returns an error if the path is invalid. -func newPathExpression(path string) (*pathExpression, error) { - expression, literalCount, varNames, varCount, tokens := templateToRegularExpression(path) - compiled, err := regexp.Compile(expression) - if err != nil { - return nil, err - } - return &pathExpression{literalCount, varNames, varCount, compiled, expression, tokens}, nil -} - -// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-370003.7.3 -func templateToRegularExpression(template string) (expression string, literalCount int, varNames []string, varCount int, tokens []string) { - var buffer bytes.Buffer - buffer.WriteString("^") - //tokens = strings.Split(template, "/") - tokens = tokenizePath(template) - for _, each := range tokens { - if each == "" { - continue - } - buffer.WriteString("/") - if strings.HasPrefix(each, "{") { - // check for regular expression in variable - colon := strings.Index(each, ":") - var varName string - if colon != -1 { - // extract expression - varName = strings.TrimSpace(each[1:colon]) - paramExpr := strings.TrimSpace(each[colon+1 : len(each)-1]) - if paramExpr == "*" { // special case - buffer.WriteString("(.*)") - } else { - buffer.WriteString(fmt.Sprintf("(%s)", paramExpr)) // between colon and closing moustache - } - } else { - // plain var - varName = strings.TrimSpace(each[1 : len(each)-1]) - buffer.WriteString("([^/]+?)") - } - varNames = append(varNames, varName) - varCount += 1 - } else { - literalCount += len(each) - encoded := each // TODO URI encode - buffer.WriteString(regexp.QuoteMeta(encoded)) - } - } - return strings.TrimRight(buffer.String(), "/") + "(/.*)?$", literalCount, varNames, varCount, tokens -} diff --git a/vendor/github.com/emicklei/go-restful/path_processor.go b/vendor/github.com/emicklei/go-restful/path_processor.go deleted file mode 100644 index 14157324506..00000000000 --- a/vendor/github.com/emicklei/go-restful/path_processor.go +++ /dev/null @@ -1,74 +0,0 @@ -package restful - -import ( - "bytes" - "strings" -) - -// Copyright 2018 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// PathProcessor is extra behaviour that a Router can provide to extract path parameters from the path. -// If a Router does not implement this interface then the default behaviour will be used. -type PathProcessor interface { - // ExtractParameters gets the path parameters defined in the route and webService from the urlPath - ExtractParameters(route *Route, webService *WebService, urlPath string) map[string]string -} - -type defaultPathProcessor struct{} - -// Extract the parameters from the request url path -func (d defaultPathProcessor) ExtractParameters(r *Route, _ *WebService, urlPath string) map[string]string { - urlParts := tokenizePath(urlPath) - pathParameters := map[string]string{} - for i, key := range r.pathParts { - var value string - if i >= len(urlParts) { - value = "" - } else { - value = urlParts[i] - } - if r.hasCustomVerb && hasCustomVerb(key) { - key = removeCustomVerb(key) - value = removeCustomVerb(value) - } - - if strings.Index(key, "{") > -1 { // path-parameter - if colon := strings.Index(key, ":"); colon != -1 { - // extract by regex - regPart := key[colon+1 : len(key)-1] - keyPart := key[1:colon] - if regPart == "*" { - pathParameters[keyPart] = untokenizePath(i, urlParts) - break - } else { - pathParameters[keyPart] = value - } - } else { - // without enclosing {} - startIndex := strings.Index(key, "{") - endKeyIndex := strings.Index(key, "}") - - suffixLength := len(key) - endKeyIndex - 1 - endValueIndex := len(value) - suffixLength - - pathParameters[key[startIndex+1:endKeyIndex]] = value[startIndex:endValueIndex] - } - } - } - return pathParameters -} - -// Untokenize back into an URL path using the slash separator -func untokenizePath(offset int, parts []string) string { - var buffer bytes.Buffer - for p := offset; p < len(parts); p++ { - buffer.WriteString(parts[p]) - // do not end - if p < len(parts)-1 { - buffer.WriteString("/") - } - } - return buffer.String() -} diff --git a/vendor/github.com/emicklei/go-restful/request.go b/vendor/github.com/emicklei/go-restful/request.go deleted file mode 100644 index a20730febf3..00000000000 --- a/vendor/github.com/emicklei/go-restful/request.go +++ /dev/null @@ -1,118 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "compress/zlib" - "net/http" -) - -var defaultRequestContentType string - -// Request is a wrapper for a http Request that provides convenience methods -type Request struct { - Request *http.Request - pathParameters map[string]string - attributes map[string]interface{} // for storing request-scoped values - selectedRoutePath string // root path + route path that matched the request, e.g. /meetings/{id}/attendees -} - -func NewRequest(httpRequest *http.Request) *Request { - return &Request{ - Request: httpRequest, - pathParameters: map[string]string{}, - attributes: map[string]interface{}{}, - } // empty parameters, attributes -} - -// If ContentType is missing or */* is given then fall back to this type, otherwise -// a "Unable to unmarshal content of type:" response is returned. -// Valid values are restful.MIME_JSON and restful.MIME_XML -// Example: -// restful.DefaultRequestContentType(restful.MIME_JSON) -func DefaultRequestContentType(mime string) { - defaultRequestContentType = mime -} - -// PathParameter accesses the Path parameter value by its name -func (r *Request) PathParameter(name string) string { - return r.pathParameters[name] -} - -// PathParameters accesses the Path parameter values -func (r *Request) PathParameters() map[string]string { - return r.pathParameters -} - -// QueryParameter returns the (first) Query parameter value by its name -func (r *Request) QueryParameter(name string) string { - return r.Request.FormValue(name) -} - -// QueryParameters returns the all the query parameters values by name -func (r *Request) QueryParameters(name string) []string { - return r.Request.URL.Query()[name] -} - -// BodyParameter parses the body of the request (once for typically a POST or a PUT) and returns the value of the given name or an error. -func (r *Request) BodyParameter(name string) (string, error) { - err := r.Request.ParseForm() - if err != nil { - return "", err - } - return r.Request.PostFormValue(name), nil -} - -// HeaderParameter returns the HTTP Header value of a Header name or empty if missing -func (r *Request) HeaderParameter(name string) string { - return r.Request.Header.Get(name) -} - -// ReadEntity checks the Accept header and reads the content into the entityPointer. -func (r *Request) ReadEntity(entityPointer interface{}) (err error) { - contentType := r.Request.Header.Get(HEADER_ContentType) - contentEncoding := r.Request.Header.Get(HEADER_ContentEncoding) - - // check if the request body needs decompression - if ENCODING_GZIP == contentEncoding { - gzipReader := currentCompressorProvider.AcquireGzipReader() - defer currentCompressorProvider.ReleaseGzipReader(gzipReader) - gzipReader.Reset(r.Request.Body) - r.Request.Body = gzipReader - } else if ENCODING_DEFLATE == contentEncoding { - zlibReader, err := zlib.NewReader(r.Request.Body) - if err != nil { - return err - } - r.Request.Body = zlibReader - } - - // lookup the EntityReader, use defaultRequestContentType if needed and provided - entityReader, ok := entityAccessRegistry.accessorAt(contentType) - if !ok { - if len(defaultRequestContentType) != 0 { - entityReader, ok = entityAccessRegistry.accessorAt(defaultRequestContentType) - } - if !ok { - return NewError(http.StatusBadRequest, "Unable to unmarshal content of type:"+contentType) - } - } - return entityReader.Read(r, entityPointer) -} - -// SetAttribute adds or replaces the attribute with the given value. -func (r *Request) SetAttribute(name string, value interface{}) { - r.attributes[name] = value -} - -// Attribute returns the value associated to the given name. Returns nil if absent. -func (r Request) Attribute(name string) interface{} { - return r.attributes[name] -} - -// SelectedRoutePath root path + route path that matched the request, e.g. /meetings/{id}/attendees -func (r Request) SelectedRoutePath() string { - return r.selectedRoutePath -} diff --git a/vendor/github.com/emicklei/go-restful/response.go b/vendor/github.com/emicklei/go-restful/response.go deleted file mode 100644 index e2f78f00f75..00000000000 --- a/vendor/github.com/emicklei/go-restful/response.go +++ /dev/null @@ -1,256 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "bufio" - "errors" - "net" - "net/http" -) - -// DefaultResponseMimeType is DEPRECATED, use DefaultResponseContentType(mime) -var DefaultResponseMimeType string - -//PrettyPrintResponses controls the indentation feature of XML and JSON serialization -var PrettyPrintResponses = true - -// Response is a wrapper on the actual http ResponseWriter -// It provides several convenience methods to prepare and write response content. -type Response struct { - http.ResponseWriter - requestAccept string // mime-type what the Http Request says it wants to receive - routeProduces []string // mime-types what the Route says it can produce - statusCode int // HTTP status code that has been written explicitly (if zero then net/http has written 200) - contentLength int // number of bytes written for the response body - prettyPrint bool // controls the indentation feature of XML and JSON serialization. It is initialized using var PrettyPrintResponses. - err error // err property is kept when WriteError is called - hijacker http.Hijacker // if underlying ResponseWriter supports it -} - -// NewResponse creates a new response based on a http ResponseWriter. -func NewResponse(httpWriter http.ResponseWriter) *Response { - hijacker, _ := httpWriter.(http.Hijacker) - return &Response{ResponseWriter: httpWriter, routeProduces: []string{}, statusCode: http.StatusOK, prettyPrint: PrettyPrintResponses, hijacker: hijacker} -} - -// DefaultResponseContentType set a default. -// If Accept header matching fails, fall back to this type. -// Valid values are restful.MIME_JSON and restful.MIME_XML -// Example: -// restful.DefaultResponseContentType(restful.MIME_JSON) -func DefaultResponseContentType(mime string) { - DefaultResponseMimeType = mime -} - -// InternalServerError writes the StatusInternalServerError header. -// DEPRECATED, use WriteErrorString(http.StatusInternalServerError,reason) -func (r Response) InternalServerError() Response { - r.WriteHeader(http.StatusInternalServerError) - return r -} - -// Hijack implements the http.Hijacker interface. This expands -// the Response to fulfill http.Hijacker if the underlying -// http.ResponseWriter supports it. -func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) { - if r.hijacker == nil { - return nil, nil, errors.New("http.Hijacker not implemented by underlying http.ResponseWriter") - } - return r.hijacker.Hijack() -} - -// PrettyPrint changes whether this response must produce pretty (line-by-line, indented) JSON or XML output. -func (r *Response) PrettyPrint(bePretty bool) { - r.prettyPrint = bePretty -} - -// AddHeader is a shortcut for .Header().Add(header,value) -func (r Response) AddHeader(header string, value string) Response { - r.Header().Add(header, value) - return r -} - -// SetRequestAccepts tells the response what Mime-type(s) the HTTP request said it wants to accept. Exposed for testing. -func (r *Response) SetRequestAccepts(mime string) { - r.requestAccept = mime -} - -// EntityWriter returns the registered EntityWriter that the entity (requested resource) -// can write according to what the request wants (Accept) and what the Route can produce or what the restful defaults say. -// If called before WriteEntity and WriteHeader then a false return value can be used to write a 406: Not Acceptable. -func (r *Response) EntityWriter() (EntityReaderWriter, bool) { - sorted := sortedMimes(r.requestAccept) - for _, eachAccept := range sorted { - for _, eachProduce := range r.routeProduces { - if eachProduce == eachAccept.media { - if w, ok := entityAccessRegistry.accessorAt(eachAccept.media); ok { - return w, true - } - } - } - if eachAccept.media == "*/*" { - for _, each := range r.routeProduces { - if w, ok := entityAccessRegistry.accessorAt(each); ok { - return w, true - } - } - } - } - // if requestAccept is empty - writer, ok := entityAccessRegistry.accessorAt(r.requestAccept) - if !ok { - // if not registered then fallback to the defaults (if set) - if DefaultResponseMimeType == MIME_JSON { - return entityAccessRegistry.accessorAt(MIME_JSON) - } - if DefaultResponseMimeType == MIME_XML { - return entityAccessRegistry.accessorAt(MIME_XML) - } - // Fallback to whatever the route says it can produce. - // https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html - for _, each := range r.routeProduces { - if w, ok := entityAccessRegistry.accessorAt(each); ok { - return w, true - } - } - if trace { - traceLogger.Printf("no registered EntityReaderWriter found for %s", r.requestAccept) - } - } - return writer, ok -} - -// WriteEntity calls WriteHeaderAndEntity with Http Status OK (200) -func (r *Response) WriteEntity(value interface{}) error { - return r.WriteHeaderAndEntity(http.StatusOK, value) -} - -// WriteHeaderAndEntity marshals the value using the representation denoted by the Accept Header and the registered EntityWriters. -// If no Accept header is specified (or */*) then respond with the Content-Type as specified by the first in the Route.Produces. -// If an Accept header is specified then respond with the Content-Type as specified by the first in the Route.Produces that is matched with the Accept header. -// If the value is nil then no response is send except for the Http status. You may want to call WriteHeader(http.StatusNotFound) instead. -// If there is no writer available that can represent the value in the requested MIME type then Http Status NotAcceptable is written. -// Current implementation ignores any q-parameters in the Accept Header. -// Returns an error if the value could not be written on the response. -func (r *Response) WriteHeaderAndEntity(status int, value interface{}) error { - writer, ok := r.EntityWriter() - if !ok { - r.WriteHeader(http.StatusNotAcceptable) - return nil - } - return writer.Write(r, status, value) -} - -// WriteAsXml is a convenience method for writing a value in xml (requires Xml tags on the value) -// It uses the standard encoding/xml package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteAsXml(value interface{}) error { - return writeXML(r, http.StatusOK, MIME_XML, value) -} - -// WriteHeaderAndXml is a convenience method for writing a status and value in xml (requires Xml tags on the value) -// It uses the standard encoding/xml package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteHeaderAndXml(status int, value interface{}) error { - return writeXML(r, status, MIME_XML, value) -} - -// WriteAsJson is a convenience method for writing a value in json. -// It uses the standard encoding/json package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteAsJson(value interface{}) error { - return writeJSON(r, http.StatusOK, MIME_JSON, value) -} - -// WriteJson is a convenience method for writing a value in Json with a given Content-Type. -// It uses the standard encoding/json package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteJson(value interface{}, contentType string) error { - return writeJSON(r, http.StatusOK, contentType, value) -} - -// WriteHeaderAndJson is a convenience method for writing the status and a value in Json with a given Content-Type. -// It uses the standard encoding/json package for marshalling the value ; not using a registered EntityReaderWriter. -func (r *Response) WriteHeaderAndJson(status int, value interface{}, contentType string) error { - return writeJSON(r, status, contentType, value) -} - -// WriteError writes the http status and the error string on the response. err can be nil. -// Return an error if writing was not succesful. -func (r *Response) WriteError(httpStatus int, err error) (writeErr error) { - r.err = err - if err == nil { - writeErr = r.WriteErrorString(httpStatus, "") - } else { - writeErr = r.WriteErrorString(httpStatus, err.Error()) - } - return writeErr -} - -// WriteServiceError is a convenience method for a responding with a status and a ServiceError -func (r *Response) WriteServiceError(httpStatus int, err ServiceError) error { - r.err = err - return r.WriteHeaderAndEntity(httpStatus, err) -} - -// WriteErrorString is a convenience method for an error status with the actual error -func (r *Response) WriteErrorString(httpStatus int, errorReason string) error { - if r.err == nil { - // if not called from WriteError - r.err = errors.New(errorReason) - } - r.WriteHeader(httpStatus) - if _, err := r.Write([]byte(errorReason)); err != nil { - return err - } - return nil -} - -// Flush implements http.Flusher interface, which sends any buffered data to the client. -func (r *Response) Flush() { - if f, ok := r.ResponseWriter.(http.Flusher); ok { - f.Flush() - } else if trace { - traceLogger.Printf("ResponseWriter %v doesn't support Flush", r) - } -} - -// WriteHeader is overridden to remember the Status Code that has been written. -// Changes to the Header of the response have no effect after this. -func (r *Response) WriteHeader(httpStatus int) { - r.statusCode = httpStatus - r.ResponseWriter.WriteHeader(httpStatus) -} - -// StatusCode returns the code that has been written using WriteHeader. -func (r Response) StatusCode() int { - if 0 == r.statusCode { - // no status code has been written yet; assume OK - return http.StatusOK - } - return r.statusCode -} - -// Write writes the data to the connection as part of an HTTP reply. -// Write is part of http.ResponseWriter interface. -func (r *Response) Write(bytes []byte) (int, error) { - written, err := r.ResponseWriter.Write(bytes) - r.contentLength += written - return written, err -} - -// ContentLength returns the number of bytes written for the response content. -// Note that this value is only correct if all data is written through the Response using its Write* methods. -// Data written directly using the underlying http.ResponseWriter is not accounted for. -func (r Response) ContentLength() int { - return r.contentLength -} - -// CloseNotify is part of http.CloseNotifier interface -func (r Response) CloseNotify() <-chan bool { - return r.ResponseWriter.(http.CloseNotifier).CloseNotify() -} - -// Error returns the err created by WriteError -func (r Response) Error() error { - return r.err -} diff --git a/vendor/github.com/emicklei/go-restful/route.go b/vendor/github.com/emicklei/go-restful/route.go deleted file mode 100644 index 598aa57a76e..00000000000 --- a/vendor/github.com/emicklei/go-restful/route.go +++ /dev/null @@ -1,177 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "net/http" - "strings" -) - -// RouteFunction declares the signature of a function that can be bound to a Route. -type RouteFunction func(*Request, *Response) - -// RouteSelectionConditionFunction declares the signature of a function that -// can be used to add extra conditional logic when selecting whether the route -// matches the HTTP request. -type RouteSelectionConditionFunction func(httpRequest *http.Request) bool - -// Route binds a HTTP Method,Path,Consumes combination to a RouteFunction. -type Route struct { - Method string - Produces []string - Consumes []string - Path string // webservice root path + described path - Function RouteFunction - Filters []FilterFunction - If []RouteSelectionConditionFunction - - // cached values for dispatching - relativePath string - pathParts []string - pathExpr *pathExpression // cached compilation of relativePath as RegExp - - // documentation - Doc string - Notes string - Operation string - ParameterDocs []*Parameter - ResponseErrors map[int]ResponseError - DefaultResponse *ResponseError - ReadSample, WriteSample interface{} // structs that model an example request or response payload - - // Extra information used to store custom information about the route. - Metadata map[string]interface{} - - // marks a route as deprecated - Deprecated bool - - //Overrides the container.contentEncodingEnabled - contentEncodingEnabled *bool - - // indicate route path has custom verb - hasCustomVerb bool - - // if a request does not include a content-type header then - // depending on the method, it may return a 415 Unsupported Media - // Must have uppercase HTTP Method names such as GET,HEAD,OPTIONS,... - allowedMethodsWithoutContentType []string -} - -// Initialize for Route -func (r *Route) postBuild() { - r.pathParts = tokenizePath(r.Path) - r.hasCustomVerb = hasCustomVerb(r.Path) -} - -// Create Request and Response from their http versions -func (r *Route) wrapRequestResponse(httpWriter http.ResponseWriter, httpRequest *http.Request, pathParams map[string]string) (*Request, *Response) { - wrappedRequest := NewRequest(httpRequest) - wrappedRequest.pathParameters = pathParams - wrappedRequest.selectedRoutePath = r.Path - wrappedResponse := NewResponse(httpWriter) - wrappedResponse.requestAccept = httpRequest.Header.Get(HEADER_Accept) - wrappedResponse.routeProduces = r.Produces - return wrappedRequest, wrappedResponse -} - -func stringTrimSpaceCutset(r rune) bool { - return r == ' ' -} - -// Return whether the mimeType matches to what this Route can produce. -func (r Route) matchesAccept(mimeTypesWithQuality string) bool { - remaining := mimeTypesWithQuality - for { - var mimeType string - if end := strings.Index(remaining, ","); end == -1 { - mimeType, remaining = remaining, "" - } else { - mimeType, remaining = remaining[:end], remaining[end+1:] - } - if quality := strings.Index(mimeType, ";"); quality != -1 { - mimeType = mimeType[:quality] - } - mimeType = strings.TrimFunc(mimeType, stringTrimSpaceCutset) - if mimeType == "*/*" { - return true - } - for _, producibleType := range r.Produces { - if producibleType == "*/*" || producibleType == mimeType { - return true - } - } - if len(remaining) == 0 { - return false - } - } -} - -// Return whether this Route can consume content with a type specified by mimeTypes (can be empty). -func (r Route) matchesContentType(mimeTypes string) bool { - - if len(r.Consumes) == 0 { - // did not specify what it can consume ; any media type (“*/*”) is assumed - return true - } - - if len(mimeTypes) == 0 { - // idempotent methods with (most-likely or guaranteed) empty content match missing Content-Type - m := r.Method - // if route specifies less or non-idempotent methods then use that - if len(r.allowedMethodsWithoutContentType) > 0 { - for _, each := range r.allowedMethodsWithoutContentType { - if m == each { - return true - } - } - } else { - if m == "GET" || m == "HEAD" || m == "OPTIONS" || m == "DELETE" || m == "TRACE" { - return true - } - } - // proceed with default - mimeTypes = MIME_OCTET - } - - remaining := mimeTypes - for { - var mimeType string - if end := strings.Index(remaining, ","); end == -1 { - mimeType, remaining = remaining, "" - } else { - mimeType, remaining = remaining[:end], remaining[end+1:] - } - if quality := strings.Index(mimeType, ";"); quality != -1 { - mimeType = mimeType[:quality] - } - mimeType = strings.TrimFunc(mimeType, stringTrimSpaceCutset) - for _, consumeableType := range r.Consumes { - if consumeableType == "*/*" || consumeableType == mimeType { - return true - } - } - if len(remaining) == 0 { - return false - } - } -} - -// Tokenize an URL path using the slash separator ; the result does not have empty tokens -func tokenizePath(path string) []string { - if "/" == path { - return nil - } - return strings.Split(strings.Trim(path, "/"), "/") -} - -// for debugging -func (r Route) String() string { - return r.Method + " " + r.Path -} - -// EnableContentEncoding (default=false) allows for GZIP or DEFLATE encoding of responses. Overrides the container.contentEncodingEnabled value. -func (r Route) EnableContentEncoding(enabled bool) { - r.contentEncodingEnabled = &enabled -} diff --git a/vendor/github.com/emicklei/go-restful/route_builder.go b/vendor/github.com/emicklei/go-restful/route_builder.go deleted file mode 100644 index 1d67a4c2358..00000000000 --- a/vendor/github.com/emicklei/go-restful/route_builder.go +++ /dev/null @@ -1,364 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "fmt" - "os" - "reflect" - "runtime" - "strings" - "sync/atomic" - - "github.com/emicklei/go-restful/log" -) - -// RouteBuilder is a helper to construct Routes. -type RouteBuilder struct { - rootPath string - currentPath string - produces []string - consumes []string - httpMethod string // required - function RouteFunction // required - filters []FilterFunction - conditions []RouteSelectionConditionFunction - allowedMethodsWithoutContentType []string // see Route - - typeNameHandleFunc TypeNameHandleFunction // required - - // documentation - doc string - notes string - operation string - readSample, writeSample interface{} - parameters []*Parameter - errorMap map[int]ResponseError - defaultResponse *ResponseError - metadata map[string]interface{} - deprecated bool - contentEncodingEnabled *bool -} - -// Do evaluates each argument with the RouteBuilder itself. -// This allows you to follow DRY principles without breaking the fluent programming style. -// Example: -// ws.Route(ws.DELETE("/{name}").To(t.deletePerson).Do(Returns200, Returns500)) -// -// func Returns500(b *RouteBuilder) { -// b.Returns(500, "Internal Server Error", restful.ServiceError{}) -// } -func (b *RouteBuilder) Do(oneArgBlocks ...func(*RouteBuilder)) *RouteBuilder { - for _, each := range oneArgBlocks { - each(b) - } - return b -} - -// To bind the route to a function. -// If this route is matched with the incoming Http Request then call this function with the *Request,*Response pair. Required. -func (b *RouteBuilder) To(function RouteFunction) *RouteBuilder { - b.function = function - return b -} - -// Method specifies what HTTP method to match. Required. -func (b *RouteBuilder) Method(method string) *RouteBuilder { - b.httpMethod = method - return b -} - -// Produces specifies what MIME types can be produced ; the matched one will appear in the Content-Type Http header. -func (b *RouteBuilder) Produces(mimeTypes ...string) *RouteBuilder { - b.produces = mimeTypes - return b -} - -// Consumes specifies what MIME types can be consumes ; the Accept Http header must matched any of these -func (b *RouteBuilder) Consumes(mimeTypes ...string) *RouteBuilder { - b.consumes = mimeTypes - return b -} - -// Path specifies the relative (w.r.t WebService root path) URL path to match. Default is "/". -func (b *RouteBuilder) Path(subPath string) *RouteBuilder { - b.currentPath = subPath - return b -} - -// Doc tells what this route is all about. Optional. -func (b *RouteBuilder) Doc(documentation string) *RouteBuilder { - b.doc = documentation - return b -} - -// Notes is a verbose explanation of the operation behavior. Optional. -func (b *RouteBuilder) Notes(notes string) *RouteBuilder { - b.notes = notes - return b -} - -// Reads tells what resource type will be read from the request payload. Optional. -// A parameter of type "body" is added ,required is set to true and the dataType is set to the qualified name of the sample's type. -func (b *RouteBuilder) Reads(sample interface{}, optionalDescription ...string) *RouteBuilder { - fn := b.typeNameHandleFunc - if fn == nil { - fn = reflectTypeName - } - typeAsName := fn(sample) - description := "" - if len(optionalDescription) > 0 { - description = optionalDescription[0] - } - b.readSample = sample - bodyParameter := &Parameter{&ParameterData{Name: "body", Description: description}} - bodyParameter.beBody() - bodyParameter.Required(true) - bodyParameter.DataType(typeAsName) - b.Param(bodyParameter) - return b -} - -// ParameterNamed returns a Parameter already known to the RouteBuilder. Returns nil if not. -// Use this to modify or extend information for the Parameter (through its Data()). -func (b RouteBuilder) ParameterNamed(name string) (p *Parameter) { - for _, each := range b.parameters { - if each.Data().Name == name { - return each - } - } - return p -} - -// Writes tells what resource type will be written as the response payload. Optional. -func (b *RouteBuilder) Writes(sample interface{}) *RouteBuilder { - b.writeSample = sample - return b -} - -// Param allows you to document the parameters of the Route. It adds a new Parameter (does not check for duplicates). -func (b *RouteBuilder) Param(parameter *Parameter) *RouteBuilder { - if b.parameters == nil { - b.parameters = []*Parameter{} - } - b.parameters = append(b.parameters, parameter) - return b -} - -// Operation allows you to document what the actual method/function call is of the Route. -// Unless called, the operation name is derived from the RouteFunction set using To(..). -func (b *RouteBuilder) Operation(name string) *RouteBuilder { - b.operation = name - return b -} - -// ReturnsError is deprecated, use Returns instead. -func (b *RouteBuilder) ReturnsError(code int, message string, model interface{}) *RouteBuilder { - log.Print("ReturnsError is deprecated, use Returns instead.") - return b.Returns(code, message, model) -} - -// Returns allows you to document what responses (errors or regular) can be expected. -// The model parameter is optional ; either pass a struct instance or use nil if not applicable. -func (b *RouteBuilder) Returns(code int, message string, model interface{}) *RouteBuilder { - err := ResponseError{ - Code: code, - Message: message, - Model: model, - IsDefault: false, // this field is deprecated, use default response instead. - } - // lazy init because there is no NewRouteBuilder (yet) - if b.errorMap == nil { - b.errorMap = map[int]ResponseError{} - } - b.errorMap[code] = err - return b -} - -// ReturnsWithHeaders is similar to Returns, but can specify response headers -func (b *RouteBuilder) ReturnsWithHeaders(code int, message string, model interface{}, headers map[string]Header) *RouteBuilder { - b.Returns(code, message, model) - err := b.errorMap[code] - err.Headers = headers - b.errorMap[code] = err - return b -} - -// DefaultReturns is a special Returns call that sets the default of the response. -func (b *RouteBuilder) DefaultReturns(message string, model interface{}) *RouteBuilder { - b.defaultResponse = &ResponseError{ - Message: message, - Model: model, - } - return b -} - -// Metadata adds or updates a key=value pair to the metadata map. -func (b *RouteBuilder) Metadata(key string, value interface{}) *RouteBuilder { - if b.metadata == nil { - b.metadata = map[string]interface{}{} - } - b.metadata[key] = value - return b -} - -// Deprecate sets the value of deprecated to true. Deprecated routes have a special UI treatment to warn against use -func (b *RouteBuilder) Deprecate() *RouteBuilder { - b.deprecated = true - return b -} - -// AllowedMethodsWithoutContentType overides the default list GET,HEAD,OPTIONS,DELETE,TRACE -// If a request does not include a content-type header then -// depending on the method, it may return a 415 Unsupported Media. -// Must have uppercase HTTP Method names such as GET,HEAD,OPTIONS,... -func (b *RouteBuilder) AllowedMethodsWithoutContentType(methods []string) *RouteBuilder { - b.allowedMethodsWithoutContentType = methods - return b -} - -// ResponseError represents a response; not necessarily an error. -type ResponseError struct { - Code int - Message string - Model interface{} - Headers map[string]Header - IsDefault bool -} - -// Header describes a header for a response of the API -// -// For more information: http://goo.gl/8us55a#headerObject -type Header struct { - *Items - Description string -} - -// Items describe swagger simple schemas for headers -type Items struct { - Type string - Format string - Items *Items - CollectionFormat string - Default interface{} -} - -func (b *RouteBuilder) servicePath(path string) *RouteBuilder { - b.rootPath = path - return b -} - -// Filter appends a FilterFunction to the end of filters for this Route to build. -func (b *RouteBuilder) Filter(filter FilterFunction) *RouteBuilder { - b.filters = append(b.filters, filter) - return b -} - -// If sets a condition function that controls matching the Route based on custom logic. -// The condition function is provided the HTTP request and should return true if the route -// should be considered. -// -// Efficiency note: the condition function is called before checking the method, produces, and -// consumes criteria, so that the correct HTTP status code can be returned. -// -// Lifecycle note: no filter functions have been called prior to calling the condition function, -// so the condition function should not depend on any context that might be set up by container -// or route filters. -func (b *RouteBuilder) If(condition RouteSelectionConditionFunction) *RouteBuilder { - b.conditions = append(b.conditions, condition) - return b -} - -// ContentEncodingEnabled allows you to override the Containers value for auto-compressing this route response. -func (b *RouteBuilder) ContentEncodingEnabled(enabled bool) *RouteBuilder { - b.contentEncodingEnabled = &enabled - return b -} - -// If no specific Route path then set to rootPath -// If no specific Produces then set to rootProduces -// If no specific Consumes then set to rootConsumes -func (b *RouteBuilder) copyDefaults(rootProduces, rootConsumes []string) { - if len(b.produces) == 0 { - b.produces = rootProduces - } - if len(b.consumes) == 0 { - b.consumes = rootConsumes - } -} - -// typeNameHandler sets the function that will convert types to strings in the parameter -// and model definitions. -func (b *RouteBuilder) typeNameHandler(handler TypeNameHandleFunction) *RouteBuilder { - b.typeNameHandleFunc = handler - return b -} - -// Build creates a new Route using the specification details collected by the RouteBuilder -func (b *RouteBuilder) Build() Route { - pathExpr, err := newPathExpression(b.currentPath) - if err != nil { - log.Printf("Invalid path:%s because:%v", b.currentPath, err) - os.Exit(1) - } - if b.function == nil { - log.Printf("No function specified for route:" + b.currentPath) - os.Exit(1) - } - operationName := b.operation - if len(operationName) == 0 && b.function != nil { - // extract from definition - operationName = nameOfFunction(b.function) - } - route := Route{ - Method: b.httpMethod, - Path: concatPath(b.rootPath, b.currentPath), - Produces: b.produces, - Consumes: b.consumes, - Function: b.function, - Filters: b.filters, - If: b.conditions, - relativePath: b.currentPath, - pathExpr: pathExpr, - Doc: b.doc, - Notes: b.notes, - Operation: operationName, - ParameterDocs: b.parameters, - ResponseErrors: b.errorMap, - DefaultResponse: b.defaultResponse, - ReadSample: b.readSample, - WriteSample: b.writeSample, - Metadata: b.metadata, - Deprecated: b.deprecated, - contentEncodingEnabled: b.contentEncodingEnabled, - allowedMethodsWithoutContentType: b.allowedMethodsWithoutContentType, - } - route.postBuild() - return route -} - -func concatPath(path1, path2 string) string { - return strings.TrimRight(path1, "/") + "/" + strings.TrimLeft(path2, "/") -} - -var anonymousFuncCount int32 - -// nameOfFunction returns the short name of the function f for documentation. -// It uses a runtime feature for debugging ; its value may change for later Go versions. -func nameOfFunction(f interface{}) string { - fun := runtime.FuncForPC(reflect.ValueOf(f).Pointer()) - tokenized := strings.Split(fun.Name(), ".") - last := tokenized[len(tokenized)-1] - last = strings.TrimSuffix(last, ")·fm") // < Go 1.5 - last = strings.TrimSuffix(last, ")-fm") // Go 1.5 - last = strings.TrimSuffix(last, "·fm") // < Go 1.5 - last = strings.TrimSuffix(last, "-fm") // Go 1.5 - if last == "func1" { // this could mean conflicts in API docs - val := atomic.AddInt32(&anonymousFuncCount, 1) - last = "func" + fmt.Sprintf("%d", val) - atomic.StoreInt32(&anonymousFuncCount, val) - } - return last -} diff --git a/vendor/github.com/emicklei/go-restful/router.go b/vendor/github.com/emicklei/go-restful/router.go deleted file mode 100644 index 19078af1c06..00000000000 --- a/vendor/github.com/emicklei/go-restful/router.go +++ /dev/null @@ -1,20 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import "net/http" - -// A RouteSelector finds the best matching Route given the input HTTP Request -// RouteSelectors can optionally also implement the PathProcessor interface to also calculate the -// path parameters after the route has been selected. -type RouteSelector interface { - - // SelectRoute finds a Route given the input HTTP Request and a list of WebServices. - // It returns a selected Route and its containing WebService or an error indicating - // a problem. - SelectRoute( - webServices []*WebService, - httpRequest *http.Request) (selectedService *WebService, selected *Route, err error) -} diff --git a/vendor/github.com/emicklei/go-restful/service_error.go b/vendor/github.com/emicklei/go-restful/service_error.go deleted file mode 100644 index a4157546944..00000000000 --- a/vendor/github.com/emicklei/go-restful/service_error.go +++ /dev/null @@ -1,32 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "fmt" - "net/http" -) - -// ServiceError is a transport object to pass information about a non-Http error occurred in a WebService while processing a request. -type ServiceError struct { - Code int - Message string - Header http.Header -} - -// NewError returns a ServiceError using the code and reason -func NewError(code int, message string) ServiceError { - return ServiceError{Code: code, Message: message} -} - -// NewErrorWithHeader returns a ServiceError using the code, reason and header -func NewErrorWithHeader(code int, message string, header http.Header) ServiceError { - return ServiceError{Code: code, Message: message, Header: header} -} - -// Error returns a text representation of the service error -func (s ServiceError) Error() string { - return fmt.Sprintf("[ServiceError:%v] %v", s.Code, s.Message) -} diff --git a/vendor/github.com/emicklei/go-restful/web_service.go b/vendor/github.com/emicklei/go-restful/web_service.go deleted file mode 100644 index 4f907967446..00000000000 --- a/vendor/github.com/emicklei/go-restful/web_service.go +++ /dev/null @@ -1,290 +0,0 @@ -package restful - -import ( - "errors" - "os" - "reflect" - "sync" - - "github.com/emicklei/go-restful/log" -) - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -// WebService holds a collection of Route values that bind a Http Method + URL Path to a function. -type WebService struct { - rootPath string - pathExpr *pathExpression // cached compilation of rootPath as RegExp - routes []Route - produces []string - consumes []string - pathParameters []*Parameter - filters []FilterFunction - documentation string - apiVersion string - - typeNameHandleFunc TypeNameHandleFunction - - dynamicRoutes bool - - // protects 'routes' if dynamic routes are enabled - routesLock sync.RWMutex -} - -func (w *WebService) SetDynamicRoutes(enable bool) { - w.dynamicRoutes = enable -} - -// TypeNameHandleFunction declares functions that can handle translating the name of a sample object -// into the restful documentation for the service. -type TypeNameHandleFunction func(sample interface{}) string - -// TypeNameHandler sets the function that will convert types to strings in the parameter -// and model definitions. If not set, the web service will invoke -// reflect.TypeOf(object).String(). -func (w *WebService) TypeNameHandler(handler TypeNameHandleFunction) *WebService { - w.typeNameHandleFunc = handler - return w -} - -// reflectTypeName is the default TypeNameHandleFunction and for a given object -// returns the name that Go identifies it with (e.g. "string" or "v1.Object") via -// the reflection API. -func reflectTypeName(sample interface{}) string { - return reflect.TypeOf(sample).String() -} - -// compilePathExpression ensures that the path is compiled into a RegEx for those routers that need it. -func (w *WebService) compilePathExpression() { - compiled, err := newPathExpression(w.rootPath) - if err != nil { - log.Printf("invalid path:%s because:%v", w.rootPath, err) - os.Exit(1) - } - w.pathExpr = compiled -} - -// ApiVersion sets the API version for documentation purposes. -func (w *WebService) ApiVersion(apiVersion string) *WebService { - w.apiVersion = apiVersion - return w -} - -// Version returns the API version for documentation purposes. -func (w *WebService) Version() string { return w.apiVersion } - -// Path specifies the root URL template path of the WebService. -// All Routes will be relative to this path. -func (w *WebService) Path(root string) *WebService { - w.rootPath = root - if len(w.rootPath) == 0 { - w.rootPath = "/" - } - w.compilePathExpression() - return w -} - -// Param adds a PathParameter to document parameters used in the root path. -func (w *WebService) Param(parameter *Parameter) *WebService { - if w.pathParameters == nil { - w.pathParameters = []*Parameter{} - } - w.pathParameters = append(w.pathParameters, parameter) - return w -} - -// PathParameter creates a new Parameter of kind Path for documentation purposes. -// It is initialized as required with string as its DataType. -func (w *WebService) PathParameter(name, description string) *Parameter { - return PathParameter(name, description) -} - -// PathParameter creates a new Parameter of kind Path for documentation purposes. -// It is initialized as required with string as its DataType. -func PathParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: true, DataType: "string"}} - p.bePath() - return p -} - -// QueryParameter creates a new Parameter of kind Query for documentation purposes. -// It is initialized as not required with string as its DataType. -func (w *WebService) QueryParameter(name, description string) *Parameter { - return QueryParameter(name, description) -} - -// QueryParameter creates a new Parameter of kind Query for documentation purposes. -// It is initialized as not required with string as its DataType. -func QueryParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: "string", CollectionFormat: CollectionFormatCSV.String()}} - p.beQuery() - return p -} - -// BodyParameter creates a new Parameter of kind Body for documentation purposes. -// It is initialized as required without a DataType. -func (w *WebService) BodyParameter(name, description string) *Parameter { - return BodyParameter(name, description) -} - -// BodyParameter creates a new Parameter of kind Body for documentation purposes. -// It is initialized as required without a DataType. -func BodyParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: true}} - p.beBody() - return p -} - -// HeaderParameter creates a new Parameter of kind (Http) Header for documentation purposes. -// It is initialized as not required with string as its DataType. -func (w *WebService) HeaderParameter(name, description string) *Parameter { - return HeaderParameter(name, description) -} - -// HeaderParameter creates a new Parameter of kind (Http) Header for documentation purposes. -// It is initialized as not required with string as its DataType. -func HeaderParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: "string"}} - p.beHeader() - return p -} - -// FormParameter creates a new Parameter of kind Form (using application/x-www-form-urlencoded) for documentation purposes. -// It is initialized as required with string as its DataType. -func (w *WebService) FormParameter(name, description string) *Parameter { - return FormParameter(name, description) -} - -// FormParameter creates a new Parameter of kind Form (using application/x-www-form-urlencoded) for documentation purposes. -// It is initialized as required with string as its DataType. -func FormParameter(name, description string) *Parameter { - p := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: "string"}} - p.beForm() - return p -} - -// Route creates a new Route using the RouteBuilder and add to the ordered list of Routes. -func (w *WebService) Route(builder *RouteBuilder) *WebService { - w.routesLock.Lock() - defer w.routesLock.Unlock() - builder.copyDefaults(w.produces, w.consumes) - w.routes = append(w.routes, builder.Build()) - return w -} - -// RemoveRoute removes the specified route, looks for something that matches 'path' and 'method' -func (w *WebService) RemoveRoute(path, method string) error { - if !w.dynamicRoutes { - return errors.New("dynamic routes are not enabled.") - } - w.routesLock.Lock() - defer w.routesLock.Unlock() - newRoutes := make([]Route, (len(w.routes) - 1)) - current := 0 - for ix := range w.routes { - if w.routes[ix].Method == method && w.routes[ix].Path == path { - continue - } - newRoutes[current] = w.routes[ix] - current++ - } - w.routes = newRoutes - return nil -} - -// Method creates a new RouteBuilder and initialize its http method -func (w *WebService) Method(httpMethod string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method(httpMethod) -} - -// Produces specifies that this WebService can produce one or more MIME types. -// Http requests must have one of these values set for the Accept header. -func (w *WebService) Produces(contentTypes ...string) *WebService { - w.produces = contentTypes - return w -} - -// Consumes specifies that this WebService can consume one or more MIME types. -// Http requests must have one of these values set for the Content-Type header. -func (w *WebService) Consumes(accepts ...string) *WebService { - w.consumes = accepts - return w -} - -// Routes returns the Routes associated with this WebService -func (w *WebService) Routes() []Route { - if !w.dynamicRoutes { - return w.routes - } - // Make a copy of the array to prevent concurrency problems - w.routesLock.RLock() - defer w.routesLock.RUnlock() - result := make([]Route, len(w.routes)) - for ix := range w.routes { - result[ix] = w.routes[ix] - } - return result -} - -// RootPath returns the RootPath associated with this WebService. Default "/" -func (w *WebService) RootPath() string { - return w.rootPath -} - -// PathParameters return the path parameter names for (shared among its Routes) -func (w *WebService) PathParameters() []*Parameter { - return w.pathParameters -} - -// Filter adds a filter function to the chain of filters applicable to all its Routes -func (w *WebService) Filter(filter FilterFunction) *WebService { - w.filters = append(w.filters, filter) - return w -} - -// Doc is used to set the documentation of this service. -func (w *WebService) Doc(plainText string) *WebService { - w.documentation = plainText - return w -} - -// Documentation returns it. -func (w *WebService) Documentation() string { - return w.documentation -} - -/* - Convenience methods -*/ - -// HEAD is a shortcut for .Method("HEAD").Path(subPath) -func (w *WebService) HEAD(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("HEAD").Path(subPath) -} - -// GET is a shortcut for .Method("GET").Path(subPath) -func (w *WebService) GET(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("GET").Path(subPath) -} - -// POST is a shortcut for .Method("POST").Path(subPath) -func (w *WebService) POST(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("POST").Path(subPath) -} - -// PUT is a shortcut for .Method("PUT").Path(subPath) -func (w *WebService) PUT(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("PUT").Path(subPath) -} - -// PATCH is a shortcut for .Method("PATCH").Path(subPath) -func (w *WebService) PATCH(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("PATCH").Path(subPath) -} - -// DELETE is a shortcut for .Method("DELETE").Path(subPath) -func (w *WebService) DELETE(subPath string) *RouteBuilder { - return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("DELETE").Path(subPath) -} diff --git a/vendor/github.com/emicklei/go-restful/web_service_container.go b/vendor/github.com/emicklei/go-restful/web_service_container.go deleted file mode 100644 index c9d31b06c47..00000000000 --- a/vendor/github.com/emicklei/go-restful/web_service_container.go +++ /dev/null @@ -1,39 +0,0 @@ -package restful - -// Copyright 2013 Ernest Micklei. All rights reserved. -// Use of this source code is governed by a license -// that can be found in the LICENSE file. - -import ( - "net/http" -) - -// DefaultContainer is a restful.Container that uses http.DefaultServeMux -var DefaultContainer *Container - -func init() { - DefaultContainer = NewContainer() - DefaultContainer.ServeMux = http.DefaultServeMux -} - -// If set the true then panics will not be caught to return HTTP 500. -// In that case, Route functions are responsible for handling any error situation. -// Default value is false = recover from panics. This has performance implications. -// OBSOLETE ; use restful.DefaultContainer.DoNotRecover(true) -var DoNotRecover = false - -// Add registers a new WebService add it to the DefaultContainer. -func Add(service *WebService) { - DefaultContainer.Add(service) -} - -// Filter appends a container FilterFunction from the DefaultContainer. -// These are called before dispatching a http.Request to a WebService. -func Filter(filter FilterFunction) { - DefaultContainer.Filter(filter) -} - -// RegisteredWebServices returns the collections of WebServices from the DefaultContainer -func RegisteredWebServices() []*WebService { - return DefaultContainer.RegisteredWebServices() -} diff --git a/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/LICENSE b/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/LICENSE deleted file mode 100644 index 8dada3edaf5..00000000000 --- a/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/LICENSE +++ /dev/null @@ -1,201 +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: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) 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 - - (d) 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/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/register.go b/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/register.go deleted file mode 100644 index 8ea2a30281b..00000000000 --- a/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/register.go +++ /dev/null @@ -1,5 +0,0 @@ -package k8scnicncfio - -const ( - GroupName = "k8s.cni.cncf.io" -) diff --git a/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/doc.go b/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/doc.go deleted file mode 100644 index 2882952a048..00000000000 --- a/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// +k8s:deepcopy-gen=package,register -// +groupName=k8s.cni.cncf.io -// +groupGoName=K8sCniCncfIo - -package v1 diff --git a/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/register.go b/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/register.go deleted file mode 100644 index e40da25728e..00000000000 --- a/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/register.go +++ /dev/null @@ -1,41 +0,0 @@ -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - - k8scnicncfio "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io" -) - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: k8scnicncfio.GroupName, Version: "v1"} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - SchemeBuilder runtime.SchemeBuilder - localSchemeBuilder = &SchemeBuilder - AddToScheme = localSchemeBuilder.AddToScheme -) - -func init() { - // We only register manually written functions here. The registration of the - // generated functions takes place in the generated files. The separation - // makes the code compile even when the generated files are missing. - localSchemeBuilder.Register(addKnownTypes) -} - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &NetworkAttachmentDefinition{}, - &NetworkAttachmentDefinitionList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/types.go b/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/types.go deleted file mode 100644 index 77e08f8b0f4..00000000000 --- a/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/types.go +++ /dev/null @@ -1,115 +0,0 @@ -package v1 - -import ( - "net" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +resourceName=network-attachment-definitions - -type NetworkAttachmentDefinition struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec NetworkAttachmentDefinitionSpec `json:"spec"` -} - -type NetworkAttachmentDefinitionSpec struct { - Config string `json:"config"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type NetworkAttachmentDefinitionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []NetworkAttachmentDefinition `json:"items"` -} - -// DNS contains values interesting for DNS resolvers -// +k8s:deepcopy-gen=false -type DNS struct { - Nameservers []string `json:"nameservers,omitempty"` - Domain string `json:"domain,omitempty"` - Search []string `json:"search,omitempty"` - Options []string `json:"options,omitempty"` -} - -// NetworkStatus is for network status annotation for pod -// +k8s:deepcopy-gen=false -type NetworkStatus struct { - Name string `json:"name"` - Interface string `json:"interface,omitempty"` - IPs []string `json:"ips,omitempty"` - Mac string `json:"mac,omitempty"` - Default bool `json:"default,omitempty"` - DNS DNS `json:"dns,omitempty"` -} - -// PortMapEntry for CNI PortMapEntry -// +k8s:deepcopy-gen=false -type PortMapEntry struct { - HostPort int `json:"hostPort"` - ContainerPort int `json:"containerPort"` - Protocol string `json:"protocol,omitempty"` - HostIP string `json:"hostIP,omitempty"` -} - -// BandwidthEntry for CNI BandwidthEntry -// +k8s:deepcopy-gen=false -type BandwidthEntry struct { - IngressRate int `json:"ingressRate"` - IngressBurst int `json:"ingressBurst"` - - EgressRate int `json:"egressRate"` - EgressBurst int `json:"egressBurst"` -} - -// NetworkSelectionElement represents one element of the JSON format -// Network Attachment Selection Annotation as described in section 4.1.2 -// of the CRD specification. -// +k8s:deepcopy-gen=false -type NetworkSelectionElement struct { - // Name contains the name of the Network object this element selects - Name string `json:"name"` - // Namespace contains the optional namespace that the network referenced - // by Name exists in - Namespace string `json:"namespace,omitempty"` - // IPRequest contains an optional requested IP address for this network - // attachment - IPRequest string `json:"ips,omitempty"` - // MacRequest contains an optional requested MAC address for this - // network attachment - MacRequest string `json:"mac,omitempty"` - // InterfaceRequest contains an optional requested name for the - // network interface this attachment will create in the container - InterfaceRequest string `json:"interface,omitempty"` - // PortMappingsRequest contains an optional requested port mapping - // for the network - PortMappingsRequest []*PortMapEntry `json:"portMappings,omitempty"` - // BandwidthRequest contains an optional requested bandwidth for - // the network - BandwidthRequest *BandwidthEntry `json:"bandwidth,omitempty"` - // CNIArgs contains additional CNI arguments for the network interface - CNIArgs *map[string]interface{} `json:"cni-args"` - // GatewayRequest contains default route IP address for the pod - GatewayRequest []net.IP `json:"default-route,omitempty"` -} - -const ( - // Pod annotation for network-attachment-definition - NetworkAttachmentAnnot = "k8s.v1.cni.cncf.io/networks" - // Pod annotation for network status - NetworkStatusAnnot = "k8s.v1.cni.cncf.io/networks-status" -) - -// NoK8sNetworkError indicates error, no network in kubernetes -// +k8s:deepcopy-gen=false -type NoK8sNetworkError struct { - Message string -} - -func (e *NoK8sNetworkError) Error() string { return string(e.Message) } diff --git a/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/zz_generated.deepcopy.go b/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/zz_generated.deepcopy.go deleted file mode 100644 index 16919978a7c..00000000000 --- a/vendor/github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,101 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2019 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. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NetworkAttachmentDefinition) DeepCopyInto(out *NetworkAttachmentDefinition) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinition. -func (in *NetworkAttachmentDefinition) DeepCopy() *NetworkAttachmentDefinition { - if in == nil { - return nil - } - out := new(NetworkAttachmentDefinition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NetworkAttachmentDefinition) 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 *NetworkAttachmentDefinitionList) DeepCopyInto(out *NetworkAttachmentDefinitionList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NetworkAttachmentDefinition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionList. -func (in *NetworkAttachmentDefinitionList) DeepCopy() *NetworkAttachmentDefinitionList { - if in == nil { - return nil - } - out := new(NetworkAttachmentDefinitionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NetworkAttachmentDefinitionList) 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 *NetworkAttachmentDefinitionSpec) DeepCopyInto(out *NetworkAttachmentDefinitionSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkAttachmentDefinitionSpec. -func (in *NetworkAttachmentDefinitionSpec) DeepCopy() *NetworkAttachmentDefinitionSpec { - if in == nil { - return nil - } - out := new(NetworkAttachmentDefinitionSpec) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/LICENSE b/vendor/github.com/kubevirt/terraform-provider-kubevirt/LICENSE deleted file mode 100644 index 2f8ed188e8b..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/LICENSE +++ /dev/null @@ -1,374 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. - diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/client/client.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/client/client.go deleted file mode 100644 index b5b7184b661..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/client/client.go +++ /dev/null @@ -1,215 +0,0 @@ -/* -Copyright 2018 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. -*/ - -package client - -import ( - "context" - "fmt" - "log" - - "k8s.io/apimachinery/pkg/api/errors" - meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - pkgApi "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/dynamic" - restclient "k8s.io/client-go/rest" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" - cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1" -) - -//go:generate mockgen -source=./client.go -destination=./mock/client_generated.go -package=mock - -type Client interface { - // VirtualMachine CRUD operations - - CreateVirtualMachine(vm *kubevirtapiv1.VirtualMachine) error - GetVirtualMachine(namespace string, name string) (*kubevirtapiv1.VirtualMachine, error) - UpdateVirtualMachine(namespace string, name string, vm *kubevirtapiv1.VirtualMachine, data []byte) error - DeleteVirtualMachine(namespace string, name string) error - - // DataVolume CRUD operations - - CreateDataVolume(vm *cdiv1.DataVolume) error - GetDataVolume(namespace string, name string) (*cdiv1.DataVolume, error) - UpdateDataVolume(namespace string, name string, dv *cdiv1.DataVolume, data []byte) error - DeleteDataVolume(namespace string, name string) error -} - -type client struct { - dynamicClient dynamic.Interface -} - -// New creates our client wrapper object for the actual kubeVirt and kubernetes clients we use. -func NewClient(cfg *restclient.Config) (Client, error) { - result := &client{} - c, err := dynamic.NewForConfig(cfg) - if err != nil { - msg := fmt.Sprintf("Failed to create client, with error: %v", err) - log.Printf("[Error] %s", msg) - return nil, fmt.Errorf(msg) - } - result.dynamicClient = c - return result, nil -} - -// VirtualMachine CRUD operations - -func (c *client) CreateVirtualMachine(vm *kubevirtapiv1.VirtualMachine) error { - vmUpdateTypeMeta(vm) - return c.createResource(vm, vm.Namespace, vmRes()) -} - -func (c *client) GetVirtualMachine(namespace string, name string) (*kubevirtapiv1.VirtualMachine, error) { - var vm kubevirtapiv1.VirtualMachine - resp, err := c.getResource(namespace, name, vmRes()) - if err != nil { - if errors.IsNotFound(err) { - log.Printf("[Warning] VirtualMachine %s not found (namespace=%s)", name, namespace) - return nil, err - } - msg := fmt.Sprintf("Failed to get VirtualMachine, with error: %v", err) - log.Printf("[Error] %s", msg) - return nil, fmt.Errorf(msg) - } - unstructured := resp.UnstructuredContent() - if err := runtime.DefaultUnstructuredConverter.FromUnstructured(unstructured, &vm); err != nil { - msg := fmt.Sprintf("Failed to translate unstructed to VirtualMachine, with error: %v", err) - log.Printf("[Error] %s", msg) - return nil, fmt.Errorf(msg) - } - return &vm, nil -} - -func (c *client) UpdateVirtualMachine(namespace string, name string, vm *kubevirtapiv1.VirtualMachine, data []byte) error { - vmUpdateTypeMeta(vm) - return c.updateResource(namespace, name, dvRes(), vm, data) -} - -func (c *client) DeleteVirtualMachine(namespace string, name string) error { - return c.deleteResource(namespace, name, vmRes()) -} - -func vmUpdateTypeMeta(vm *kubevirtapiv1.VirtualMachine) { - vm.TypeMeta = metav1.TypeMeta{ - Kind: "VirtualMachine", - APIVersion: kubevirtapiv1.GroupVersion.String(), - } -} - -func vmRes() schema.GroupVersionResource { - return schema.GroupVersionResource{ - Group: kubevirtapiv1.GroupVersion.Group, - Version: kubevirtapiv1.GroupVersion.Version, - Resource: "virtualmachines", - } - -} - -// DataVolume CRUD operations - -func (c *client) CreateDataVolume(dv *cdiv1.DataVolume) error { - dvUpdateTypeMeta(dv) - return c.createResource(dv, dv.Namespace, dvRes()) -} - -func (c *client) GetDataVolume(namespace string, name string) (*cdiv1.DataVolume, error) { - var dv cdiv1.DataVolume - resp, err := c.getResource(namespace, name, dvRes()) - if err != nil { - if errors.IsNotFound(err) { - log.Printf("[Warning] DataVolume %s not found (namespace=%s)", name, namespace) - return nil, err - } - msg := fmt.Sprintf("Failed to get DataVolume, with error: %v", err) - log.Printf("[Error] %s", msg) - return nil, fmt.Errorf(msg) - } - unstructured := resp.UnstructuredContent() - if err := runtime.DefaultUnstructuredConverter.FromUnstructured(unstructured, &dv); err != nil { - msg := fmt.Sprintf("Failed to translate Unstructed to VirtualMachine, with error: %v", err) - log.Printf("[Error] %s", msg) - return nil, fmt.Errorf(msg) - } - return &dv, nil -} - -func (c *client) UpdateDataVolume(namespace string, name string, dv *cdiv1.DataVolume, data []byte) error { - dvUpdateTypeMeta(dv) - return c.updateResource(namespace, name, dvRes(), dv, data) -} - -func (c *client) DeleteDataVolume(namespace string, name string) error { - return c.deleteResource(namespace, name, dvRes()) -} - -func dvUpdateTypeMeta(dv *cdiv1.DataVolume) { - dv.TypeMeta = metav1.TypeMeta{ - Kind: "DataVolume", - APIVersion: cdiv1.SchemeGroupVersion.String(), - } -} - -func dvRes() schema.GroupVersionResource { - return schema.GroupVersionResource{ - Group: cdiv1.SchemeGroupVersion.Group, - Version: cdiv1.SchemeGroupVersion.Version, - Resource: "datavolumes", - } -} - -// Generic Resource CRUD operations - -func (c *client) createResource(obj interface{}, namespace string, resource schema.GroupVersionResource) error { - resultMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj) - if err != nil { - msg := fmt.Sprintf("Failed to translate %s to Unstructed (for create operation), with error: %v", resource.Resource, err) - log.Printf("[Error] %s", msg) - return fmt.Errorf(msg) - } - input := unstructured.Unstructured{} - input.SetUnstructuredContent(resultMap) - resp, err := c.dynamicClient.Resource(resource).Namespace(namespace).Create(context.Background(), &input, meta_v1.CreateOptions{}) - if err != nil { - msg := fmt.Sprintf("Failed to create %s, with error: %v", resource.Resource, err) - log.Printf("[Error] %s", msg) - return fmt.Errorf(msg) - } - unstructured := resp.UnstructuredContent() - return runtime.DefaultUnstructuredConverter.FromUnstructured(unstructured, obj) -} - -func (c *client) getResource(namespace string, name string, resource schema.GroupVersionResource) (*unstructured.Unstructured, error) { - return c.dynamicClient.Resource(resource).Namespace(namespace).Get(context.Background(), name, metav1.GetOptions{}) -} - -func (c *client) updateResource(namespace string, name string, resource schema.GroupVersionResource, obj interface{}, data []byte) error { - resp, err := c.dynamicClient.Resource(resource).Namespace(namespace).Patch(context.Background(), name, pkgApi.JSONPatchType, data, metav1.PatchOptions{}) - if err != nil { - msg := fmt.Sprintf("Failed to update %s, with error: %v", resource.Resource, err) - log.Printf("[Error] %s", msg) - return fmt.Errorf(msg) - } - unstructured := resp.UnstructuredContent() - return runtime.DefaultUnstructuredConverter.FromUnstructured(unstructured, obj) -} - -func (c *client) deleteResource(namespace string, name string, resource schema.GroupVersionResource) error { - return c.dynamicClient.Resource(resource).Namespace(namespace).Delete(context.Background(), name, metav1.DeleteOptions{}) -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/provider.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/provider.go deleted file mode 100644 index 6dc361acba1..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/provider.go +++ /dev/null @@ -1,217 +0,0 @@ -package kubevirt - -import ( - "bytes" - "fmt" - "log" - "os" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/client" - "github.com/mitchellh/go-homedir" - _ "k8s.io/client-go/plugin/pkg/client/auth" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" -) - -func Provider() terraform.ResourceProvider { - p := &schema.Provider{ - Schema: map[string]*schema.Schema{ - "host": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("KUBE_HOST", ""), - Description: "The hostname (in form of URI) of Kubernetes master.", - }, - "username": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("KUBE_USER", ""), - Description: "The username to use for HTTP basic authentication when accessing the Kubernetes master endpoint.", - }, - "password": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("KUBE_PASSWORD", ""), - Description: "The password to use for HTTP basic authentication when accessing the Kubernetes master endpoint.", - }, - "insecure": { - Type: schema.TypeBool, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("KUBE_INSECURE", false), - Description: "Whether server should be accessed without verifying the TLS certificate.", - }, - "client_certificate": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("KUBE_CLIENT_CERT_DATA", ""), - Description: "PEM-encoded client certificate for TLS authentication.", - }, - "client_key": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("KUBE_CLIENT_KEY_DATA", ""), - Description: "PEM-encoded client certificate key for TLS authentication.", - }, - "cluster_ca_certificate": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("KUBE_CLUSTER_CA_CERT_DATA", ""), - Description: "PEM-encoded root certificates bundle for TLS authentication.", - }, - "config_path": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.MultiEnvDefaultFunc( - []string{ - "KUBE_CONFIG", - "KUBECONFIG", - }, - "~/.kube/config"), - Description: "Path to the kube config file, defaults to ~/.kube/config", - }, - "config_context": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("KUBE_CTX", ""), - }, - "config_context_auth_info": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("KUBE_CTX_AUTH_INFO", ""), - Description: "", - }, - "config_context_cluster": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("KUBE_CTX_CLUSTER", ""), - Description: "", - }, - "token": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("KUBE_TOKEN", ""), - Description: "Token to authentifcate an service account", - }, - "load_config_file": { - Type: schema.TypeBool, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("KUBE_LOAD_CONFIG_FILE", true), - Description: "Load local kubeconfig.", - }, - }, - ResourcesMap: map[string]*schema.Resource{ - "kubevirt_virtual_machine": resourceKubevirtVirtualMachine(), - "kubevirt_data_volume": resourceKubevirtDataVolume(), - }, - } - p.ConfigureFunc = func(resourceData *schema.ResourceData) (interface{}, error) { - terraformVersion := p.TerraformVersion - if terraformVersion == "" { - // Terraform 0.12 introduced this field to the protocol - // We can therefore assume that if it's missing it's 0.10 or 0.11 - terraformVersion = "0.11+compatible" - } - return providerConfigure(resourceData, terraformVersion) - } - return p -} - -func providerConfigure(resourceData *schema.ResourceData, terraformVersion string) (interface{}, error) { - - var cfg *restclient.Config - var err error - if resourceData.Get("load_config_file").(bool) { - // Config file loading - cfg, err = tryLoadingConfigFile(resourceData) - } - - if err != nil { - return nil, err - } - if cfg == nil { - cfg = &restclient.Config{} - } - - // Overriding with static configuration - cfg.UserAgent = fmt.Sprintf("HashiCorp/1.0 Terraform/%s", terraformVersion) - - if v, ok := resourceData.GetOk("host"); ok { - cfg.Host = v.(string) - } - if v, ok := resourceData.GetOk("username"); ok { - cfg.Username = v.(string) - } - if v, ok := resourceData.GetOk("password"); ok { - cfg.Password = v.(string) - } - if v, ok := resourceData.GetOk("insecure"); ok { - cfg.Insecure = v.(bool) - } - if v, ok := resourceData.GetOk("cluster_ca_certificate"); ok { - cfg.CAData = bytes.NewBufferString(v.(string)).Bytes() - } - if v, ok := resourceData.GetOk("client_certificate"); ok { - cfg.CertData = bytes.NewBufferString(v.(string)).Bytes() - } - if v, ok := resourceData.GetOk("client_key"); ok { - cfg.KeyData = bytes.NewBufferString(v.(string)).Bytes() - } - if v, ok := resourceData.GetOk("token"); ok { - cfg.BearerToken = v.(string) - } - - return client.NewClient(cfg) -} - -func tryLoadingConfigFile(resourceData *schema.ResourceData) (*restclient.Config, error) { - path, err := homedir.Expand(resourceData.Get("config_path").(string)) - if err != nil { - return nil, err - } - - loader := &clientcmd.ClientConfigLoadingRules{ - ExplicitPath: path, - } - - overrides := &clientcmd.ConfigOverrides{} - ctxSuffix := "; default context" - - ctx, ctxOk := resourceData.GetOk("config_context") - authInfo, authInfoOk := resourceData.GetOk("config_context_auth_info") - cluster, clusterOk := resourceData.GetOk("config_context_cluster") - if ctxOk || authInfoOk || clusterOk { - ctxSuffix = "; overriden context" - if ctxOk { - overrides.CurrentContext = ctx.(string) - ctxSuffix += fmt.Sprintf("; config ctx: %s", overrides.CurrentContext) - log.Printf("[DEBUG] Using custom current context: %q", overrides.CurrentContext) - } - - overrides.Context = clientcmdapi.Context{} - if authInfoOk { - overrides.Context.AuthInfo = authInfo.(string) - ctxSuffix += fmt.Sprintf("; auth_info: %s", overrides.Context.AuthInfo) - } - if clusterOk { - overrides.Context.Cluster = cluster.(string) - ctxSuffix += fmt.Sprintf("; cluster: %s", overrides.Context.Cluster) - } - log.Printf("[DEBUG] Using overidden context: %#v", overrides.Context) - } - - cc := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loader, overrides) - cfg, err := cc.ClientConfig() - if err != nil { - if pathErr, ok := err.(*os.PathError); ok && os.IsNotExist(pathErr.Err) { - log.Printf("[INFO] Unable to load config file as it doesn't exist at %q", path) - return nil, nil - } - return nil, fmt.Errorf("Failed to load config (%s%s): %s", path, ctxSuffix, err) - } - - log.Printf("[INFO] Successfully loaded config file (%s%s)", path, ctxSuffix) - return cfg, nil -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/resource_datavolume.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/resource_datavolume.go deleted file mode 100644 index 644df45ff0d..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/resource_datavolume.go +++ /dev/null @@ -1,194 +0,0 @@ -package kubevirt - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/client" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/patch" - "k8s.io/apimachinery/pkg/api/errors" - cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1" -) - -func resourceKubevirtDataVolume() *schema.Resource { - return &schema.Resource{ - Create: resourceKubevirtDataVolumeCreate, - Read: resourceKubevirtDataVolumeRead, - Update: resourceKubevirtDataVolumeUpdate, - Delete: resourceKubevirtDataVolumeDelete, - Exists: resourceKubevirtDataVolumeExists, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(40 * time.Minute), - Delete: schema.DefaultTimeout(5 * time.Minute), - }, - Schema: datavolume.DataVolumeFields(), - } -} - -func resourceKubevirtDataVolumeCreate(resourceData *schema.ResourceData, meta interface{}) error { - cli := (meta).(client.Client) - - dv, err := datavolume.FromResourceData(resourceData) - if err != nil { - return err - } - - log.Printf("[INFO] Creating new data volume: %#v", dv) - if err := cli.CreateDataVolume(dv); err != nil { - return err - } - log.Printf("[INFO] Submitted new data volume: %#v", dv) - if err := datavolume.ToResourceData(*dv, resourceData); err != nil { - return err - } - resourceData.SetId(utils.BuildId(dv.ObjectMeta)) - - // Wait for data volume instance's status phase to be succeeded: - name := dv.ObjectMeta.Name - namespace := dv.ObjectMeta.Namespace - - stateConf := &resource.StateChangeConf{ - Pending: []string{"Creating"}, - Target: []string{"Succeeded"}, - Timeout: resourceData.Timeout(schema.TimeoutCreate), - Refresh: func() (interface{}, string, error) { - var err error - dv, err = cli.GetDataVolume(namespace, name) - if err != nil { - if errors.IsNotFound(err) { - log.Printf("[DEBUG] data volume %s is not created yet", name) - return dv, "Creating", nil - } - return dv, "", err - } - - switch dv.Status.Phase { - case cdiv1.Succeeded: - return dv, "Succeeded", nil - case cdiv1.Failed: - return dv, "", fmt.Errorf("data volume failed to be created, finished with phase=\"failed\"") - } - - log.Printf("[DEBUG] data volume %s is being created", name) - return dv, "Creating", nil - }, - } - - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf("%s", err) - } - return datavolume.ToResourceData(*dv, resourceData) -} - -func resourceKubevirtDataVolumeRead(resourceData *schema.ResourceData, meta interface{}) error { - cli := (meta).(client.Client) - - namespace, name, err := utils.IdParts(resourceData.Id()) - if err != nil { - return err - } - - log.Printf("[INFO] Reading data volume %s", name) - - dv, err := cli.GetDataVolume(namespace, name) - if err != nil { - log.Printf("[DEBUG] Received error: %#v", err) - return err - } - log.Printf("[INFO] Received data volume: %#v", dv) - - return datavolume.ToResourceData(*dv, resourceData) -} - -func resourceKubevirtDataVolumeUpdate(resourceData *schema.ResourceData, meta interface{}) error { - cli := (meta).(client.Client) - - namespace, name, err := utils.IdParts(resourceData.Id()) - if err != nil { - return err - } - - ops := datavolume.AppendPatchOps("", "", resourceData, make([]patch.PatchOperation, 0, 0)) - data, err := ops.MarshalJSON() - if err != nil { - return fmt.Errorf("Failed to marshal update operations: %s", err) - } - - log.Printf("[INFO] Updating data volume: %s", ops) - out := &cdiv1.DataVolume{} - if err := cli.UpdateDataVolume(namespace, name, out, data); err != nil { - return err - } - - log.Printf("[INFO] Submitted updated data volume: %#v", out) - - return resourceKubevirtDataVolumeRead(resourceData, meta) -} - -func resourceKubevirtDataVolumeDelete(resourceData *schema.ResourceData, meta interface{}) error { - cli := (meta).(client.Client) - - namespace, name, err := utils.IdParts(resourceData.Id()) - if err != nil { - return err - } - - log.Printf("[INFO] Deleting data volume: %#v", name) - if err := cli.DeleteDataVolume(namespace, name); err != nil { - return err - } - - // Wait for data volume instance to be removed: - stateConf := &resource.StateChangeConf{ - Pending: []string{"Deleting"}, - Timeout: resourceData.Timeout(schema.TimeoutDelete), - Refresh: func() (interface{}, string, error) { - dv, err := cli.GetDataVolume(namespace, name) - if err != nil { - if errors.IsNotFound(err) { - return nil, "", nil - } - return dv, "", err - } - - log.Printf("[DEBUG] data volume %s is being deleted", dv.GetName()) - return dv, "Deleting", nil - }, - } - - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf("%s", err) - } - - log.Printf("[INFO] data volume %s deleted", name) - - resourceData.SetId("") - return nil -} - -func resourceKubevirtDataVolumeExists(resourceData *schema.ResourceData, meta interface{}) (bool, error) { - cli := (meta).(client.Client) - - namespace, name, err := utils.IdParts(resourceData.Id()) - if err != nil { - return false, err - } - - log.Printf("[INFO] Checking data volume %s", name) - if _, err := cli.GetDataVolume(namespace, name); err != nil { - if statusErr, ok := err.(*errors.StatusError); ok && statusErr.ErrStatus.Code == 404 { - return false, nil - } - log.Printf("[DEBUG] Received error: %#v", err) - return true, err - } - return true, nil -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/resource_virtualmachine.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/resource_virtualmachine.go deleted file mode 100644 index e3a42b1e0fc..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/resource_virtualmachine.go +++ /dev/null @@ -1,192 +0,0 @@ -package kubevirt - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/client" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/patch" - "k8s.io/apimachinery/pkg/api/errors" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -func resourceKubevirtVirtualMachine() *schema.Resource { - return &schema.Resource{ - Create: resourceKubevirtVirtualMachineCreate, - Read: resourceKubevirtVirtualMachineRead, - Update: resourceKubevirtVirtualMachineUpdate, - Delete: resourceKubevirtVirtualMachineDelete, - Exists: resourceKubevirtVirtualMachineExists, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(40 * time.Minute), - Delete: schema.DefaultTimeout(5 * time.Minute), - }, - Schema: virtualmachine.VirtualMachineFields(), - } -} - -func resourceKubevirtVirtualMachineCreate(resourceData *schema.ResourceData, meta interface{}) error { - cli := (meta).(client.Client) - - vm, err := virtualmachine.FromResourceData(resourceData) - if err != nil { - return err - } - - log.Printf("[INFO] Creating new virtual machine: %#v", vm) - if err := cli.CreateVirtualMachine(vm); err != nil { - return err - } - log.Printf("[INFO] Submitted new virtual machine: %#v", vm) - if err := virtualmachine.ToResourceData(*vm, resourceData); err != nil { - return err - } - resourceData.SetId(utils.BuildId(vm.ObjectMeta)) - - // Wait for virtual machine instance's status phase to be succeeded: - name := vm.ObjectMeta.Name - namespace := vm.ObjectMeta.Namespace - - stateConf := &resource.StateChangeConf{ - Pending: []string{"Creating"}, - Target: []string{"Succeeded"}, - Timeout: resourceData.Timeout(schema.TimeoutCreate), - Refresh: func() (interface{}, string, error) { - var err error - vm, err = cli.GetVirtualMachine(namespace, name) - if err != nil { - if errors.IsNotFound(err) { - log.Printf("[DEBUG] virtual machine %s is not created yet", name) - return vm, "Creating", nil - } - return vm, "", err - } - - if vm.Status.Created == true && vm.Status.Ready == true { - return vm, "Succeeded", nil - } - - log.Printf("[DEBUG] virtual machine %s is being created", name) - return vm, "Creating", nil - }, - } - - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf("%s", err) - } - - return resourceKubevirtVirtualMachineRead(resourceData, meta) -} - -func resourceKubevirtVirtualMachineRead(resourceData *schema.ResourceData, meta interface{}) error { - cli := (meta).(client.Client) - - namespace, name, err := utils.IdParts(resourceData.Id()) - if err != nil { - return err - } - - log.Printf("[INFO] Reading virtual machine %s", name) - - vm, err := cli.GetVirtualMachine(namespace, name) - if err != nil { - log.Printf("[DEBUG] Received error: %#v", err) - return err - } - log.Printf("[INFO] Received virtual machine: %#v", vm) - - return virtualmachine.ToResourceData(*vm, resourceData) -} - -func resourceKubevirtVirtualMachineUpdate(resourceData *schema.ResourceData, meta interface{}) error { - cli := (meta).(client.Client) - - namespace, name, err := utils.IdParts(resourceData.Id()) - if err != nil { - return err - } - - ops := virtualmachine.AppendPatchOps("", "", resourceData, make([]patch.PatchOperation, 0, 0)) - data, err := ops.MarshalJSON() - if err != nil { - return fmt.Errorf("Failed to marshal update operations: %s", err) - } - - log.Printf("[INFO] Updating virtual machine: %s", ops) - out := &kubevirtapiv1.VirtualMachine{} - if err := cli.UpdateVirtualMachine(namespace, name, out, data); err != nil { - return err - } - - log.Printf("[INFO] Submitted updated virtual machine: %#v", out) - - return resourceKubevirtVirtualMachineRead(resourceData, meta) -} - -func resourceKubevirtVirtualMachineDelete(resourceData *schema.ResourceData, meta interface{}) error { - namespace, name, err := utils.IdParts(resourceData.Id()) - if err != nil { - return err - } - - cli := (meta).(client.Client) - - log.Printf("[INFO] Deleting virtual machine: %#v", name) - if err := cli.DeleteVirtualMachine(namespace, name); err != nil { - return err - } - - // Wait for virtual machine instance to be removed: - stateConf := &resource.StateChangeConf{ - Pending: []string{"Deleting"}, - Timeout: resourceData.Timeout(schema.TimeoutDelete), - Refresh: func() (interface{}, string, error) { - vm, err := cli.GetVirtualMachine(namespace, name) - if err != nil { - if errors.IsNotFound(err) { - return nil, "", nil - } - return vm, "", err - } - - log.Printf("[DEBUG] Virtual machine %s is being deleted", vm.GetName()) - return vm, "Deleting", nil - }, - } - - if _, err := stateConf.WaitForState(); err != nil { - return fmt.Errorf("%s", err) - } - - log.Printf("[INFO] virtual machine %s deleted", name) - - resourceData.SetId("") - return nil -} - -func resourceKubevirtVirtualMachineExists(resourceData *schema.ResourceData, meta interface{}) (bool, error) { - namespace, name, err := utils.IdParts(resourceData.Id()) - if err != nil { - return false, err - } - - cli := (meta).(client.Client) - - log.Printf("[INFO] Checking virtual machine %s", name) - if _, err := cli.GetVirtualMachine(namespace, name); err != nil { - if statusErr, ok := err.(*errors.StatusError); ok && statusErr.ErrStatus.Code == 404 { - return false, nil - } - log.Printf("[DEBUG] Received error: %#v", err) - return true, err - } - return true, nil -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume/data_volume.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume/data_volume.go deleted file mode 100644 index 33772acc680..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume/data_volume.go +++ /dev/null @@ -1,106 +0,0 @@ -package datavolume - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/patch" - cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1" -) - -func DataVolumeFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "metadata": k8s.NamespacedMetadataSchema("DataVolume", false), - "spec": dataVolumeSpecSchema(), - "status": dataVolumeStatusSchema(), - } -} - -func DataVolumeTemplatesSchema() *schema.Schema { - fields := DataVolumeFields() - - return &schema.Schema{ - Type: schema.TypeList, - Description: fmt.Sprintf("dataVolumeTemplates is a list of dataVolumes that the VirtualMachineInstance template can reference."), - Required: true, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func ExpandDataVolumeTemplates(dataVolumes []interface{}) ([]cdiv1.DataVolume, error) { - result := make([]cdiv1.DataVolume, len(dataVolumes)) - - if len(dataVolumes) == 0 || dataVolumes[0] == nil { - return result, nil - } - - for i, dataVolume := range dataVolumes { - in := dataVolume.(map[string]interface{}) - - if v, ok := in["metadata"].([]interface{}); ok { - result[i].ObjectMeta = k8s.ExpandMetadata(v) - } - if v, ok := in["spec"].([]interface{}); ok { - spec, err := expandDataVolumeSpec(v) - if err != nil { - return result, err - } - result[i].Spec = spec - } - if v, ok := in["status"].([]interface{}); ok { - result[i].Status = expandDataVolumeStatus(v) - } - } - - return result, nil -} - -func FlattenDataVolumeTemplates(in []cdiv1.DataVolume) []interface{} { - att := make([]interface{}, len(in)) - - for i, v := range in { - c := make(map[string]interface{}) - c["metadata"] = k8s.FlattenMetadata(v.ObjectMeta) - c["spec"] = flattenDataVolumeSpec(v.Spec) - c["status"] = flattenDataVolumeStatus(v.Status) - att[i] = c - } - - return att -} - -func FromResourceData(resourceData *schema.ResourceData) (*cdiv1.DataVolume, error) { - result := &cdiv1.DataVolume{} - - result.ObjectMeta = k8s.ExpandMetadata(resourceData.Get("metadata").([]interface{})) - spec, err := expandDataVolumeSpec(resourceData.Get("spec").([]interface{})) - if err != nil { - return result, err - } - result.Spec = spec - result.Status = expandDataVolumeStatus(resourceData.Get("status").([]interface{})) - - return result, nil -} - -func ToResourceData(dv cdiv1.DataVolume, resourceData *schema.ResourceData) error { - if err := resourceData.Set("metadata", k8s.FlattenMetadata(dv.ObjectMeta)); err != nil { - return err - } - if err := resourceData.Set("spec", flattenDataVolumeSpec(dv.Spec)); err != nil { - return err - } - if err := resourceData.Set("status", flattenDataVolumeStatus(dv.Status)); err != nil { - return err - } - - return nil -} - -func AppendPatchOps(keyPrefix, pathPrefix string, resourceData *schema.ResourceData, ops []patch.PatchOperation) patch.PatchOperations { - return k8s.AppendPatchOps(keyPrefix+"metadata.0.", pathPrefix+"/metadata/", resourceData, ops) -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume/source.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume/source.go deleted file mode 100644 index f617a7af68d..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume/source.go +++ /dev/null @@ -1,185 +0,0 @@ -package datavolume - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1" -) - -func dataVolumeSourceFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "http": dataVolumeSourceHTTPSchema(), - "pvc": dataVolumeSourcePVCSchema(), - } -} - -func dataVolumeSourceSchema() *schema.Schema { - fields := dataVolumeSourceFields() - - return &schema.Schema{ - Type: schema.TypeList, - Description: fmt.Sprintf("Source is the src of the data for the requested DataVolume."), - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func dataVolumeSourceHTTPFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "url": { - Type: schema.TypeString, - Description: "url is the URL of the http source.", - Optional: true, - }, - "secret_ref": { - Type: schema.TypeString, - Description: "Secret_ref provides the secret reference needed to access the HTTP source.", - Optional: true, - }, - "cert_config_map": { - Type: schema.TypeString, - Description: "Cert_config_map provides a reference to the Registry certs.", - Optional: true, - }, - } -} - -func dataVolumeSourceHTTPSchema() *schema.Schema { - fields := dataVolumeSourceHTTPFields() - - return &schema.Schema{ - Type: schema.TypeList, - Description: "DataVolumeSourceHTTP provides the parameters to create a Data Volume from an HTTP source.", - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func dataVolumeSourcePVCFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "namespace": { - Type: schema.TypeString, - Description: "The namespace which the PVC located in.", - Optional: true, - }, - "name": { - Type: schema.TypeString, - Description: "The name of the PVC.", - Optional: true, - }, - } -} - -func dataVolumeSourcePVCSchema() *schema.Schema { - fields := dataVolumeSourcePVCFields() - - return &schema.Schema{ - Type: schema.TypeList, - Description: "DataVolumeSourcePVC provides the parameters to create a Data Volume from an existing PVC.", - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -// Expanders - -func expandDataVolumeSource(dataVolumeSource []interface{}) cdiv1.DataVolumeSource { - result := cdiv1.DataVolumeSource{} - - if len(dataVolumeSource) == 0 || dataVolumeSource[0] == nil { - return result - } - - in := dataVolumeSource[0].(map[string]interface{}) - - result.HTTP = expandDataVolumeSourceHTTP(in["http"].([]interface{})) - result.PVC = expandDataVolumeSourcePVC(in["pvc"].([]interface{})) - - return result -} - -func expandDataVolumeSourceHTTP(dataVolumeSourceHTTP []interface{}) *cdiv1.DataVolumeSourceHTTP { - if len(dataVolumeSourceHTTP) == 0 || dataVolumeSourceHTTP[0] == nil { - return nil - } - - result := &cdiv1.DataVolumeSourceHTTP{} - - in := dataVolumeSourceHTTP[0].(map[string]interface{}) - - if v, ok := in["url"].(string); ok { - result.URL = v - } - if v, ok := in["secret_ref"].(string); ok { - result.SecretRef = v - } - if v, ok := in["cert_config_map"].(string); ok { - result.CertConfigMap = v - } - - return result -} - -func expandDataVolumeSourcePVC(dataVolumeSourcePVC []interface{}) *cdiv1.DataVolumeSourcePVC { - if len(dataVolumeSourcePVC) == 0 || dataVolumeSourcePVC[0] == nil { - return nil - } - - result := &cdiv1.DataVolumeSourcePVC{} - - in := dataVolumeSourcePVC[0].(map[string]interface{}) - - if v, ok := in["namespace"].(string); ok { - result.Namespace = v - } - if v, ok := in["name"].(string); ok { - result.Name = v - } - - return result -} - -// Flatteners - -func flattenDataVolumeSource(in cdiv1.DataVolumeSource) []interface{} { - att := make(map[string]interface{}) - - if in.HTTP != nil { - att["http"] = flattenDataVolumeSourceHTTP(*in.HTTP) - } - if in.PVC != nil { - att["pvc"] = flattenDataVolumeSourcePVC(*in.PVC) - } - - return []interface{}{att} -} - -func flattenDataVolumeSourceHTTP(in cdiv1.DataVolumeSourceHTTP) []interface{} { - att := map[string]interface{}{ - "url": in.URL, - "secret_ref": in.SecretRef, - "cert_config_map": in.CertConfigMap, - } - return []interface{}{att} -} - -func flattenDataVolumeSourcePVC(in cdiv1.DataVolumeSourcePVC) []interface{} { - att := map[string]interface{}{ - "namespace": in.Namespace, - "name": in.Name, - } - return []interface{}{att} -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume/spec.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume/spec.go deleted file mode 100644 index 8699af6ad1d..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume/spec.go +++ /dev/null @@ -1,73 +0,0 @@ -package datavolume - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s" - cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1" -) - -func dataVolumeSpecFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "source": dataVolumeSourceSchema(), - "pvc": k8s.PersistentVolumeClaimSpecSchema(), - "content_type": { - Type: schema.TypeString, - Description: "ContentType options: \"kubevirt\", \"archive\".", - Optional: true, - ValidateFunc: validation.StringInSlice([]string{ - "kubevirt", - "archive", - }, false), - }, - } -} - -func dataVolumeSpecSchema() *schema.Schema { - fields := dataVolumeSpecFields() - - return &schema.Schema{ - Type: schema.TypeList, - Description: fmt.Sprintf("DataVolumeSpec defines our specification for a DataVolume type"), - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func expandDataVolumeSpec(dataVolumeSpec []interface{}) (cdiv1.DataVolumeSpec, error) { - result := cdiv1.DataVolumeSpec{} - - if len(dataVolumeSpec) == 0 || dataVolumeSpec[0] == nil { - return result, nil - } - - in := dataVolumeSpec[0].(map[string]interface{}) - - result.Source = expandDataVolumeSource(in["source"].([]interface{})) - p, err := k8s.ExpandPersistentVolumeClaimSpec(in["pvc"].([]interface{})) - if err != nil { - return result, err - } - result.PVC = p - - if v, ok := in["content_type"].(string); ok { - result.ContentType = cdiv1.DataVolumeContentType(v) - } - - return result, nil -} - -func flattenDataVolumeSpec(spec cdiv1.DataVolumeSpec) []interface{} { - att := map[string]interface{}{ - "source": flattenDataVolumeSource(spec.Source), - "pvc": k8s.FlattenPersistentVolumeClaimSpec(*spec.PVC), - "content_type": string(spec.ContentType), - } - return []interface{}{att} -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume/status.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume/status.go deleted file mode 100644 index 634470754ab..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume/status.go +++ /dev/null @@ -1,87 +0,0 @@ -package datavolume - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils" - cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1" -) - -func dataVolumeStatusFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "phase": { - Type: schema.TypeString, - Description: "DataVolumePhase is the current phase of the DataVolume.", - Optional: true, - Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - "", - "Pending", - "PVCBound", - "ImportScheduled", - "ImportInProgress", - "CloneScheduled", - "CloneInProgress", - "SnapshotForSmartCloneInProgress", - "SmartClonePVCInProgress", - "UploadScheduled", - "UploadReady", - "Succeeded", - "Failed", - "Unknown", - }, false), - }, - "progress": { - Type: schema.TypeString, - Description: "DataVolumePhase is the current phase of the DataVolume.", - Optional: true, - Computed: true, - ValidateFunc: utils.StringIsIntInRange(0, 100), - }, - } -} - -func dataVolumeStatusSchema() *schema.Schema { - fields := dataVolumeStatusFields() - - return &schema.Schema{ - Type: schema.TypeList, - Description: fmt.Sprintf("DataVolumeStatus provides the parameters to store the phase of the Data Volume"), - Optional: true, - MaxItems: 1, - Computed: true, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func expandDataVolumeStatus(dataVolumeStatus []interface{}) cdiv1.DataVolumeStatus { - result := cdiv1.DataVolumeStatus{} - - if len(dataVolumeStatus) == 0 || dataVolumeStatus[0] == nil { - return result - } - - in := dataVolumeStatus[0].(map[string]interface{}) - - if v, ok := in["phase"].(string); ok { - result.Phase = cdiv1.DataVolumePhase(v) - } - if v, ok := in["progress"].(string); ok { - result.Progress = cdiv1.DataVolumeProgress(v) - } - - return result -} - -func flattenDataVolumeStatus(in cdiv1.DataVolumeStatus) []interface{} { - att := map[string]interface{}{ - "phase": string(in.Phase), - "progress": string(in.Progress), - } - return []interface{}{att} -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/affinity_spec.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/affinity_spec.go deleted file mode 100644 index e4e2d60056a..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/affinity_spec.go +++ /dev/null @@ -1,521 +0,0 @@ -package k8s - -import ( - "regexp" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils" - api "k8s.io/api/core/v1" - v1 "k8s.io/api/core/v1" -) - -func affinityFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "node_affinity": { - Type: schema.TypeList, - Description: "Node affinity scheduling rules for the pod.", - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: nodeAffinityFields(), - }, - }, - "pod_affinity": { - Type: schema.TypeList, - Description: "Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.)", - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: podAffinityFields(), - }, - }, - "pod_anti_affinity": { - Type: schema.TypeList, - Description: "Inter-pod topological affinity. rules that specify that certain pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.)", - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: podAffinityFields(), - }, - }, - } -} - -func AffinitySchema() *schema.Schema { - fields := affinityFields() - - return &schema.Schema{ - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Description: "Optional pod scheduling constraints.", - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func nodeAffinityFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "required_during_scheduling_ignored_during_execution": { - Type: schema.TypeList, - Description: "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a node label update), the system may or may not try to eventually evict the pod from its node.", - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: nodeSelectorFields(), - }, - }, - "preferred_during_scheduling_ignored_during_execution": { - Type: schema.TypeList, - Description: "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, RequiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding 'weight' to the sum if the node matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred.", - Optional: true, - Elem: &schema.Resource{ - Schema: preferredSchedulingTermFields(), - }, - }, - } -} - -func nodeSelectorFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "node_selector_term": { - Type: schema.TypeList, - Description: "List of node selector terms. The terms are ORed.", - Optional: true, - Elem: &schema.Resource{ - Schema: nodeSelectorRequirementsFields(), - }, - }, - } -} - -func preferredSchedulingTermFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "weight": { - Type: schema.TypeInt, - Description: "weight is in the range 1-100", - Required: true, - }, - "preference": { - Type: schema.TypeList, - Description: "A node selector term, associated with the corresponding weight.", - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: nodeSelectorRequirementsFields(), - }, - }, - } -} - -func nodeSelectorRequirementsFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "match_expressions": { - Type: schema.TypeList, - Description: "List of node selector requirements. The requirements are ANDed.", - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": { - Type: schema.TypeString, - Description: "The label key that the selector applies to.", - Optional: true, - }, - "operator": { - Type: schema.TypeString, - Description: "Operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.", - Optional: true, - ValidateFunc: validation.StringInSlice([]string{"In", "NotIn", "Exists", "DoesNotExist", "Gt", "Lt"}, false), - }, - "values": { - Type: schema.TypeSet, - Description: "Values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.", - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - }, - }, - } -} - -func podAffinityFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "required_during_scheduling_ignored_during_execution": { - Type: schema.TypeList, - Description: "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each PodAffinityTerm are intersected, i.e. all terms must be satisfied.", - Optional: true, - Elem: &schema.Resource{ - Schema: podAffinityTermFields(), - }, - }, - "preferred_during_scheduling_ignored_during_execution": { - Type: schema.TypeList, - Description: "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, RequiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding 'weight' to the sum if the node matches the corresponding MatchExpressions; the node(s) with the highest sum are the most preferred.", - Optional: true, - Elem: &schema.Resource{ - Schema: weightedPodAffinityTermFields(), - }, - }, - } -} - -func podAffinityTermFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "label_selector": { - Type: schema.TypeList, - Description: "A label query over a set of resources, in this case pods.", - Optional: true, - Elem: &schema.Resource{ - Schema: labelSelectorFields(true), - }, - }, - "namespaces": { - Type: schema.TypeSet, - Description: "namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means 'this pod's namespace'", - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - "topology_key": { - Type: schema.TypeString, - Description: "empty topology key is interpreted by the scheduler as 'all topologies'", - Optional: true, - ValidateFunc: validation.StringMatch(regexp.MustCompile(`^.+$`), "value cannot be empty"), - }, - } -} - -func weightedPodAffinityTermFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "weight": { - Type: schema.TypeInt, - Description: "weight associated with matching the corresponding podAffinityTerm, in the range 1-100", - Required: true, - }, - "pod_affinity_term": { - Type: schema.TypeList, - Description: "A pod affinity term, associated with the corresponding weight", - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: podAffinityTermFields(), - }, - }, - } -} - -// Flatteners - -func FlattenAffinity(in *v1.Affinity) []interface{} { - att := make(map[string]interface{}) - if in.NodeAffinity != nil { - att["node_affinity"] = flattenNodeAffinity(in.NodeAffinity) - } - if in.PodAffinity != nil { - att["pod_affinity"] = flattenPodAffinity(in.PodAffinity) - } - if in.PodAntiAffinity != nil { - att["pod_anti_affinity"] = flattenPodAntiAffinity(in.PodAntiAffinity) - } - if len(att) > 0 { - return []interface{}{att} - } - return []interface{}{} -} - -func flattenNodeAffinity(in *v1.NodeAffinity) []interface{} { - att := make(map[string]interface{}) - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - att["required_during_scheduling_ignored_during_execution"] = flattenNodeSelector(in.RequiredDuringSchedulingIgnoredDuringExecution) - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - att["preferred_during_scheduling_ignored_during_execution"] = flattenPreferredSchedulingTerm(in.PreferredDuringSchedulingIgnoredDuringExecution) - } - if len(att) > 0 { - return []interface{}{att} - } - return []interface{}{} -} - -func flattenPodAffinity(in *v1.PodAffinity) []interface{} { - att := make(map[string]interface{}) - if len(in.RequiredDuringSchedulingIgnoredDuringExecution) > 0 { - att["required_during_scheduling_ignored_during_execution"] = flattenPodAffinityTerms(in.RequiredDuringSchedulingIgnoredDuringExecution) - } - if len(in.PreferredDuringSchedulingIgnoredDuringExecution) > 0 { - att["preferred_during_scheduling_ignored_during_execution"] = flattenWeightedPodAffinityTerms(in.PreferredDuringSchedulingIgnoredDuringExecution) - } - if len(att) > 0 { - return []interface{}{att} - } - return []interface{}{} -} - -func flattenPodAntiAffinity(in *v1.PodAntiAffinity) []interface{} { - att := make(map[string]interface{}) - if len(in.RequiredDuringSchedulingIgnoredDuringExecution) > 0 { - att["required_during_scheduling_ignored_during_execution"] = flattenPodAffinityTerms(in.RequiredDuringSchedulingIgnoredDuringExecution) - } - if len(in.PreferredDuringSchedulingIgnoredDuringExecution) > 0 { - att["preferred_during_scheduling_ignored_during_execution"] = flattenWeightedPodAffinityTerms(in.PreferredDuringSchedulingIgnoredDuringExecution) - } - if len(att) > 0 { - return []interface{}{att} - } - return []interface{}{} -} - -func flattenNodeSelector(in *v1.NodeSelector) []interface{} { - att := make(map[string]interface{}) - if len(in.NodeSelectorTerms) > 0 { - att["node_selector_term"] = flattenNodeSelectorTerms(in.NodeSelectorTerms) - } - if len(att) > 0 { - return []interface{}{att} - } - return []interface{}{} -} - -func flattenPreferredSchedulingTerm(in []v1.PreferredSchedulingTerm) []interface{} { - att := make([]interface{}, len(in), len(in)) - for i, n := range in { - m := make(map[string]interface{}) - m["weight"] = int(n.Weight) - m["preference"] = flattenNodeSelectorTerm(n.Preference) - att[i] = m - } - return att -} - -func flattenPodAffinityTerms(in []v1.PodAffinityTerm) []interface{} { - att := make([]interface{}, len(in), len(in)) - for i, n := range in { - m := make(map[string]interface{}) - m["namespaces"] = utils.NewStringSet(schema.HashString, n.Namespaces) - m["topology_key"] = n.TopologyKey - if n.LabelSelector != nil { - m["label_selector"] = flattenLabelSelector(n.LabelSelector) - } - att[i] = m - } - return att -} - -func flattenWeightedPodAffinityTerms(in []v1.WeightedPodAffinityTerm) []interface{} { - att := make([]interface{}, len(in), len(in)) - for i, n := range in { - m := make(map[string]interface{}) - m["weight"] = int(n.Weight) - m["pod_affinity_term"] = flattenPodAffinityTerms([]v1.PodAffinityTerm{n.PodAffinityTerm}) - att[i] = m - } - return att -} - -func flattenNodeSelectorTerms(in []api.NodeSelectorTerm) []interface{} { - att := make([]interface{}, len(in), len(in)) - for i, n := range in { - att[i] = flattenNodeSelectorTerm(n)[0] - } - return att -} - -func flattenNodeSelectorTerm(in api.NodeSelectorTerm) []interface{} { - att := make(map[string]interface{}) - if len(in.MatchExpressions) > 0 { - att["match_expressions"] = flattenNodeSelectorRequirementList(in.MatchExpressions) - } - if len(in.MatchFields) > 0 { - att["match_fields"] = flattenNodeSelectorRequirementList(in.MatchFields) - } - return []interface{}{att} -} - -func flattenNodeSelectorRequirementList(in []api.NodeSelectorRequirement) []map[string]interface{} { - att := make([]map[string]interface{}, len(in)) - for i, v := range in { - m := map[string]interface{}{} - m["key"] = v.Key - m["values"] = utils.NewStringSet(schema.HashString, v.Values) - m["operator"] = string(v.Operator) - att[i] = m - } - return att -} - -// Expanders - -func ExpandAffinity(a []interface{}) *v1.Affinity { - if len(a) == 0 || a[0] == nil { - return &v1.Affinity{} - } - in := a[0].(map[string]interface{}) - obj := v1.Affinity{} - if v, ok := in["node_affinity"].([]interface{}); ok && len(v) > 0 { - obj.NodeAffinity = expandNodeAffinity(v) - } - if v, ok := in["pod_affinity"].([]interface{}); ok && len(v) > 0 { - obj.PodAffinity = expandPodAffinity(v) - } - if v, ok := in["pod_anti_affinity"].([]interface{}); ok && len(v) > 0 { - obj.PodAntiAffinity = expandPodAntiAffinity(v) - } - return &obj -} - -func expandNodeAffinity(a []interface{}) *v1.NodeAffinity { - if len(a) == 0 || a[0] == nil { - return &v1.NodeAffinity{} - } - in := a[0].(map[string]interface{}) - obj := v1.NodeAffinity{} - if v, ok := in["required_during_scheduling_ignored_during_execution"].([]interface{}); ok && len(v) > 0 { - obj.RequiredDuringSchedulingIgnoredDuringExecution = expandNodeSelector(v) - } - if v, ok := in["preferred_during_scheduling_ignored_during_execution"].([]interface{}); ok && len(v) > 0 { - obj.PreferredDuringSchedulingIgnoredDuringExecution = expandPreferredSchedulingTerms(v) - } - return &obj -} - -func expandPodAffinity(a []interface{}) *v1.PodAffinity { - if len(a) == 0 || a[0] == nil { - return &v1.PodAffinity{} - } - in := a[0].(map[string]interface{}) - obj := v1.PodAffinity{} - if v, ok := in["required_during_scheduling_ignored_during_execution"].([]interface{}); ok && len(v) > 0 { - obj.RequiredDuringSchedulingIgnoredDuringExecution = expandPodAffinityTerms(v) - } - if v, ok := in["preferred_during_scheduling_ignored_during_execution"].([]interface{}); ok && len(v) > 0 { - obj.PreferredDuringSchedulingIgnoredDuringExecution = expandWeightedPodAffinityTerms(v) - } - return &obj -} - -func expandPodAntiAffinity(a []interface{}) *v1.PodAntiAffinity { - if len(a) == 0 || a[0] == nil { - return &v1.PodAntiAffinity{} - } - in := a[0].(map[string]interface{}) - obj := v1.PodAntiAffinity{} - if v, ok := in["required_during_scheduling_ignored_during_execution"].([]interface{}); ok && len(v) > 0 { - obj.RequiredDuringSchedulingIgnoredDuringExecution = expandPodAffinityTerms(v) - } - if v, ok := in["preferred_during_scheduling_ignored_during_execution"].([]interface{}); ok && len(v) > 0 { - obj.PreferredDuringSchedulingIgnoredDuringExecution = expandWeightedPodAffinityTerms(v) - } - return &obj -} - -func expandNodeSelector(s []interface{}) *v1.NodeSelector { - if len(s) == 0 || s[0] == nil { - return &v1.NodeSelector{} - } - in := s[0].(map[string]interface{}) - obj := v1.NodeSelector{} - if v, ok := in["node_selector_term"].([]interface{}); ok && len(v) > 0 { - obj.NodeSelectorTerms = expandNodeSelectorTerms(v) - } - return &obj -} - -func expandPreferredSchedulingTerms(t []interface{}) []v1.PreferredSchedulingTerm { - if len(t) == 0 || t[0] == nil { - return []v1.PreferredSchedulingTerm{} - } - obj := make([]v1.PreferredSchedulingTerm, len(t), len(t)) - for i, n := range t { - in := n.(map[string]interface{}) - if v, ok := in["weight"].(int); ok { - obj[i].Weight = int32(v) - } - if v, ok := in["preference"].([]interface{}); ok && len(v) > 0 { - obj[i].Preference = *expandNodeSelectorTerm(v) - } - } - return obj -} - -func expandPodAffinityTerms(t []interface{}) []v1.PodAffinityTerm { - if len(t) == 0 || t[0] == nil { - return []v1.PodAffinityTerm{} - } - obj := make([]v1.PodAffinityTerm, len(t), len(t)) - for i, n := range t { - in := n.(map[string]interface{}) - if v, ok := in["label_selector"].([]interface{}); ok && len(v) > 0 { - obj[i].LabelSelector = expandLabelSelector(v) - } - if v, ok := in["namespaces"].(*schema.Set); ok { - obj[i].Namespaces = utils.SliceOfString(v.List()) - } - if v, ok := in["topology_key"].(string); ok { - obj[i].TopologyKey = v - } - } - return obj -} - -func expandWeightedPodAffinityTerms(t []interface{}) []v1.WeightedPodAffinityTerm { - if len(t) == 0 || t[0] == nil { - return []v1.WeightedPodAffinityTerm{} - } - obj := make([]v1.WeightedPodAffinityTerm, len(t), len(t)) - for i, n := range t { - in := n.(map[string]interface{}) - if v, ok := in["weight"].(int); ok { - obj[i].Weight = int32(v) - } - if v, ok := in["pod_affinity_term"].([]interface{}); ok && len(v) > 0 { - obj[i].PodAffinityTerm = expandPodAffinityTerms(v)[0] - } - } - return obj -} - -func expandNodeSelectorTerms(l []interface{}) []api.NodeSelectorTerm { - if len(l) == 0 || l[0] == nil { - return []api.NodeSelectorTerm{} - } - obj := make([]api.NodeSelectorTerm, len(l), len(l)) - for i, n := range l { - obj[i] = *expandNodeSelectorTerm([]interface{}{n}) - } - return obj -} - -func expandNodeSelectorTerm(l []interface{}) *api.NodeSelectorTerm { - if len(l) == 0 || l[0] == nil { - return &api.NodeSelectorTerm{} - } - in := l[0].(map[string]interface{}) - obj := api.NodeSelectorTerm{} - if v, ok := in["match_expressions"].([]interface{}); ok && len(v) > 0 { - obj.MatchExpressions = expandNodeSelectorRequirementList(v) - } - if v, ok := in["match_fields"].([]interface{}); ok && len(v) > 0 { - obj.MatchFields = expandNodeSelectorRequirementList(v) - } - return &obj -} - -func expandNodeSelectorRequirementList(in []interface{}) []api.NodeSelectorRequirement { - att := []api.NodeSelectorRequirement{} - if len(in) < 1 { - return att - } - att = make([]api.NodeSelectorRequirement, len(in)) - for i, c := range in { - p := c.(map[string]interface{}) - att[i].Key = p["key"].(string) - att[i].Operator = api.NodeSelectorOperator(p["operator"].(string)) - att[i].Values = utils.ExpandStringSlice(p["values"].(*schema.Set).List()) - } - return att -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/label_selector.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/label_selector.go deleted file mode 100644 index a1b2edebffe..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/label_selector.go +++ /dev/null @@ -1,106 +0,0 @@ -package k8s - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func labelSelectorFields(updatable bool) map[string]*schema.Schema { - return map[string]*schema.Schema{ - "match_expressions": { - Type: schema.TypeList, - Description: "A list of label selector requirements. The requirements are ANDed.", - Optional: true, - ForceNew: !updatable, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": { - Type: schema.TypeString, - Description: "The label key that the selector applies to.", - Optional: true, - ForceNew: !updatable, - }, - "operator": { - Type: schema.TypeString, - Description: "A key's relationship to a set of values. Valid operators ard `In`, `NotIn`, `Exists` and `DoesNotExist`.", - Optional: true, - ForceNew: !updatable, - }, - "values": { - Type: schema.TypeSet, - Description: "An array of string values. If the operator is `In` or `NotIn`, the values array must be non-empty. If the operator is `Exists` or `DoesNotExist`, the values array must be empty. This array is replaced during a strategic merge patch.", - Optional: true, - ForceNew: !updatable, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - }, - }, - }, - }, - "match_labels": { - Type: schema.TypeMap, - Description: "A map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of `match_expressions`, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", - Optional: true, - ForceNew: !updatable, - }, - } -} - -// Flatteners - -func flattenLabelSelector(in *metav1.LabelSelector) []interface{} { - att := make(map[string]interface{}) - if len(in.MatchLabels) > 0 { - att["match_labels"] = in.MatchLabels - } - if len(in.MatchExpressions) > 0 { - att["match_expressions"] = flattenLabelSelectorRequirement(in.MatchExpressions) - } - return []interface{}{att} -} - -func flattenLabelSelectorRequirement(in []metav1.LabelSelectorRequirement) []interface{} { - att := make([]interface{}, len(in), len(in)) - for i, n := range in { - m := make(map[string]interface{}) - m["key"] = n.Key - m["operator"] = n.Operator - m["values"] = utils.NewStringSet(schema.HashString, n.Values) - att[i] = m - } - return att -} - -// Expanders - -func expandLabelSelector(l []interface{}) *metav1.LabelSelector { - if len(l) == 0 || l[0] == nil { - return &metav1.LabelSelector{} - } - in := l[0].(map[string]interface{}) - obj := &metav1.LabelSelector{} - if v, ok := in["match_labels"].(map[string]interface{}); ok && len(v) > 0 { - obj.MatchLabels = utils.ExpandStringMap(v) - } - if v, ok := in["match_expressions"].([]interface{}); ok && len(v) > 0 { - obj.MatchExpressions = expandLabelSelectorRequirement(v) - } - return obj -} - -func expandLabelSelectorRequirement(l []interface{}) []metav1.LabelSelectorRequirement { - if len(l) == 0 || l[0] == nil { - return []metav1.LabelSelectorRequirement{} - } - obj := make([]metav1.LabelSelectorRequirement, len(l), len(l)) - for i, n := range l { - in := n.(map[string]interface{}) - obj[i] = metav1.LabelSelectorRequirement{ - Key: in["key"].(string), - Operator: metav1.LabelSelectorOperator(in["operator"].(string)), - Values: utils.SliceOfString(in["values"].(*schema.Set).List()), - } - } - return obj -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/local_object_reference.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/local_object_reference.go deleted file mode 100644 index b6daaadf508..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/local_object_reference.go +++ /dev/null @@ -1,54 +0,0 @@ -package k8s - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - v1 "k8s.io/api/core/v1" -) - -func localObjectReferenceFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Description: "Name of the referent.", - Required: true, - }, - } -} - -func LocalObjectReferenceSchema(description string) *schema.Schema { - fields := localObjectReferenceFields() - - return &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Description: description, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func ExpandLocalObjectReferences(localObjectReference []interface{}) *v1.LocalObjectReference { - if len(localObjectReference) == 0 { - return nil - } - result := &v1.LocalObjectReference{} - - in := localObjectReference[0].(map[string]interface{}) - - if v, ok := in["name"].(string); ok { - result.Name = v - } - - return result -} - -func FlattenLocalObjectReferences(localObjectReference v1.LocalObjectReference) []interface{} { - att := make(map[string]interface{}) - - att["name"] = localObjectReference.Name - - return []interface{}{att} -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/metadata.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/metadata.go deleted file mode 100644 index 561e3e3fbe6..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/metadata.go +++ /dev/null @@ -1,224 +0,0 @@ -package k8s - -import ( - "fmt" - "net/url" - "strings" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/patch" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func metadataFields(objectName string) map[string]*schema.Schema { - return map[string]*schema.Schema{ - "annotations": { - Type: schema.TypeMap, - Description: fmt.Sprintf("An unstructured key value map stored with the %s that may be used to store arbitrary metadata. More info: http://kubernetes.io/docs/user-guide/annotations", objectName), - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - ValidateFunc: utils.ValidateAnnotations, - Computed: true, - }, - "generation": { - Type: schema.TypeInt, - Description: "A sequence number representing a specific generation of the desired state.", - Computed: true, - }, - "labels": { - Type: schema.TypeMap, - Description: fmt.Sprintf("Map of string keys and values that can be used to organize and categorize (scope and select) the %s. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels", objectName), - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - ValidateFunc: utils.ValidateLabels, - }, - "name": { - Type: schema.TypeString, - Description: fmt.Sprintf("Name of the %s, must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names", objectName), - Optional: true, - ForceNew: true, - Computed: true, - ValidateFunc: utils.ValidateName, - }, - "resource_version": { - Type: schema.TypeString, - Description: fmt.Sprintf("An opaque value that represents the internal version of this %s that can be used by clients to determine when %s has changed. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", objectName, objectName), - Computed: true, - }, - "self_link": { - Type: schema.TypeString, - Description: fmt.Sprintf("A URL representing this %s.", objectName), - Computed: true, - }, - "uid": { - Type: schema.TypeString, - Description: fmt.Sprintf("The unique in time and space value for this %s. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", objectName), - Computed: true, - }, - } -} - -func metadataSchema(objectName string, generatableName bool) *schema.Schema { - fields := metadataFields(objectName) - - if generatableName { - fields["generate_name"] = &schema.Schema{ - Type: schema.TypeString, - Description: "Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency", - Optional: true, - ForceNew: true, - ValidateFunc: utils.ValidateGenerateName, - ConflictsWith: []string{"metadata.0.name"}, - } - fields["name"].ConflictsWith = []string{"metadata.0.generate_name"} - } - - return &schema.Schema{ - Type: schema.TypeList, - Description: fmt.Sprintf("Standard %s's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata", objectName), - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func NamespacedMetadataSchema(objectName string, generatableName bool) *schema.Schema { - return namespacedMetadataSchemaIsTemplate(objectName, generatableName, false) -} - -func namespacedMetadataSchemaIsTemplate(objectName string, generatableName, isTemplate bool) *schema.Schema { - fields := metadataFields(objectName) - fields["namespace"] = &schema.Schema{ - Type: schema.TypeString, - Description: fmt.Sprintf("Namespace defines the space within which name of the %s must be unique.", objectName), - Optional: true, - ForceNew: true, - Default: utils.ConditionalDefault(!isTemplate, "default"), - } - if generatableName { - fields["generate_name"] = &schema.Schema{ - Type: schema.TypeString, - Description: "Prefix, used by the server, to generate a unique name ONLY IF the `name` field has not been provided. This value will also be combined with a unique suffix. Read more: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency", - Optional: true, - ForceNew: true, - ValidateFunc: utils.ValidateGenerateName, - ConflictsWith: []string{"metadata.name"}, - } - fields["name"].ConflictsWith = []string{"metadata.generate_name"} - } - - return &schema.Schema{ - Type: schema.TypeList, - Description: fmt.Sprintf("Standard %s's metadata. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata", objectName), - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } -} - -func BuildId(meta metav1.ObjectMeta) string { - return meta.Namespace + "/" + meta.Name -} - -func ExpandMetadata(in []interface{}) metav1.ObjectMeta { - meta := metav1.ObjectMeta{} - if len(in) < 1 { - return meta - } - m := in[0].(map[string]interface{}) - - if v, ok := m["annotations"].(map[string]interface{}); ok && len(v) > 0 { - meta.Annotations = utils.ExpandStringMap(m["annotations"].(map[string]interface{})) - } - - if v, ok := m["labels"].(map[string]interface{}); ok && len(v) > 0 { - meta.Labels = utils.ExpandStringMap(m["labels"].(map[string]interface{})) - } - - if v, ok := m["generate_name"]; ok { - meta.GenerateName = v.(string) - } - if v, ok := m["name"]; ok { - meta.Name = v.(string) - } - if v, ok := m["namespace"]; ok { - meta.Namespace = v.(string) - } - - return meta -} - -func FlattenMetadata(meta metav1.ObjectMeta) []interface{} { - m := make(map[string]interface{}) - m["annotations"] = meta.Annotations - if meta.GenerateName != "" { - m["generate_name"] = meta.GenerateName - } - m["labels"] = meta.Labels - m["name"] = meta.Name - m["resource_version"] = meta.ResourceVersion - m["self_link"] = meta.SelfLink - m["uid"] = fmt.Sprintf("%v", meta.UID) - m["generation"] = meta.Generation - - if meta.Namespace != "" { - m["namespace"] = meta.Namespace - } - - return []interface{}{m} -} - -func AppendPatchOps(keyPrefix, pathPrefix string, resourceData *schema.ResourceData, ops []patch.PatchOperation) patch.PatchOperations { - if resourceData.HasChange(keyPrefix + "annotations") { - oldV, newV := resourceData.GetChange(keyPrefix + "annotations") - diffOps := patch.DiffStringMap(pathPrefix+"annotations", oldV.(map[string]interface{}), newV.(map[string]interface{})) - ops = append(ops, diffOps...) - } - if resourceData.HasChange(keyPrefix + "labels") { - oldV, newV := resourceData.GetChange(keyPrefix + "labels") - diffOps := patch.DiffStringMap(pathPrefix+"labels", oldV.(map[string]interface{}), newV.(map[string]interface{})) - ops = append(ops, diffOps...) - } - return ops -} - -func removeInternalKeys(m map[string]string, d map[string]interface{}) map[string]string { - for k := range m { - if isInternalKey(k) && !isKeyInMap(k, d) { - delete(m, k) - } - } - return m -} - -func isKeyInMap(key string, d map[string]interface{}) bool { - if d == nil { - return false - } - for k := range d { - if k == key { - return true - } - } - return false -} - -func isInternalKey(annotationKey string) bool { - u, err := url.Parse("//" + annotationKey) - if err == nil && strings.HasSuffix(u.Hostname(), "kubernetes.io") { - return true - } - - // Specific to DaemonSet annotations, generated & controlled by the server. - if strings.Contains(annotationKey, "deprecated.daemonset.template.generation") { - return true - } - - return false -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/persistent_volume_claim.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/persistent_volume_claim.go deleted file mode 100644 index d4f9dc0bdc9..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/persistent_volume_claim.go +++ /dev/null @@ -1,184 +0,0 @@ -package k8s - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils" - api "k8s.io/api/core/v1" - v1 "k8s.io/api/core/v1" -) - -func persistentVolumeClaimSpecFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "access_modes": { - Type: schema.TypeSet, - Description: "A set of the desired access modes the volume should have. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#access-modes-1", - Required: true, - ForceNew: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - ValidateFunc: validation.StringInSlice([]string{ - "ReadWriteOnce", - "ReadOnlyMany", - "ReadWriteMany", - }, false), - }, - Set: schema.HashString, - }, - "resources": { - Type: schema.TypeList, - Description: "A list of the minimum resources the volume should have. More info: http://kubernetes.io/docs/user-guide/persistent-volumes#resources", - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "limits": { - Type: schema.TypeMap, - Description: "Map describing the maximum amount of compute resources allowed. More info: http://kubernetes.io/docs/user-guide/compute-resources/", - Optional: true, - ForceNew: true, - }, - // This is the only field the API will allow modifying in-place, so ForceNew is not used. - "requests": { - Type: schema.TypeMap, - Description: "Map describing the minimum amount of compute resources required. If this is omitted for a container, it defaults to `limits` if that is explicitly specified, otherwise to an implementation-defined value. More info: http://kubernetes.io/docs/user-guide/compute-resources/", - Optional: true, - }, - }, - }, - }, - "selector": { - Type: schema.TypeList, - Description: "A label query over volumes to consider for binding.", - Optional: true, - ForceNew: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: labelSelectorFields(false), - }, - }, - "volume_name": { - Type: schema.TypeString, - Description: "The binding reference to the PersistentVolume backing this claim.", - Optional: true, - ForceNew: true, - Computed: true, - }, - "storage_class_name": { - Type: schema.TypeString, - Description: "Name of the storage class requested by the claim", - Optional: true, - Computed: true, - ForceNew: true, - }, - } -} - -func PersistentVolumeClaimSpecSchema() *schema.Schema { - fields := persistentVolumeClaimSpecFields() - - return &schema.Schema{ - Type: schema.TypeList, - Description: "PVC is a pointer to the PVC Spec we want to use.", - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -// Flatteners - -func FlattenPersistentVolumeClaimSpec(in v1.PersistentVolumeClaimSpec) []interface{} { - att := make(map[string]interface{}) - att["access_modes"] = flattenPersistentVolumeAccessModes(in.AccessModes) - att["resources"] = flattenResourceRequirements(in.Resources) - if in.Selector != nil { - att["selector"] = flattenLabelSelector(in.Selector) - } - if in.VolumeName != "" { - att["volume_name"] = in.VolumeName - } - if in.StorageClassName != nil { - att["storage_class_name"] = *in.StorageClassName - } - return []interface{}{att} -} - -func flattenResourceRequirements(in v1.ResourceRequirements) []interface{} { - att := make(map[string]interface{}) - if len(in.Limits) > 0 { - att["limits"] = utils.FlattenResourceList(in.Limits) - } - if len(in.Requests) > 0 { - att["requests"] = utils.FlattenResourceList(in.Requests) - } - return []interface{}{att} -} - -// Expanders - -func ExpandPersistentVolumeClaimSpec(l []interface{}) (*v1.PersistentVolumeClaimSpec, error) { - obj := &v1.PersistentVolumeClaimSpec{} - if len(l) == 0 || l[0] == nil { - return obj, nil - } - in := l[0].(map[string]interface{}) - resourceRequirements, err := expandResourceRequirements(in["resources"].([]interface{})) - if err != nil { - return nil, err - } - obj.AccessModes = expandPersistentVolumeAccessModes(in["access_modes"].(*schema.Set).List()) - obj.Resources = *resourceRequirements - if v, ok := in["selector"].([]interface{}); ok && len(v) > 0 { - obj.Selector = expandLabelSelector(v) - } - if v, ok := in["volume_name"].(string); ok { - obj.VolumeName = v - } - if v, ok := in["storage_class_name"].(string); ok && v != "" { - obj.StorageClassName = utils.PtrToString(v) - } - return obj, nil -} - -func expandResourceRequirements(l []interface{}) (*v1.ResourceRequirements, error) { - obj := &v1.ResourceRequirements{} - if len(l) == 0 || l[0] == nil { - return obj, nil - } - in := l[0].(map[string]interface{}) - if v, ok := in["limits"].(map[string]interface{}); ok && len(v) > 0 { - rl, err := utils.ExpandMapToResourceList(v) - if err != nil { - return obj, err - } - obj.Limits = *rl - } - if v, ok := in["requests"].(map[string]interface{}); ok && len(v) > 0 { - rq, err := utils.ExpandMapToResourceList(v) - if err != nil { - return obj, err - } - obj.Requests = *rq - } - return obj, nil -} - -func expandPersistentVolumeAccessModes(s []interface{}) []api.PersistentVolumeAccessMode { - out := make([]api.PersistentVolumeAccessMode, len(s), len(s)) - for i, v := range s { - out[i] = api.PersistentVolumeAccessMode(v.(string)) - } - return out -} - -func flattenPersistentVolumeAccessModes(in []api.PersistentVolumeAccessMode) *schema.Set { - var out = make([]interface{}, len(in), len(in)) - for i, v := range in { - out[i] = string(v) - } - return schema.NewSet(schema.HashString, out) -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/pod_dns_config.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/pod_dns_config.go deleted file mode 100644 index ae88bfc8875..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/pod_dns_config.go +++ /dev/null @@ -1,142 +0,0 @@ -package k8s - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils" - v1 "k8s.io/api/core/v1" -) - -func podDnsConfigFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "nameservers": { - Type: schema.TypeList, - Description: "A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.", - Optional: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - ValidateFunc: validation.IsIPAddress, - }, - }, - "option": { - Type: schema.TypeList, - Description: "A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.", - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Description: "Name of the option.", - Required: true, - }, - "value": { - Type: schema.TypeString, - Description: "Value of the option. Optional: Defaults to empty.", - Optional: true, - }, - }, - }, - }, - "searches": { - Type: schema.TypeList, - Description: "A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.", - Optional: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - ValidateFunc: utils.ValidateName, - }, - }, - } -} - -func PodDnsConfigSchema() *schema.Schema { - fields := podDnsConfigFields() - - return &schema.Schema{ - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - Description: "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Optional: Defaults to empty", - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func ExpandPodDNSConfig(l []interface{}) (*v1.PodDNSConfig, error) { - if len(l) == 0 || l[0] == nil { - return &v1.PodDNSConfig{}, nil - } - in := l[0].(map[string]interface{}) - obj := &v1.PodDNSConfig{} - if v, ok := in["nameservers"].([]interface{}); ok { - obj.Nameservers = utils.ExpandStringSlice(v) - } - if v, ok := in["searches"].([]interface{}); ok { - obj.Searches = utils.ExpandStringSlice(v) - } - if v, ok := in["option"].([]interface{}); ok { - opts, err := expandDNSConfigOptions(v) - if err != nil { - return obj, err - } - obj.Options = opts - } - return obj, nil -} - -func expandDNSConfigOptions(options []interface{}) ([]v1.PodDNSConfigOption, error) { - if len(options) == 0 { - return []v1.PodDNSConfigOption{}, nil - } - opts := make([]v1.PodDNSConfigOption, len(options)) - for i, c := range options { - in := c.(map[string]interface{}) - opt := v1.PodDNSConfigOption{} - if v, ok := in["name"].(string); ok { - opt.Name = v - } - if v, ok := in["value"].(string); ok { - opt.Value = utils.PtrToString(v) - } - opts[i] = opt - } - - return opts, nil -} - -func FlattenPodDNSConfig(in *v1.PodDNSConfig) []interface{} { - att := make(map[string]interface{}) - - if len(in.Nameservers) > 0 { - att["nameservers"] = in.Nameservers - } - if len(in.Searches) > 0 { - att["searches"] = in.Searches - } - if len(in.Options) > 0 { - att["option"] = flattenPodDNSConfigOptions(in.Options) - } - - if len(att) > 0 { - return []interface{}{att} - } - return []interface{}{} -} - -func flattenPodDNSConfigOptions(options []v1.PodDNSConfigOption) []interface{} { - att := make([]interface{}, len(options)) - for i, v := range options { - obj := map[string]interface{}{} - - if v.Name != "" { - obj["name"] = v.Name - } - if v.Value != nil { - obj["value"] = *v.Value - } - att[i] = obj - } - return att -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/toleration.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/toleration.go deleted file mode 100644 index 4c3c03f056c..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s/toleration.go +++ /dev/null @@ -1,124 +0,0 @@ -package k8s - -import ( - "fmt" - "log" - "strconv" - "strings" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils" - v1 "k8s.io/api/core/v1" -) - -func tolerationFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "effect": { - Type: schema.TypeString, - Description: "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.", - Optional: true, - ValidateFunc: validation.StringInSlice([]string{"NoSchedule", "PreferNoSchedule", "NoExecute"}, false), - }, - "key": { - Type: schema.TypeString, - Description: "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.", - Optional: true, - }, - "operator": { - Type: schema.TypeString, - Description: "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.", - Default: "Equal", - Optional: true, - ValidateFunc: validation.StringInSlice([]string{"Exists", "Equal"}, false), - }, - "toleration_seconds": { - // Use TypeString to allow an "unspecified" value, - Type: schema.TypeString, - Description: "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.", - Optional: true, - ValidateFunc: utils.ValidateTypeStringNullableInt, - }, - "value": { - Type: schema.TypeString, - Description: "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.", - Optional: true, - }, - } -} - -func TolerationSchema() *schema.Schema { - fields := tolerationFields() - - return &schema.Schema{ - Type: schema.TypeList, - Optional: true, - Description: "If specified, the pod's toleration. Optional: Defaults to empty", - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func ExpandTolerations(tolerations []interface{}) ([]v1.Toleration, error) { - if len(tolerations) == 0 { - return []v1.Toleration{}, nil - } - ts := make([]v1.Toleration, len(tolerations)) - for i, t := range tolerations { - m := t.(map[string]interface{}) - ts[i] = v1.Toleration{} - - if value, ok := m["effect"].(string); ok { - ts[i].Effect = v1.TaintEffect(value) - } - if value, ok := m["key"].(string); ok { - ts[i].Key = value - } - if value, ok := m["operator"].(string); ok { - ts[i].Operator = v1.TolerationOperator(value) - } - if value, ok := m["toleration_seconds"].(string); ok && value != "" { - seconds, err := strconv.ParseInt(value, 10, 64) - if err != nil { - return nil, fmt.Errorf("invalid toleration_seconds must be int or \"\", got \"%s\"", value) - } - ts[i].TolerationSeconds = utils.PtrToInt64(seconds) - } - if value, ok := m["value"]; ok { - ts[i].Value = value.(string) - } - } - return ts, nil -} - -func FlattenTolerations(tolerations []v1.Toleration) []interface{} { - att := []interface{}{} - for _, v := range tolerations { - // The API Server may automatically add several Tolerations to pods, strip these to avoid TF diff. - if strings.Contains(v.Key, "node.kubernetes.io/") { - log.Printf("[INFO] ignoring toleration with key: %s", v.Key) - continue - } - obj := map[string]interface{}{} - - if v.Effect != "" { - obj["effect"] = string(v.Effect) - } - if v.Key != "" { - obj["key"] = v.Key - } - if v.Operator != "" { - obj["operator"] = string(v.Operator) - } - if v.TolerationSeconds != nil { - obj["toleration_seconds"] = strconv.FormatInt(*v.TolerationSeconds, 10) - } - if v.Value != "" { - obj["value"] = v.Value - } - att = append(att, obj) - } - return att -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/conditions.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/conditions.go deleted file mode 100644 index d1028402161..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/conditions.go +++ /dev/null @@ -1,115 +0,0 @@ -package virtualmachine - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - k8sv1 "k8s.io/api/core/v1" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -func virtualMachineConditionsFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "type": { - Type: schema.TypeString, - Description: "VirtualMachineConditionType represent the type of the VM as concluded from its VMi status.", - Optional: true, - ValidateFunc: validation.StringInSlice([]string{ - "Failure", - "Ready", - "Paused", - "RenameOperation", - }, false), - }, - "status": { - Type: schema.TypeString, - Description: "ConditionStatus represents the status of this VM condition, if the VM currently in the condition.", - Optional: true, - ValidateFunc: validation.StringInSlice([]string{ - "True", - "False", - "Unknown", - }, false), - }, - // TODO nargaman - Add following values - // "last_probe_time": { - // Type: schema.TypeString, - // Description: "Last probe time.", - // Optional: true, - // }, - // "last_transition_time": { - // Type: schema.TypeString, - // Description: "Last transition time.", - // Optional: true, - // }, - "reason": { - Type: schema.TypeString, - Description: "Condition reason.", - Optional: true, - }, - "message": { - Type: schema.TypeString, - Description: "Condition message.", - Optional: true, - }, - } -} - -func virtualMachineConditionsSchema() *schema.Schema { - fields := virtualMachineConditionsFields() - - return &schema.Schema{ - Type: schema.TypeList, - - Description: fmt.Sprintf("Hold the state information of the VirtualMachine and its VirtualMachineInstance."), - Required: true, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func expandVirtualMachineConditions(conditions []interface{}) ([]kubevirtapiv1.VirtualMachineCondition, error) { - result := make([]kubevirtapiv1.VirtualMachineCondition, len(conditions)) - - if len(conditions) == 0 || conditions[0] == nil { - return result, nil - } - - for i, condition := range conditions { - in := condition.(map[string]interface{}) - - if v, ok := in["type"].(string); ok { - result[i].Type = kubevirtapiv1.VirtualMachineConditionType(v) - } - if v, ok := in["status"].(string); ok { - result[i].Status = k8sv1.ConditionStatus(v) - } - if v, ok := in["reason"].(string); ok { - result[i].Reason = v - } - if v, ok := in["message"].(string); ok { - result[i].Message = v - } - } - - return result, nil -} - -func flattenVirtualMachineConditions(in []kubevirtapiv1.VirtualMachineCondition) []interface{} { - att := make([]interface{}, len(in)) - - for i, v := range in { - c := make(map[string]interface{}) - c["type"] = string(v.Type) - c["status"] = string(v.Status) - c["reason"] = v.Reason - c["message"] = v.Message - - att[i] = c - } - - return att -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/spec.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/spec.go deleted file mode 100644 index e69519726b5..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/spec.go +++ /dev/null @@ -1,104 +0,0 @@ -package virtualmachine - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -func virtualMachineSpecFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - // "running": &schema.Schema{ - // Type: schema.TypeBool, - // Description: "Running controls whether the associatied VirtualMachineInstance is created or not, Mutually exclusive with RunStrategy", - // Optional: true, - // }, - "run_strategy": { - Type: schema.TypeString, - Description: "Running state indicates the requested running state of the VirtualMachineInstance, mutually exclusive with Running.", - Optional: true, - ValidateFunc: validation.StringInSlice([]string{ - "", - "Always", - "Halted", - "Manual", - "RerunOnFailure", - }, false), - }, - "template": virtualmachineinstance.VirtualMachineInstanceTemplateSpecSchema(), - "data_volume_templates": datavolume.DataVolumeTemplatesSchema(), - } -} - -func virtualMachineSpecSchema() *schema.Schema { - fields := virtualMachineSpecFields() - - return &schema.Schema{ - Type: schema.TypeList, - - Description: fmt.Sprintf("VirtualMachineSpec describes how the proper VirtualMachine should look like."), - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func expandVirtualMachineSpec(virtualMachine []interface{}) (kubevirtapiv1.VirtualMachineSpec, error) { - result := kubevirtapiv1.VirtualMachineSpec{} - - if len(virtualMachine) == 0 || virtualMachine[0] == nil { - return result, nil - } - - in := virtualMachine[0].(map[string]interface{}) - - // if v, ok := in["running"].(bool); ok { - // result.Running = &v - // } - if v, ok := in["run_strategy"].(string); ok { - if v != "" { - runStrategy := kubevirtapiv1.VirtualMachineRunStrategy(v) - result.RunStrategy = &runStrategy - } - } - if v, ok := in["template"].([]interface{}); ok { - template, err := virtualmachineinstance.ExpandVirtualMachineInstanceTemplateSpec(v) - if err != nil { - return result, err - } - result.Template = template - } - if v, ok := in["data_volume_templates"].([]interface{}); ok { - dataVolumeTemplates, err := datavolume.ExpandDataVolumeTemplates(v) - if err != nil { - return result, err - } - result.DataVolumeTemplates = dataVolumeTemplates - } - - return result, nil -} - -func flattenVirtualMachineSpec(in kubevirtapiv1.VirtualMachineSpec) []interface{} { - att := make(map[string]interface{}) - - // if in.Running != nil { - // att["running"] = strconv.FormatBool(*in.Running) - // } - if in.RunStrategy != nil { - att["run_strategy"] = string(*in.RunStrategy) - } - if in.Template != nil { - att["template"] = virtualmachineinstance.FlattenVirtualMachineInstanceTemplateSpec(*in.Template) - } - att["data_volume_templates"] = datavolume.FlattenDataVolumeTemplates(in.DataVolumeTemplates) - - return []interface{}{att} -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/state_change_requests.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/state_change_requests.go deleted file mode 100644 index 6fc8825e918..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/state_change_requests.go +++ /dev/null @@ -1,94 +0,0 @@ -package virtualmachine - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils" - k8stypes "k8s.io/apimachinery/pkg/types" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -func virtualMachineStateChangeRequestFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "action": { - Type: schema.TypeString, - Description: "Indicates the type of action that is requested. e.g. Start or Stop.", - Optional: true, - ValidateFunc: validation.StringInSlice([]string{ - "Start", - "Stop", - }, false), - }, - "data": { - Type: schema.TypeMap, - Description: "Provides additional data in order to perform the Action.", - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "uid": { - Type: schema.TypeString, - Description: "Indicates the UUID of an existing Virtual Machine Instance that this change request applies to -- if applicable.", - Optional: true, - }, - } -} - -func virtualMachineStateChangeRequestsSchema() *schema.Schema { - fields := virtualMachineStateChangeRequestFields() - - return &schema.Schema{ - Type: schema.TypeList, - - Description: fmt.Sprintf("StateChangeRequests indicates a list of actions that should be taken on a VMI."), - Required: true, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func expandVirtualMachineStateChangeRequests(virtualMachineStateChangeRequests []interface{}) []kubevirtapiv1.VirtualMachineStateChangeRequest { - result := make([]kubevirtapiv1.VirtualMachineStateChangeRequest, len(virtualMachineStateChangeRequests)) - - if len(virtualMachineStateChangeRequests) == 0 || virtualMachineStateChangeRequests[0] == nil { - return result - } - - for i, virtualMachineStateChangeRequest := range virtualMachineStateChangeRequests { - in := virtualMachineStateChangeRequest.(map[string]interface{}) - - if v, ok := in["action"].(string); ok { - result[i].Action = kubevirtapiv1.StateChangeRequestAction(v) - } - if v, ok := in["data"].(map[string]interface{}); ok && len(v) > 0 { - result[i].Data = utils.ExpandStringMap(v) - } - if v, ok := in["uid"].(string); ok { - uid := k8stypes.UID(v) - result[i].UID = &uid - } - } - - return result -} - -func flattenVirtualMachineStateChangeRequests(in []kubevirtapiv1.VirtualMachineStateChangeRequest) []interface{} { - att := make([]interface{}, len(in)) - - for i, v := range in { - c := make(map[string]interface{}) - - c["action"] = string(v.Action) - c["data"] = v.Data - if v.UID != nil { - c["uid"] = string(*v.UID) - } - - att[i] = c - } - - return att -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/status.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/status.go deleted file mode 100644 index 15a33bc5f85..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/status.go +++ /dev/null @@ -1,81 +0,0 @@ -package virtualmachine - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -func virtualMachineStatusFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "created": &schema.Schema{ - Type: schema.TypeBool, - Description: "Created indicates if the virtual machine is created in the cluster.", - Optional: true, - }, - "ready": &schema.Schema{ - Type: schema.TypeBool, - Description: "Ready indicates if the virtual machine is running and ready.", - Optional: true, - }, - "conditions": virtualMachineConditionsSchema(), - "state_change_requests": virtualMachineStateChangeRequestsSchema(), - } -} - -func virtualMachineStatusSchema() *schema.Schema { - fields := virtualMachineStatusFields() - - return &schema.Schema{ - Type: schema.TypeList, - - Description: fmt.Sprintf("VirtualMachineStatus represents the status returned by the controller to describe how the VirtualMachine is doing."), - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func expandVirtualMachineStatus(virtualMachineStatus []interface{}) (kubevirtapiv1.VirtualMachineStatus, error) { - result := kubevirtapiv1.VirtualMachineStatus{} - - if len(virtualMachineStatus) == 0 || virtualMachineStatus[0] == nil { - return result, nil - } - - in := virtualMachineStatus[0].(map[string]interface{}) - - if v, ok := in["created"].(bool); ok { - result.Created = v - } - if v, ok := in["ready"].(bool); ok { - result.Ready = v - } - if v, ok := in["conditions"].([]interface{}); ok { - conditions, err := expandVirtualMachineConditions(v) - if err != nil { - return result, err - } - result.Conditions = conditions - } - if v, ok := in["state_change_requests"].([]interface{}); ok { - result.StateChangeRequests = expandVirtualMachineStateChangeRequests(v) - } - - return result, nil -} - -func flattenVirtualMachineStatus(in kubevirtapiv1.VirtualMachineStatus) []interface{} { - att := make(map[string]interface{}) - - att["created"] = in.Created - att["ready"] = in.Ready - att["conditions"] = flattenVirtualMachineConditions(in.Conditions) - att["state_change_requests"] = flattenVirtualMachineStateChangeRequests(in.StateChangeRequests) - - return []interface{}{att} -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/virtual_machine.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/virtual_machine.go deleted file mode 100644 index 283158dcbf7..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine/virtual_machine.go +++ /dev/null @@ -1,109 +0,0 @@ -package virtualmachine - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/patch" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -func VirtualMachineFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "metadata": k8s.NamespacedMetadataSchema("VirtualMachine", false), - "spec": virtualMachineSpecSchema(), - "status": virtualMachineStatusSchema(), - } -} - -func VirtualMachineSchema() *schema.Schema { - fields := VirtualMachineFields() - - return &schema.Schema{ - Type: schema.TypeList, - Description: fmt.Sprintf("VirtualMachine provides a representation of our virtual machine."), - Required: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func ExpandVirtualMachine(virtualMachine []interface{}) (*kubevirtapiv1.VirtualMachine, error) { - result := &kubevirtapiv1.VirtualMachine{} - - if len(virtualMachine) == 0 || virtualMachine[0] == nil { - return result, nil - } - - in := virtualMachine[0].(map[string]interface{}) - - if v, ok := in["metadata"].([]interface{}); ok { - result.ObjectMeta = k8s.ExpandMetadata(v) - } - if v, ok := in["spec"].([]interface{}); ok { - spec, err := expandVirtualMachineSpec(v) - if err != nil { - return result, err - } - result.Spec = spec - } - if v, ok := in["status"].([]interface{}); ok { - status, err := expandVirtualMachineStatus(v) - if err != nil { - return result, err - } - result.Status = status - } - - return result, nil -} - -func FlattenVirtualMachine(in kubevirtapiv1.VirtualMachine) []interface{} { - att := make(map[string]interface{}) - - att["metadata"] = k8s.FlattenMetadata(in.ObjectMeta) - att["spec"] = flattenVirtualMachineSpec(in.Spec) - att["status"] = flattenVirtualMachineStatus(in.Status) - - return []interface{}{att} -} - -func FromResourceData(resourceData *schema.ResourceData) (*kubevirtapiv1.VirtualMachine, error) { - result := &kubevirtapiv1.VirtualMachine{} - - result.ObjectMeta = k8s.ExpandMetadata(resourceData.Get("metadata").([]interface{})) - spec, err := expandVirtualMachineSpec(resourceData.Get("spec").([]interface{})) - if err != nil { - return result, err - } - result.Spec = spec - status, err := expandVirtualMachineStatus(resourceData.Get("status").([]interface{})) - if err != nil { - return result, err - } - result.Status = status - - return result, nil -} - -func ToResourceData(vm kubevirtapiv1.VirtualMachine, resourceData *schema.ResourceData) error { - if err := resourceData.Set("metadata", k8s.FlattenMetadata(vm.ObjectMeta)); err != nil { - return err - } - if err := resourceData.Set("spec", flattenVirtualMachineSpec(vm.Spec)); err != nil { - return err - } - if err := resourceData.Set("status", flattenVirtualMachineStatus(vm.Status)); err != nil { - return err - } - - return nil -} - -func AppendPatchOps(keyPrefix, pathPrefix string, resourceData *schema.ResourceData, ops []patch.PatchOperation) patch.PatchOperations { - return k8s.AppendPatchOps(keyPrefix+"metadata.0.", pathPrefix+"/metadata/", resourceData, ops) -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/domain_spec.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/domain_spec.go deleted file mode 100644 index f830457a1ab..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/domain_spec.go +++ /dev/null @@ -1,415 +0,0 @@ -package virtualmachineinstance - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -func domainSpecFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "resources": { - Type: schema.TypeList, - Description: "Resources describes the Compute Resources required by this vmi.", - MaxItems: 1, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "requests": { - Type: schema.TypeMap, - Description: "Requests is a description of the initial vmi resources.", - Optional: true, - }, - "limits": { - Type: schema.TypeMap, - Description: "Requests is a description of the initial vmi resources.", - Optional: true, - }, - "over_commit_guest_overhead": { - Type: schema.TypeBool, - Description: "Don't ask the scheduler to take the guest-management overhead into account. Instead put the overhead only into the container's memory limit. This can lead to crashes if all memory is in use on a node. Defaults to false.", - Optional: true, - }, - }, - }, - }, - "devices": { - Type: schema.TypeList, - Description: "Devices allows adding disks, network interfaces, ...", - MaxItems: 1, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "disk": { - Type: schema.TypeList, - Description: "Disks describes disks, cdroms, floppy and luns which are connected to the vmi.", - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Description: "Name is the device name", - Required: true, - }, - "disk_device": { - Type: schema.TypeList, - Description: "DiskDevice specifies as which device the disk should be added to the guest.", - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "disk": { - Type: schema.TypeList, - Description: "Attach a volume as a disk to the vmi.", - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "bus": { - Type: schema.TypeString, - Description: "Bus indicates the type of disk device to emulate.", - Required: true, - }, - "read_only": { - Type: schema.TypeBool, - Description: "ReadOnly. Defaults to false.", - Optional: true, - }, - "pci_address": { - Type: schema.TypeString, - 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", - Optional: true, - }, - }, - }, - }, - }, - }, - }, - "serial": { - Type: schema.TypeString, - Description: "Serial provides the ability to specify a serial number for the disk device.", - Optional: true, - }, - }, - }, - }, - "interface": { - Type: schema.TypeList, - Description: "Interfaces describe network interfaces which are added to the vmi.", - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Description: "Logical name of the interface as well as a reference to the associated networks.", - Required: true, - }, - "interface_binding_method": { - Type: schema.TypeString, - ValidateFunc: validation.StringInSlice([]string{ - "InterfaceBridge", - "InterfaceSlirp", - "InterfaceMasquerade", - "InterfaceSRIOV", - }, false), - Description: "Represents the method which will be used to connect the interface to the guest.", - Required: true, - }, - }, - }, - }, - }, - }, - }, - } -} - -func domainSpecSchema() *schema.Schema { - fields := domainSpecFields() - - return &schema.Schema{ - Type: schema.TypeList, - - Description: fmt.Sprintf("Specification of the desired behavior of the VirtualMachineInstance on the host."), - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func expandDomainSpec(domainSpec []interface{}) (kubevirtapiv1.DomainSpec, error) { - result := kubevirtapiv1.DomainSpec{} - - if len(domainSpec) == 0 || domainSpec[0] == nil { - return result, nil - } - - in := domainSpec[0].(map[string]interface{}) - - if v, ok := in["resources"].([]interface{}); ok { - resources, err := expandResources(v) - if err != nil { - return result, err - } - result.Resources = resources - } - if v, ok := in["devices"].([]interface{}); ok { - devices, err := expandDevices(v) - if err != nil { - return result, err - } - result.Devices = devices - } - - return result, nil -} - -func expandResources(resources []interface{}) (kubevirtapiv1.ResourceRequirements, error) { - result := kubevirtapiv1.ResourceRequirements{} - - if len(resources) == 0 || resources[0] == nil { - return result, nil - } - - in := resources[0].(map[string]interface{}) - - if v, ok := in["requests"].(map[string]interface{}); ok { - requests, err := utils.ExpandMapToResourceList(v) - if err != nil { - return result, err - } - result.Requests = *requests - } - if v, ok := in["limits"].(map[string]interface{}); ok { - limits, err := utils.ExpandMapToResourceList(v) - if err != nil { - return result, err - } - result.Limits = *limits - } - if v, ok := in["over_commit_guest_overhead"].(bool); ok { - result.OvercommitGuestOverhead = v - } - - return result, nil -} - -func expandDevices(devices []interface{}) (kubevirtapiv1.Devices, error) { - result := kubevirtapiv1.Devices{} - - if len(devices) == 0 || devices[0] == nil { - return result, nil - } - - in := devices[0].(map[string]interface{}) - - if v, ok := in["disk"].([]interface{}); ok { - result.Disks = expandDisks(v) - } - if v, ok := in["interface"].([]interface{}); ok { - result.Interfaces = expandInterfaces(v) - } - - return result, nil -} - -func expandDisks(disks []interface{}) []kubevirtapiv1.Disk { - result := make([]kubevirtapiv1.Disk, len(disks)) - - if len(disks) == 0 || disks[0] == nil { - return result - } - - for i, condition := range disks { - in := condition.(map[string]interface{}) - - if v, ok := in["name"].(string); ok { - result[i].Name = v - } - if v, ok := in["disk_device"].([]interface{}); ok { - result[i].DiskDevice = expandDiskDevice(v) - } - if v, ok := in["serial"].(string); ok { - result[i].Serial = v - } - } - - return result -} - -func expandDiskDevice(diskDevice []interface{}) kubevirtapiv1.DiskDevice { - result := kubevirtapiv1.DiskDevice{} - - if len(diskDevice) == 0 || diskDevice[0] == nil { - return result - } - - in := diskDevice[0].(map[string]interface{}) - - if v, ok := in["disk"].([]interface{}); ok { - result.Disk = expandDiskTarget(v) - } - - return result -} - -func expandDiskTarget(disk []interface{}) *kubevirtapiv1.DiskTarget { - if len(disk) == 0 || disk[0] == nil { - return nil - } - - result := &kubevirtapiv1.DiskTarget{} - - in := disk[0].(map[string]interface{}) - - if v, ok := in["bus"].(string); ok { - result.Bus = v - } - if v, ok := in["read_only"].(bool); ok { - result.ReadOnly = v - } - if v, ok := in["pci_address"].(string); ok { - result.PciAddress = v - } - - return result -} - -func expandInterfaces(interfaces []interface{}) []kubevirtapiv1.Interface { - result := make([]kubevirtapiv1.Interface, len(interfaces)) - - if len(interfaces) == 0 || interfaces[0] == nil { - return result - } - - for i, condition := range interfaces { - in := condition.(map[string]interface{}) - - if v, ok := in["name"].(string); ok { - result[i].Name = v - } - if v, ok := in["interface_binding_method"].(string); ok { - result[i].InterfaceBindingMethod = expandInterfaceBindingMethod(v) - } - } - - return result -} - -func expandInterfaceBindingMethod(interfaceBindingMethod string) kubevirtapiv1.InterfaceBindingMethod { - result := kubevirtapiv1.InterfaceBindingMethod{} - - switch interfaceBindingMethod { - case "InterfaceBridge": - result.Bridge = &kubevirtapiv1.InterfaceBridge{} - case "InterfaceSlirp": - result.Slirp = &kubevirtapiv1.InterfaceSlirp{} - case "InterfaceMasquerade": - result.Masquerade = &kubevirtapiv1.InterfaceMasquerade{} - case "InterfaceSRIOV": - result.SRIOV = &kubevirtapiv1.InterfaceSRIOV{} - } - - return result -} - -func flattenDomainSpec(in kubevirtapiv1.DomainSpec) []interface{} { - att := make(map[string]interface{}) - - att["resources"] = flattenResources(in.Resources) - att["devices"] = flattenDevices(in.Devices) - - return []interface{}{att} -} - -func flattenResources(in kubevirtapiv1.ResourceRequirements) []interface{} { - att := make(map[string]interface{}) - - att["requests"] = utils.FlattenResourceList(in.Requests) - att["limits"] = utils.FlattenResourceList(in.Limits) - att["over_commit_guest_overhead"] = in.OvercommitGuestOverhead - - return []interface{}{att} -} - -func flattenDevices(in kubevirtapiv1.Devices) []interface{} { - att := make(map[string]interface{}) - - att["disk"] = flattenDisks(in.Disks) - att["interface"] = flattenInterfaces(in.Interfaces) - - return []interface{}{att} -} - -func flattenDisks(in []kubevirtapiv1.Disk) []interface{} { - att := make([]interface{}, len(in)) - - for i, v := range in { - c := make(map[string]interface{}) - - c["name"] = v.Name - c["disk_device"] = flattenDiskDevice(v.DiskDevice) - c["serial"] = v.Serial - - att[i] = c - } - - return att -} - -func flattenDiskDevice(in kubevirtapiv1.DiskDevice) []interface{} { - att := make(map[string]interface{}) - - if in.Disk != nil { - att["disk"] = flattenDiskTarget(*in.Disk) - } - - return []interface{}{att} -} - -func flattenDiskTarget(in kubevirtapiv1.DiskTarget) []interface{} { - att := make(map[string]interface{}) - - att["bus"] = in.Bus - att["read_only"] = in.ReadOnly - att["pci_address"] = in.PciAddress - - return []interface{}{att} -} - -func flattenInterfaces(in []kubevirtapiv1.Interface) []interface{} { - att := make([]interface{}, len(in)) - - for i, v := range in { - c := make(map[string]interface{}) - - c["name"] = v.Name - c["interface_binding_method"] = flattenInterfaceBindingMethod(v.InterfaceBindingMethod) - - att[i] = c - } - - return att -} - -func flattenInterfaceBindingMethod(in kubevirtapiv1.InterfaceBindingMethod) string { - if in.Bridge != nil { - return "InterfaceBridge" - } - if in.Slirp != nil { - return "InterfaceSlirp" - } - if in.Masquerade != nil { - return "InterfaceMasquerade" - } - if in.SRIOV != nil { - return "InterfaceSRIOV" - } - - return "" -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/networks.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/networks.go deleted file mode 100644 index e1cac036c1c..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/networks.go +++ /dev/null @@ -1,197 +0,0 @@ -package virtualmachineinstance - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -func networkFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Description: "Network name.", - Required: true, - }, - "network_source": { - Type: schema.TypeList, - Description: "NetworkSource represents the network type and the source interface that should be connected to the virtual machine.", - MaxItems: 1, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "pod": { - Type: schema.TypeList, - Description: "Pod network.", - MaxItems: 1, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "vm_network_cidr": { - Type: schema.TypeString, - Description: "CIDR for vm network.", - Required: true, - }, - }, - }, - }, - "multus": { - Type: schema.TypeList, - Description: "Multus network.", - MaxItems: 1, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "network_name": { - Type: schema.TypeString, - Description: "References to a NetworkAttachmentDefinition CRD object. Format: , /. If namespace is not specified, VMI namespace is assumed.", - Required: true, - }, - "default": { - Type: schema.TypeBool, - Description: "Select the default network and add it to the multus-cni.io/default-network annotation.", - Optional: true, - }, - }, - }, - }, - }, - }, - }, - } -} - -func networksSchema() *schema.Schema { - fields := networkFields() - - return &schema.Schema{ - Type: schema.TypeList, - - Description: fmt.Sprintf("List of networks that can be attached to a vm's virtual interface."), - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func expandNetworks(networks []interface{}) []kubevirtapiv1.Network { - result := make([]kubevirtapiv1.Network, len(networks)) - - if len(networks) == 0 || networks[0] == nil { - return result - } - - for i, network := range networks { - in := network.(map[string]interface{}) - - if v, ok := in["name"].(string); ok { - result[i].Name = v - } - if v, ok := in["network_source"].([]interface{}); ok { - result[i].NetworkSource = expandNetworkSource(v) - } - } - - return result -} - -func expandNetworkSource(networkSource []interface{}) kubevirtapiv1.NetworkSource { - result := kubevirtapiv1.NetworkSource{} - - if len(networkSource) == 0 || networkSource[0] == nil { - return result - } - - in := networkSource[0].(map[string]interface{}) - - if v, ok := in["pod"].([]interface{}); ok { - result.Pod = expandPodNetwork(v) - } - if v, ok := in["multus"].([]interface{}); ok { - result.Multus = expandMultusNetwork(v) - } - - return result -} - -func expandPodNetwork(pod []interface{}) *kubevirtapiv1.PodNetwork { - if len(pod) == 0 || pod[0] == nil { - return nil - } - - result := &kubevirtapiv1.PodNetwork{} - in := pod[0].(map[string]interface{}) - - if v, ok := in["vm_network_cidr"].(string); ok { - result.VMNetworkCIDR = v - } - - return result -} - -func expandMultusNetwork(multus []interface{}) *kubevirtapiv1.MultusNetwork { - if len(multus) == 0 || multus[0] == nil { - return nil - } - - result := &kubevirtapiv1.MultusNetwork{} - in := multus[0].(map[string]interface{}) - - if v, ok := in["network_name"].(string); ok { - result.NetworkName = v - } - if v, ok := in["default"].(bool); ok { - result.Default = v - } - - return result -} - -func flattenNetworks(in []kubevirtapiv1.Network) []interface{} { - att := make([]interface{}, len(in)) - - for i, v := range in { - c := make(map[string]interface{}) - - c["name"] = v.Name - c["network_source"] = flattenNetworkSource(v.NetworkSource) - - att[i] = c - } - - return att -} - -func flattenNetworkSource(in kubevirtapiv1.NetworkSource) []interface{} { - att := make(map[string]interface{}) - - if in.Pod != nil { - att["pod"] = flattenPodNetwork(*in.Pod) - } - if in.Multus != nil { - att["multus"] = flattenMultusNetwork(*in.Multus) - } - - return []interface{}{att} -} - -func flattenPodNetwork(in kubevirtapiv1.PodNetwork) []interface{} { - att := make(map[string]interface{}) - - att["vm_network_cidr"] = in.VMNetworkCIDR - - return []interface{}{att} -} - -func flattenMultusNetwork(in kubevirtapiv1.MultusNetwork) []interface{} { - att := make(map[string]interface{}) - - att["network_name"] = in.NetworkName - att["default"] = in.Default - - return []interface{}{att} -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/probe.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/probe.go deleted file mode 100644 index 01af9d5ec66..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/probe.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualmachineinstance - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -func probeFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - // TODO nargaman - } -} - -func probeSchema() *schema.Schema { - fields := probeFields() - - return &schema.Schema{ - Type: schema.TypeList, - - Description: fmt.Sprintf("Specification of the desired behavior of the VirtualMachineInstance on the host."), - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func expandProbe(probe []interface{}) *kubevirtapiv1.Probe { - if len(probe) == 0 || probe[0] == nil { - return nil - } - - result := &kubevirtapiv1.Probe{} - - _ = probe[0].(map[string]interface{}) - - // TODO nargaman - - return result -} - -func flattenProbe(in kubevirtapiv1.Probe) []interface{} { - att := make(map[string]interface{}) - - // att["spec"] = flattenVirtualMachineInstanceSpecSpec(in.Spec) - // att["status"] = flattenVirtualMachineInstanceSpecStatus(in.Status) - // TODO nargaman - - return []interface{}{att} -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/spec.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/spec.go deleted file mode 100644 index a02567bdb97..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/spec.go +++ /dev/null @@ -1,201 +0,0 @@ -package virtualmachineinstance - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils" - k8sv1 "k8s.io/api/core/v1" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -func virtualMachineInstanceSpecFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "priority_class_name": { - Type: schema.TypeString, - Description: "If specified, indicates the pod's priority. If not specified, the pod priority will be default or zero if there is no default.", - Optional: true, - }, - "domain": domainSpecSchema(), - "node_selector": { - Type: schema.TypeMap, - 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.", - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "affinity": k8s.AffinitySchema(), - "scheduler_name": { - Type: schema.TypeString, - Description: "If specified, the VMI will be dispatched by specified scheduler. If not specified, the VMI will be dispatched by default scheduler.", - Optional: true, - }, - "tolerations": k8s.TolerationSchema(), - "eviction_strategy": { - Type: schema.TypeString, - Description: "EvictionStrategy can be set to \"LiveMigrate\" if the VirtualMachineInstance should be migrated instead of shut-off in case of a node drain.", - Optional: true, - ValidateFunc: validation.StringInSlice([]string{ - "LiveMigrate", - }, false), - }, - "termination_grace_period_seconds": { - Type: schema.TypeInt, - Description: "Grace period observed after signalling a VirtualMachineInstance to stop after which the VirtualMachineInstance is force terminated.", - Optional: true, - }, - "volume": volumesSchema(), - "liveness_probe": probeSchema(), - "readiness_probe": probeSchema(), - "hostname": { - Type: schema.TypeString, - Description: "Specifies the hostname of the vmi.", - Optional: true, - }, - "subdomain": { - Type: schema.TypeString, - Description: "If specified, the fully qualified vmi hostname will be \"...svc.\".", - Optional: true, - }, - "network": networksSchema(), - "dns_policy": { - Type: schema.TypeString, - Description: "DNSPolicy defines how a pod's DNS will be configured.", - Optional: true, - ValidateFunc: validation.StringInSlice([]string{ - "ClusterFirstWithHostNet", - "ClusterFirst", - "Default", - "None", - }, false), - }, - "pod_dns_config": k8s.PodDnsConfigSchema(), - } -} - -func virtualMachineInstanceSpecSchema() *schema.Schema { - fields := virtualMachineInstanceSpecFields() - - return &schema.Schema{ - Type: schema.TypeList, - - Description: fmt.Sprintf("Template is the direct specification of VirtualMachineInstance."), - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func expandVirtualMachineInstanceSpec(virtualMachineInstanceSpec []interface{}) (kubevirtapiv1.VirtualMachineInstanceSpec, error) { - result := kubevirtapiv1.VirtualMachineInstanceSpec{} - - if len(virtualMachineInstanceSpec) == 0 || virtualMachineInstanceSpec[0] == nil { - return result, nil - } - - in := virtualMachineInstanceSpec[0].(map[string]interface{}) - - if v, ok := in["priority_class_name"].(string); ok { - result.PriorityClassName = v - } - if v, ok := in["domain"].([]interface{}); ok { - domain, err := expandDomainSpec(v) - if err != nil { - return result, err - } - result.Domain = domain - } - if v, ok := in["node_selector"].(map[string]interface{}); ok && len(v) > 0 { - result.NodeSelector = utils.ExpandStringMap(v) - } - if v, ok := in["affinity"].([]interface{}); ok { - result.Affinity = k8s.ExpandAffinity(v) - } - if v, ok := in["scheduler_name"].(string); ok { - result.SchedulerName = v - } - if v, ok := in["tolerations"].([]interface{}); ok { - tolerations, err := k8s.ExpandTolerations(v) - if err != nil { - return result, err - } - result.Tolerations = tolerations - } - if v, ok := in["eviction_strategy"].(string); ok { - if v != "" { - evictionStrategy := kubevirtapiv1.EvictionStrategy(v) - result.EvictionStrategy = &evictionStrategy - } - } - if v, ok := in["termination_grace_period_seconds"].(int); ok { - seconds := int64(v) - result.TerminationGracePeriodSeconds = &seconds - } - if v, ok := in["volume"].([]interface{}); ok { - result.Volumes = expandVolumes(v) - } - if v, ok := in["liveness_probe"].([]interface{}); ok { - result.LivenessProbe = expandProbe(v) - } - if v, ok := in["readiness_probe"].([]interface{}); ok { - result.ReadinessProbe = expandProbe(v) - } - if v, ok := in["hostname"].(string); ok { - result.Hostname = v - } - if v, ok := in["subdomain"].(string); ok { - result.Subdomain = v - } - if v, ok := in["network"].([]interface{}); ok { - result.Networks = expandNetworks(v) - } - if v, ok := in["dns_policy"].(string); ok { - result.DNSPolicy = k8sv1.DNSPolicy(v) - } - if v, ok := in["pod_dns_config"].([]interface{}); ok { - dnsConfig, err := k8s.ExpandPodDNSConfig(v) - if err != nil { - return result, err - } - result.DNSConfig = dnsConfig - } - - return result, nil -} - -func flattenVirtualMachineInstanceSpec(in kubevirtapiv1.VirtualMachineInstanceSpec) []interface{} { - att := make(map[string]interface{}) - - att["priority_class_name"] = in.PriorityClassName - att["domain"] = flattenDomainSpec(in.Domain) - att["node_selector"] = in.NodeSelector - att["affinity"] = k8s.FlattenAffinity(in.Affinity) - att["scheduler_name"] = in.SchedulerName - att["tolerations"] = k8s.FlattenTolerations(in.Tolerations) - if in.EvictionStrategy != nil { - att["eviction_strategy"] = string(*in.EvictionStrategy) - } - if in.TerminationGracePeriodSeconds != nil { - att["termination_grace_period_seconds"] = *in.TerminationGracePeriodSeconds - } - att["volume"] = flattenVolumes(in.Volumes) - if in.LivenessProbe != nil { - att["liveness_probe"] = flattenProbe(*in.LivenessProbe) - } - if in.ReadinessProbe != nil { - att["readiness_probe"] = flattenProbe(*in.ReadinessProbe) - } - att["hostname"] = in.Hostname - att["subdomain"] = in.Subdomain - att["network"] = flattenNetworks(in.Networks) - att["dns_policy"] = string(in.DNSPolicy) - if in.DNSConfig != nil { - att["pod_dns_config"] = k8s.FlattenPodDNSConfig(in.DNSConfig) - } - - return []interface{}{att} -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/template_spec.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/template_spec.go deleted file mode 100644 index 41db01bd091..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/template_spec.go +++ /dev/null @@ -1,64 +0,0 @@ -package virtualmachineinstance - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -func virtualMachineInstanceTemplateSpecFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "metadata": k8s.NamespacedMetadataSchema("VirtualMachineInstanceTemplateSpec", false), - "spec": virtualMachineInstanceSpecSchema(), - } -} - -func VirtualMachineInstanceTemplateSpecSchema() *schema.Schema { - fields := virtualMachineInstanceTemplateSpecFields() - - return &schema.Schema{ - Type: schema.TypeList, - - Description: fmt.Sprintf("Template is the direct specification of VirtualMachineInstance."), - Optional: true, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func ExpandVirtualMachineInstanceTemplateSpec(virtualMachine []interface{}) (*kubevirtapiv1.VirtualMachineInstanceTemplateSpec, error) { - if len(virtualMachine) == 0 || virtualMachine[0] == nil { - return nil, nil - } - - result := &kubevirtapiv1.VirtualMachineInstanceTemplateSpec{} - - in := virtualMachine[0].(map[string]interface{}) - - if v, ok := in["metadata"].([]interface{}); ok { - result.ObjectMeta = k8s.ExpandMetadata(v) - } - if v, ok := in["spec"].([]interface{}); ok { - spec, err := expandVirtualMachineInstanceSpec(v) - if err != nil { - return result, err - } - result.Spec = spec - } - - return result, nil -} - -func FlattenVirtualMachineInstanceTemplateSpec(in kubevirtapiv1.VirtualMachineInstanceTemplateSpec) []interface{} { - att := make(map[string]interface{}) - - att["metadata"] = k8s.FlattenMetadata(in.ObjectMeta) - att["spec"] = flattenVirtualMachineInstanceSpec(in.Spec) - - return []interface{}{att} -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/volumes.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/volumes.go deleted file mode 100644 index 676229ee039..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance/volumes.go +++ /dev/null @@ -1,274 +0,0 @@ -package virtualmachineinstance - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -func volumesFields() map[string]*schema.Schema { - return map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Description: "Volume's name.", - Required: true, - }, - "volume_source": { - Type: schema.TypeList, - Description: "VolumeSource represents the location and type of the mounted volume. Defaults to Disk, if no type is specified.", - MaxItems: 1, - Required: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "data_volume": { - Type: schema.TypeList, - Description: "DataVolume represents the dynamic creation a PVC for this volume as well as the process of populating that PVC with a disk image.", - MaxItems: 1, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Description: "Name represents the name of the DataVolume in the same namespace.", - Required: true, - }, - }, - }, - }, - "cloud_init_config_drive": { - Type: schema.TypeList, - Description: "CloudInitConfigDrive represents a cloud-init Config Drive user-data source.", - MaxItems: 1, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "user_data_secret_ref": k8s.LocalObjectReferenceSchema("UserDataSecretRef references a k8s secret that contains config drive userdata."), - "user_data_base64": { - Type: schema.TypeString, - Description: "UserDataBase64 contains config drive cloud-init userdata as a base64 encoded string.", - Optional: true, - }, - "user_data": { - Type: schema.TypeString, - Description: "UserData contains config drive inline cloud-init userdata.", - Optional: true, - }, - "network_data_secret_ref": k8s.LocalObjectReferenceSchema("NetworkDataSecretRef references a k8s secret that contains config drive networkdata."), - "network_data_base64": { - Type: schema.TypeString, - Description: "NetworkDataBase64 contains config drive cloud-init networkdata as a base64 encoded string.", - Optional: true, - }, - "network_data": { - Type: schema.TypeString, - Description: "NetworkData contains config drive inline cloud-init networkdata.", - Optional: true, - }, - }, - }, - }, - "service_account": { - Type: schema.TypeList, - Description: "ServiceAccountVolumeSource represents a reference to a service account.", - MaxItems: 1, - Optional: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "service_account_name": { - Type: schema.TypeString, - Description: "Name of the service account in the pod's namespace to use.", - Required: true, - }, - }, - }, - }, - // TODO nargaman - Add other data volume source types - }, - }, - }, - } -} - -func volumesSchema() *schema.Schema { - fields := volumesFields() - - return &schema.Schema{ - Type: schema.TypeList, - - Description: fmt.Sprintf("Specification of the desired behavior of the VirtualMachineInstance on the host."), - Optional: true, - Elem: &schema.Resource{ - Schema: fields, - }, - } - -} - -func expandVolumes(volumes []interface{}) []kubevirtapiv1.Volume { - result := make([]kubevirtapiv1.Volume, len(volumes)) - - if len(volumes) == 0 || volumes[0] == nil { - return result - } - - for i, condition := range volumes { - in := condition.(map[string]interface{}) - - if v, ok := in["name"].(string); ok { - result[i].Name = v - } - if v, ok := in["volume_source"].([]interface{}); ok { - result[i].VolumeSource = expandVolumeSource(v) - } - } - - return result -} - -func expandVolumeSource(volumeSource []interface{}) kubevirtapiv1.VolumeSource { - result := kubevirtapiv1.VolumeSource{} - - if len(volumeSource) == 0 || volumeSource[0] == nil { - return result - } - - in := volumeSource[0].(map[string]interface{}) - - if v, ok := in["data_volume"].([]interface{}); ok { - result.DataVolume = expandDataVolume(v) - } - if v, ok := in["cloud_init_config_drive"].([]interface{}); ok { - result.CloudInitConfigDrive = expandCloudInitConfigDrive(v) - } - if v, ok := in["service_account"].([]interface{}); ok { - result.ServiceAccount = expandServiceAccount(v) - } - - return result -} - -func expandDataVolume(dataVolumeSource []interface{}) *kubevirtapiv1.DataVolumeSource { - if len(dataVolumeSource) == 0 || dataVolumeSource[0] == nil { - return nil - } - - result := &kubevirtapiv1.DataVolumeSource{} - in := dataVolumeSource[0].(map[string]interface{}) - - if v, ok := in["name"].(string); ok { - result.Name = v - } - - return result -} - -func expandCloudInitConfigDrive(cloudInitConfigDriveSource []interface{}) *kubevirtapiv1.CloudInitConfigDriveSource { - if len(cloudInitConfigDriveSource) == 0 || cloudInitConfigDriveSource[0] == nil { - return nil - } - - result := &kubevirtapiv1.CloudInitConfigDriveSource{} - in := cloudInitConfigDriveSource[0].(map[string]interface{}) - - if v, ok := in["user_data_secret_ref"].([]interface{}); ok { - result.UserDataSecretRef = k8s.ExpandLocalObjectReferences(v) - } - if v, ok := in["user_data_base64"].(string); ok { - result.UserDataBase64 = v - } - if v, ok := in["user_data"].(string); ok { - result.UserData = v - } - if v, ok := in["network_data_secret_ref"].([]interface{}); ok { - result.NetworkDataSecretRef = k8s.ExpandLocalObjectReferences(v) - } - if v, ok := in["network_data_base64"].(string); ok { - result.NetworkDataBase64 = v - } - if v, ok := in["network_data"].(string); ok { - result.NetworkData = v - } - - return result -} - -func expandServiceAccount(serviceAccountSource []interface{}) *kubevirtapiv1.ServiceAccountVolumeSource { - if len(serviceAccountSource) == 0 || serviceAccountSource[0] == nil { - return nil - } - - result := &kubevirtapiv1.ServiceAccountVolumeSource{} - in := serviceAccountSource[0].(map[string]interface{}) - - if v, ok := in["service_account_name"].(string); ok { - result.ServiceAccountName = v - } - - return result -} - -func flattenVolumes(in []kubevirtapiv1.Volume) []interface{} { - att := make([]interface{}, len(in)) - - for i, v := range in { - c := make(map[string]interface{}) - - c["name"] = v.Name - c["volume_source"] = flattenVolumeSource(v.VolumeSource) - - att[i] = c - } - - return att -} - -func flattenVolumeSource(in kubevirtapiv1.VolumeSource) []interface{} { - att := make(map[string]interface{}) - - if in.DataVolume != nil { - att["data_volume"] = flattenDataVolume(*in.DataVolume) - } - if in.CloudInitConfigDrive != nil { - att["cloud_init_config_drive"] = flattenCloudInitConfigDrive(*in.CloudInitConfigDrive) - } - if in.ServiceAccount != nil { - att["service_account"] = flattenServiceAccount(*in.ServiceAccount) - } - - return []interface{}{att} -} - -func flattenDataVolume(in kubevirtapiv1.DataVolumeSource) []interface{} { - att := make(map[string]interface{}) - - att["name"] = in.Name - - return []interface{}{att} -} - -func flattenCloudInitConfigDrive(in kubevirtapiv1.CloudInitConfigDriveSource) []interface{} { - att := make(map[string]interface{}) - - if in.UserDataSecretRef != nil { - att["user_data_secret_ref"] = k8s.FlattenLocalObjectReferences(*in.UserDataSecretRef) - } - att["user_data_base64"] = in.UserDataBase64 - att["user_data"] = in.UserData - if in.NetworkDataSecretRef != nil { - att["network_data_secret_ref"] = k8s.FlattenLocalObjectReferences(*in.NetworkDataSecretRef) - } - att["network_data_base64"] = in.NetworkDataBase64 - att["network_data"] = in.NetworkData - - return []interface{}{att} -} - -func flattenServiceAccount(in kubevirtapiv1.ServiceAccountVolumeSource) []interface{} { - att := make(map[string]interface{}) - - att["service_account_name"] = in.ServiceAccountName - - return []interface{}{att} -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/patch/patch_operations.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/patch/patch_operations.go deleted file mode 100644 index 003c1902b16..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/patch/patch_operations.go +++ /dev/null @@ -1,154 +0,0 @@ -package patch - -import ( - "encoding/json" - "reflect" - "sort" - "strings" -) - -func DiffStringMap(pathPrefix string, oldV, newV map[string]interface{}) PatchOperations { - ops := make([]PatchOperation, 0, 0) - - pathPrefix = strings.TrimRight(pathPrefix, "/") - - // If old value was empty, just create the object - if len(oldV) == 0 { - ops = append(ops, &AddOperation{ - Path: pathPrefix, - Value: newV, - }) - return ops - } - - // This is suboptimal for adding whole new map from scratch - // or deleting the whole map, but it's actually intention. - // There may be some other map items managed outside of TF - // and we don't want to touch these. - - for k := range oldV { - if _, ok := newV[k]; ok { - continue - } - ops = append(ops, &RemoveOperation{ - Path: pathPrefix + "/" + escapeJsonPointer(k), - }) - } - - for k, v := range newV { - newValue := v.(string) - - if oldValue, ok := oldV[k].(string); ok { - if oldValue == newValue { - continue - } - - ops = append(ops, &ReplaceOperation{ - Path: pathPrefix + "/" + escapeJsonPointer(k), - Value: newValue, - }) - continue - } - - ops = append(ops, &AddOperation{ - Path: pathPrefix + "/" + escapeJsonPointer(k), - Value: newValue, - }) - } - - return ops -} - -// escapeJsonPointer escapes string per RFC 6901 -// so it can be used as path in JSON patch operations -func escapeJsonPointer(path string) string { - path = strings.Replace(path, "~", "~0", -1) - path = strings.Replace(path, "/", "~1", -1) - return path -} - -type PatchOperations []PatchOperation - -func (po PatchOperations) MarshalJSON() ([]byte, error) { - var v []PatchOperation = po - return json.Marshal(v) -} - -func (po PatchOperations) Equal(ops []PatchOperation) bool { - var v []PatchOperation = po - - sort.Slice(v, sortByPathAsc(v)) - sort.Slice(ops, sortByPathAsc(ops)) - - return reflect.DeepEqual(v, ops) -} - -func sortByPathAsc(ops []PatchOperation) func(i, j int) bool { - return func(i, j int) bool { - return ops[i].GetPath() < ops[j].GetPath() - } -} - -type PatchOperation interface { - MarshalJSON() ([]byte, error) - GetPath() string -} - -type ReplaceOperation struct { - Path string `json:"path"` - Value interface{} `json:"value"` - Op string `json:"op"` -} - -func (o *ReplaceOperation) GetPath() string { - return o.Path -} - -func (o *ReplaceOperation) MarshalJSON() ([]byte, error) { - o.Op = "replace" - return json.Marshal(*o) -} - -func (o *ReplaceOperation) String() string { - b, _ := o.MarshalJSON() - return string(b) -} - -type AddOperation struct { - Path string `json:"path"` - Value interface{} `json:"value"` - Op string `json:"op"` -} - -func (o *AddOperation) GetPath() string { - return o.Path -} - -func (o *AddOperation) MarshalJSON() ([]byte, error) { - o.Op = "add" - return json.Marshal(*o) -} - -func (o *AddOperation) String() string { - b, _ := o.MarshalJSON() - return string(b) -} - -type RemoveOperation struct { - Path string `json:"path"` - Op string `json:"op"` -} - -func (o *RemoveOperation) GetPath() string { - return o.Path -} - -func (o *RemoveOperation) MarshalJSON() ([]byte, error) { - o.Op = "remove" - return json.Marshal(*o) -} - -func (o *RemoveOperation) String() string { - b, _ := o.MarshalJSON() - return string(b) -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/structures.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/structures.go deleted file mode 100644 index f292a37aeb9..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/structures.go +++ /dev/null @@ -1,181 +0,0 @@ -package utils - -import ( - "encoding/base64" - "fmt" - "strings" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - api "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func IdParts(id string) (string, string, error) { - parts := strings.Split(id, "/") - if len(parts) != 2 { - err := fmt.Errorf("Unexpected ID format (%q), expected %q.", id, "namespace/name") - return "", "", err - } - - return parts[0], parts[1], nil -} - -func BuildId(meta metav1.ObjectMeta) string { - return meta.Namespace + "/" + meta.Name -} - -func ExpandStringMap(m map[string]interface{}) map[string]string { - result := make(map[string]string) - for k, v := range m { - result[k] = v.(string) - } - return result -} - -func ExpandBase64MapToByteMap(m map[string]interface{}) map[string][]byte { - result := make(map[string][]byte) - for k, v := range m { - b, err := base64.StdEncoding.DecodeString(v.(string)) - if err == nil { - result[k] = b - } - } - return result -} - -func ExpandStringMapToByteMap(m map[string]interface{}) map[string][]byte { - result := make(map[string][]byte) - for k, v := range m { - result[k] = []byte(v.(string)) - } - return result -} - -func ExpandStringSlice(s []interface{}) []string { - result := make([]string, len(s), len(s)) - for k, v := range s { - // Handle the Terraform parser bug which turns empty strings in lists to nil. - if v == nil { - result[k] = "" - } else { - result[k] = v.(string) - } - } - return result -} - -func FlattenByteMapToBase64Map(m map[string][]byte) map[string]string { - result := make(map[string]string) - for k, v := range m { - result[k] = base64.StdEncoding.EncodeToString([]byte(v)) - } - return result -} - -func FlattenByteMapToStringMap(m map[string][]byte) map[string]string { - result := make(map[string]string) - for k, v := range m { - result[k] = string(v) - } - return result -} - -func PtrToString(s string) *string { - return &s -} - -func PtrToBool(b bool) *bool { - return &b -} - -func PtrToInt32(i int32) *int32 { - return &i -} - -func PtrToInt64(i int64) *int64 { - return &i -} - -func SliceOfString(slice []interface{}) []string { - result := make([]string, len(slice), len(slice)) - for i, s := range slice { - result[i] = s.(string) - } - return result -} - -func Base64EncodeStringMap(m map[string]interface{}) map[string]interface{} { - result := make(map[string]interface{}) - for k, v := range m { - value := v.(string) - result[k] = base64.StdEncoding.EncodeToString([]byte(value)) - } - return result -} - -func NewStringSet(f schema.SchemaSetFunc, in []string) *schema.Set { - var out = make([]interface{}, len(in), len(in)) - for i, v := range in { - out[i] = v - } - return schema.NewSet(f, out) -} - -func NewInt64Set(f schema.SchemaSetFunc, in []int64) *schema.Set { - var out = make([]interface{}, len(in), len(in)) - for i, v := range in { - out[i] = int(v) - } - return schema.NewSet(f, out) -} - -func SchemaSetToStringArray(set *schema.Set) []string { - array := make([]string, 0, set.Len()) - for _, elem := range set.List() { - e := elem.(string) - array = append(array, e) - } - return array -} - -func SchemaSetToInt64Array(set *schema.Set) []int64 { - array := make([]int64, 0, set.Len()) - for _, elem := range set.List() { - e := elem.(int) - array = append(array, int64(e)) - } - return array -} - -func ExpandMapToResourceList(m map[string]interface{}) (*api.ResourceList, error) { - out := make(api.ResourceList) - for stringKey, origValue := range m { - key := api.ResourceName(stringKey) - var value resource.Quantity - - if v, ok := origValue.(int); ok { - q := resource.NewQuantity(int64(v), resource.DecimalExponent) - value = *q - } else if v, ok := origValue.(string); ok { - var err error - value, err = resource.ParseQuantity(v) - if err != nil { - return &out, err - } - } else { - return &out, fmt.Errorf("Unexpected value type: %#v", origValue) - } - - out[key] = value - } - return &out, nil -} - -func FlattenResourceList(l api.ResourceList) map[string]string { - m := make(map[string]string) - for k, v := range l { - m[string(k)] = v.String() - } - return m -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/utils.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/utils.go deleted file mode 100644 index 9a449f006a3..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/utils.go +++ /dev/null @@ -1,17 +0,0 @@ -package utils - -func ConvertMap(src map[string]interface{}) map[string]string { - result := map[string]string{} - for k, v := range src { - result[k] = v.(string) - } - return result -} - -func ConditionalDefault(condition bool, defaultValue interface{}) interface{} { - if !condition { - return nil - } - - return defaultValue -} diff --git a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/validators.go b/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/validators.go deleted file mode 100644 index e36c46f9356..00000000000 --- a/vendor/github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/validators.go +++ /dev/null @@ -1,312 +0,0 @@ -package utils - -import ( - "encoding/base64" - "fmt" - "strconv" - "strings" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "k8s.io/apimachinery/pkg/api/resource" - apiValidation "k8s.io/apimachinery/pkg/api/validation" - utilValidation "k8s.io/apimachinery/pkg/util/validation" -) - -func ValidateAnnotations(value interface{}, key string) (ws []string, es []error) { - m := value.(map[string]interface{}) - for k := range m { - errors := utilValidation.IsQualifiedName(strings.ToLower(k)) - if len(errors) > 0 { - for _, e := range errors { - es = append(es, fmt.Errorf("%s (%q) %s", key, k, e)) - } - } - } - return -} - -func validateBase64Encoded(v interface{}, key string) (ws []string, es []error) { - s, ok := v.(string) - if !ok { - es = []error{fmt.Errorf("%s: must be a non-nil base64-encoded string", key)} - return - } - - _, err := base64.StdEncoding.DecodeString(s) - if err != nil { - es = []error{fmt.Errorf("%s: must be a base64-encoded string", key)} - return - } - return -} - -func validateBase64EncodedMap(value interface{}, key string) (ws []string, es []error) { - m, ok := value.(map[string]interface{}) - if !ok { - es = []error{fmt.Errorf("%s: must be a map of strings to base64 encoded strings", key)} - return - } - - for k, v := range m { - _, errs := validateBase64Encoded(v, k) - for _, e := range errs { - es = append(es, fmt.Errorf("%s (%q) %s", k, v, e)) - } - } - - return -} - -func ValidateName(value interface{}, key string) (ws []string, es []error) { - v := value.(string) - errors := apiValidation.NameIsDNSSubdomain(v, false) - if len(errors) > 0 { - for _, err := range errors { - es = append(es, fmt.Errorf("%s %s", key, err)) - } - } - return -} - -func ValidateGenerateName(value interface{}, key string) (ws []string, es []error) { - v := value.(string) - - errors := apiValidation.NameIsDNSLabel(v, true) - if len(errors) > 0 { - for _, err := range errors { - es = append(es, fmt.Errorf("%s %s", key, err)) - } - } - return -} - -func ValidateLabels(value interface{}, key string) (ws []string, es []error) { - m := value.(map[string]interface{}) - for k, v := range m { - for _, msg := range utilValidation.IsQualifiedName(k) { - es = append(es, fmt.Errorf("%s (%q) %s", key, k, msg)) - } - val, isString := v.(string) - if !isString { - es = append(es, fmt.Errorf("%s.%s (%#v): Expected value to be string", key, k, v)) - return - } - for _, msg := range utilValidation.IsValidLabelValue(val) { - es = append(es, fmt.Errorf("%s (%q) %s", key, val, msg)) - } - } - return -} - -func validatePortNum(value interface{}, key string) (ws []string, es []error) { - errors := utilValidation.IsValidPortNum(value.(int)) - if len(errors) > 0 { - for _, err := range errors { - es = append(es, fmt.Errorf("%s %s", key, err)) - } - } - return -} - -func validatePortName(value interface{}, key string) (ws []string, es []error) { - errors := utilValidation.IsValidPortName(value.(string)) - if len(errors) > 0 { - for _, err := range errors { - es = append(es, fmt.Errorf("%s %s", key, err)) - } - } - return -} -func validatePortNumOrName(value interface{}, key string) (ws []string, es []error) { - switch value.(type) { - case string: - intVal, err := strconv.Atoi(value.(string)) - if err != nil { - return validatePortName(value, key) - } - return validatePortNum(intVal, key) - case int: - return validatePortNum(value, key) - - default: - es = append(es, fmt.Errorf("%s must be defined of type string or int on the schema", key)) - return - } -} - -func validateResourceList(value interface{}, key string) (ws []string, es []error) { - m := value.(map[string]interface{}) - for k, value := range m { - if _, ok := value.(int); ok { - continue - } - - if v, ok := value.(string); ok { - _, err := resource.ParseQuantity(v) - if err != nil { - es = append(es, fmt.Errorf("%s.%s (%q): %s", key, k, v, err)) - } - continue - } - - err := "Value can be either string or int" - es = append(es, fmt.Errorf("%s.%s (%#v): %s", key, k, value, err)) - } - return -} - -func validateResourceQuantity(value interface{}, key string) (ws []string, es []error) { - if v, ok := value.(string); ok { - _, err := resource.ParseQuantity(v) - if err != nil { - es = append(es, fmt.Errorf("%s.%s : %s", key, v, err)) - } - } - return -} - -func validateNonNegativeInteger(value interface{}, key string) (ws []string, es []error) { - v := value.(int) - if v < 0 { - es = append(es, fmt.Errorf("%s must be greater than or equal to 0", key)) - } - return -} - -func validatePositiveInteger(value interface{}, key string) (ws []string, es []error) { - v := value.(int) - if v <= 0 { - es = append(es, fmt.Errorf("%s must be greater than 0", key)) - } - return -} - -func validateTerminationGracePeriodSeconds(value interface{}, key string) (ws []string, es []error) { - v := value.(int) - if v < 0 { - es = append(es, fmt.Errorf("%s must be greater than or equal to 0", key)) - } - return -} - -func validateIntGreaterThan(minValue int) func(value interface{}, key string) (ws []string, es []error) { - return func(value interface{}, key string) (ws []string, es []error) { - v := value.(int) - if v < minValue { - es = append(es, fmt.Errorf("%s must be greater than or equal to %d", key, minValue)) - } - return - } -} - -// validateTypeStringNullableInt provides custom error messaging for TypeString ints -// Some arguments require an int value or unspecified, empty field. -func ValidateTypeStringNullableInt(v interface{}, k string) (ws []string, es []error) { - value, ok := v.(string) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be string", k)) - return - } - - if value == "" { - return - } - - if _, err := strconv.ParseInt(value, 10, 64); err != nil { - es = append(es, fmt.Errorf("%s: cannot parse '%s' as int: %s", k, value, err)) - } - - return -} - -func validateModeBits(value interface{}, key string) (ws []string, es []error) { - if !strings.HasPrefix(value.(string), "0") { - es = append(es, fmt.Errorf("%s: value %s should start with '0' (octal numeral)", key, value.(string))) - } - v, err := strconv.ParseInt(value.(string), 8, 32) - if err != nil { - es = append(es, fmt.Errorf("%s :Cannot parse octal numeral (%#v): %s", key, value, err)) - } - if v < 0 || v > 0777 { - es = append(es, fmt.Errorf("%s (%#o) expects octal notation (a value between 0 and 0777)", key, v)) - } - return -} - -func validateAttributeValueDoesNotContain(searchString string) schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - input := v.(string) - if strings.Contains(input, searchString) { - errors = append(errors, fmt.Errorf( - "%q must not contain %q", - k, searchString)) - } - return - } -} - -func validateAttributeValueIsIn(validValues []string) schema.SchemaValidateFunc { - return func(v interface{}, k string) (ws []string, errors []error) { - input := v.(string) - isValid := false - for _, s := range validValues { - if s == input { - isValid = true - break - } - } - if !isValid { - errors = append(errors, fmt.Errorf( - "%q must contain a value from %#v, got %q", - k, validValues, input)) - } - return - - } -} - -func validateTypeStringNullableIntOrPercent(v interface{}, key string) (ws []string, es []error) { - value, ok := v.(string) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be string", key)) - return - } - - if value == "" { - return - } - - if strings.HasSuffix(value, "%") { - percent, err := strconv.ParseInt(strings.TrimSuffix(value, "%"), 10, 32) - if err != nil { - es = append(es, fmt.Errorf("%s: cannot parse '%s' as percent: %s", key, value, err)) - } - if percent < 0 || percent >= 100 { - es = append(es, fmt.Errorf("%s: '%s' is not between 0%% and 100%%", key, value)) - } - } else if _, err := strconv.ParseInt(value, 10, 32); err != nil { - es = append(es, fmt.Errorf("%s: cannot parse '%s' as int or percent: %s", key, value, err)) - } - - return -} - -func StringIsIntInRange(min int, max int) schema.SchemaValidateFunc { - return func(i interface{}, k string) (warnings []string, errors []error) { - stringVal, ok := i.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) - return warnings, errors - } - intVal, err := strconv.Atoi(stringVal) - if err != nil { - errors = append(errors, fmt.Errorf("expected %s to string representation of integer", k)) - return warnings, errors - } - if intVal < min || intVal > max { - errors = append(errors, fmt.Errorf("expected %s to be between %d and %d inclusive", k, min, max)) - return warnings, errors - } - return warnings, errors - } -} diff --git a/vendor/github.com/openshift/cluster-api-provider-kubevirt/LICENSE b/vendor/github.com/openshift/cluster-api-provider-kubevirt/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-kubevirt/LICENSE +++ /dev/null @@ -1,201 +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: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) 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 - - (d) 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/openshift/cluster-api-provider-kubevirt/pkg/apis/addtoscheme_openshiftkubevirtprovider_v1alpha1.go b/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/addtoscheme_openshiftkubevirtprovider_v1alpha1.go deleted file mode 100644 index 46aa858551a..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/addtoscheme_openshiftkubevirtprovider_v1alpha1.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2018 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. -*/ - -package apis - -import ( - "github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1" -) - -func init() { - // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme) -} diff --git a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/apis.go b/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/apis.go deleted file mode 100644 index aedf2fe5b4c..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/apis.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2018 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. -*/ - -// Generate deepcopy for apis -//go:generate go run ../../vendor/sigs.k8s.io/controller-tools/cmd/controller-gen paths=./... object:headerFile=../../hack/boilerplate/boilerplate.go.txt - -// Package apis contains Kubernetes API groups. -package apis - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -// AddToSchemes may be used to add all resources defined in the project to a Scheme -var AddToSchemes runtime.SchemeBuilder - -// AddToScheme adds all Resources to the Scheme -func AddToScheme(s *runtime.Scheme) error { - return AddToSchemes.AddToScheme(s) -} diff --git a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1/doc.go b/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1/doc.go deleted file mode 100644 index 0017ca1d2d2..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// +k8s:deepcopy-gen=package,register -// +k8s:conversion-gen=github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider -// +k8s:openapi-gen=true -// +k8s:defaulter-gen=TypeMeta -// +groupName=kubevirtproviderconfig.openshift.io -package v1alpha1 diff --git a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1/register.go b/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1/register.go deleted file mode 100644 index 419d47103b9..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1/register.go +++ /dev/null @@ -1,100 +0,0 @@ -/* -Copyright 2018 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. -*/ - -package v1alpha1 - -import ( - "encoding/json" - "fmt" - - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/klog" - "sigs.k8s.io/controller-runtime/pkg/scheme" - "sigs.k8s.io/yaml" -) - -var ( - // SchemeGroupVersion is group version used to register these objects - SchemeGroupVersion = schema.GroupVersion{Group: "kubevirtproviderconfig.openshift.io", Version: "v1alpha1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} -) - -// RawExtensionFromProviderSpec marshals the machine provider spec. -func RawExtensionFromProviderSpec(spec *KubevirtMachineProviderSpec) (*runtime.RawExtension, error) { - if spec == nil { - return &runtime.RawExtension{}, nil - } - - var rawBytes []byte - var err error - if rawBytes, err = json.Marshal(spec); err != nil { - return nil, fmt.Errorf("error marshalling providerSpec: %v", err) - } - - return &runtime.RawExtension{ - Raw: rawBytes, - }, nil -} - -// RawExtensionFromProviderStatus marshals the machine provider status -func RawExtensionFromProviderStatus(status *KubevirtMachineProviderStatus) (*runtime.RawExtension, error) { - if status == nil { - return &runtime.RawExtension{}, nil - } - - var rawBytes []byte - var err error - if rawBytes, err = json.Marshal(status); err != nil { - return nil, fmt.Errorf("error marshalling providerStatus: %v", err) - } - - return &runtime.RawExtension{ - Raw: rawBytes, - }, nil -} - -// ProviderSpecFromRawExtension unmarshals a raw extension into an KubevirtMachineProviderSpec type -func ProviderSpecFromRawExtension(rawExtension *runtime.RawExtension) (*KubevirtMachineProviderSpec, error) { - if rawExtension == nil { - return &KubevirtMachineProviderSpec{}, nil - } - - spec := new(KubevirtMachineProviderSpec) - if err := yaml.Unmarshal(rawExtension.Raw, &spec); err != nil { - return nil, fmt.Errorf("error unmarshalling providerSpec: %v", err) - } - - klog.V(5).Infof("Got provider Spec from raw extension: %+v", spec) - return spec, nil -} - -// ProviderStatusFromRawExtension unmarshals a raw extension into an KubevirtMachineProviderStatus type -func ProviderStatusFromRawExtension(rawExtension *runtime.RawExtension) (*KubevirtMachineProviderStatus, error) { - if rawExtension == nil { - return &KubevirtMachineProviderStatus{}, nil - } - - providerStatus := new(KubevirtMachineProviderStatus) - if err := yaml.Unmarshal(rawExtension.Raw, providerStatus); err != nil { - return nil, fmt.Errorf("error unmarshalling providerStatus: %v", err) - } - - klog.V(5).Infof("Got provider Status from raw extension: %+v", providerStatus) - return providerStatus, nil -} diff --git a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1/types.go b/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1/types.go deleted file mode 100644 index 0dd3d9f9d14..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1/types.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright 2018 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. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kubevirtapiv1 "kubevirt.io/client-go/api/v1" -) - -// KubevirtMachineProviderSpec is the Schema for the KubevirtMachineProviderSpec API -// +k8s:openapi-gen=true -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type KubevirtMachineProviderSpec struct { - metav1.TypeMeta `json:",inline"` - SourcePvcName string `json:"sourcePvcName,omitempty"` - CredentialsSecretName string `json:"credentialsSecretName,omitempty"` - RequestedMemory string `json:"requestedMemory,omitempty"` - RequestedCPU uint32 `json:"requestedCPU,omitempty"` - RequestedStorage string `json:"requestedStorage,omitempty"` - StorageClassName string `json:"storageClassName,omitempty"` - IgnitionSecretName string `json:"ignitionSecretName,omitempty"` - NetworkName string `json:"networkName,omitempty"` - InterfaceBindingMethod string `json:"interfaceBindingMethod,omitempty"` - PersistentVolumeAccessMode string `json:"persistentVolumeAccessMode,omitempty"` -} - -// KubevirtMachineProviderStatus is the type that will be embedded in a Machine.Status.ProviderStatus field. -// It contains Kubevirt-specific status information. -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type KubevirtMachineProviderStatus struct { - metav1.TypeMeta `json:",inline"` - kubevirtapiv1.VirtualMachineStatus -} - -func init() { - SchemeBuilder.Register(&KubevirtMachineProviderSpec{}, &KubevirtMachineProviderStatus{}) -} diff --git a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index eb571b0e64c..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,74 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 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. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubevirtMachineProviderSpec) DeepCopyInto(out *KubevirtMachineProviderSpec) { - *out = *in - out.TypeMeta = in.TypeMeta -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtMachineProviderSpec. -func (in *KubevirtMachineProviderSpec) DeepCopy() *KubevirtMachineProviderSpec { - if in == nil { - return nil - } - out := new(KubevirtMachineProviderSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubevirtMachineProviderSpec) 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 *KubevirtMachineProviderStatus) DeepCopyInto(out *KubevirtMachineProviderStatus) { - *out = *in - out.TypeMeta = in.TypeMeta - in.VirtualMachineStatus.DeepCopyInto(&out.VirtualMachineStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubevirtMachineProviderStatus. -func (in *KubevirtMachineProviderStatus) DeepCopy() *KubevirtMachineProviderStatus { - if in == nil { - return nil - } - out := new(KubevirtMachineProviderStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubevirtMachineProviderStatus) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} diff --git a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/utils/utils.go b/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/utils/utils.go deleted file mode 100644 index f445ffecf48..00000000000 --- a/vendor/github.com/openshift/cluster-api-provider-kubevirt/pkg/utils/utils.go +++ /dev/null @@ -1,9 +0,0 @@ -package utils - -import "fmt" - -func BuildLabels(infraID string) map[string]string { - return map[string]string{ - fmt.Sprintf("tenantcluster-%s-machine.openshift.io", infraID): "owned", - } -} diff --git a/vendor/github.com/openshift/custom-resource-status/LICENSE b/vendor/github.com/openshift/custom-resource-status/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/vendor/github.com/openshift/custom-resource-status/LICENSE +++ /dev/null @@ -1,201 +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: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) 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 - - (d) 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/openshift/custom-resource-status/conditions/v1/_doc.go b/vendor/github.com/openshift/custom-resource-status/conditions/v1/_doc.go deleted file mode 100644 index b657efeaa65..00000000000 --- a/vendor/github.com/openshift/custom-resource-status/conditions/v1/_doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// +k8s:deepcopy-gen=package,register -// +k8s:defaulter-gen=TypeMeta -// +k8s:openapi-gen=true - -// Package v1 provides version v1 of the types and functions necessary to -// manage and inspect a slice of conditions. It is opinionated in the -// condition types provided but leaves it to the user to define additional -// types as necessary. -package v1 diff --git a/vendor/github.com/openshift/custom-resource-status/conditions/v1/conditions.go b/vendor/github.com/openshift/custom-resource-status/conditions/v1/conditions.go deleted file mode 100644 index d32c48d9a77..00000000000 --- a/vendor/github.com/openshift/custom-resource-status/conditions/v1/conditions.go +++ /dev/null @@ -1,82 +0,0 @@ -package v1 - -import ( - "time" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// SetStatusCondition sets the corresponding condition in conditions to newCondition. -func SetStatusCondition(conditions *[]Condition, newCondition Condition) { - if conditions == nil { - conditions = &[]Condition{} - } - existingCondition := FindStatusCondition(*conditions, newCondition.Type) - if existingCondition == nil { - newCondition.LastTransitionTime = metav1.NewTime(time.Now()) - newCondition.LastHeartbeatTime = metav1.NewTime(time.Now()) - *conditions = append(*conditions, newCondition) - return - } - - if existingCondition.Status != newCondition.Status { - existingCondition.Status = newCondition.Status - existingCondition.LastTransitionTime = metav1.NewTime(time.Now()) - } - - existingCondition.Reason = newCondition.Reason - existingCondition.Message = newCondition.Message - existingCondition.LastHeartbeatTime = metav1.NewTime(time.Now()) -} - -// RemoveStatusCondition removes the corresponding conditionType from conditions. -func RemoveStatusCondition(conditions *[]Condition, conditionType ConditionType) { - if conditions == nil { - return - } - newConditions := []Condition{} - for _, condition := range *conditions { - if condition.Type != conditionType { - newConditions = append(newConditions, condition) - } - } - - *conditions = newConditions -} - -// FindStatusCondition finds the conditionType in conditions. -func FindStatusCondition(conditions []Condition, conditionType ConditionType) *Condition { - for i := range conditions { - if conditions[i].Type == conditionType { - return &conditions[i] - } - } - - return nil -} - -// IsStatusConditionTrue returns true when the conditionType is present and set to `corev1.ConditionTrue` -func IsStatusConditionTrue(conditions []Condition, conditionType ConditionType) bool { - return IsStatusConditionPresentAndEqual(conditions, conditionType, corev1.ConditionTrue) -} - -// IsStatusConditionFalse returns true when the conditionType is present and set to `corev1.ConditionFalse` -func IsStatusConditionFalse(conditions []Condition, conditionType ConditionType) bool { - return IsStatusConditionPresentAndEqual(conditions, conditionType, corev1.ConditionFalse) -} - -// IsStatusConditionUnknown returns true when the conditionType is present and set to `corev1.ConditionUnknown` -func IsStatusConditionUnknown(conditions []Condition, conditionType ConditionType) bool { - return IsStatusConditionPresentAndEqual(conditions, conditionType, corev1.ConditionUnknown) -} - -// IsStatusConditionPresentAndEqual returns true when conditionType is present and equal to status. -func IsStatusConditionPresentAndEqual(conditions []Condition, conditionType ConditionType, status corev1.ConditionStatus) bool { - for _, condition := range conditions { - if condition.Type == conditionType { - return condition.Status == status - } - } - return false -} diff --git a/vendor/github.com/openshift/custom-resource-status/conditions/v1/types.go b/vendor/github.com/openshift/custom-resource-status/conditions/v1/types.go deleted file mode 100644 index 950678fb970..00000000000 --- a/vendor/github.com/openshift/custom-resource-status/conditions/v1/types.go +++ /dev/null @@ -1,51 +0,0 @@ -package v1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Condition represents the state of the operator's -// reconciliation functionality. -// +k8s:deepcopy-gen=true -type Condition struct { - Type ConditionType `json:"type" description:"type of condition ie. Available|Progressing|Degraded."` - - Status corev1.ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"` - - // +optional - Reason string `json:"reason,omitempty" description:"one-word CamelCase reason for the condition's last transition"` - - // +optional - Message string `json:"message,omitempty" description:"human-readable message indicating details about last transition"` - - // +optional - LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime" description:"last time we got an update on a given condition"` - - // +optional - LastTransitionTime metav1.Time `json:"lastTransitionTime" description:"last time the condition transit from one status to another"` -} - -// ConditionType is the state of the operator's reconciliation functionality. -type ConditionType string - -const ( - // ConditionAvailable indicates that the resources maintained by the operator, - // is functional and available in the cluster. - ConditionAvailable ConditionType = "Available" - - // ConditionProgressing indicates that the operator is actively making changes to the resources maintained by the - // operator - ConditionProgressing ConditionType = "Progressing" - - // ConditionDegraded indicates that the resources maintained by the operator are not functioning completely. - // An example of a degraded state would be if not all pods in a deployment were running. - // It may still be available, but it is degraded - ConditionDegraded ConditionType = "Degraded" - - // ConditionUpgradeable indicates whether the resources maintained by the operator are in a state that is safe to upgrade. - // When `False`, the resources maintained by the operator should not be upgraded and the - // message field should contain a human readable description of what the administrator should do to - // allow the operator to successfully update the resources maintained by the operator. - ConditionUpgradeable ConditionType = "Upgradeable" -) diff --git a/vendor/github.com/openshift/custom-resource-status/conditions/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/custom-resource-status/conditions/v1/zz_generated.deepcopy.go deleted file mode 100644 index bbbbf863d13..00000000000 --- a/vendor/github.com/openshift/custom-resource-status/conditions/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1 - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Condition) DeepCopyInto(out *Condition) { - *out = *in - in.LastHeartbeatTime.DeepCopyInto(&out.LastHeartbeatTime) - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. -func (in *Condition) DeepCopy() *Condition { - if in == nil { - return nil - } - out := new(Condition) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/k8s.io/kube-openapi/pkg/common/common.go b/vendor/k8s.io/kube-openapi/pkg/common/common.go deleted file mode 100644 index 40be34786cd..00000000000 --- a/vendor/k8s.io/kube-openapi/pkg/common/common.go +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2016 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. -*/ - -package common - -import ( - "net/http" - "strings" - - "github.com/emicklei/go-restful" - "github.com/go-openapi/spec" -) - -const ( - // TODO: Make this configurable. - ExtensionPrefix = "x-kubernetes-" - ExtensionV2Schema = ExtensionPrefix + "v2-schema" -) - -// OpenAPIDefinition describes single type. Normally these definitions are auto-generated using gen-openapi. -type OpenAPIDefinition struct { - Schema spec.Schema - Dependencies []string -} - -type ReferenceCallback func(path string) spec.Ref - -// GetOpenAPIDefinitions is collection of all definitions. -type GetOpenAPIDefinitions func(ReferenceCallback) map[string]OpenAPIDefinition - -// OpenAPIDefinitionGetter gets openAPI definitions for a given type. If a type implements this interface, -// the definition returned by it will be used, otherwise the auto-generated definitions will be used. See -// GetOpenAPITypeFormat for more information about trade-offs of using this interface or GetOpenAPITypeFormat method when -// possible. -type OpenAPIDefinitionGetter interface { - OpenAPIDefinition() *OpenAPIDefinition -} - -type OpenAPIV3DefinitionGetter interface { - OpenAPIV3Definition() *OpenAPIDefinition -} - -type PathHandler interface { - Handle(path string, handler http.Handler) -} - -// Config is set of configuration for openAPI spec generation. -type Config struct { - // List of supported protocols such as https, http, etc. - ProtocolList []string - - // Info is general information about the API. - Info *spec.Info - - // DefaultResponse will be used if an operation does not have any responses listed. It - // will show up as ... "responses" : {"default" : $DefaultResponse} in the spec. - DefaultResponse *spec.Response - - // ResponseDefinitions will be added to "responses" under the top-level swagger object. This is an object - // that holds responses definitions that can be used across operations. This property does not define - // global responses for all operations. For more info please refer: - // https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#fixed-fields - ResponseDefinitions map[string]spec.Response - - // CommonResponses will be added as a response to all operation specs. This is a good place to add common - // responses such as authorization failed. - CommonResponses map[int]spec.Response - - // List of webservice's path prefixes to ignore - IgnorePrefixes []string - - // OpenAPIDefinitions should provide definition for all models used by routes. Failure to provide this map - // or any of the models will result in spec generation failure. - GetDefinitions GetOpenAPIDefinitions - - // GetOperationIDAndTags returns operation id and tags for a restful route. It is an optional function to customize operation IDs. - GetOperationIDAndTags func(r *restful.Route) (string, []string, error) - - // GetDefinitionName returns a friendly name for a definition base on the serving path. parameter `name` is the full name of the definition. - // It is an optional function to customize model names. - GetDefinitionName func(name string) (string, spec.Extensions) - - // PostProcessSpec runs after the spec is ready to serve. It allows a final modification to the spec before serving. - PostProcessSpec func(*spec.Swagger) (*spec.Swagger, error) - - // SecurityDefinitions is list of all security definitions for OpenAPI service. If this is not nil, the user of config - // is responsible to provide DefaultSecurity and (maybe) add unauthorized response to CommonResponses. - SecurityDefinitions *spec.SecurityDefinitions - - // DefaultSecurity for all operations. This will pass as spec.SwaggerProps.Security to OpenAPI. - // For most cases, this will be list of acceptable definitions in SecurityDefinitions. - DefaultSecurity []map[string][]string -} - -type typeInfo struct { - name string - format string - zero interface{} -} - -var schemaTypeFormatMap = map[string]typeInfo{ - "uint": {"integer", "int32", 0.}, - "uint8": {"integer", "byte", 0.}, - "uint16": {"integer", "int32", 0.}, - "uint32": {"integer", "int64", 0.}, - "uint64": {"integer", "int64", 0.}, - "int": {"integer", "int32", 0.}, - "int8": {"integer", "byte", 0.}, - "int16": {"integer", "int32", 0.}, - "int32": {"integer", "int32", 0.}, - "int64": {"integer", "int64", 0.}, - "byte": {"integer", "byte", 0}, - "float64": {"number", "double", 0.}, - "float32": {"number", "float", 0.}, - "bool": {"boolean", "", false}, - "time.Time": {"string", "date-time", ""}, - "string": {"string", "", ""}, - "integer": {"integer", "", 0.}, - "number": {"number", "", 0.}, - "boolean": {"boolean", "", false}, - "[]byte": {"string", "byte", ""}, // base64 encoded characters - "interface{}": {"object", "", interface{}(nil)}, -} - -// This function is a reference for converting go (or any custom type) to a simple open API type,format pair. There are -// two ways to customize spec for a type. If you add it here, a type will be converted to a simple type and the type -// comment (the comment that is added before type definition) will be lost. The spec will still have the property -// comment. The second way is to implement OpenAPIDefinitionGetter interface. That function can customize the spec (so -// the spec does not need to be simple type,format) or can even return a simple type,format (e.g. IntOrString). For simple -// type formats, the benefit of adding OpenAPIDefinitionGetter interface is to keep both type and property documentation. -// Example: -// type Sample struct { -// ... -// // port of the server -// port IntOrString -// ... -// } -// // IntOrString documentation... -// type IntOrString { ... } -// -// Adding IntOrString to this function: -// "port" : { -// format: "string", -// type: "int-or-string", -// Description: "port of the server" -// } -// -// Implement OpenAPIDefinitionGetter for IntOrString: -// -// "port" : { -// $Ref: "#/definitions/IntOrString" -// Description: "port of the server" -// } -// ... -// definitions: -// { -// "IntOrString": { -// format: "string", -// type: "int-or-string", -// Description: "IntOrString documentation..." // new -// } -// } -// -func OpenAPITypeFormat(typeName string) (string, string) { - mapped, ok := schemaTypeFormatMap[typeName] - if !ok { - return "", "" - } - return mapped.name, mapped.format -} - -// Returns the zero-value for the given type along with true if the type -// could be found. -func OpenAPIZeroValue(typeName string) (interface{}, bool) { - mapped, ok := schemaTypeFormatMap[typeName] - if !ok { - return nil, false - } - return mapped.zero, true -} - -func EscapeJsonPointer(p string) string { - // Escaping reference name using rfc6901 - p = strings.Replace(p, "~", "~0", -1) - p = strings.Replace(p, "/", "~1", -1) - return p -} - -func EmbedOpenAPIDefinitionIntoV2Extension(main OpenAPIDefinition, embedded OpenAPIDefinition) OpenAPIDefinition { - if main.Schema.Extensions == nil { - main.Schema.Extensions = make(map[string]interface{}) - } - main.Schema.Extensions[ExtensionV2Schema] = embedded.Schema - return main -} diff --git a/vendor/k8s.io/kube-openapi/pkg/common/doc.go b/vendor/k8s.io/kube-openapi/pkg/common/doc.go deleted file mode 100644 index 2ba6d247b37..00000000000 --- a/vendor/k8s.io/kube-openapi/pkg/common/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2016 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. -*/ - -// package common holds shared code and types between open API code -// generator and spec generator. -package common diff --git a/vendor/kubevirt.io/client-go/LICENSE b/vendor/kubevirt.io/client-go/LICENSE deleted file mode 100644 index 549d874d4f8..00000000000 --- a/vendor/kubevirt.io/client-go/LICENSE +++ /dev/null @@ -1,202 +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: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) 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 - - (d) 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 2017 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. 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 89a0eb3dfd2..00000000000 --- a/vendor/kubevirt.io/client-go/api/v1/deepcopy_generated.go +++ /dev/null @@ -1,2808 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2020 The KubeVirt Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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 ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - types "k8s.io/apimachinery/pkg/types" - - 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 - *out = new(BIOS) - **out = **in - } - if in.EFI != nil { - in, out := &in.EFI, &out.EFI - *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 - *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 *Chassis) DeepCopyInto(out *Chassis) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Chassis. -func (in *Chassis) DeepCopy() *Chassis { - if in == nil { - return nil - } - out := new(Chassis) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Clock) DeepCopyInto(out *Clock) { - *out = *in - in.ClockOffset.DeepCopyInto(&out.ClockOffset) - if in.Timer != nil { - in, out := &in.Timer, &out.Timer - *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 - *out = new(ClockOffsetUTC) - (*in).DeepCopyInto(*out) - } - if in.Timezone != nil { - in, out := &in.Timezone, &out.Timezone - *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 - *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 - *out = new(corev1.LocalObjectReference) - **out = **in - } - if in.NetworkDataSecretRef != nil { - in, out := &in.NetworkDataSecretRef, &out.NetworkDataSecretRef - *out = new(corev1.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 - *out = new(corev1.LocalObjectReference) - **out = **in - } - if in.NetworkDataSecretRef != nil { - in, out := &in.NetworkDataSecretRef, &out.NetworkDataSecretRef - *out = new(corev1.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 - *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 - *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 - *out = new(bool) - **out = **in - } - if in.AutoattachGraphicsDevice != nil { - in, out := &in.AutoattachGraphicsDevice, &out.AutoattachGraphicsDevice - *out = new(bool) - **out = **in - } - if in.AutoattachSerialConsole != nil { - in, out := &in.AutoattachSerialConsole, &out.AutoattachSerialConsole - *out = new(bool) - **out = **in - } - if in.Rng != nil { - in, out := &in.Rng, &out.Rng - *out = new(Rng) - **out = **in - } - if in.BlockMultiQueue != nil { - in, out := &in.BlockMultiQueue, &out.BlockMultiQueue - *out = new(bool) - **out = **in - } - if in.NetworkInterfaceMultiQueue != nil { - in, out := &in.NetworkInterfaceMultiQueue, &out.NetworkInterfaceMultiQueue - *out = new(bool) - **out = **in - } - if in.GPUs != nil { - in, out := &in.GPUs, &out.GPUs - *out = make([]GPU, len(*in)) - copy(*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 - *out = new(uint) - **out = **in - } - if in.DedicatedIOThread != nil { - in, out := &in.DedicatedIOThread, &out.DedicatedIOThread - *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 - *out = new(DiskTarget) - **out = **in - } - if in.LUN != nil { - in, out := &in.LUN, &out.LUN - *out = new(LunTarget) - **out = **in - } - if in.Floppy != nil { - in, out := &in.Floppy, &out.Floppy - *out = new(FloppyTarget) - **out = **in - } - if in.CDRom != nil { - in, out := &in.CDRom, &out.CDRom - *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 - *out = new(CPU) - (*in).DeepCopyInto(*out) - } - if in.Memory != nil { - in, out := &in.Memory, &out.Memory - *out = new(Memory) - (*in).DeepCopyInto(*out) - } - out.Machine = in.Machine - if in.Firmware != nil { - in, out := &in.Firmware, &out.Firmware - *out = new(Firmware) - (*in).DeepCopyInto(*out) - } - if in.Clock != nil { - in, out := &in.Clock, &out.Clock - *out = new(Clock) - (*in).DeepCopyInto(*out) - } - if in.Features != nil { - in, out := &in.Features, &out.Features - *out = new(Features) - (*in).DeepCopyInto(*out) - } - in.Devices.DeepCopyInto(&out.Devices) - if in.IOThreadsPolicy != nil { - in, out := &in.IOThreadsPolicy, &out.IOThreadsPolicy - *out = new(IOThreadsPolicy) - **out = **in - } - if in.Chassis != nil { - in, out := &in.Chassis, &out.Chassis - *out = new(Chassis) - **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 - *out = new(corev1.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 - *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 - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } - if in.VAPIC != nil { - in, out := &in.VAPIC, &out.VAPIC - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } - if in.Spinlocks != nil { - in, out := &in.Spinlocks, &out.Spinlocks - *out = new(FeatureSpinlocks) - (*in).DeepCopyInto(*out) - } - if in.VPIndex != nil { - in, out := &in.VPIndex, &out.VPIndex - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } - if in.Runtime != nil { - in, out := &in.Runtime, &out.Runtime - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } - if in.SyNIC != nil { - in, out := &in.SyNIC, &out.SyNIC - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } - if in.SyNICTimer != nil { - in, out := &in.SyNICTimer, &out.SyNICTimer - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } - if in.Reset != nil { - in, out := &in.Reset, &out.Reset - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } - if in.VendorID != nil { - in, out := &in.VendorID, &out.VendorID - *out = new(FeatureVendorID) - (*in).DeepCopyInto(*out) - } - if in.Frequencies != nil { - in, out := &in.Frequencies, &out.Frequencies - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } - if in.Reenlightenment != nil { - in, out := &in.Reenlightenment, &out.Reenlightenment - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } - if in.TLBFlush != nil { - in, out := &in.TLBFlush, &out.TLBFlush - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } - if in.IPI != nil { - in, out := &in.IPI, &out.IPI - *out = new(FeatureState) - (*in).DeepCopyInto(*out) - } - if in.EVMCS != nil { - in, out := &in.EVMCS, &out.EVMCS - *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 - *out = new(bool) - **out = **in - } - if in.Retries != nil { - in, out := &in.Retries, &out.Retries - *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 - *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 - *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 - *out = new(FeatureAPIC) - (*in).DeepCopyInto(*out) - } - if in.Hyperv != nil { - in, out := &in.Hyperv, &out.Hyperv - *out = new(FeatureHyperv) - (*in).DeepCopyInto(*out) - } - if in.SMM != nil { - in, out := &in.SMM, &out.SMM - *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 - *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 *GPU) DeepCopyInto(out *GPU) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GPU. -func (in *GPU) DeepCopy() *GPU { - if in == nil { - return nil - } - out := new(GPU) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HPETTimer) DeepCopyInto(out *HPETTimer) { - *out = *in - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *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 - *out = new(corev1.HTTPGetAction) - (*in).DeepCopyInto(*out) - } - if in.TCPSocket != nil { - in, out := &in.TCPSocket, &out.TCPSocket - *out = new(corev1.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 - *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 - *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 - *out = new(uint) - **out = **in - } - if in.DHCPOptions != nil { - in, out := &in.DHCPOptions, &out.DHCPOptions - *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 - *out = new(InterfaceBridge) - **out = **in - } - if in.Slirp != nil { - in, out := &in.Slirp, &out.Slirp - *out = new(InterfaceSlirp) - **out = **in - } - if in.Masquerade != nil { - in, out := &in.Masquerade, &out.Masquerade - *out = new(InterfaceMasquerade) - **out = **in - } - if in.SRIOV != nil { - in, out := &in.SRIOV, &out.SRIOV - *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 - *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) - in.Spec.DeepCopyInto(&out.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 *KubeVirtCertificateRotateStrategy) DeepCopyInto(out *KubeVirtCertificateRotateStrategy) { - *out = *in - if in.SelfSigned != nil { - in, out := &in.SelfSigned, &out.SelfSigned - *out = new(KubeVirtSelfSignConfiguration) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeVirtCertificateRotateStrategy. -func (in *KubeVirtCertificateRotateStrategy) DeepCopy() *KubeVirtCertificateRotateStrategy { - if in == nil { - return nil - } - out := new(KubeVirtCertificateRotateStrategy) - in.DeepCopyInto(out) - return out -} - -// 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 - in.ListMeta.DeepCopyInto(&out.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 *KubeVirtSelfSignConfiguration) DeepCopyInto(out *KubeVirtSelfSignConfiguration) { - *out = *in - if in.CARotateInterval != nil { - in, out := &in.CARotateInterval, &out.CARotateInterval - *out = new(metav1.Duration) - **out = **in - } - if in.CertRotateInterval != nil { - in, out := &in.CertRotateInterval, &out.CertRotateInterval - *out = new(metav1.Duration) - **out = **in - } - if in.CAOverlapInterval != nil { - in, out := &in.CAOverlapInterval, &out.CAOverlapInterval - *out = new(metav1.Duration) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeVirtSelfSignConfiguration. -func (in *KubeVirtSelfSignConfiguration) DeepCopy() *KubeVirtSelfSignConfiguration { - if in == nil { - return nil - } - out := new(KubeVirtSelfSignConfiguration) - in.DeepCopyInto(out) - return out -} - -// 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 - in.CertificateRotationStrategy.DeepCopyInto(&out.CertificateRotationStrategy) - 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 - *out = new(Hugepages) - **out = **in - } - if in.Guest != nil { - in, out := &in.Guest, &out.Guest - 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 - *out = new(PodNetwork) - **out = **in - } - if in.Multus != nil { - in, out := &in.Multus, &out.Multus - *out = new(MultusNetwork) - **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 - *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 - *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 *RenameOptions) DeepCopyInto(out *RenameOptions) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.OldName != nil { - in, out := &in.OldName, &out.OldName - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RenameOptions. -func (in *RenameOptions) DeepCopy() *RenameOptions { - if in == nil { - return nil - } - out := new(RenameOptions) - 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(corev1.ResourceList, len(*in)) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make(corev1.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 *RestartOptions) DeepCopyInto(out *RestartOptions) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.GracePeriodSeconds != nil { - in, out := &in.GracePeriodSeconds, &out.GracePeriodSeconds - *out = new(int64) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestartOptions. -func (in *RestartOptions) DeepCopy() *RestartOptions { - if in == nil { - return nil - } - out := new(RestartOptions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Rng) DeepCopyInto(out *Rng) { - *out = *in - 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 - *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 - *out = new(HPETTimer) - (*in).DeepCopyInto(*out) - } - if in.KVM != nil { - in, out := &in.KVM, &out.KVM - *out = new(KVMTimer) - (*in).DeepCopyInto(*out) - } - if in.PIT != nil { - in, out := &in.PIT, &out.PIT - *out = new(PITTimer) - (*in).DeepCopyInto(*out) - } - if in.RTC != nil { - in, out := &in.RTC, &out.RTC - *out = new(RTCTimer) - (*in).DeepCopyInto(*out) - } - if in.Hyperv != nil { - in, out := &in.Hyperv, &out.Hyperv - *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 *VirtualMachineInstanceFileSystem) DeepCopyInto(out *VirtualMachineInstanceFileSystem) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceFileSystem. -func (in *VirtualMachineInstanceFileSystem) DeepCopy() *VirtualMachineInstanceFileSystem { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceFileSystem) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceFileSystemInfo) DeepCopyInto(out *VirtualMachineInstanceFileSystemInfo) { - *out = *in - if in.Filesystems != nil { - in, out := &in.Filesystems, &out.Filesystems - *out = make([]VirtualMachineInstanceFileSystem, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceFileSystemInfo. -func (in *VirtualMachineInstanceFileSystemInfo) DeepCopy() *VirtualMachineInstanceFileSystemInfo { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceFileSystemInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceFileSystemList) DeepCopyInto(out *VirtualMachineInstanceFileSystemList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]VirtualMachineInstanceFileSystem, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceFileSystemList. -func (in *VirtualMachineInstanceFileSystemList) DeepCopy() *VirtualMachineInstanceFileSystemList { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceFileSystemList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachineInstanceFileSystemList) 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 *VirtualMachineInstanceGuestAgentInfo) DeepCopyInto(out *VirtualMachineInstanceGuestAgentInfo) { - *out = *in - out.TypeMeta = in.TypeMeta - out.OS = in.OS - if in.UserList != nil { - in, out := &in.UserList, &out.UserList - *out = make([]VirtualMachineInstanceGuestOSUser, len(*in)) - copy(*out, *in) - } - in.FSInfo.DeepCopyInto(&out.FSInfo) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceGuestAgentInfo. -func (in *VirtualMachineInstanceGuestAgentInfo) DeepCopy() *VirtualMachineInstanceGuestAgentInfo { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceGuestAgentInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachineInstanceGuestAgentInfo) 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 *VirtualMachineInstanceGuestOSInfo) DeepCopyInto(out *VirtualMachineInstanceGuestOSInfo) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceGuestOSInfo. -func (in *VirtualMachineInstanceGuestOSInfo) DeepCopy() *VirtualMachineInstanceGuestOSInfo { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceGuestOSInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceGuestOSUser) DeepCopyInto(out *VirtualMachineInstanceGuestOSUser) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceGuestOSUser. -func (in *VirtualMachineInstanceGuestOSUser) DeepCopy() *VirtualMachineInstanceGuestOSUser { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceGuestOSUser) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VirtualMachineInstanceGuestOSUserList) DeepCopyInto(out *VirtualMachineInstanceGuestOSUserList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]VirtualMachineInstanceGuestOSUser, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineInstanceGuestOSUserList. -func (in *VirtualMachineInstanceGuestOSUserList) DeepCopy() *VirtualMachineInstanceGuestOSUserList { - if in == nil { - return nil - } - out := new(VirtualMachineInstanceGuestOSUserList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *VirtualMachineInstanceGuestOSUserList) 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 *VirtualMachineInstanceList) DeepCopyInto(out *VirtualMachineInstanceList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.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 - in.ListMeta.DeepCopyInto(&out.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 - *out = (*in).DeepCopy() - } - if in.EndTimestamp != nil { - in, out := &in.EndTimestamp, &out.EndTimestamp - *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 - in.ListMeta.DeepCopyInto(&out.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 - *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 - in.ListMeta.DeepCopyInto(&out.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 - *out = new(int32) - **out = **in - } - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(metav1.LabelSelector) - (*in).DeepCopyInto(*out) - } - if in.Template != nil { - in, out := &in.Template, &out.Template - *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 - *out = new(corev1.Affinity) - (*in).DeepCopyInto(*out) - } - if in.Tolerations != nil { - in, out := &in.Tolerations, &out.Tolerations - *out = make([]corev1.Toleration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.EvictionStrategy != nil { - in, out := &in.EvictionStrategy, &out.EvictionStrategy - *out = new(EvictionStrategy) - **out = **in - } - if in.TerminationGracePeriodSeconds != nil { - in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds - *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 - *out = new(Probe) - (*in).DeepCopyInto(*out) - } - if in.ReadinessProbe != nil { - in, out := &in.ReadinessProbe, &out.ReadinessProbe - *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 - *out = new(corev1.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]) - } - } - out.GuestOSInfo = in.GuestOSInfo - if in.MigrationState != nil { - in, out := &in.MigrationState, &out.MigrationState - *out = new(VirtualMachineInstanceMigrationState) - (*in).DeepCopyInto(*out) - } - if in.QOSClass != nil { - in, out := &in.QOSClass, &out.QOSClass - *out = new(corev1.PodQOSClass) - **out = **in - } - if in.ActivePods != nil { - in, out := &in.ActivePods, &out.ActivePods - *out = make(map[types.UID]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - 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 - in.ListMeta.DeepCopyInto(&out.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 - *out = new(bool) - **out = **in - } - if in.RunStrategy != nil { - in, out := &in.RunStrategy, &out.RunStrategy - *out = new(VirtualMachineRunStrategy) - **out = **in - } - if in.Template != nil { - in, out := &in.Template, &out.Template - *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.Data != nil { - in, out := &in.Data, &out.Data - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.UID != nil { - in, out := &in.UID, &out.UID - *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 - *out = new(HostDisk) - (*in).DeepCopyInto(*out) - } - if in.PersistentVolumeClaim != nil { - in, out := &in.PersistentVolumeClaim, &out.PersistentVolumeClaim - *out = new(corev1.PersistentVolumeClaimVolumeSource) - **out = **in - } - if in.CloudInitNoCloud != nil { - in, out := &in.CloudInitNoCloud, &out.CloudInitNoCloud - *out = new(CloudInitNoCloudSource) - (*in).DeepCopyInto(*out) - } - if in.CloudInitConfigDrive != nil { - in, out := &in.CloudInitConfigDrive, &out.CloudInitConfigDrive - *out = new(CloudInitConfigDriveSource) - (*in).DeepCopyInto(*out) - } - if in.ContainerDisk != nil { - in, out := &in.ContainerDisk, &out.ContainerDisk - *out = new(ContainerDiskSource) - **out = **in - } - if in.Ephemeral != nil { - in, out := &in.Ephemeral, &out.Ephemeral - *out = new(EphemeralVolumeSource) - (*in).DeepCopyInto(*out) - } - if in.EmptyDisk != nil { - in, out := &in.EmptyDisk, &out.EmptyDisk - *out = new(EmptyDiskSource) - (*in).DeepCopyInto(*out) - } - if in.DataVolume != nil { - in, out := &in.DataVolume, &out.DataVolume - *out = new(DataVolumeSource) - **out = **in - } - if in.ConfigMap != nil { - in, out := &in.ConfigMap, &out.ConfigMap - *out = new(ConfigMapVolumeSource) - (*in).DeepCopyInto(*out) - } - if in.Secret != nil { - in, out := &in.Secret, &out.Secret - *out = new(SecretVolumeSource) - (*in).DeepCopyInto(*out) - } - if in.ServiceAccount != nil { - in, out := &in.ServiceAccount, &out.ServiceAccount - *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 - *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 ea33b55bed8..00000000000 --- a/vendor/kubevirt.io/client-go/api/v1/defaults.go +++ /dev/null @@ -1,204 +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) -} - -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{*DefaultBridgeNetworkInterface()} - obj.Spec.Networks = []Network{*DefaultPodNetwork()} - } -} - -func DefaultBridgeNetworkInterface() *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 DefaultMasqueradeNetworkInterface() *Interface { - iface := &Interface{ - Name: "default", - InterfaceBindingMethod: InterfaceBindingMethod{ - Masquerade: &InterfaceMasquerade{}, - }, - } - 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 eacf13d3056..00000000000 --- 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 807a4694079..00000000000 --- a/vendor/kubevirt.io/client-go/api/v1/openapi_generated.go +++ /dev/null @@ -1,4123 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2020 The KubeVirt Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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/staging/src/kubevirt.io/client-go/api/v1.BIOS": schema_kubevirtio_client_go_api_v1_BIOS(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Bootloader": schema_kubevirtio_client_go_api_v1_Bootloader(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CDRomTarget": schema_kubevirtio_client_go_api_v1_CDRomTarget(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CPU": schema_kubevirtio_client_go_api_v1_CPU(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CPUFeature": schema_kubevirtio_client_go_api_v1_CPUFeature(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Chassis": schema_kubevirtio_client_go_api_v1_Chassis(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Clock": schema_kubevirtio_client_go_api_v1_Clock(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ClockOffset": schema_kubevirtio_client_go_api_v1_ClockOffset(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ClockOffsetUTC": schema_kubevirtio_client_go_api_v1_ClockOffsetUTC(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CloudInitConfigDriveSource": schema_kubevirtio_client_go_api_v1_CloudInitConfigDriveSource(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CloudInitNoCloudSource": schema_kubevirtio_client_go_api_v1_CloudInitNoCloudSource(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ConfigMapVolumeSource": schema_kubevirtio_client_go_api_v1_ConfigMapVolumeSource(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ContainerDiskSource": schema_kubevirtio_client_go_api_v1_ContainerDiskSource(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DHCPOptions": schema_kubevirtio_client_go_api_v1_DHCPOptions(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DataVolumeSource": schema_kubevirtio_client_go_api_v1_DataVolumeSource(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Devices": schema_kubevirtio_client_go_api_v1_Devices(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Disk": schema_kubevirtio_client_go_api_v1_Disk(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DiskDevice": schema_kubevirtio_client_go_api_v1_DiskDevice(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DiskTarget": schema_kubevirtio_client_go_api_v1_DiskTarget(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DomainSpec": schema_kubevirtio_client_go_api_v1_DomainSpec(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.EFI": schema_kubevirtio_client_go_api_v1_EFI(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.EmptyDiskSource": schema_kubevirtio_client_go_api_v1_EmptyDiskSource(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.EphemeralVolumeSource": schema_kubevirtio_client_go_api_v1_EphemeralVolumeSource(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureAPIC": schema_kubevirtio_client_go_api_v1_FeatureAPIC(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureHyperv": schema_kubevirtio_client_go_api_v1_FeatureHyperv(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureSpinlocks": schema_kubevirtio_client_go_api_v1_FeatureSpinlocks(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureState": schema_kubevirtio_client_go_api_v1_FeatureState(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureVendorID": schema_kubevirtio_client_go_api_v1_FeatureVendorID(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Features": schema_kubevirtio_client_go_api_v1_Features(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Firmware": schema_kubevirtio_client_go_api_v1_Firmware(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FloppyTarget": schema_kubevirtio_client_go_api_v1_FloppyTarget(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.GPU": schema_kubevirtio_client_go_api_v1_GPU(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.HPETTimer": schema_kubevirtio_client_go_api_v1_HPETTimer(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.HostDisk": schema_kubevirtio_client_go_api_v1_HostDisk(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Hugepages": schema_kubevirtio_client_go_api_v1_Hugepages(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.HypervTimer": schema_kubevirtio_client_go_api_v1_HypervTimer(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.I6300ESBWatchdog": schema_kubevirtio_client_go_api_v1_I6300ESBWatchdog(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Input": schema_kubevirtio_client_go_api_v1_Input(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Interface": schema_kubevirtio_client_go_api_v1_Interface(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceBindingMethod": schema_kubevirtio_client_go_api_v1_InterfaceBindingMethod(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceBridge": schema_kubevirtio_client_go_api_v1_InterfaceBridge(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceMasquerade": schema_kubevirtio_client_go_api_v1_InterfaceMasquerade(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceSRIOV": schema_kubevirtio_client_go_api_v1_InterfaceSRIOV(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceSlirp": schema_kubevirtio_client_go_api_v1_InterfaceSlirp(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KVMTimer": schema_kubevirtio_client_go_api_v1_KVMTimer(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirt": schema_kubevirtio_client_go_api_v1_KubeVirt(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtCondition": schema_kubevirtio_client_go_api_v1_KubeVirtCondition(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtList": schema_kubevirtio_client_go_api_v1_KubeVirtList(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtSpec": schema_kubevirtio_client_go_api_v1_KubeVirtSpec(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtStatus": schema_kubevirtio_client_go_api_v1_KubeVirtStatus(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.LunTarget": schema_kubevirtio_client_go_api_v1_LunTarget(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Machine": schema_kubevirtio_client_go_api_v1_Machine(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Memory": schema_kubevirtio_client_go_api_v1_Memory(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.MultusNetwork": schema_kubevirtio_client_go_api_v1_MultusNetwork(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Network": schema_kubevirtio_client_go_api_v1_Network(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.NetworkSource": schema_kubevirtio_client_go_api_v1_NetworkSource(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.PITTimer": schema_kubevirtio_client_go_api_v1_PITTimer(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.PodNetwork": schema_kubevirtio_client_go_api_v1_PodNetwork(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Port": schema_kubevirtio_client_go_api_v1_Port(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.RTCTimer": schema_kubevirtio_client_go_api_v1_RTCTimer(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ResourceRequirements": schema_kubevirtio_client_go_api_v1_ResourceRequirements(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.RestartOptions": schema_kubevirtio_client_go_api_v1_RestartOptions(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Rng": schema_kubevirtio_client_go_api_v1_Rng(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.SecretVolumeSource": schema_kubevirtio_client_go_api_v1_SecretVolumeSource(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ServiceAccountVolumeSource": schema_kubevirtio_client_go_api_v1_ServiceAccountVolumeSource(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Timer": schema_kubevirtio_client_go_api_v1_Timer(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachine": schema_kubevirtio_client_go_api_v1_VirtualMachine(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineCondition": schema_kubevirtio_client_go_api_v1_VirtualMachineCondition(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstance": schema_kubevirtio_client_go_api_v1_VirtualMachineInstance(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceCondition": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceCondition(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceFileSystemList": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceFileSystemList(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceGuestAgentInfo": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceGuestAgentInfo(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceGuestOSUserList": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceGuestOSUserList(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceList": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceList(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigration": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceMigration(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationCondition": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceMigrationCondition(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationList": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceMigrationList(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationSpec": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceMigrationSpec(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationStatus": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceMigrationStatus(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceNetworkInterface": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceNetworkInterface(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstancePreset": schema_kubevirtio_client_go_api_v1_VirtualMachineInstancePreset(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstancePresetList": schema_kubevirtio_client_go_api_v1_VirtualMachineInstancePresetList(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstancePresetSpec": schema_kubevirtio_client_go_api_v1_VirtualMachineInstancePresetSpec(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSet": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceReplicaSet(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSetCondition": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceReplicaSetCondition(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSetList": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceReplicaSetList(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSetSpec": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceReplicaSetSpec(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSetStatus": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceReplicaSetStatus(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceSpec": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceSpec(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceStatus": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceStatus(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceTemplateSpec": schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceTemplateSpec(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineList": schema_kubevirtio_client_go_api_v1_VirtualMachineList(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineSpec": schema_kubevirtio_client_go_api_v1_VirtualMachineSpec(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineStatus": schema_kubevirtio_client_go_api_v1_VirtualMachineStatus(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Volume": schema_kubevirtio_client_go_api_v1_Volume(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VolumeSource": schema_kubevirtio_client_go_api_v1_VolumeSource(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Watchdog": schema_kubevirtio_client_go_api_v1_Watchdog(ref), - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.WatchdogDevice": schema_kubevirtio_client_go_api_v1_WatchdogDevice(ref), - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "bios": { - SchemaProps: spec.SchemaProps{ - Description: "If set (default), BIOS will be used.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.BIOS"), - }, - }, - "efi": { - SchemaProps: spec.SchemaProps{ - Description: "If set, EFI will be used instead of BIOS.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.EFI"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.BIOS", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.EFI"}, - } -} - -func schema_kubevirtio_client_go_api_v1_CDRomTarget(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_CPU(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CPU allows specifying the CPU topology.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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: "", - }, - }, - "isolateEmulatorThread": { - SchemaProps: spec.SchemaProps{ - Description: "IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place the emulator thread on it.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CPUFeature"}, - } -} - -func schema_kubevirtio_client_go_api_v1_CPUFeature(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CPUFeature allows specifying a CPU feature.", - Type: []string{"object"}, - 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"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_Chassis(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Chassis specifies the chassis info passed to the domain.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "manufacturer": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "serial": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "asset": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "sku": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.ClockOffsetUTC"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.ClockOffsetUTC"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_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", - Type: []string{"object"}, - 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_kubevirtio_client_go_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", - Type: []string{"object"}, - 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_kubevirtio_client_go_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", - Type: []string{"object"}, - 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: "", - }, - }, - "volumeLabel": { - SchemaProps: spec.SchemaProps{ - Description: "The volume label of the resulting disk inside the VMI. Different bootstrapping mechanisms require different values. Typical values are \"cidata\" (cloud-init), \"config-2\" (cloud-init) or \"OEMDRV\" (kickstart).", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/api/v1.DHCPPrivateOptions"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DHCPPrivateOptions"}, - } -} - -func schema_kubevirtio_client_go_api_v1_DataVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_Devices(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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: "", - }, - }, - "autoattachSerialConsole": { - SchemaProps: spec.SchemaProps{ - Description: "Whether to attach the default serial console or not. Serial console access 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/staging/src/kubevirt.io/client-go/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: "", - }, - }, - "gpus": { - SchemaProps: spec.SchemaProps{ - Description: "Whether to attach a GPU device to the vmi.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.GPU"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Disk", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.GPU", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Input", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Interface", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Rng", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Watchdog"}, - } -} - -func schema_kubevirtio_client_go_api_v1_Disk(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/api/v1.DiskTarget"), - }, - }, - "lun": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a LUN to the vmi.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.LunTarget"), - }, - }, - "floppy": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a floppy to the vmi.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FloppyTarget"), - }, - }, - "cdrom": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a cdrom to the vmi.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/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: "", - }, - }, - "tag": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, disk address and its tag will be provided to the guest via config drive metadata", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CDRomTarget", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DiskTarget", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FloppyTarget", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.LunTarget"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "disk": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a disk to the vmi.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DiskTarget"), - }, - }, - "lun": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a LUN to the vmi.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.LunTarget"), - }, - }, - "floppy": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a floppy to the vmi.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FloppyTarget"), - }, - }, - "cdrom": { - SchemaProps: spec.SchemaProps{ - Description: "Attach a volume as a cdrom to the vmi.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CDRomTarget"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CDRomTarget", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DiskTarget", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FloppyTarget", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.LunTarget"}, - } -} - -func schema_kubevirtio_client_go_api_v1_DiskTarget(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_DomainSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "resources": { - SchemaProps: spec.SchemaProps{ - Description: "Resources describes the Compute Resources required by this vmi.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ResourceRequirements"), - }, - }, - "cpu": { - SchemaProps: spec.SchemaProps{ - Description: "CPU allow specified the detailed CPU topology inside the vmi.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CPU"), - }, - }, - "memory": { - SchemaProps: spec.SchemaProps{ - Description: "Memory allow specifying the VMI memory features.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Memory"), - }, - }, - "machine": { - SchemaProps: spec.SchemaProps{ - Description: "Machine type.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Machine"), - }, - }, - "firmware": { - SchemaProps: spec.SchemaProps{ - Description: "Firmware.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Firmware"), - }, - }, - "clock": { - SchemaProps: spec.SchemaProps{ - Description: "Clock sets the clock and timers of the vmi.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Clock"), - }, - }, - "features": { - SchemaProps: spec.SchemaProps{ - Description: "Features like acpi, apic, hyperv, smm.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Features"), - }, - }, - "devices": { - SchemaProps: spec.SchemaProps{ - Description: "Devices allows adding disks, network interfaces, ...", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/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: "", - }, - }, - "chassis": { - SchemaProps: spec.SchemaProps{ - Description: "Chassis specifies the chassis info passed to the domain.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Chassis"), - }, - }, - }, - Required: []string{"devices"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CPU", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Chassis", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Clock", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Devices", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Features", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Firmware", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Machine", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Memory", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ResourceRequirements"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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_kubevirtio_client_go_api_v1_EphemeralVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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_kubevirtio_client_go_api_v1_FeatureAPIC(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_FeatureHyperv(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Hyperv specific features.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.FeatureState"), - }, - }, - "spinlocks": { - SchemaProps: spec.SchemaProps{ - Description: "Spinlocks allows to configure the spinlock retry attempts.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.FeatureState"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureSpinlocks", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureState", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureVendorID"}, - } -} - -func schema_kubevirtio_client_go_api_v1_FeatureSpinlocks(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_FeatureVendorID(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_Features(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "acpi": { - SchemaProps: spec.SchemaProps{ - Description: "ACPI enables/disables ACPI insidejsondata guest. Defaults to enabled.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureState"), - }, - }, - "apic": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureAPIC"), - }, - }, - "hyperv": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to the machine type setting.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureHyperv"), - }, - }, - "smm": { - SchemaProps: spec.SchemaProps{ - Description: "SMM enables/disables System Management Mode. TSEG not yet implemented.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureState"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureAPIC", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureHyperv", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.FeatureState"}, - } -} - -func schema_kubevirtio_client_go_api_v1_Firmware(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/api/v1.Bootloader"), - }, - }, - "serial": { - SchemaProps: spec.SchemaProps{ - Description: "The system-serial-number in SMBIOS", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Bootloader"}, - } -} - -func schema_kubevirtio_client_go_api_v1_FloppyTarget(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_GPU(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the GPU device as exposed by a device plugin", - Type: []string{"string"}, - Format: "", - }, - }, - "deviceName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "deviceName"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_HPETTimer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_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", - Type: []string{"object"}, - 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_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_HypervTimer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_I6300ESBWatchdog(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "i6300esb watchdog device.", - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_Input(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_Interface(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/api/v1.InterfaceBridge"), - }, - }, - "slirp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceSlirp"), - }, - }, - "masquerade": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceMasquerade"), - }, - }, - "sriov": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.DHCPOptions"), - }, - }, - "tag": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the virtual network interface address and its tag will be provided to the guest via config drive", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DHCPOptions", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceBridge", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceMasquerade", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceSRIOV", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceSlirp", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Port"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "bridge": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceBridge"), - }, - }, - "slirp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceSlirp"), - }, - }, - "masquerade": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceMasquerade"), - }, - }, - "sriov": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceSRIOV"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceBridge", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceMasquerade", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceSRIOV", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.InterfaceSlirp"}, - } -} - -func schema_kubevirtio_client_go_api_v1_InterfaceBridge(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_InterfaceMasquerade(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_InterfaceSRIOV(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_InterfaceSlirp(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_KVMTimer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_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", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtStatus"}, - } -} - -func schema_kubevirtio_client_go_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", - Type: []string{"object"}, - 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_kubevirtio_client_go_api_v1_KubeVirtList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "KubeVirtList is a list of KubeVirts", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/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/staging/src/kubevirt.io/client-go/api/v1.KubeVirt"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirt"}, - } -} - -func schema_kubevirtio_client_go_api_v1_KubeVirtSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - "monitorNamespace": { - SchemaProps: spec.SchemaProps{ - Description: "The namespace Prometheus is deployed in Defaults to openshift-monitor", - Type: []string{"string"}, - Format: "", - }, - }, - "monitorAccount": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the Prometheus service account that needs read-access to KubeVirt endpoints Defaults to prometheus-k8s", - Type: []string{"string"}, - Format: "", - }, - }, - "uninstallStrategy": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies if kubevirt can be deleted if workloads are still present. This is mainly a precaution to avoid accidental data loss", - Type: []string{"string"}, - Format: "", - }, - }, - "certificateRotateStrategy": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtCertificateRotateStrategy"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtCertificateRotateStrategy"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/api/v1.KubeVirtCondition"), - }, - }, - }, - }, - }, - "operatorVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "targetKubeVirtRegistry": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "targetKubeVirtVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "targetDeploymentConfig": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "targetDeploymentID": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "observedKubeVirtRegistry": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "observedKubeVirtVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "observedDeploymentConfig": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "observedDeploymentID": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KubeVirtCondition"}, - } -} - -func schema_kubevirtio_client_go_api_v1_LunTarget(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_Machine(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.Hugepages"}, - } -} - -func schema_kubevirtio_client_go_api_v1_MultusNetwork(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the multus cni network.", - Type: []string{"object"}, - 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"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/api/v1.PodNetwork"), - }, - }, - "multus": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.MultusNetwork"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.MultusNetwork", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.PodNetwork"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "pod": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.PodNetwork"), - }, - }, - "multus": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.MultusNetwork"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.MultusNetwork", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.PodNetwork"}, - } -} - -func schema_kubevirtio_client_go_api_v1_PITTimer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_PodNetwork(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the stock pod network interface.", - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_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", - Type: []string{"object"}, - 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"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_RTCTimer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_ResourceRequirements(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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{ - Allows: true, - 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{ - Allows: true, - 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 container's memory limit. 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_kubevirtio_client_go_api_v1_RestartOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RestartOptions may be provided when deleting an API object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "gracePeriodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "The duration in seconds before the object should be force-restared. Value must be non-negative integer. The value zero indicates, restart immediately. If this value is nil, the default grace period for deletion of the corresponding VMI for the specified type will be used to determine on how much time to give the VMI to restart. Defaults to a per object value if not specified. zero means restart immediately. Allowed Values: nil and 0", - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_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", - Type: []string{"object"}, - }, - }, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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: "", - }, - }, - "volumeLabel": { - SchemaProps: spec.SchemaProps{ - Description: "The volume label of the resulting disk inside the VMI. Different bootstrapping mechanisms require different values. Typical values are \"cidata\" (cloud-init), \"config-2\" (cloud-init) or \"OEMDRV\" (kickstart).", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.KVMTimer"), - }, - }, - "pit": { - SchemaProps: spec.SchemaProps{ - Description: "PIT (Programmable Interval Timer) - a timer with periodic interrupts.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.PITTimer"), - }, - }, - "rtc": { - SchemaProps: spec.SchemaProps{ - Description: "RTC (Real Time Clock) - a continuously running timer with periodic interrupts.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.HypervTimer"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.HPETTimer", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.HypervTimer", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.KVMTimer", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.PITTimer", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.RTCTimer"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec contains the specification of VirtualMachineInstance created", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineStatus"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineCondition represents the state of VirtualMachine", - Type: []string{"object"}, - 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_kubevirtio_client_go_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.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstance Spec contains the VirtualMachineInstance specification.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceStatus"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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_kubevirtio_client_go_api_v1_VirtualMachineInstanceFileSystemList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstanceFileSystemList comprises the list of all filesystems on guest machine", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceFileSystem"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceFileSystem"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceGuestAgentInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstanceGuestAgentInfo represents information from the installed guest agent", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "guestAgentVersion": { - SchemaProps: spec.SchemaProps{ - Description: "GAVersion is a version of currently installed guest agent", - Type: []string{"string"}, - Format: "", - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "Hostname represents FQDN of a guest", - Type: []string{"string"}, - Format: "", - }, - }, - "os": { - SchemaProps: spec.SchemaProps{ - Description: "OS contains the guest operating system information", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceGuestOSInfo"), - }, - }, - "timezone": { - SchemaProps: spec.SchemaProps{ - Description: "Timezone is guest os current timezone", - Type: []string{"string"}, - Format: "", - }, - }, - "userList": { - SchemaProps: spec.SchemaProps{ - Description: "UserList is a list of active guest OS users", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceGuestOSUser"), - }, - }, - }, - }, - }, - "fsInfo": { - SchemaProps: spec.SchemaProps{ - Description: "FSInfo is a guest os filesystem information containing the disk mapping and disk mounts with usage", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceFileSystemInfo"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceFileSystemInfo", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceGuestOSInfo", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceGuestOSUser"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceGuestOSUserList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstanceGuestOSUserList comprises the list of all active users on guest machine", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceGuestOSUser"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceGuestOSUser"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstanceList is a list of VirtualMachines", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstance"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstance"}, - } -} - -func schema_kubevirtio_client_go_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", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationStatus"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceMigrationCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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_kubevirtio_client_go_api_v1_VirtualMachineInstanceMigrationList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstanceMigrationList is a list of VirtualMachineMigrations", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigration"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigration"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceMigrationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationCondition"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationCondition"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceNetworkInterface(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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: "", - }, - }, - }, - }, - }, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstancePreset(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstance Spec contains the VirtualMachineInstance specification.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstancePresetSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstancePresetSpec"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstancePresetList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstancePresetList is a list of VirtualMachinePresets", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstancePreset"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstancePreset"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstancePresetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/api/v1.DomainSpec"), - }, - }, - }, - Required: []string{"selector"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DomainSpec"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineInstance Spec contains the VirtualMachineInstance specification.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSetStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSetSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSetStatus"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceReplicaSetCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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_kubevirtio_client_go_api_v1_VirtualMachineInstanceReplicaSetList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VMIList is a list of VMIs", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSet"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSet"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceReplicaSetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceTemplateSpec"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceReplicaSetStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceReplicaSetCondition"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "priorityClassName": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, indicates the pod's priority. If not specified, the pod priority will be default or zero if there is no default.", - Type: []string{"string"}, - Format: "", - }, - }, - "domain": { - SchemaProps: spec.SchemaProps{ - Description: "Specification of the desired behavior of the VirtualMachineInstance on the host.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/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{ - Allows: true, - 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"), - }, - }, - "schedulerName": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the VMI will be dispatched by specified scheduler. If not specified, the VMI will be dispatched by default scheduler.", - Type: []string{"string"}, - Format: "", - }, - }, - "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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.DomainSpec", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Network", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Probe", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.Volume"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceNetworkInterface"), - }, - }, - }, - }, - }, - "guestOSInfo": { - SchemaProps: spec.SchemaProps{ - Description: "Guest OS Information", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceGuestOSInfo"), - }, - }, - "migrationState": { - SchemaProps: spec.SchemaProps{ - Description: "Represents the status of a live migration", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/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: "", - }, - }, - "qosClass": { - SchemaProps: spec.SchemaProps{ - Description: "The Quality of Service (QOS) classification assigned to the virtual machine instance based on resource requirements See PodQOSClass type for available QOS classes More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md", - Type: []string{"string"}, - Format: "", - }, - }, - "activePods": { - SchemaProps: spec.SchemaProps{ - Description: "ActivePods is a mapping of pod UID to node name. It is possible for multiple pods to be running for a single VMI during migration.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceCondition", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceGuestOSInfo", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceMigrationState", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceNetworkInterface"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineInstanceTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceSpec"}, - } -} - -func schema_kubevirtio_client_go_api_v1_VirtualMachineList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VirtualMachineList is a list of virtualmachines", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/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/sig-architecture/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachine"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachine"}, - } -} - -func schema_kubevirtio_client_go_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", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineInstanceTemplateSpec"}, - } -} - -func schema_kubevirtio_client_go_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", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineStateChangeRequest"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineCondition", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.VirtualMachineStateChangeRequest"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.ServiceAccountVolumeSource"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CloudInitConfigDriveSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CloudInitNoCloudSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ConfigMapVolumeSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ContainerDiskSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DataVolumeSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.EmptyDiskSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.EphemeralVolumeSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.HostDisk", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.SecretVolumeSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ServiceAccountVolumeSource"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "hostDisk": { - SchemaProps: spec.SchemaProps{ - Description: "HostDisk represents a disk created on the cluster level", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/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/staging/src/kubevirt.io/client-go/api/v1.ServiceAccountVolumeSource"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CloudInitConfigDriveSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.CloudInitNoCloudSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ConfigMapVolumeSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ContainerDiskSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.DataVolumeSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.EmptyDiskSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.EphemeralVolumeSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.HostDisk", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.SecretVolumeSource", "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.ServiceAccountVolumeSource"}, - } -} - -func schema_kubevirtio_client_go_api_v1_Watchdog(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Named watchdog device.", - Type: []string{"object"}, - 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/staging/src/kubevirt.io/client-go/api/v1.I6300ESBWatchdog"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.I6300ESBWatchdog"}, - } -} - -func schema_kubevirtio_client_go_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.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "i6300esb": { - SchemaProps: spec.SchemaProps{ - Description: "i6300esb watchdog device.", - Ref: ref("kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.I6300ESBWatchdog"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/kubevirt/staging/src/kubevirt.io/client-go/api/v1.I6300ESBWatchdog"}, - } -} diff --git a/vendor/kubevirt.io/client-go/api/v1/register.go b/vendor/kubevirt.io/client-go/api/v1/register.go deleted file mode 100644 index 290e6b45d46..00000000000 --- a/vendor/kubevirt.io/client-go/api/v1/register.go +++ /dev/null @@ -1,116 +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 2019 Red Hat, Inc. - * - */ -package v1 - -import ( - extv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/client-go/kubernetes/scheme" -) - -// GroupName is the group name use in this package -const GroupName = "kubevirt.io" -const SubresourceGroupName = "subresources.kubevirt.io" - -var ( - ApiLatestVersion = "v1alpha3" - ApiSupportedWebhookVersions = []string{"v1alpha3"} - ApiStorageVersion = "v1alpha3" - ApiSupportedVersions = []extv1beta1.CustomResourceDefinitionVersion{ - { - Name: "v1alpha3", - Served: true, - Storage: true, - }, - } -) - -var ( - // GroupVersion is the latest group version for the KubeVirt api - GroupVersion = schema.GroupVersion{Group: GroupName, Version: ApiLatestVersion} - - // StorageGroupVersion is the group version our api is persistented internally as - StorageGroupVersion = schema.GroupVersion{Group: GroupName, Version: ApiStorageVersion} - - // GroupVersions is group version list used to register these objects - // The preferred group version is the first item in the list. - GroupVersions = []schema.GroupVersion{GroupVersion} - - // SubresourceGroupVersions is group version list used to register these objects - // The preferred group version is the first item in the list. - SubresourceGroupVersions = []schema.GroupVersion{{Group: SubresourceGroupName, Version: "v1alpha3"}} - - // SubresourceStorageGroupVersion is the group version our api is persistented internally as - SubresourceStorageGroupVersion = schema.GroupVersion{Group: SubresourceGroupName, Version: ApiStorageVersion} -) - -var ( - // GroupVersionKind - VirtualMachineInstanceGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachineInstance"} - VirtualMachineInstanceReplicaSetGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachineInstanceReplicaSet"} - VirtualMachineInstancePresetGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachineInstancePreset"} - VirtualMachineGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachine"} - VirtualMachineInstanceMigrationGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VirtualMachineInstanceMigration"} - KubeVirtGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "KubeVirt"} -) - -var ( - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - Scheme = runtime.NewScheme() - AddToScheme = SchemeBuilder.AddToScheme - Codecs = serializer.NewCodecFactory(Scheme) - ParameterCodec = runtime.NewParameterCodec(Scheme) -) - -func init() { - AddToScheme(Scheme) - AddToScheme(scheme.Scheme) -} - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - - for _, groupVersion := range GroupVersions { - scheme.AddKnownTypes(groupVersion, - &VirtualMachineInstance{}, - &VirtualMachineInstanceList{}, - &VirtualMachineInstanceReplicaSet{}, - &VirtualMachineInstanceReplicaSetList{}, - &VirtualMachineInstancePreset{}, - &VirtualMachineInstancePresetList{}, - &VirtualMachineInstanceMigration{}, - &VirtualMachineInstanceMigrationList{}, - &VirtualMachine{}, - &VirtualMachineList{}, - &KubeVirt{}, - &KubeVirtList{}, - ) - metav1.AddToGroupVersion(scheme, groupVersion) - } - - return nil -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return GroupVersion.WithResource(resource).GroupResource() -} diff --git a/vendor/kubevirt.io/client-go/api/v1/schema.go b/vendor/kubevirt.io/client-go/api/v1/schema.go deleted file mode 100644 index 0e86ab184b3..00000000000 --- a/vendor/kubevirt.io/client-go/api/v1/schema.go +++ /dev/null @@ -1,1107 +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/staging/src/kubevirt.io/client-go/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"` - // The volume label of the resulting disk inside the VMI. - // Different bootstrapping mechanisms require different values. - // Typical values are "cidata" (cloud-init), "config-2" (cloud-init) or "OEMDRV" (kickstart). - // +optional - VolumeLabel string `json:"volumeLabel,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"` - // The volume label of the resulting disk inside the VMI. - // Different bootstrapping mechanisms require different values. - // Typical values are "cidata" (cloud-init), "config-2" (cloud-init) or "OEMDRV" (kickstart). - // +optional - VolumeLabel string `json:"volumeLabel,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"` - // Chassis specifies the chassis info passed to the domain. - // +optional - Chassis *Chassis `json:"chassis,omitempty"` -} - -// Chassis specifies the chassis info passed to the domain. -// --- -// +k8s:openapi-gen=true -type Chassis struct { - Manufacturer string `json:"manufacturer,omitempty"` - Version string `json:"version,omitempty"` - Serial string `json:"serial,omitempty"` - Asset string `json:"asset,omitempty"` - Sku string `json:"sku,omitempty"` -} - -// Represents the firmware blob used to assist in the domain creation process. -// 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 container's memory limit. 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"` - // IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place - // the emulator thread on it. - // +optional - IsolateEmulatorThread bool `json:"isolateEmulatorThread,omitempty"` -} - -// CPUFeature allows specifying a CPU feature. -// --- -// +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 attach the default serial console or not. - // Serial console access will not be available if set to false. Defaults to true. - AutoattachSerialConsole *bool `json:"autoattachSerialConsole,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"` - //Whether to attach a GPU device to the vmi. - // +optional - GPUs []GPU `json:"gpus,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 GPU struct { - // Name of the GPU device as exposed by a device plugin - Name string `json:"name"` - DeviceName string `json:"deviceName"` -} - -// --- -// +k8s:openapi-gen=true -type Disk struct { - // 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"` - // If specified, disk address and its tag will be provided to the guest via config drive metadata - // +optional - Tag string `json:"tag,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"` -} - -// --- -// +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"` - // If specified, the virtual network interface address and its tag will be provided to the guest via config drive - // +optional - Tag string `json:"tag,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"` -} - -// 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 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 083c10558ce..00000000000 --- a/vendor/kubevirt.io/client-go/api/v1/schema_swagger_generated.go +++ /dev/null @@ -1,535 +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", - "volumeLabel": "The volume label of the resulting disk inside the VMI.\nDifferent bootstrapping mechanisms require different values.\nTypical values are \"cidata\" (cloud-init), \"config-2\" (cloud-init) or \"OEMDRV\" (kickstart).\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", - "volumeLabel": "The volume label of the resulting disk inside the VMI.\nDifferent bootstrapping mechanisms require different values.\nTypical values are \"cidata\" (cloud-init), \"config-2\" (cloud-init) or \"OEMDRV\" (kickstart).\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", - "chassis": "Chassis specifies the chassis info passed to the domain.\n+optional", - } -} - -func (Chassis) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Chassis specifies the chassis info passed to the domain.", - } -} - -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 container's memory limit. 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", - "isolateEmulatorThread": "IsolateEmulatorThread requests one more dedicated pCPU to be allocated for the VMI to place\nthe emulator thread on 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.", - "autoattachSerialConsole": "Whether to attach the default serial console or not.\nSerial console access 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", - "gpus": "Whether to attach a GPU device to the vmi.\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 (GPU) SwaggerDoc() map[string]string { - return map[string]string{ - "name": "Name of the GPU device as exposed by a device plugin", - } -} - -func (Disk) SwaggerDoc() map[string]string { - return map[string]string{ - "name": "Name is the device name", - "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", - "tag": "If specified, disk address and its tag will be provided to the guest via config drive metadata\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", - "tag": "If specified, the virtual network interface address and its tag will be provided to the guest via config drive\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 (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 28c9348c424..00000000000 --- a/vendor/kubevirt.io/client-go/api/v1/types.go +++ /dev/null @@ -1,1262 +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/staging/src/kubevirt.io/client-go/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" - - k8sv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - - cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1" -) - -const DefaultGracePeriodSeconds int64 = 30 - -// 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"` - // +k8s:openapi-gen=false - metav1.ObjectMeta `json:"metadata,omitempty"` - // VirtualMachineInstance Spec contains the VirtualMachineInstance specification. - Spec VirtualMachineInstanceSpec `json:"spec" valid:"required"` - // Status is the high level overview of how the VirtualMachineInstance is doing. It contains information available to controllers and users. - Status VirtualMachineInstanceStatus `json:"status,omitempty"` -} - -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"` - 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 { - // If specified, indicates the pod's priority. - // If not specified, the pod priority will be default or zero if there is no - // default. - // +optional - PriorityClassName string `json:"priorityClassName,omitempty"` - - // 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 specified, the VMI will be dispatched by specified scheduler. - // If not specified, the VMI will be dispatched by default scheduler. - // +optional - SchedulerName string `json:"schedulerName,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"` - // Guest OS Information - GuestOSInfo VirtualMachineInstanceGuestOSInfo `json:"guestOSInfo,omitempty"` - // Represents the status of a live migration - MigrationState *VirtualMachineInstanceMigrationState `json:"migrationState,omitempty"` - // Represents the method using which the vmi can be migrated: live migration or block migration - MigrationMethod VirtualMachineInstanceMigrationMethod `json:"migrationMethod,omitempty"` - // The Quality of Service (QOS) classification assigned to the virtual machine instance based on resource requirements - // See PodQOSClass type for available QOS classes - // More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md - // +optional - QOSClass *k8sv1.PodQOSClass `json:"qosClass,omitempty"` - - // ActivePods is a mapping of pod UID to node name. - // It is possible for multiple pods to be running for a single VMI during migration. - ActivePods map[types.UID]string `json:"activePods,omitempty"` -} - -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 -} - -// WantsToHaveQOSGuaranteed checks if cpu and memoyr limits and requests are identical on the VMI. -// This is the indicator that people want a VMI with QOS of guaranteed -func (v *VirtualMachineInstance) WantsToHaveQOSGuaranteed() bool { - resources := v.Spec.Domain.Resources - return !resources.Requests.Memory().IsZero() && resources.Requests.Memory().Cmp(*resources.Limits.Memory()) == 0 && - !resources.Requests.Cpu().IsZero() && resources.Requests.Cpu().Cmp(*resources.Limits.Cpu()) == 0 -} - -// --- -// +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" - - // If the VMI was paused by the user, this is reported as true. - VirtualMachineInstancePaused VirtualMachineInstanceConditionType = "Paused" - - // Reflects whether the QEMU guest agent is connected through the channel - VirtualMachineInstanceAgentConnected VirtualMachineInstanceConditionType = "AgentConnected" - - // Reflects whether the QEMU guest agent is connected through the channel - VirtualMachineInstanceUnsupportedAgent VirtualMachineInstanceConditionType = "AgentVersionNotSupported" - - // 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" - // Reason means that VMI is not live migratioable because of it's network interfaces collection - VirtualMachineInstanceReasonInterfaceNotMigratable = "InterfaceNotLiveMigratable" -) - -// +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 VirtualMachineInstanceGuestOSInfo struct { - // Name of the Guest OS - Name string `json:"name,omitempty"` - // Guest OS Kernel Release - KernelRelease string `json:"kernelRelease,omitempty"` - // Guest OS Version - Version string `json:"version,omitempty"` - // Guest OS Pretty Name - PrettyName string `json:"prettyName,omitempty"` - // Version ID of the Guest OS - VersionID string `json:"versionId,omitempty"` - // Kernel version of the Guest OS - KernelVersion string `json:"kernelVersion,omitempty"` - // Machine type of the Guest OS - Machine string `json:"machine,omitempty"` - // Guest OS Id - ID string `json:"id,omitempty"` -} - -type VirtualMachineInstanceMigrationState struct { - // The time the migration action began - StartTimestamp *metav1.Time `json:"startTimestamp,omitempty"` - // 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" - ControllerAPILatestVersionObservedAnnotation string = "kubevirt.io/latest-observed-api-version" - ControllerAPIStorageVersionObservedAnnotation string = "kubevirt.io/storage-observed-api-version" - // 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 the kubevirt deployment identifier used for an install strategy configmap. - InstallStrategyIdentifierAnnotation = "kubevirt.io/install-strategy-identifier" - // 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" - PlacePCIDevicesOnRootComplex string = "kubevirt.io/placePCIDevicesOnRootComplex" - - VirtualMachineLabel = AppLabel + "/vm" -) - -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) -} - -// 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"` - // +k8s:openapi-gen=false - metav1.ObjectMeta `json:"metadata,omitempty"` - // VirtualMachineInstance Spec contains the VirtualMachineInstance specification. - Spec VirtualMachineInstanceReplicaSetSpec `json:"spec" valid:"required"` - // Status is the high level overview of how the VirtualMachineInstance is doing. It contains information available to controllers and users. - Status VirtualMachineInstanceReplicaSetStatus `json:"status,omitempty"` -} - -// 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"` - 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"` -} - -// 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"` - // +k8s:openapi-gen=false - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec VirtualMachineInstanceMigrationSpec `json:"spec" valid:"required"` - Status VirtualMachineInstanceMigrationStatus `json:"status,omitempty"` -} - -// 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"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []VirtualMachineInstanceMigration `json:"items"` -} - -// --- -// +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"` - // +k8s:openapi-gen=false - metav1.ObjectMeta `json:"metadata,omitempty"` - // VirtualMachineInstance Spec contains the VirtualMachineInstance specification. - Spec VirtualMachineInstancePresetSpec `json:"spec,omitempty" valid:"required"` -} - -// 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"` - 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, - }, - } -} - -// 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"` - // +k8s:openapi-gen=false - metav1.ObjectMeta `json:"metadata,omitempty"` - // Spec contains the specification of VirtualMachineInstance created - Spec VirtualMachineSpec `json:"spec" valid:"required"` - // Status holds the current state of the controller and brief information - // about its associated VirtualMachineInstance - Status VirtualMachineStatus `json:"status,omitempty"` -} - -// 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,omitempty"` - 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" - RenameRequest = "Rename" -) - -// 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"` - // Provides additional data in order to perform the Action - Data map[string]string `json:"data,omitempty" optional:"true"` - // 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"` -} - -// 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" - - // VirtualMachineReady is copied to the virtual machine from its vmi - VirtualMachineReady VirtualMachineConditionType = "Ready" - - // VirtualMachinePaused is added in a virtual machine when its vmi - // signals with its own condition that it is paused. - VirtualMachinePaused VirtualMachineConditionType = "Paused" - - // This condition indicates that the VM was renamed - RenameConditionType VirtualMachineConditionType = "RenameOperation" -) - -// --- -// +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 NetworkInterfaceType string - -const ( - // Virtual machine instance bride interface - BridgeInterface NetworkInterfaceType = "bridge" - // Virtual machine instance slirp interface - SlirpInterface NetworkInterfaceType = "slirp" - // Virtual machine instance masquerade interface - MasqueradeInterface NetworkInterfaceType = "masquerade" -) - -// --- -// +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"` - // +k8s:openapi-gen=false - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec KubeVirtSpec `json:"spec" valid:"required"` - Status KubeVirtStatus `json:"status,omitempty"` -} - -// 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"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []KubeVirt `json:"items"` -} - -type KubeVirtSelfSignConfiguration struct { - CARotateInterval *metav1.Duration `json:"caRotateInterval,omitempty"` - CertRotateInterval *metav1.Duration `json:"certRotateInterval,omitempty"` - CAOverlapInterval *metav1.Duration `json:"caOverlapInterval,omitempty"` -} - -type KubeVirtCertificateRotateStrategy struct { - SelfSigned *KubeVirtSelfSignConfiguration `json:"selfSigned,omitempty"` -} - -// --- -// +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"` - - // The namespace Prometheus is deployed in - // Defaults to openshift-monitor - MonitorNamespace string `json:"monitorNamespace,omitempty"` - - // The name of the Prometheus service account that needs read-access to KubeVirt endpoints - // Defaults to prometheus-k8s - MonitorAccount string `json:"monitorAccount,omitempty"` - - // Specifies if kubevirt can be deleted if workloads are still present. - // This is mainly a precaution to avoid accidental data loss - UninstallStrategy KubeVirtUninstallStrategy `json:"uninstallStrategy,omitempty"` - - CertificateRotationStrategy KubeVirtCertificateRotateStrategy `json:"certificateRotateStrategy,omitempty"` -} - -type KubeVirtUninstallStrategy string - -const ( - KubeVirtUninstallStrategyRemoveWorkloads KubeVirtUninstallStrategy = "RemoveWorkloads" - KubeVirtUninstallStrategyBlockUninstallIfWorkloadsExist KubeVirtUninstallStrategy = "BlockUninstallIfWorkloadsExist" -) - -// 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"` - TargetKubeVirtRegistry string `json:"targetKubeVirtRegistry,omitempty" optional:"true"` - TargetKubeVirtVersion string `json:"targetKubeVirtVersion,omitempty" optional:"true"` - TargetDeploymentConfig string `json:"targetDeploymentConfig,omitempty" optional:"true"` - TargetDeploymentID string `json:"targetDeploymentID,omitempty" optional:"true"` - ObservedKubeVirtRegistry string `json:"observedKubeVirtRegistry,omitempty" optional:"true"` - ObservedKubeVirtVersion string `json:"observedKubeVirtVersion,omitempty" optional:"true"` - ObservedDeploymentConfig string `json:"observedDeploymentConfig,omitempty" optional:"true"` - ObservedDeploymentID string `json:"observedDeploymentID,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" - - // Conditions for HCO, see https://github.com/kubevirt/hyperconverged-cluster-operator/blob/master/docs/conditions.md - // Whether KubeVirt is functional and available in the cluster. - KubeVirtConditionAvailable KubeVirtConditionType = "Available" - // Whether the operator is actively making changes to KubeVirt - KubeVirtConditionProgressing KubeVirtConditionType = "Progressing" - // Whether KubeVirt is not functioning completely - KubeVirtConditionDegraded KubeVirtConditionType = "Degraded" -) - -const ( - EvictionStrategyLiveMigrate EvictionStrategy = "LiveMigrate" -) - -// RestartOptions may be provided when deleting an API object. -// --- -// +k8s:openapi-gen=true -type RestartOptions struct { - metav1.TypeMeta `json:",inline"` - - // The duration in seconds before the object should be force-restared. Value must be non-negative integer. - // The value zero indicates, restart immediately. If this value is nil, the default grace period for deletion of the corresponding VMI for the - // specified type will be used to determine on how much time to give the VMI to restart. - // Defaults to a per object value if not specified. zero means restart immediately. - // Allowed Values: nil and 0 - // +optional - GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty" protobuf:"varint,1,opt,name=gracePeriodSeconds"` -} - -// VirtualMachineInstanceGuestAgentInfo represents information from the installed guest agent -// --- -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type VirtualMachineInstanceGuestAgentInfo struct { - metav1.TypeMeta `json:",inline"` - // GAVersion is a version of currently installed guest agent - GAVersion string `json:"guestAgentVersion,omitempty"` - // Hostname represents FQDN of a guest - Hostname string `json:"hostname,omitempty"` - // OS contains the guest operating system information - OS VirtualMachineInstanceGuestOSInfo `json:"os,omitempty"` - // Timezone is guest os current timezone - Timezone string `json:"timezone,omitempty"` - // UserList is a list of active guest OS users - UserList []VirtualMachineInstanceGuestOSUser `json:"userList,omitempty"` - // FSInfo is a guest os filesystem information containing the disk mapping and disk mounts with usage - FSInfo VirtualMachineInstanceFileSystemInfo `json:"fsInfo,omitempty"` -} - -// VirtualMachineInstanceGuestOSUserList comprises the list of all active users on guest machine -// --- -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type VirtualMachineInstanceGuestOSUserList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []VirtualMachineInstanceGuestOSUser `json:"items"` -} - -// VirtualMachineGuestOSUser is the single user of the guest os -type VirtualMachineInstanceGuestOSUser struct { - UserName string `json:"userName"` - Domain string `json:"domain,omitempty"` - LoginTime float64 `json:"loginTime,omitempty"` -} - -// VirtualMachineInstanceFileSystemInfo represents information regarding single guest os filesystem -type VirtualMachineInstanceFileSystemInfo struct { - Filesystems []VirtualMachineInstanceFileSystem `json:"disks"` -} - -// VirtualMachineInstanceFileSystemList comprises the list of all filesystems on guest machine -// --- -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true -type VirtualMachineInstanceFileSystemList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []VirtualMachineInstanceFileSystem `json:"items"` -} - -// VirtualMachineInstanceFileSystem represents guest os disk -type VirtualMachineInstanceFileSystem struct { - DiskName string `json:"diskName"` - MountPoint string `json:"mountPoint"` - FileSystemType string `json:"fileSystemType"` - UsedBytes int `json:"usedBytes"` - TotalBytes int `json:"totalBytes"` -} - -// Options for a rename operation -type RenameOptions struct { - metav1.TypeMeta `json:",inline"` - NewName string `json:"newName"` - OldName *string `json:"oldName,omitempty"` -} 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 f781ae54f60..00000000000 --- a/vendor/kubevirt.io/client-go/api/v1/types_swagger_generated.go +++ /dev/null @@ -1,359 +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.", - "priorityClassName": "If specified, indicates the pod's priority.\nIf not specified, the pod priority will be default or zero if there is no\ndefault.\n+optional", - "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", - "schedulerName": "If specified, the VMI will be dispatched by specified scheduler.\nIf not specified, the VMI will be dispatched by default scheduler.\n+optional", - "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.", - "guestOSInfo": "Guest OS Information", - "migrationState": "Represents the status of a live migration", - "migrationMethod": "Represents the method using which the vmi can be migrated: live migration or block migration", - "qosClass": "The Quality of Service (QOS) classification assigned to the virtual machine instance based on resource requirements\nSee PodQOSClass type for available QOS classes\nMore info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md\n+optional", - "activePods": "ActivePods is a mapping of pod UID to node name.\nIt is possible for multiple pods to be running for a single VMI during 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 (VirtualMachineInstanceGuestOSInfo) SwaggerDoc() map[string]string { - return map[string]string{ - "name": "Name of the Guest OS", - "kernelRelease": "Guest OS Kernel Release", - "version": "Guest OS Version", - "prettyName": "Guest OS Pretty Name", - "versionId": "Version ID of the Guest OS", - "kernelVersion": "Kernel version of the Guest OS", - "machine": "Machine type of the Guest OS", - "id": "Guest OS Id", - } -} - -func (VirtualMachineInstanceMigrationState) SwaggerDoc() map[string]string { - return map[string]string{ - "startTimestamp": "The time the migration action began", - "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", - } -} - -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", - "data": "Provides additional data in order to perform the Action", - "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 (KubeVirtSelfSignConfiguration) SwaggerDoc() map[string]string { - return map[string]string{} -} - -func (KubeVirtCertificateRotateStrategy) SwaggerDoc() map[string]string { - return map[string]string{} -} - -func (KubeVirtSpec) SwaggerDoc() map[string]string { - return map[string]string{ - "imageTag": "The image tag to use for the continer images installed.\nDefaults to the same tag as the operator's container image.", - "imageRegistry": "The image registry to pull the container images from\nDefaults to the same registry the operator's container image is pulled from.", - "imagePullPolicy": "The ImagePullPolicy to use.", - "monitorNamespace": "The namespace Prometheus is deployed in\nDefaults to openshift-monitor", - "monitorAccount": "The name of the Prometheus service account that needs read-access to KubeVirt endpoints\nDefaults to prometheus-k8s", - "uninstallStrategy": "Specifies if kubevirt can be deleted if workloads are still present.\nThis is mainly a precaution to avoid accidental data loss", - } -} - -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", - } -} - -func (RestartOptions) SwaggerDoc() map[string]string { - return map[string]string{ - "": "RestartOptions may be provided when deleting an API object.", - "gracePeriodSeconds": "The duration in seconds before the object should be force-restared. Value must be non-negative integer.\nThe value zero indicates, restart immediately. If this value is nil, the default grace period for deletion of the corresponding VMI for the\nspecified type will be used to determine on how much time to give the VMI to restart.\nDefaults to a per object value if not specified. zero means restart immediately.\nAllowed Values: nil and 0\n+optional", - } -} - -func (VirtualMachineInstanceGuestAgentInfo) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstanceGuestAgentInfo represents information from the installed guest agent", - "guestAgentVersion": "GAVersion is a version of currently installed guest agent", - "hostname": "Hostname represents FQDN of a guest", - "os": "OS contains the guest operating system information", - "timezone": "Timezone is guest os current timezone", - "userList": "UserList is a list of active guest OS users", - "fsInfo": "FSInfo is a guest os filesystem information containing the disk mapping and disk mounts with usage", - } -} - -func (VirtualMachineInstanceGuestOSUserList) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstanceGuestOSUserList comprises the list of all active users on guest machine", - } -} - -func (VirtualMachineInstanceGuestOSUser) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineGuestOSUser is the single user of the guest os", - } -} - -func (VirtualMachineInstanceFileSystemInfo) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstanceFileSystemInfo represents information regarding single guest os filesystem", - } -} - -func (VirtualMachineInstanceFileSystemList) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstanceFileSystemList comprises the list of all filesystems on guest machine", - } -} - -func (VirtualMachineInstanceFileSystem) SwaggerDoc() map[string]string { - return map[string]string{ - "": "VirtualMachineInstanceFileSystem represents guest os disk", - } -} - -func (RenameOptions) SwaggerDoc() map[string]string { - return map[string]string{ - "": "Options for a rename operation", - } -} diff --git a/vendor/kubevirt.io/client-go/api/v1/utils.go b/vendor/kubevirt.io/client-go/api/v1/utils.go deleted file mode 100644 index fbd9bdb45ba..00000000000 --- a/vendor/kubevirt.io/client-go/api/v1/utils.go +++ /dev/null @@ -1,48 +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 - -import ( - k8sv1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - k8smetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "kubevirt.io/client-go/precond" -) - -// This is meant for testing -func NewMinimalVMI(name string) *VirtualMachineInstance { - return NewMinimalVMIWithNS(k8sv1.NamespaceDefault, name) -} - -// This is meant for testing -func NewMinimalVMIWithNS(namespace, name string) *VirtualMachineInstance { - precond.CheckNotEmpty(name) - vmi := NewVMIReferenceFromNameWithNS(namespace, name) - vmi.Spec = VirtualMachineInstanceSpec{Domain: DomainSpec{}} - vmi.Spec.Domain.Resources.Requests = k8sv1.ResourceList{ - k8sv1.ResourceMemory: resource.MustParse("8192Ki"), - } - vmi.TypeMeta = k8smetav1.TypeMeta{ - APIVersion: GroupVersion.String(), - Kind: "VirtualMachineInstance", - } - return vmi -} 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 4ef247387e9..00000000000 --- a/vendor/kubevirt.io/client-go/api/v1/zz_generated.defaults.go +++ /dev/null @@ -1,459 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2020 The KubeVirt Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -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/precond/precond.go b/vendor/kubevirt.io/client-go/precond/precond.go deleted file mode 100644 index 44fc624fbdd..00000000000 --- 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/containerized-data-importer/LICENSE b/vendor/kubevirt.io/containerized-data-importer/LICENSE deleted file mode 100644 index 549d874d4f8..00000000000 --- a/vendor/kubevirt.io/containerized-data-importer/LICENSE +++ /dev/null @@ -1,202 +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: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) 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 - - (d) 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 2017 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. diff --git a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/register.go b/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/register.go deleted file mode 100644 index 77f5af7007f..00000000000 --- a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/register.go +++ /dev/null @@ -1,6 +0,0 @@ -package core - -const ( - // GroupName to hold the string name for the cdi project - GroupName = "cdi.kubevirt.io" -) diff --git a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/deepcopy_generated.go b/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/deepcopy_generated.go deleted file mode 100644 index 83abb799c21..00000000000 --- a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/deepcopy_generated.go +++ /dev/null @@ -1,476 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2018 The CDI 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 v1alpha1 - -import ( - v1 "github.com/openshift/custom-resource-status/conditions/v1" - corev1 "k8s.io/api/core/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CDI) DeepCopyInto(out *CDI) { - *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 CDI. -func (in *CDI) DeepCopy() *CDI { - if in == nil { - return nil - } - out := new(CDI) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CDI) 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 *CDIConfig) DeepCopyInto(out *CDIConfig) { - *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 CDIConfig. -func (in *CDIConfig) DeepCopy() *CDIConfig { - if in == nil { - return nil - } - out := new(CDIConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CDIConfig) 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 *CDIConfigList) DeepCopyInto(out *CDIConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CDIConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CDIConfigList. -func (in *CDIConfigList) DeepCopy() *CDIConfigList { - if in == nil { - return nil - } - out := new(CDIConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CDIConfigList) 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 *CDIConfigSpec) DeepCopyInto(out *CDIConfigSpec) { - *out = *in - if in.UploadProxyURLOverride != nil { - in, out := &in.UploadProxyURLOverride, &out.UploadProxyURLOverride - *out = new(string) - **out = **in - } - if in.ScratchSpaceStorageClass != nil { - in, out := &in.ScratchSpaceStorageClass, &out.ScratchSpaceStorageClass - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CDIConfigSpec. -func (in *CDIConfigSpec) DeepCopy() *CDIConfigSpec { - if in == nil { - return nil - } - out := new(CDIConfigSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CDIConfigStatus) DeepCopyInto(out *CDIConfigStatus) { - *out = *in - if in.UploadProxyURL != nil { - in, out := &in.UploadProxyURL, &out.UploadProxyURL - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CDIConfigStatus. -func (in *CDIConfigStatus) DeepCopy() *CDIConfigStatus { - if in == nil { - return nil - } - out := new(CDIConfigStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CDIList) DeepCopyInto(out *CDIList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CDI, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CDIList. -func (in *CDIList) DeepCopy() *CDIList { - if in == nil { - return nil - } - out := new(CDIList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CDIList) 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 *CDISpec) DeepCopyInto(out *CDISpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CDISpec. -func (in *CDISpec) DeepCopy() *CDISpec { - if in == nil { - return nil - } - out := new(CDISpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CDIStatus) DeepCopyInto(out *CDIStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CDIStatus. -func (in *CDIStatus) DeepCopy() *CDIStatus { - if in == nil { - return nil - } - out := new(CDIStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DataVolume) DeepCopyInto(out *DataVolume) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataVolume. -func (in *DataVolume) DeepCopy() *DataVolume { - if in == nil { - return nil - } - out := new(DataVolume) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DataVolume) 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 *DataVolumeBlankImage) DeepCopyInto(out *DataVolumeBlankImage) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataVolumeBlankImage. -func (in *DataVolumeBlankImage) DeepCopy() *DataVolumeBlankImage { - if in == nil { - return nil - } - out := new(DataVolumeBlankImage) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DataVolumeList) DeepCopyInto(out *DataVolumeList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]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 DataVolumeList. -func (in *DataVolumeList) DeepCopy() *DataVolumeList { - if in == nil { - return nil - } - out := new(DataVolumeList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DataVolumeList) 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 *DataVolumeSource) DeepCopyInto(out *DataVolumeSource) { - *out = *in - if in.HTTP != nil { - in, out := &in.HTTP, &out.HTTP - *out = new(DataVolumeSourceHTTP) - **out = **in - } - if in.S3 != nil { - in, out := &in.S3, &out.S3 - *out = new(DataVolumeSourceS3) - **out = **in - } - if in.Registry != nil { - in, out := &in.Registry, &out.Registry - *out = new(DataVolumeSourceRegistry) - **out = **in - } - if in.PVC != nil { - in, out := &in.PVC, &out.PVC - *out = new(DataVolumeSourcePVC) - **out = **in - } - if in.Upload != nil { - in, out := &in.Upload, &out.Upload - *out = new(DataVolumeSourceUpload) - **out = **in - } - if in.Blank != nil { - in, out := &in.Blank, &out.Blank - *out = new(DataVolumeBlankImage) - **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 *DataVolumeSourceHTTP) DeepCopyInto(out *DataVolumeSourceHTTP) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataVolumeSourceHTTP. -func (in *DataVolumeSourceHTTP) DeepCopy() *DataVolumeSourceHTTP { - if in == nil { - return nil - } - out := new(DataVolumeSourceHTTP) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DataVolumeSourcePVC) DeepCopyInto(out *DataVolumeSourcePVC) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataVolumeSourcePVC. -func (in *DataVolumeSourcePVC) DeepCopy() *DataVolumeSourcePVC { - if in == nil { - return nil - } - out := new(DataVolumeSourcePVC) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DataVolumeSourceRegistry) DeepCopyInto(out *DataVolumeSourceRegistry) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataVolumeSourceRegistry. -func (in *DataVolumeSourceRegistry) DeepCopy() *DataVolumeSourceRegistry { - if in == nil { - return nil - } - out := new(DataVolumeSourceRegistry) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DataVolumeSourceS3) DeepCopyInto(out *DataVolumeSourceS3) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataVolumeSourceS3. -func (in *DataVolumeSourceS3) DeepCopy() *DataVolumeSourceS3 { - if in == nil { - return nil - } - out := new(DataVolumeSourceS3) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DataVolumeSourceUpload) DeepCopyInto(out *DataVolumeSourceUpload) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataVolumeSourceUpload. -func (in *DataVolumeSourceUpload) DeepCopy() *DataVolumeSourceUpload { - if in == nil { - return nil - } - out := new(DataVolumeSourceUpload) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DataVolumeSpec) DeepCopyInto(out *DataVolumeSpec) { - *out = *in - in.Source.DeepCopyInto(&out.Source) - if in.PVC != nil { - in, out := &in.PVC, &out.PVC - *out = new(corev1.PersistentVolumeClaimSpec) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataVolumeSpec. -func (in *DataVolumeSpec) DeepCopy() *DataVolumeSpec { - if in == nil { - return nil - } - out := new(DataVolumeSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DataVolumeStatus) DeepCopyInto(out *DataVolumeStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DataVolumeStatus. -func (in *DataVolumeStatus) DeepCopy() *DataVolumeStatus { - if in == nil { - return nil - } - out := new(DataVolumeStatus) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/doc.go b/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/doc.go deleted file mode 100644 index 85f3dd689f0..00000000000 --- a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// +k8s:deepcopy-gen=package -// +k8s:openapi-gen=true - -// Package v1alpha1 is the v1alpha1 version of the API. -// +groupName=cdi.kubevirt.io -package v1alpha1 diff --git a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/openapi_generated.go b/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/openapi_generated.go deleted file mode 100644 index 9e069161f8c..00000000000 --- a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/openapi_generated.go +++ /dev/null @@ -1,711 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2018 The CDI 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 v1alpha1 - -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/containerized-data-importer/pkg/apis/core/v1alpha1.CDI": schema_pkg_apis_core_v1alpha1_CDI(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIConfig": schema_pkg_apis_core_v1alpha1_CDIConfig(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIConfigList": schema_pkg_apis_core_v1alpha1_CDIConfigList(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIConfigSpec": schema_pkg_apis_core_v1alpha1_CDIConfigSpec(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIConfigStatus": schema_pkg_apis_core_v1alpha1_CDIConfigStatus(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIList": schema_pkg_apis_core_v1alpha1_CDIList(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDISpec": schema_pkg_apis_core_v1alpha1_CDISpec(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIStatus": schema_pkg_apis_core_v1alpha1_CDIStatus(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolume": schema_pkg_apis_core_v1alpha1_DataVolume(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeBlankImage": schema_pkg_apis_core_v1alpha1_DataVolumeBlankImage(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeList": schema_pkg_apis_core_v1alpha1_DataVolumeList(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSource": schema_pkg_apis_core_v1alpha1_DataVolumeSource(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourceHTTP": schema_pkg_apis_core_v1alpha1_DataVolumeSourceHTTP(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourcePVC": schema_pkg_apis_core_v1alpha1_DataVolumeSourcePVC(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourceRegistry": schema_pkg_apis_core_v1alpha1_DataVolumeSourceRegistry(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourceS3": schema_pkg_apis_core_v1alpha1_DataVolumeSourceS3(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourceUpload": schema_pkg_apis_core_v1alpha1_DataVolumeSourceUpload(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSpec": schema_pkg_apis_core_v1alpha1_DataVolumeSpec(ref), - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeStatus": schema_pkg_apis_core_v1alpha1_DataVolumeStatus(ref), - } -} - -func schema_pkg_apis_core_v1alpha1_CDI(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CDI is the CDI Operator CRD", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDISpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIStatus"), - }, - }, - }, - Required: []string{"spec", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDISpec", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIStatus"}, - } -} - -func schema_pkg_apis_core_v1alpha1_CDIConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CDIConfig provides a user configuration for CDI", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIConfigSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIConfigStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIConfigSpec", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIConfigStatus"}, - } -} - -func schema_pkg_apis_core_v1alpha1_CDIConfigList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CDIConfigList provides the needed parameters to do request a list of CDIConfigs from the system", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items provides a list of CDIConfigs", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIConfig"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDIConfig"}, - } -} - -func schema_pkg_apis_core_v1alpha1_CDIConfigSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CDIConfigSpec defines specification for user configuration", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "uploadProxyURLOverride": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "scratchSpaceStorageClass": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_core_v1alpha1_CDIConfigStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CDIConfigStatus provides", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "uploadProxyURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "scratchSpaceStorageClass": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_core_v1alpha1_CDIList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CDIList provides the needed parameters to do request a list of CDIs from the system", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items provides a list of CDIs", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDI"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.CDI"}, - } -} - -func schema_pkg_apis_core_v1alpha1_CDISpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CDISpec defines our specification for the CDI installation", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "imageRegistry": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "imageTag": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "imagePullPolicy": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_core_v1alpha1_CDIStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CDIStatus defines the status of the CDI installation", - Type: []string{"object"}, - 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("github.com/openshift/custom-resource-status/conditions/v1.Condition"), - }, - }, - }, - }, - }, - "operatorVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "targetVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "observedVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/openshift/custom-resource-status/conditions/v1.Condition"}, - } -} - -func schema_pkg_apis_core_v1alpha1_DataVolume(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DataVolume provides a representation of our data volume", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSpec", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeStatus"}, - } -} - -func schema_pkg_apis_core_v1alpha1_DataVolumeBlankImage(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DataVolumeBlankImage provides the parameters to create a new raw blank image for the PVC", - Type: []string{"object"}, - }, - }, - } -} - -func schema_pkg_apis_core_v1alpha1_DataVolumeList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DataVolumeList provides the needed parameters to do request a list of Data Volumes from the system", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items provides a list of DataVolumes", - 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{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolume"}, - } -} - -func schema_pkg_apis_core_v1alpha1_DataVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DataVolumeSource represents the source for our Data Volume, this can be HTTP, S3, Registry or an existing PVC", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "http": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourceHTTP"), - }, - }, - "s3": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourceS3"), - }, - }, - "registry": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourceRegistry"), - }, - }, - "pvc": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourcePVC"), - }, - }, - "upload": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourceUpload"), - }, - }, - "blank": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeBlankImage"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeBlankImage", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourceHTTP", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourcePVC", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourceRegistry", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourceS3", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSourceUpload"}, - } -} - -func schema_pkg_apis_core_v1alpha1_DataVolumeSourceHTTP(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DataVolumeSourceHTTP provides the parameters to create a Data Volume from an HTTP source", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "url": { - SchemaProps: spec.SchemaProps{ - Description: "URL is the URL of the http source", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef provides the secret reference needed to access the HTTP source", - Type: []string{"string"}, - Format: "", - }, - }, - "certConfigMap": { - SchemaProps: spec.SchemaProps{ - Description: "CertConfigMap provides a reference to the Registry certs", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_core_v1alpha1_DataVolumeSourcePVC(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DataVolumeSourcePVC provides the parameters to create a Data Volume from an existing PVC", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "namespace": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_core_v1alpha1_DataVolumeSourceRegistry(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DataVolumeSourceRegistry provides the parameters to create a Data Volume from an registry source", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "url": { - SchemaProps: spec.SchemaProps{ - Description: "URL is the url of the Registry source", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef provides the secret reference needed to access the Registry source", - Type: []string{"string"}, - Format: "", - }, - }, - "certConfigMap": { - SchemaProps: spec.SchemaProps{ - Description: "CertConfigMap provides a reference to the Registry certs", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_core_v1alpha1_DataVolumeSourceS3(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DataVolumeSourceS3 provides the parameters to create a Data Volume from an S3 source", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "url": { - SchemaProps: spec.SchemaProps{ - Description: "URL is the url of the S3 source", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef provides the secret reference needed to access the S3 source", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_core_v1alpha1_DataVolumeSourceUpload(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DataVolumeSourceUpload provides the parameters to create a Data Volume by uploading the source", - Type: []string{"object"}, - }, - }, - } -} - -func schema_pkg_apis_core_v1alpha1_DataVolumeSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DataVolumeSpec defines our specification for a DataVolume type", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "source": { - SchemaProps: spec.SchemaProps{ - Description: "Source is the src of the data for the requested DataVolume", - Ref: ref("kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSource"), - }, - }, - "pvc": { - SchemaProps: spec.SchemaProps{ - Description: "PVC is a pointer to the PVC Spec we want to use", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimSpec"), - }, - }, - "contentType": { - SchemaProps: spec.SchemaProps{ - Description: "DataVolumeContentType options: \"kubevirt\", \"archive\"", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"source", "pvc"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1.DataVolumeSource"}, - } -} - -func schema_pkg_apis_core_v1alpha1_DataVolumeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DataVolumeStatus provides the parameters to store the phase of the Data Volume", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "Phase is the current phase of the data volume", - Type: []string{"string"}, - Format: "", - }, - }, - "progress": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} diff --git a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/register.go b/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/register.go deleted file mode 100644 index 29e937c079d..00000000000 --- a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/register.go +++ /dev/null @@ -1,46 +0,0 @@ -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - - "kubevirt.io/containerized-data-importer/pkg/apis/core" -) - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: core.GroupName, Version: "v1alpha1"} - -//CDIGroupVersionKind group version kind -var CDIGroupVersionKind = schema.GroupVersionKind{Group: SchemeGroupVersion.Group, Version: SchemeGroupVersion.Version, Kind: "CDI"} - -// Kind takes an unqualified kind and returns back a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // SchemeBuilder tbd - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme tbd - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &DataVolume{}, - &DataVolumeList{}, - &CDIConfig{}, - &CDIConfigList{}, - &CDI{}, - &CDIList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/types.go b/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/types.go deleted file mode 100644 index be42732dd38..00000000000 --- a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/types.go +++ /dev/null @@ -1,281 +0,0 @@ -/* -Copyright 2018 The CDI 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. -*/ - -package v1alpha1 - -//go:generate swagger-doc -//go:generate deepcopy-gen -i . --go-header-file ../../../../hack/custom-boilerplate.go.txt -//go:generate openapi-gen -i . --output-package=kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1 --go-header-file ../../../../hack/custom-boilerplate.go.txt - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - conditions "github.com/openshift/custom-resource-status/conditions/v1" -) - -// DataVolume provides a representation of our data volume -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type DataVolume struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec DataVolumeSpec `json:"spec"` - Status DataVolumeStatus `json:"status,omitempty"` -} - -// DataVolumeSpec defines our specification for a DataVolume type -type DataVolumeSpec struct { - //Source is the src of the data for the requested DataVolume - Source DataVolumeSource `json:"source"` - //PVC is a pointer to the PVC Spec we want to use - PVC *corev1.PersistentVolumeClaimSpec `json:"pvc"` - //DataVolumeContentType options: "kubevirt", "archive" - ContentType DataVolumeContentType `json:"contentType,omitempty"` -} - -// DataVolumeContentType represents the types of the imported data -type DataVolumeContentType string - -const ( - // DataVolumeKubeVirt is the content-type of the imported file, defaults to kubevirt - DataVolumeKubeVirt DataVolumeContentType = "kubevirt" - // DataVolumeArchive is the content-type to specify if there is a need to extract the imported archive - DataVolumeArchive DataVolumeContentType = "archive" -) - -// DataVolumeSource represents the source for our Data Volume, this can be HTTP, S3, Registry or an existing PVC -type DataVolumeSource struct { - HTTP *DataVolumeSourceHTTP `json:"http,omitempty"` - S3 *DataVolumeSourceS3 `json:"s3,omitempty"` - Registry *DataVolumeSourceRegistry `json:"registry,omitempty"` - PVC *DataVolumeSourcePVC `json:"pvc,omitempty"` - Upload *DataVolumeSourceUpload `json:"upload,omitempty"` - Blank *DataVolumeBlankImage `json:"blank,omitempty"` -} - -// DataVolumeSourcePVC provides the parameters to create a Data Volume from an existing PVC -type DataVolumeSourcePVC struct { - Namespace string `json:"namespace,omitempty"` - Name string `json:"name,omitempty"` -} - -// DataVolumeBlankImage provides the parameters to create a new raw blank image for the PVC -type DataVolumeBlankImage struct{} - -// DataVolumeSourceUpload provides the parameters to create a Data Volume by uploading the source -type DataVolumeSourceUpload struct { - //Target string `json:"shouldUpload,omitempty"` -} - -// DataVolumeSourceS3 provides the parameters to create a Data Volume from an S3 source -type DataVolumeSourceS3 struct { - //URL is the url of the S3 source - URL string `json:"url,omitempty"` - //SecretRef provides the secret reference needed to access the S3 source - SecretRef string `json:"secretRef,omitempty"` -} - -// DataVolumeSourceRegistry provides the parameters to create a Data Volume from an registry source -type DataVolumeSourceRegistry struct { - //URL is the url of the Registry source - URL string `json:"url,omitempty"` - //SecretRef provides the secret reference needed to access the Registry source - SecretRef string `json:"secretRef,omitempty"` - //CertConfigMap provides a reference to the Registry certs - CertConfigMap string `json:"certConfigMap,omitempty"` -} - -// DataVolumeSourceHTTP provides the parameters to create a Data Volume from an HTTP source -type DataVolumeSourceHTTP struct { - //URL is the URL of the http source - URL string `json:"url,omitempty"` - //SecretRef provides the secret reference needed to access the HTTP source - SecretRef string `json:"secretRef,omitempty"` - //CertConfigMap provides a reference to the Registry certs - CertConfigMap string `json:"certConfigMap,omitempty"` -} - -// DataVolumeStatus provides the parameters to store the phase of the Data Volume -type DataVolumeStatus struct { - //Phase is the current phase of the data volume - Phase DataVolumePhase `json:"phase,omitempty"` - Progress DataVolumeProgress `json:"progress,omitempty"` -} - -//DataVolumeList provides the needed parameters to do request a list of Data Volumes from the system -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type DataVolumeList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - // Items provides a list of DataVolumes - Items []DataVolume `json:"items"` -} - -// DataVolumePhase is the current phase of the DataVolume -type DataVolumePhase string - -// DataVolumeProgress is the current progress of the DataVolume transfer operation. Value between 0 and 100 inclusive -type DataVolumeProgress string - -const ( - // PhaseUnset represents a data volume with no current phase - PhaseUnset DataVolumePhase = "" - - // Pending represents a data volume with a current phase of Pending - Pending DataVolumePhase = "Pending" - // PVCBound represents a data volume with a current phase of PVCBound - PVCBound DataVolumePhase = "PVCBound" - - // ImportScheduled represents a data volume with a current phase of ImportScheduled - ImportScheduled DataVolumePhase = "ImportScheduled" - - // ImportInProgress represents a data volume with a current phase of ImportInProgress - ImportInProgress DataVolumePhase = "ImportInProgress" - - // CloneScheduled represents a data volume with a current phase of CloneScheduled - CloneScheduled DataVolumePhase = "CloneScheduled" - - // CloneInProgress represents a data volume with a current phase of CloneInProgress - CloneInProgress DataVolumePhase = "CloneInProgress" - - // SnapshotForSmartCloneInProgress represents a data volume with a current phase of SnapshotForSmartCloneInProgress - SnapshotForSmartCloneInProgress DataVolumePhase = "SnapshotForSmartCloneInProgress" - - // SmartClonePVCInProgress represents a data volume with a current phase of SmartClonePVCInProgress - SmartClonePVCInProgress DataVolumePhase = "SmartClonePVCInProgress" - - // UploadScheduled represents a data volume with a current phase of UploadScheduled - UploadScheduled DataVolumePhase = "UploadScheduled" - - // UploadReady represents a data volume with a current phase of UploadReady - UploadReady DataVolumePhase = "UploadReady" - - // Succeeded represents a DataVolumePhase of Succeeded - Succeeded DataVolumePhase = "Succeeded" - // Failed represents a DataVolumePhase of Failed - Failed DataVolumePhase = "Failed" - // Unknown represents a DataVolumePhase of Unknown - Unknown DataVolumePhase = "Unknown" -) - -// DataVolumeCloneSourceSubresource is the subresource checked for permission to clone -const DataVolumeCloneSourceSubresource = "source" - -// this has to be here otherwise informer-gen doesn't recognize it -// see https://github.com/kubernetes/code-generator/issues/59 -// +genclient:nonNamespaced - -// CDI is the CDI Operator CRD -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type CDI struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec CDISpec `json:"spec"` - Status CDIStatus `json:"status"` -} - -// CDISpec defines our specification for the CDI installation -type CDISpec struct { - ImageRegistry string `json:"imageRegistry,omitempty"` - - ImageTag string `json:"imageTag,omitempty"` - - ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty" valid:"required"` -} - -// CDIPhase is the current phase of the CDI deployment -type CDIPhase string - -// CDIStatus defines the status of the CDI installation -type CDIStatus struct { - Phase CDIPhase `json:"phase,omitempty"` - Conditions []conditions.Condition `json:"conditions,omitempty" optional:"true"` - OperatorVersion string `json:"operatorVersion,omitempty" optional:"true"` - TargetVersion string `json:"targetVersion,omitempty" optional:"true"` - ObservedVersion string `json:"observedVersion,omitempty" optional:"true"` -} - -const ( - // CDIPhaseDeploying signals that the CDI resources are being deployed - CDIPhaseDeploying CDIPhase = "Deploying" - - // CDIPhaseDeployed signals that the CDI resources are successflly deployed - CDIPhaseDeployed CDIPhase = "Deployed" - - // CDIPhaseDeleting signals that the CDI resources are being removed - CDIPhaseDeleting CDIPhase = "Deleting" - - // CDIPhaseDeleted signals that the CDI resources are deleted - CDIPhaseDeleted CDIPhase = "Deleted" - - // CDIPhaseError signals that the CDI deployment is in an error state - CDIPhaseError CDIPhase = "Error" - - // CDIPhaseUpgrading signals that the CDI resources are being deployed - CDIPhaseUpgrading CDIPhase = "Upgrading" -) - -//CDIList provides the needed parameters to do request a list of CDIs from the system -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type CDIList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - // Items provides a list of CDIs - Items []CDI `json:"items"` -} - -// this has to be here otherwise informer-gen doesn't recognize it -// see https://github.com/kubernetes/code-generator/issues/59 -// +genclient:nonNamespaced - -// CDIConfig provides a user configuration for CDI -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type CDIConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec CDIConfigSpec `json:"spec"` - Status CDIConfigStatus `json:"status,omitempty"` -} - -//CDIConfigSpec defines specification for user configuration -type CDIConfigSpec struct { - UploadProxyURLOverride *string `json:"uploadProxyURLOverride,omitempty"` - ScratchSpaceStorageClass *string `json:"scratchSpaceStorageClass,omitempty"` -} - -//CDIConfigStatus provides -type CDIConfigStatus struct { - UploadProxyURL *string `json:"uploadProxyURL,omitempty"` - ScratchSpaceStorageClass string `json:"scratchSpaceStorageClass,omitempty"` -} - -//CDIConfigList provides the needed parameters to do request a list of CDIConfigs from the system -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type CDIConfigList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - // Items provides a list of CDIConfigs - Items []CDIConfig `json:"items"` -} diff --git a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/types_swagger_generated.go b/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/types_swagger_generated.go deleted file mode 100644 index bd8b5f5436b..00000000000 --- a/vendor/kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1/types_swagger_generated.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by swagger-doc. DO NOT EDIT. - -package v1alpha1 - -func (DataVolume) SwaggerDoc() map[string]string { - return map[string]string{ - "": "DataVolume provides a representation of our data volume\n+genclient\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object", - } -} - -func (DataVolumeSpec) SwaggerDoc() map[string]string { - return map[string]string{ - "": "DataVolumeSpec defines our specification for a DataVolume type", - "source": "Source is the src of the data for the requested DataVolume", - "pvc": "PVC is a pointer to the PVC Spec we want to use", - "contentType": "DataVolumeContentType options: \"kubevirt\", \"archive\"", - } -} - -func (DataVolumeSource) SwaggerDoc() map[string]string { - return map[string]string{ - "": "DataVolumeSource represents the source for our Data Volume, this can be HTTP, S3, Registry or an existing PVC", - } -} - -func (DataVolumeSourcePVC) SwaggerDoc() map[string]string { - return map[string]string{ - "": "DataVolumeSourcePVC provides the parameters to create a Data Volume from an existing PVC", - } -} - -func (DataVolumeBlankImage) SwaggerDoc() map[string]string { - return map[string]string{ - "": "DataVolumeBlankImage provides the parameters to create a new raw blank image for the PVC", - } -} - -func (DataVolumeSourceUpload) SwaggerDoc() map[string]string { - return map[string]string{ - "": "DataVolumeSourceUpload provides the parameters to create a Data Volume by uploading the source", - } -} - -func (DataVolumeSourceS3) SwaggerDoc() map[string]string { - return map[string]string{ - "": "DataVolumeSourceS3 provides the parameters to create a Data Volume from an S3 source", - "url": "URL is the url of the S3 source", - "secretRef": "SecretRef provides the secret reference needed to access the S3 source", - } -} - -func (DataVolumeSourceRegistry) SwaggerDoc() map[string]string { - return map[string]string{ - "": "DataVolumeSourceRegistry provides the parameters to create a Data Volume from an registry source", - "url": "URL is the url of the Registry source", - "secretRef": "SecretRef provides the secret reference needed to access the Registry source", - "certConfigMap": "CertConfigMap provides a reference to the Registry certs", - } -} - -func (DataVolumeSourceHTTP) SwaggerDoc() map[string]string { - return map[string]string{ - "": "DataVolumeSourceHTTP provides the parameters to create a Data Volume from an HTTP source", - "url": "URL is the URL of the http source", - "secretRef": "SecretRef provides the secret reference needed to access the HTTP source", - "certConfigMap": "CertConfigMap provides a reference to the Registry certs", - } -} - -func (DataVolumeStatus) SwaggerDoc() map[string]string { - return map[string]string{ - "": "DataVolumeStatus provides the parameters to store the phase of the Data Volume", - "phase": "Phase is the current phase of the data volume", - } -} - -func (DataVolumeList) SwaggerDoc() map[string]string { - return map[string]string{ - "": "DataVolumeList provides the needed parameters to do request a list of Data Volumes from the system\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object", - "items": "Items provides a list of DataVolumes", - } -} - -func (CDI) SwaggerDoc() map[string]string { - return map[string]string{ - "": "CDI is the CDI Operator CRD\n+genclient\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object", - } -} - -func (CDISpec) SwaggerDoc() map[string]string { - return map[string]string{ - "": "CDISpec defines our specification for the CDI installation", - } -} - -func (CDIStatus) SwaggerDoc() map[string]string { - return map[string]string{ - "": "CDIStatus defines the status of the CDI installation", - } -} - -func (CDIList) SwaggerDoc() map[string]string { - return map[string]string{ - "": "CDIList provides the needed parameters to do request a list of CDIs from the system\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object", - "items": "Items provides a list of CDIs", - } -} - -func (CDIConfig) SwaggerDoc() map[string]string { - return map[string]string{ - "": "CDIConfig provides a user configuration for CDI\n+genclient\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object", - } -} - -func (CDIConfigSpec) SwaggerDoc() map[string]string { - return map[string]string{ - "": "CDIConfigSpec defines specification for user configuration", - } -} - -func (CDIConfigStatus) SwaggerDoc() map[string]string { - return map[string]string{ - "": "CDIConfigStatus provides", - } -} - -func (CDIConfigList) SwaggerDoc() map[string]string { - return map[string]string{ - "": "CDIConfigList provides the needed parameters to do request a list of CDIConfigs from the system\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object", - "items": "Items provides a list of CDIConfigs", - } -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 66441a837ce..23931d12aec 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -700,9 +700,6 @@ github.com/eapache/go-resiliency/breaker github.com/eapache/go-xerial-snappy # github.com/eapache/queue v1.1.0 github.com/eapache/queue -# github.com/emicklei/go-restful v2.14.2+incompatible -github.com/emicklei/go-restful -github.com/emicklei/go-restful/log # github.com/evanphx/json-patch v4.11.0+incompatible github.com/evanphx/json-patch # github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d @@ -1250,10 +1247,6 @@ github.com/json-iterator/go github.com/jstemmer/go-junit-report github.com/jstemmer/go-junit-report/formatter github.com/jstemmer/go-junit-report/parser -# github.com/k8snetworkplumbingwg/network-attachment-definition-client v0.0.0-20191119172530-79f836b90111 -## explicit -github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io -github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1 # github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 github.com/kardianos/osext # github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 @@ -1284,16 +1277,6 @@ github.com/kr/fs github.com/kr/pretty # github.com/kr/text v0.2.0 github.com/kr/text -# github.com/kubevirt/terraform-provider-kubevirt v0.0.0-00010101000000-000000000000 => github.com/nirarg/terraform-provider-kubevirt v0.0.0-20201222125919-101cee051ed3 -## explicit -github.com/kubevirt/terraform-provider-kubevirt/kubevirt -github.com/kubevirt/terraform-provider-kubevirt/kubevirt/client -github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/datavolume -github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/k8s -github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachine -github.com/kubevirt/terraform-provider-kubevirt/kubevirt/schema/virtualmachineinstance -github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils -github.com/kubevirt/terraform-provider-kubevirt/kubevirt/utils/patch # github.com/leodido/go-urn v1.2.1 github.com/leodido/go-urn # github.com/libvirt/libvirt-go v5.10.0+incompatible @@ -1421,11 +1404,6 @@ github.com/openshift/cluster-api-provider-gcp/pkg/apis/gcpprovider/v1beta1 ## explicit github.com/openshift/cluster-api-provider-ibmcloud/pkg/apis github.com/openshift/cluster-api-provider-ibmcloud/pkg/apis/ibmcloudprovider/v1beta1 -# github.com/openshift/cluster-api-provider-kubevirt v0.0.0-20210719100556-9b8bc3666720 -## explicit -github.com/openshift/cluster-api-provider-kubevirt/pkg/apis -github.com/openshift/cluster-api-provider-kubevirt/pkg/apis/kubevirtprovider/v1alpha1 -github.com/openshift/cluster-api-provider-kubevirt/pkg/utils # github.com/openshift/cluster-api-provider-libvirt v0.2.1-0.20191219173431-2336783d4603 ## explicit github.com/openshift/cluster-api-provider-libvirt/pkg/apis @@ -1434,8 +1412,6 @@ github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig ## explicit github.com/openshift/cluster-api-provider-ovirt/pkg/apis github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1 -# github.com/openshift/custom-resource-status v0.0.0-20190822192428-e62f2f3b79f3 -github.com/openshift/custom-resource-status/conditions/v1 # github.com/openshift/library-go v0.0.0-20210408164723-7a65fdb398e2 ## explicit github.com/openshift/library-go/pkg/config/clusteroperator/v1helpers @@ -2736,7 +2712,6 @@ k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1 k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1 # k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e => k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 -k8s.io/kube-openapi/pkg/common k8s.io/kube-openapi/pkg/util/proto k8s.io/kube-openapi/pkg/util/proto/validation # k8s.io/kubectl v0.21.0 => k8s.io/kubectl v0.21.0-rc.0 @@ -2769,14 +2744,6 @@ k8s.io/utils/exec k8s.io/utils/integer k8s.io/utils/pointer k8s.io/utils/trace -# kubevirt.io/client-go v0.29.0 => kubevirt.io/client-go v0.29.0 -## explicit -kubevirt.io/client-go/api/v1 -kubevirt.io/client-go/precond -# kubevirt.io/containerized-data-importer v1.10.9 -## explicit -kubevirt.io/containerized-data-importer/pkg/apis/core -kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1 # sigs.k8s.io/cluster-api-provider-aws v0.0.0 => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20210121023454-5ffc5f422a80 ## explicit sigs.k8s.io/cluster-api-provider-aws/pkg/apis @@ -2934,7 +2901,6 @@ sigs.k8s.io/yaml # github.com/hashicorp/terraform => github.com/openshift/terraform v0.12.20-openshift-4 # github.com/hashicorp/terraform-plugin-sdk => github.com/openshift/hashicorp-terraform-plugin-sdk v1.14.0-openshift # github.com/hashicorp/terraform-provider-vsphere => github.com/openshift/terraform-provider-vsphere v1.24.3-openshift -# github.com/kubevirt/terraform-provider-kubevirt => github.com/nirarg/terraform-provider-kubevirt v0.0.0-20201222125919-101cee051ed3 # github.com/metal3-io/baremetal-operator => github.com/openshift/baremetal-operator v0.0.0-20210706141527-5240e42f012a # github.com/metal3-io/baremetal-operator/apis => github.com/openshift/baremetal-operator/apis v0.0.0-20210706141527-5240e42f012a # github.com/metal3-io/cluster-api-provider-baremetal => github.com/openshift/cluster-api-provider-baremetal v0.0.0-20190821174549-a2a477909c1d @@ -2947,7 +2913,6 @@ sigs.k8s.io/yaml # k8s.io/client-go => k8s.io/client-go v0.22.0 # k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 # k8s.io/kubectl => k8s.io/kubectl v0.21.0-rc.0 -# kubevirt.io/client-go => kubevirt.io/client-go v0.29.0 # sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20210121023454-5ffc5f422a80 # sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20210626224711-5d94c794092f # sigs.k8s.io/cluster-api-provider-openstack => github.com/openshift/cluster-api-provider-openstack v0.0.0-20210302164104-8498241fa4bd