2020-02-13 06:14:28 +00:00
|
|
|
import { computed } from '@ember/object';
|
2020-03-25 12:51:26 +00:00
|
|
|
import { alias, equal } from '@ember/object/computed';
|
2021-02-17 21:01:44 +00:00
|
|
|
import { attr } from '@ember-data/model';
|
2020-02-11 00:19:28 +00:00
|
|
|
import Fragment from 'ember-data-model-fragments/fragment';
|
2020-02-13 06:14:28 +00:00
|
|
|
import { fragmentOwner } from 'ember-data-model-fragments/attributes';
|
2020-02-11 00:19:28 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
export default class VolumeMount extends Fragment {
|
|
|
|
@fragmentOwner() task;
|
2020-02-13 06:14:28 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@attr('string') volume;
|
2020-03-25 12:51:26 +00:00
|
|
|
|
2021-02-17 21:01:44 +00:00
|
|
|
@computed('task.taskGroup.volumes.@each.name', 'volume')
|
2020-06-10 13:49:16 +00:00
|
|
|
get volumeDeclaration() {
|
2020-03-25 12:51:26 +00:00
|
|
|
return this.task.taskGroup.volumes.findBy('name', this.volume);
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
2020-02-11 00:19:28 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@equal('volumeDeclaration.type', 'csi') isCSI;
|
|
|
|
@alias('volumeDeclaration.source') source;
|
2020-03-25 12:51:26 +00:00
|
|
|
|
|
|
|
// Since CSI volumes are namespaced, the link intent of a volume mount will
|
|
|
|
// be to the CSI volume with a namespace that matches this task's job's namespace.
|
2020-06-10 13:49:16 +00:00
|
|
|
@alias('task.taskGroup.job.namespace') namespace;
|
2020-03-25 12:51:26 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@attr('string') destination;
|
|
|
|
@attr('string') propagationMode;
|
|
|
|
@attr('boolean') readOnly;
|
|
|
|
}
|