github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/app/models/volume-mount.js (about) 1 import { computed } from '@ember/object'; 2 import { alias, equal } from '@ember/object/computed'; 3 import attr from 'ember-data/attr'; 4 import Fragment from 'ember-data-model-fragments/fragment'; 5 import { fragmentOwner } from 'ember-data-model-fragments/attributes'; 6 7 export default Fragment.extend({ 8 task: fragmentOwner(), 9 10 volume: attr('string'), 11 12 volumeDeclaration: computed('task.taskGroup.volumes.@each.name', function() { 13 return this.task.taskGroup.volumes.findBy('name', this.volume); 14 }), 15 16 isCSI: equal('volumeDeclaration.type', 'csi'), 17 source: alias('volumeDeclaration.source'), 18 19 // Since CSI volumes are namespaced, the link intent of a volume mount will 20 // be to the CSI volume with a namespace that matches this task's job's namespace. 21 namespace: alias('task.taskGroup.job.namespace'), 22 23 destination: attr('string'), 24 propagationMode: attr('string'), 25 readOnly: attr('boolean'), 26 });