Skip to content

Commit

Permalink
Bug 1754478: Migrate TemplateSource component from kubevirt-web-ui-co…
Browse files Browse the repository at this point in the history
…mponents

Signed-off-by: Ido Rosenzwig <irosenzw@redhat.com>
  • Loading branch information
irosenzw committed Nov 7, 2019
1 parent 97bce69 commit feedfb7
Show file tree
Hide file tree
Showing 12 changed files with 1,585 additions and 29 deletions.
3 changes: 1 addition & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,5 @@
},
"engines": {
"node": ">=8.x"
},
"version": "0.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
export const urlTemplate = {
apiVersion: 'template.openshift.io/v1',
kind: 'Template',
metadata: {
annotations: {
description: 'foo description',
'name.os.template.kubevirt.io/fedora29': 'Fedora 29',
},
labels: {
'flavor.template.kubevirt.io/small': 'true',
'os.template.kubevirt.io/fedora29': 'true',
'template.kubevirt.io/type': 'vm',
'vm.kubevirt.io/template': 'fedora-generic',
'vm.kubevirt.io/template-namespace': 'default',
'workload.template.kubevirt.io/generic': 'true',
},
name: 'url-template',
namespace: 'myproject',
},
objects: [
{
apiVersion: 'kubevirt.io/v1alpha3',
kind: 'VirtualMachine',
metadata: {
// eslint-disable-next-line no-template-curly-in-string
name: '${NAME}',
},
spec: {
template: {
spec: {
domain: {
cpu: {
cores: 2,
},
devices: {
disks: [
{
bootOrder: 1,
disk: {
bus: 'virtio',
},
name: 'rootdisk',
},
],
interfaces: [
{
bridge: {},
name: 'eth0',
},
],
rng: {},
},
resources: {
requests: {
memory: '2G',
},
},
},
networks: [
{
name: 'eth0',
pod: {},
},
],
terminationGracePeriodSeconds: 0,
volumes: [
{
dataVolume: {
// eslint-disable-next-line no-template-curly-in-string
name: 'url-template-rootdisk',
},
name: 'rootdisk',
},
],
},
},
},
},
],
parameters: [
{
description: 'Name for the new VM',
name: 'NAME',
},
],
};

export const containerTemplate = {
apiVersion: 'template.openshift.io/v1',
kind: 'Template',
metadata: {
labels: {
'flavor.template.kubevirt.io/small': 'true',
'os.template.kubevirt.io/fedora29': 'true',
'template.kubevirt.io/type': 'vm',
'vm.kubevirt.io/template': 'fedora-generic',
'vm.kubevirt.io/template-namespace': 'default',
'workload.template.kubevirt.io/generic': 'true',
},
annotations: {
'name.os.template.kubevirt.io/fedora29': 'Fedora 29',
},
name: 'container-template',
namespace: 'myproject',
},
objects: [
{
apiVersion: 'kubevirt.io/v1alpha3',
kind: 'VirtualMachine',
metadata: {
// eslint-disable-next-line no-template-curly-in-string
name: '${NAME}',
},
spec: {
template: {
spec: {
domain: {
cpu: {
cores: 2,
},
devices: {
disks: [
{
bootOrder: 1,
disk: {
bus: 'virtio',
},
name: 'rootdisk',
},
],
interfaces: [
{
bridge: {},
name: 'eth0',
},
],
rng: {},
},
resources: {
requests: {
memory: '2G',
},
},
},
networks: [
{
name: 'eth0',
pod: {},
},
],
terminationGracePeriodSeconds: 0,
volumes: [
{
name: 'rootdisk',
containerDisk: {
image: 'fooContainer',
},
},
],
},
},
},
},
],
parameters: [
{
description: 'Name for the new VM',
name: 'NAME',
},
],
};

export const pxeTemplate = {
apiVersion: 'template.openshift.io/v1',
kind: 'Template',
metadata: {
labels: {
'flavor.template.kubevirt.io/small': 'true',
'os.template.kubevirt.io/fedora29': 'true',
'template.kubevirt.io/type': 'vm',
'vm.kubevirt.io/template': 'fedora-generic',
'vm.kubevirt.io/template-namespace': 'default',
'workload.template.kubevirt.io/generic': 'true',
},
annotations: {
'name.os.template.kubevirt.io/fedora29': 'Fedora 29',
},
name: 'pxe-template',
namespace: 'myproject',
},
objects: [
{
apiVersion: 'kubevirt.io/v1alpha3',
kind: 'VirtualMachine',
metadata: {
annotations: {
'kubevirt.ui/firstBoot': 'true',
'kubevirt.ui/pxeInterface': 'eth1',
},
// eslint-disable-next-line no-template-curly-in-string
name: '${NAME}',
},
spec: {
template: {
spec: {
domain: {
cpu: {
cores: 2,
},
devices: {
interfaces: [
{
bridge: {},
name: 'eth0',
},
{
bootOrder: 1,
bridge: {},
name: 'eth1',
},
],
rng: {},
},
resources: {
requests: {
memory: '2G',
},
},
},
networks: [
{
name: 'eth0',
pod: {},
},
{
multus: {
networkName: 'pxe-net-conf',
},
name: 'eth1',
},
],
terminationGracePeriodSeconds: 0,
},
},
},
},
],
parameters: [
{
description: 'Name for the new VM',
name: 'NAME',
},
],
};

0 comments on commit feedfb7

Please sign in to comment.