Skip to content
Snippets Groups Projects

fix: ensure sort coder and runtime volumes to avoid recreation

Merged TheLD requested to merge dev into master
1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
+ 4
4
@@ -71,7 +71,7 @@ export const applyCurrentCoderStack = async (removeOrphans?: boolean) => {
// services section
const container: coderContainerJSON[] = coder.map(c => {
// runtime volume mappings
const mappedVolumes = c.runtimes.map(r => ({
const mappedVolumes: Array<{ source: string; target: string }> = c.runtimes.map(r => ({
source: runtimeStack + '_' + r._id,
target: '/home/coder/repositories/' + r.title,
}));
@@ -94,7 +94,7 @@ export const applyCurrentCoderStack = async (removeOrphans?: boolean) => {
name: c.title.toLocaleLowerCase(),
gitUser: c.user.username,
gitEmail: c.user.email,
volumes: mappedVolumes,
volumes: mappedVolumes.sort((a, b) => a.source.localeCompare(b.source)),
};
if (c.customPassword) cJson.password = c.customPassword;
return cJson;
@@ -103,8 +103,8 @@ export const applyCurrentCoderStack = async (removeOrphans?: boolean) => {
stack: coderStack,
runtimeStack: runtimeStack,
domain: coderDomain,
container,
volumes,
container: container.sort((a, b) => a.name.localeCompare(b.name)),
volumes: volumes.sort((a, b) => a.name.localeCompare(b.name)),
};
return sendStackJSON(stack, { removeOrphans, template: 'coder', endpoint: apiEndpoint });
};
Loading