mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 09:25:46 +03:00
Closes #7197 #7199 Note: Test coverage is limited to adapter and serializer unit tests. All acceptance tests have been stubbed and all features have been manually tested end-to-end. This represents Phase 1 of #6993 which is the core workflow of CSI in the UI. It includes a couple new pages for viewing all external volumes as well as the allocations associated with each. It also updates existing volume related views on job and allocation pages to handle both Host Volumes and CSI Volumes.
27 lines
916 B
JavaScript
27 lines
916 B
JavaScript
import { computed } from '@ember/object';
|
|
import { alias, equal } from '@ember/object/computed';
|
|
import attr from 'ember-data/attr';
|
|
import Fragment from 'ember-data-model-fragments/fragment';
|
|
import { fragmentOwner } from 'ember-data-model-fragments/attributes';
|
|
|
|
export default Fragment.extend({
|
|
task: fragmentOwner(),
|
|
|
|
volume: attr('string'),
|
|
|
|
volumeDeclaration: computed('task.taskGroup.volumes.@each.name', function() {
|
|
return this.task.taskGroup.volumes.findBy('name', this.volume);
|
|
}),
|
|
|
|
isCSI: equal('volumeDeclaration.type', 'csi'),
|
|
source: alias('volumeDeclaration.source'),
|
|
|
|
// 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.
|
|
namespace: alias('task.taskGroup.job.namespace'),
|
|
|
|
destination: attr('string'),
|
|
propagationMode: attr('string'),
|
|
readOnly: attr('boolean'),
|
|
});
|