open-nomad/ui/app/models/volume-mount.js
Buck Doyle e9e52e0dfe
Update Ember/Ember CLI to 3.20 (#9641)
This doesn’t include Ember Data, as we are still back on 3.12.

Most changes are deprecation updates, linting fixes, and dependencies. It can
be read commit-by-commit, though many of them are mechanical and skimmable.
For the new linting exclusions, I’ve added them to the Tech Debt list.

The decrease in test count is because linting is no longer included in ember test.

There’s a new deprecation warning in the logs that can be fixed by updating Ember
Power Select but when I tried that it caused it to render incorrectly, so I decided to
ignore it for now and address it separately.
2021-02-17 15:01:44 -06:00

28 lines
944 B
JavaScript

import { computed } from '@ember/object';
import { alias, equal } from '@ember/object/computed';
import { attr } from '@ember-data/model';
import Fragment from 'ember-data-model-fragments/fragment';
import { fragmentOwner } from 'ember-data-model-fragments/attributes';
export default class VolumeMount extends Fragment {
@fragmentOwner() task;
@attr('string') volume;
@computed('task.taskGroup.volumes.@each.name', 'volume')
get volumeDeclaration() {
return this.task.taskGroup.volumes.findBy('name', this.volume);
}
@equal('volumeDeclaration.type', 'csi') isCSI;
@alias('volumeDeclaration.source') 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.
@alias('task.taskGroup.job.namespace') namespace;
@attr('string') destination;
@attr('string') propagationMode;
@attr('boolean') readOnly;
}