Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
[OKD-core] Add YAML template for VirtualMachineModel
Browse files Browse the repository at this point in the history
  • Loading branch information
rawagner committed Jan 23, 2019
1 parent 3471088 commit 7b96b29
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
37 changes: 37 additions & 0 deletions frontend/public/kubevirt/models/vm-yaml-templates.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import * as k8sModels from '../models';

export const vmYamlTemplate = `
apiVersion: ${k8sModels.VirtualMachineModel.apiGroup}/${k8sModels.VirtualMachineModel.apiVersion}
kind: VirtualMachine
metadata:
name: example
spec:
running: false
template:
spec:
domain:
devices:
disks:
- name: containerdisk
disk:
bus: virtio
- name: cloudinitdisk
disk:
bus: virtio
interfaces:
- name: default
bridge: {}
resources:
requests:
memory: 64M
networks:
- name: default
pod: {}
volumes:
- name: containerdisk
containerDisk:
image: kubevirt/cirros-registry-disk-demo
- name: cloudinitdisk
cloudInitNoCloud:
userDataBase64: SGkuXG4=
`;
4 changes: 3 additions & 1 deletion frontend/public/models/yaml-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Map as ImmutableMap } from 'immutable';
import { GroupVersionKind, referenceForModel } from '../module/k8s';
import * as k8sModels from '../models';

import { vmYamlTemplate } from '../kubevirt/models/vm-yaml-templates';

/**
* Sample YAML manifests for some of the statically-defined Kubernetes models.
*/
Expand Down Expand Up @@ -767,4 +769,4 @@ spec:
delayAfterAdd: 10s
delayAfterDelete: 10s
delayAfterFailure: 10s
`);
`).setIn([referenceForModel(k8sModels.VirtualMachineModel), 'default'], vmYamlTemplate);

0 comments on commit 7b96b29

Please sign in to comment.