open-nomad/ui/mirage/factories/task.js
2020-02-13 17:11:30 -08:00

21 lines
531 B
JavaScript

import { Factory } from 'ember-cli-mirage';
import faker from 'nomad-ui/mirage/faker';
import { generateResources } from '../common';
const DRIVERS = ['docker', 'java', 'rkt', 'qemu', 'exec', 'raw_exec'];
export default Factory.extend({
// Hidden property used to compute the Summary hash
groupNames: [],
// Set in the TaskGroup factory
volumeMounts: [],
JobID: '',
name: id => `task-${faker.hacker.noun().dasherize()}-${id}`,
driver: () => faker.helpers.randomize(DRIVERS),
Resources: generateResources,
});