backport of commit 8da40465af3133df150cf0e0d10c7e1b36fd2151 (#18625)
Co-authored-by: Phil Renaud <phil.renaud@hashicorp.com>
This commit is contained in:
parent
00cf4f973d
commit
269111a369
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:bug
|
||||||
|
ui: using start/stop from the job page in the UI will no longer fail when the job lacks HCL submission data
|
||||||
|
```
|
|
@ -71,8 +71,17 @@ export default class Title extends Component {
|
||||||
*/
|
*/
|
||||||
@task(function* (withNotifications = false) {
|
@task(function* (withNotifications = false) {
|
||||||
const job = this.job;
|
const job = this.job;
|
||||||
const specification = yield job.fetchRawSpecification();
|
|
||||||
job.set('_newDefinition', specification.Source);
|
// Try to get the submission/hcl sourced specification first.
|
||||||
|
// In the event that this fails, fall back to the raw definition.
|
||||||
|
try {
|
||||||
|
const specification = yield job.fetchRawSpecification();
|
||||||
|
job.set('_newDefinition', specification.Source);
|
||||||
|
} catch {
|
||||||
|
const definition = yield job.fetchRawDefinition();
|
||||||
|
delete definition.Stop;
|
||||||
|
job.set('_newDefinition', JSON.stringify(definition));
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
yield job.parse();
|
yield job.parse();
|
||||||
|
|
Loading…
Reference in New Issue