Skip to content

Commit

Permalink
chore: improve
Browse files Browse the repository at this point in the history
  • Loading branch information
StarpTech committed Mar 14, 2024
1 parent 2614475 commit 1ab5c2b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions controlplane/src/core/composition/composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class Composer {
secret: admissionConfig.jwtSecret,
token: {
iat: nowInSeconds() + 5 * 60, // 5 minutes
aud: 'admission-hooks',
aud: 'admission-hooks', // to distinguish from other tokens
organization_id: organizationId,
federated_graph_id: composedGraph.id,
},
Expand Down Expand Up @@ -256,8 +256,18 @@ export class Composer {
}
}

const errors: ComposeDeploymentError[] = [];

if (deploymentError) {
errors.push(deploymentError);
}

if (admissionError) {
errors.push(admissionError);
}

return {
errors: [deploymentError, admissionError].filter(Boolean) as ComposeDeploymentError[],
errors,
};
}

Expand Down

0 comments on commit 1ab5c2b

Please sign in to comment.