-
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
13 changed files
with
1,557 additions
and
31 deletions.
There are no files selected for viewing
84 changes: 84 additions & 0 deletions
84
...end/packages/kubevirt-plugin/integration-tests/tests/utils/templates/containerTemplate.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,84 @@ | ||
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', | ||
}, | ||
], | ||
}; |
82 changes: 82 additions & 0 deletions
82
frontend/packages/kubevirt-plugin/integration-tests/tests/utils/templates/pxeTemplate.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,82 @@ | ||
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', | ||
}, | ||
], | ||
}; |
86 changes: 86 additions & 0 deletions
86
frontend/packages/kubevirt-plugin/integration-tests/tests/utils/templates/urlTemplate.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,86 @@ | ||
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', | ||
}, | ||
], | ||
}; |
Oops, something went wrong.