mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
[ui] Fix a bug where promotion would be asked with no new canaries (#20408)
* Fix a UI bug where promotion would be asked with no new canaries * Because we now make sure of your allocations, our test cases should more accurately reflect a state of a promotable workflow
This commit is contained in:
3
.changelog/20408.txt
Normal file
3
.changelog/20408.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
ui: Fix a bug where the UI would prompt a user to promote a deployment with unplaced canaries
|
||||
```
|
||||
@@ -42,8 +42,9 @@ export default class JobStatusPanelDeployingComponent extends Component {
|
||||
const relevantAllocs = this.job.allocations.filter(
|
||||
(a) => !a.isOld && a.isCanary && !a.hasBeenRescheduled
|
||||
);
|
||||
return relevantAllocs.every(
|
||||
(a) => a.clientStatus === 'running' && a.isHealthy
|
||||
return (
|
||||
relevantAllocs.length &&
|
||||
relevantAllocs.every((a) => a.clientStatus === 'running' && a.isHealthy)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -227,11 +227,25 @@ module('Integration | Component | job-page/service', function (hooks) {
|
||||
this.server.create('node');
|
||||
const mirageJob = makeMirageJob(this.server, { activeDeployment: true });
|
||||
|
||||
await this.store.findAll('job');
|
||||
const fullId = JSON.stringify([mirageJob.name, 'default']);
|
||||
await this.store.findRecord('job', fullId);
|
||||
|
||||
const job = this.store.peekAll('job').findBy('plainId', mirageJob.id);
|
||||
this.server.db.jobs.update(mirageJob.id, {
|
||||
activeDeployment: true,
|
||||
noDeployments: true,
|
||||
});
|
||||
const deployment = await job.get('latestDeployment');
|
||||
|
||||
server.create('allocation', {
|
||||
jobId: mirageJob.id,
|
||||
deploymentId: deployment.id,
|
||||
clientStatus: 'running',
|
||||
deploymentStatus: {
|
||||
Healthy: true,
|
||||
Canary: true,
|
||||
},
|
||||
});
|
||||
this.setProperties(commonProperties(job));
|
||||
await render(commonTemplate);
|
||||
|
||||
@@ -259,9 +273,25 @@ module('Integration | Component | job-page/service', function (hooks) {
|
||||
this.server.create('node');
|
||||
const mirageJob = makeMirageJob(this.server, { activeDeployment: true });
|
||||
|
||||
await this.store.findAll('job');
|
||||
const fullId = JSON.stringify([mirageJob.name, 'default']);
|
||||
await this.store.findRecord('job', fullId);
|
||||
|
||||
const job = this.store.peekAll('job').findBy('plainId', mirageJob.id);
|
||||
this.server.db.jobs.update(mirageJob.id, {
|
||||
activeDeployment: true,
|
||||
noDeployments: true,
|
||||
});
|
||||
const deployment = await job.get('latestDeployment');
|
||||
|
||||
server.create('allocation', {
|
||||
jobId: mirageJob.id,
|
||||
deploymentId: deployment.id,
|
||||
clientStatus: 'running',
|
||||
deploymentStatus: {
|
||||
Healthy: true,
|
||||
Canary: true,
|
||||
},
|
||||
});
|
||||
|
||||
this.setProperties(commonProperties(job));
|
||||
await render(commonTemplate);
|
||||
|
||||
Reference in New Issue
Block a user