@firestartr/cli 1.49.0-snapshot-8 → 1.49.0-snapshot-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +9 -4
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -302667,15 +302667,20 @@ function validatePermissionsUniqueness(crs) {
|
|
|
302667
302667
|
const permissions = cr.spec.permissions;
|
|
302668
302668
|
cdk8s_renderer_src_logger.debug(`Validating Permissions Uniqueness of ${crkey}`);
|
|
302669
302669
|
if (permissions) {
|
|
302670
|
-
const
|
|
302670
|
+
const rolesByIdentifier = new Map();
|
|
302671
302671
|
for (const perm of permissions) {
|
|
302672
302672
|
const identifier = perm.collaborator
|
|
302673
302673
|
? perm.collaborator
|
|
302674
302674
|
: `ref:${perm.ref.kind}:${perm.ref.name}`;
|
|
302675
|
-
|
|
302676
|
-
|
|
302675
|
+
const role = perm.role;
|
|
302676
|
+
if (rolesByIdentifier.has(identifier)) {
|
|
302677
|
+
const prevRole = rolesByIdentifier.get(identifier);
|
|
302678
|
+
if (prevRole !== role) {
|
|
302679
|
+
throw new Error(`Conflicting permission role in FirestartrGithubRepository ${crkey}: ${identifier} has roles "${prevRole}" and "${role}".\nFull CR: ${JSON.stringify(cr, null, 2)}`);
|
|
302680
|
+
}
|
|
302681
|
+
continue;
|
|
302677
302682
|
}
|
|
302678
|
-
|
|
302683
|
+
rolesByIdentifier.set(identifier, role);
|
|
302679
302684
|
}
|
|
302680
302685
|
}
|
|
302681
302686
|
}
|