Skip to content

Commit

Permalink
Add crd manifest auto generation
Browse files Browse the repository at this point in the history
Signed-off-by: David Vossel <[email protected]>
  • Loading branch information
davidvossel committed Apr 4, 2018
1 parent 2088a58 commit 563cc20
Show file tree
Hide file tree
Showing 9 changed files with 1,695 additions and 56 deletions.
77 changes: 52 additions & 25 deletions api/openapi-spec/swagger.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions hack/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ ${KUBEVIRT_DIR}/hack/build-go.sh generate ${WHAT}
(cd ${KUBEVIRT_DIR}/tools/openapispec/ && go build)
goimports -w -local kubevirt.io ${KUBEVIRT_DIR}/cmd/ ${KUBEVIRT_DIR}/pkg/ ${KUBEVIRT_DIR}/tests/
${KUBEVIRT_DIR}/tools/openapispec/openapispec --dump-api-spec-path ${KUBEVIRT_DIR}/api/openapi-spec/swagger.json

(cd ${KUBEVIRT_DIR}/tools/crd-generator/ && go build)
${KUBEVIRT_DIR}/tools/crd-generator/crd-generator --crd-type=vm >${KUBEVIRT_DIR}/manifests/generated/vm-resource.yaml
${KUBEVIRT_DIR}/tools/crd-generator/crd-generator --crd-type=vmrs >${KUBEVIRT_DIR}/manifests/generated/vmrs-resource.yaml
${KUBEVIRT_DIR}/tools/crd-generator/crd-generator --crd-type=vmpreset >${KUBEVIRT_DIR}/manifests/generated/vmpreset-resource.yaml
${KUBEVIRT_DIR}/tools/crd-generator/crd-generator --crd-type=ovm >${KUBEVIRT_DIR}/manifests/generated/ovm-resource.yaml
396 changes: 396 additions & 0 deletions manifests/generated/ovm-resource.yaml

Large diffs are not rendered by default.

367 changes: 367 additions & 0 deletions manifests/generated/vm-resource.yaml

Large diffs are not rendered by default.

267 changes: 267 additions & 0 deletions manifests/generated/vmpreset-resource.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: null
labels:
kubevirt.io: ""
name: virtualmachinepresets.kubevirt.io
spec:
group: kubevirt.io
names:
kind: VirtualMachinePreset
plural: virtualmachinepresets
shortNames:
- vmpreset
- vmpresets
singular: virtualmachinepreset
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
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
kind:
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
metadata: {}
spec:
properties:
domain:
properties:
clock:
description: Represents the clock and timers of a vm
properties:
timezone:
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
utc:
description: UTC sets the guest clock to UTC on each boot.
properties:
offsetSeconds:
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.
format: int32
type: integer
cpu:
description: CPU allow specifying the CPU topology
properties:
cores:
description: Cores specifies the number of cores inside the
vm. Must be a value greater or equal 1.
format: int64
type: integer
devices:
properties:
disks:
description: Disks describes disks, cdroms, floppy and luns
which are connected to the vm
items:
properties:
cdrom:
properties:
bus:
description: 'Bus indicates the type of disk device
to emulate. supported values: virtio, sata, scsi,
ide'
type: string
readonly:
description: ReadOnly Defaults to true
type: boolean
tray:
description: Tray indicates if the tray of the device
is open or closed. Allowed values are "open" and
"closed" Defaults to closed
type: string
disk:
properties:
bus:
description: 'Bus indicates the type of disk device
to emulate. supported values: virtio, sata, scsi,
ide'
type: string
readonly:
description: ReadOnly Defaults to false
type: boolean
floppy:
properties:
readonly:
description: ReadOnly Defaults to false
type: boolean
tray:
description: Tray indicates if the tray of the device
is open or closed. Allowed values are "open" and
"closed" Defaults to closed
type: string
lun:
properties:
bus:
description: 'Bus indicates the type of disk device
to emulate. supported values: virtio, sata, scsi,
ide'
type: string
readonly:
description: ReadOnly Defaults to false
type: boolean
name:
description: Name is the device name
type: string
volumeName:
description: Name of the volume which is referenced Must
match the Name of a Volume.
type: string
required:
- name
- volumeName
type: array
watchdog:
description: Named watchdog device
properties:
i6300esb:
description: i6300esb watchdog device
properties:
action:
description: The action to take. Valid values are poweroff,
reset, shutdown. Defaults to reset
type: string
name:
description: Name of the watchdog
type: string
required:
- name
features:
properties:
acpi:
description: Represents if a feature is enabled or disabled
properties:
enabled:
description: Enabled determines if the feature should be
enabled or disabled on the guest Defaults to true
type: boolean
apic:
properties:
enabled:
description: Enabled determines if the feature should be
enabled or disabled on the guest Defaults to true
type: boolean
endOfInterrupt:
description: EndOfInterrupt enables the end of interrupt
notification in the guest Defaults to false
type: boolean
hyperv:
description: Hyperv specific features
properties:
relaxed:
description: Represents if a feature is enabled or disabled
properties:
enabled:
description: Enabled determines if the feature should
be enabled or disabled on the guest Defaults to true
type: boolean
reset:
description: Represents if a feature is enabled or disabled
properties:
enabled:
description: Enabled determines if the feature should
be enabled or disabled on the guest Defaults to true
type: boolean
runtime:
description: Represents if a feature is enabled or disabled
properties:
enabled:
description: Enabled determines if the feature should
be enabled or disabled on the guest Defaults to true
type: boolean
spinlocks:
properties:
enabled:
description: Enabled determines if the feature should
be enabled or disabled on the guest Defaults to true
type: boolean
spinlocks:
description: Retries indicates the number of retries
Must be a value greater or equal 4096 Defaults to
4096
format: int64
type: integer
synic:
description: Represents if a feature is enabled or disabled
properties:
enabled:
description: Enabled determines if the feature should
be enabled or disabled on the guest Defaults to true
type: boolean
synictimer:
description: Represents if a feature is enabled or disabled
properties:
enabled:
description: Enabled determines if the feature should
be enabled or disabled on the guest Defaults to true
type: boolean
vapic:
description: Represents if a feature is enabled or disabled
properties:
enabled:
description: Enabled determines if the feature should
be enabled or disabled on the guest Defaults to true
type: boolean
vendorid:
properties:
enabled:
description: Enabled determines if the feature should
be enabled or disabled on the guest Defaults to true
type: boolean
vendorid:
description: VendorID sets the hypervisor vendor id,
visible to the vm String up to twelve characters
type: string
vpindex:
description: Represents if a feature is enabled or disabled
properties:
enabled:
description: Enabled determines if the feature should
be enabled or disabled on the guest Defaults to true
type: boolean
firmware:
properties:
uuid:
description: UUID reported by the vm bios Defaults to a random
generated uid
type: string
machine:
properties:
type:
description: QEMU machine type is the actual chipset of the
VM.
type: string
required:
- type
resources:
properties:
limits:
description: Limits describes the maximum amount of compute
resources allowed. Valid resource keys are "memory" and "cpu".
type: object
requests:
description: Requests is a description of the initial vm resources.
Valid resource keys are "memory" and "cpu".
type: object
required:
- devices
selector: {}
required:
- selector
version: v1alpha1
status:
acceptedNames:
kind: ""
plural: ""
conditions: null
Loading

0 comments on commit 563cc20

Please sign in to comment.