-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1754478: Migrate TemplateSource component from kubevirt-web-ui-co…
…mponents Signed-off-by: Ido Rosenzwig <irosenzw@redhat.com>
- Loading branch information
Showing
12 changed files
with
1,585 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,6 +195,5 @@ | |
}, | ||
"engines": { | ||
"node": ">=8.x" | ||
}, | ||
"version": "0.0.0" | ||
} | ||
} |
254 changes: 254 additions & 0 deletions
254
frontend/packages/kubevirt-plugin/integration-tests/tests/utils/templates.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
}, | ||
], | ||
}; |
Oops, something went wrong.