Skip to content

Commit

Permalink
Merge pull request #103 from baoduy/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
baoduy authored Nov 25, 2024
2 parents e0ea6f6 + cc7326c commit ebe1721
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 38 deletions.
60 changes: 35 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
"lint": "npx eslint src/**/*.ts"
},
"devDependencies": {
"@types/chai": "^5.0.0",
"@types/chai": "^5.0.1",
"@types/mocha": "^10.0.9",
"@types/netmask": "^2.0.5",
"@types/node": "^22.7.7",
"@types/node": "^22.9.0",
"@types/node-forge": "^1.3.11",
"chai": "^5.1.1",
"chai": "^5.1.2",
"cpy-cli": "^5.0.0",
"cross-env": "^7.0.3",
"husky": "^9.1.6",
"husky": "^9.1.7",
"lint-staged": "^15.2.10",
"mocha": "^9.2.2",
"nyc": "^17.1.0",
Expand All @@ -56,9 +56,9 @@
},
"dependencies": {
"@drunk-pulumi/azure-providers": "^1.0.7",
"@pulumi/azure-native": "^2.67.0",
"@pulumi/azure-native": "^2.72.0",
"@pulumi/azuread": "6.0.1",
"@pulumi/pulumi": "^3.137.0",
"@pulumi/pulumi": "^3.139.0",
"@pulumi/random": "^4.16.7",
"@pulumi/tls": "^5.0.9",
"netmask": "^2.0.2",
Expand Down
6 changes: 5 additions & 1 deletion src/Aks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ const autoScaleFor = ({
nodeType,
env,
maxCount,
minCount = 1,
}: {
env: Environments;
nodeType: 'Default' | 'System' | 'User';
enableAutoScaling?: boolean;
maxCount?: number;
minCount?: number;
}) => {
const nodeCount = 1;
const minCount = 1;

if (!maxCount) {
switch (nodeType) {
Expand Down Expand Up @@ -118,6 +119,7 @@ export type AskFeatureProps = {
enablePrivateCluster?: boolean;
enableAutoScale?: boolean;
maxAutoScaleNodes?: number;
minAutoScaleNodes?: number;
enablePodIdentity?: boolean;
enableWorkloadIdentity?: boolean;
//enableDiagnosticSetting?: boolean;
Expand Down Expand Up @@ -309,6 +311,7 @@ export default async ({
env: currentEnv,
nodeType: 'System',
enableAutoScaling: features?.enableAutoScale,
minCount: features?.minAutoScaleNodes,
maxCount: features?.maxAutoScaleNodes,
}),

Expand Down Expand Up @@ -480,6 +483,7 @@ export default async ({
env: currentEnv,
nodeType: p.mode,
enableAutoScaling: features.enableAutoScale,
minCount: features?.minAutoScaleNodes,
maxCount: features?.maxAutoScaleNodes,
}),

Expand Down
12 changes: 7 additions & 5 deletions src/AzAd/EnvRoles/EnvRoles.Consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ const SignalRRoles: Record<EnvRoleKeyTypes, string[]> = {
admin: ['SignalR REST API Owner'],
};

// const RedisCacheRoles: Record<EnvRoleKeyTypes, string[]> = {
// readOnly: ['Azure Service Bus Data Receiver'],
// contributor: ['Azure Service Bus Data Sender'],
// admin: ['Azure Service Bus Data Owner'],
// };
const RedisCacheRoles: Record<EnvRoleKeyTypes, string[]> = {
readOnly: [],
contributor: ['Redis Cache Contributor'],
admin: [],
};

export const getRoleNames = ({
enableRGRoles,
Expand All @@ -201,6 +201,7 @@ export const getRoleNames = ({
enableAppConfig,
enableServiceBus,
enableSignalR,
enableRedisCache,
}: RoleEnableTypes): Record<EnvRoleKeyTypes, string[]> => {
const rs: ListRoleType = {
readOnly: new Set<string>(),
Expand All @@ -217,6 +218,7 @@ export const getRoleNames = ({
getRoleFor(enableAppConfig, AppConfigRoleNames, rs);
getRoleFor(enableServiceBus, ServiceBusRoles, rs);
getRoleFor(enableSignalR, SignalRRoles, rs);
getRoleFor(enableRedisCache, RedisCacheRoles, rs);

return {
readOnly: Array.from(rs.readOnly).sort(),
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ export type RoleEnableTypes = {
enableAppConfig?: RoleEnableItem;
enableServiceBus?: RoleEnableItem;
enableSignalR?: RoleEnableItem;
//enableRedisCache?: RoleEnableItem;
enableRedisCache?: RoleEnableItem;
};

export type ListRoleType = Record<EnvRoleKeyTypes, Set<string>>;
Expand Down

0 comments on commit ebe1721

Please sign in to comment.