github.com/hernad/nomad@v1.6.112/ui/app/models/volume-mount.js (about) 1 /** 2 * Copyright (c) HashiCorp, Inc. 3 * SPDX-License-Identifier: MPL-2.0 4 */ 5 6 import { computed } from '@ember/object'; 7 import { alias, equal } from '@ember/object/computed'; 8 import { attr } from '@ember-data/model'; 9 import Fragment from 'ember-data-model-fragments/fragment'; 10 import { fragmentOwner } from 'ember-data-model-fragments/attributes'; 11 12 export default class VolumeMount extends Fragment { 13 @fragmentOwner() task; 14 15 @attr('string') volume; 16 17 @computed('task.taskGroup.volumes.@each.name', 'volume') 18 get volumeDeclaration() { 19 return this.task.taskGroup.volumes.findBy('name', this.volume); 20 } 21 22 @equal('volumeDeclaration.type', 'csi') isCSI; 23 @alias('volumeDeclaration.source') source; 24 25 // Since CSI volumes are namespaced, the link intent of a volume mount will 26 // be to the CSI volume with a namespace that matches this task's job's namespace. 27 @alias('task.taskGroup.job.namespace') namespace; 28 29 @attr('string') destination; 30 @attr('string') propagationMode; 31 @attr('boolean') readOnly; 32 }