Skip to content

Commit

Permalink
chore(generation): Sort CRDs by name
Browse files Browse the repository at this point in the history
Fixes unstable generation order based on OS differences
  • Loading branch information
danopia committed Aug 12, 2023
1 parent 8a0871f commit b64fa05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion generation/run-on-crds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ for await (const dirEntry of Deno.readDir(Deno.args[0])) {
}
}

// Sort CRDs by name, to ensure we use a stable order
v1CRDs.sort((a,b) => a.metadata!.name!.localeCompare(b.metadata!.name!));

const apiMap = new SurfaceMap({
paths: {},
definitions: {},
Expand Down Expand Up @@ -482,7 +485,7 @@ function fixupSchema(schema: OpenAPI2SchemaObject, shapePrefix: string, defMap:
return;
}
}

fixupSchema(originalItems, shapePrefix, defMap, [...path, '*']);

if (path.join('.').endsWith('Issuer.spec.acme.solvers')) {
Expand Down

0 comments on commit b64fa05

Please sign in to comment.