Skip to content

Commit 6f7d20c

Browse files
removing clusters no longer in the model from the domain portion of the project file (#201)
1 parent ff43c67 commit 6f7d20c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

webui/src/js/models/k8s-domain-definition.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,18 @@ define(['knockout', 'utils/observable-properties', 'utils/common-utilities', 'ut
206206
this.handlePrepareModelTopology = (domain) => {
207207
if (domain && Array.isArray(domain.clusters)) {
208208
domain.clusters.forEach(cluster => this.setClusterRow(cluster));
209+
// Remove any clusters that are no longer in the model
210+
//
211+
this.clusters.observable.remove(cluster => {
212+
let remove = true;
213+
for (const prepareModelCluster of domain.clusters) {
214+
if (prepareModelCluster.clusterName === cluster.name) {
215+
remove = false;
216+
break;
217+
}
218+
}
219+
return remove;
220+
});
209221
}
210222
};
211223

0 commit comments

Comments
 (0)