Skip to content

Commit 077f803

Browse files
deps: bump the production-dependencies group with 8 updates (#315)
Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com>
1 parent af6771c commit 077f803

15 files changed

Lines changed: 433 additions & 504 deletions

backend/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
"test:coverage": "bun test --coverage"
2222
},
2323
"dependencies": {
24-
"@hono/zod-validator": "^0.7.6",
25-
"@kubernetes/client-node": "^0.21.0",
24+
"@hono/zod-validator": "^0.8.0",
25+
"@kubernetes/client-node": "^1.0.0",
2626
"hono": "^4.10.7",
2727
"js-yaml": "^4.1.1",
2828
"pino": "^10.1.0",
29-
"zod": "^3.25.76",
29+
"zod": "^4.0.0",
3030
"@airunway/shared": "workspace:*"
3131
},
3232
"devDependencies": {

backend/src/routes/aiconfigurator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ aiconfigurator.post('/analyze', async (c) => {
3333

3434
const validation = analyzeSchema.safeParse(body);
3535
if (!validation.success) {
36-
const errors = validation.error.errors.map(e => `${e.path.join('.')}: ${e.message}`);
36+
const errors = validation.error.issues.map(e => `${e.path.join('.')}: ${e.message}`);
3737
logger.warn({ errors }, 'AI Configurator analyze validation failed');
3838
return c.json(
3939
{ error: { message: 'Invalid request', errors, statusCode: 400 } },

backend/src/routes/deployments.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ const createDeploymentSchema = z.object({
151151
gpu: z.number().int().min(0),
152152
memory: z.string().optional(),
153153
}).optional(),
154-
engineArgs: z.record(z.unknown()).optional(),
155-
providerOverrides: z.record(z.unknown()).optional(),
154+
engineArgs: z.record(z.string(), z.unknown()).optional(),
155+
providerOverrides: z.record(z.string(), z.unknown()).optional(),
156156
prefillReplicas: z.number().int().min(0).optional(),
157157
decodeReplicas: z.number().int().min(0).optional(),
158158
prefillGpus: z.number().int().min(0).optional(),

backend/src/services/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ class AuthService {
7575
},
7676
};
7777

78-
const response = await this.authApi.createTokenReview(tokenReview);
79-
const status = response.body.status;
78+
const response = await this.authApi.createTokenReview({ body: tokenReview });
79+
const status = response.status;
8080

8181
if (status?.authenticated) {
8282
return {

backend/src/services/autoscaler.ts

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ class AutoscalerService {
2828
{ operationName: 'isAKSCluster', maxRetries: 1 }
2929
);
3030

31-
if (nodesResponse.body.items.length === 0) {
31+
if (nodesResponse.items.length === 0) {
3232
return false;
3333
}
3434

35-
const node = nodesResponse.body.items[0];
35+
const node = nodesResponse.items[0];
3636
const labels = node.metadata?.labels || {};
3737
const providerID = node.spec?.providerID || '';
3838

@@ -65,7 +65,7 @@ class AutoscalerService {
6565
// Count unique node pools (agentpools) that have autoscaling enabled
6666
const autoscalingNodePools = new Set<string>();
6767

68-
for (const node of nodesResponse.body.items) {
68+
for (const node of nodesResponse.items) {
6969
const labels = node.metadata?.labels || {};
7070

7171
// AKS labels autoscaler-enabled nodes with this label
@@ -127,23 +127,19 @@ class AutoscalerService {
127127

128128
// Fallback: Look for cluster-autoscaler deployment
129129
const deploymentsResponse = await withRetry(
130-
() => this.appsV1Api.listNamespacedDeployment(
131-
'kube-system',
132-
undefined,
133-
undefined,
134-
undefined,
135-
undefined,
136-
'app=cluster-autoscaler'
137-
),
130+
() => this.appsV1Api.listNamespacedDeployment({
131+
namespace: 'kube-system',
132+
labelSelector: 'app=cluster-autoscaler',
133+
}),
138134
{ operationName: 'detectClusterAutoscalerDeployment', maxRetries: 1 }
139135
);
140136

141-
const deployments = deploymentsResponse.body.items;
137+
const deployments = deploymentsResponse.items;
142138

143139
if (deployments.length === 0) {
144140
// Try without label selector
145-
const allDeployments = await this.appsV1Api.listNamespacedDeployment('kube-system');
146-
const caDeployment = allDeployments.body.items.find(
141+
const allDeployments = await this.appsV1Api.listNamespacedDeployment({ namespace: 'kube-system' });
142+
const caDeployment = allDeployments.items.find(
147143
d => d.metadata?.name?.includes('cluster-autoscaler')
148144
);
149145

@@ -181,14 +177,14 @@ class AutoscalerService {
181177
async getAutoscalerStatus(): Promise<AutoscalerStatusInfo | null> {
182178
try {
183179
const configMapResponse = await withRetry(
184-
() => this.coreV1Api.readNamespacedConfigMap(
185-
'cluster-autoscaler-status',
186-
'kube-system'
187-
),
180+
() => this.coreV1Api.readNamespacedConfigMap({
181+
name: 'cluster-autoscaler-status',
182+
namespace: 'kube-system',
183+
}),
188184
{ operationName: 'getAutoscalerStatus', maxRetries: 1 }
189185
);
190186

191-
const configMap = configMapResponse.body;
187+
const configMap = configMapResponse;
192188
const statusData = configMap.data?.['status'] || '{}';
193189

194190
let parsedStatus: any;

backend/src/services/config.ts

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,19 @@ class ConfigService {
4545
*/
4646
private async ensureNamespace(): Promise<void> {
4747
try {
48-
await this.coreV1Api.readNamespace(CONFIG_NAMESPACE);
48+
await this.coreV1Api.readNamespace({ name: CONFIG_NAMESPACE });
4949
} catch (error: unknown) {
5050
const k8sError = error as { response?: { statusCode?: number } };
5151
if (k8sError?.response?.statusCode === 404) {
5252
// Create namespace
5353
await this.coreV1Api.createNamespace({
54-
metadata: {
55-
name: CONFIG_NAMESPACE,
56-
labels: {
57-
'app.kubernetes.io/name': 'airunway',
58-
'app.kubernetes.io/managed-by': 'airunway',
54+
body: {
55+
metadata: {
56+
name: CONFIG_NAMESPACE,
57+
labels: {
58+
'app.kubernetes.io/name': 'airunway',
59+
'app.kubernetes.io/managed-by': 'airunway',
60+
},
5961
},
6062
},
6163
});
@@ -77,12 +79,12 @@ class ConfigService {
7779
}
7880

7981
try {
80-
const response = await this.coreV1Api.readNamespacedConfigMap(
81-
CONFIG_NAME,
82-
CONFIG_NAMESPACE
83-
);
82+
const response = await this.coreV1Api.readNamespacedConfigMap({
83+
name: CONFIG_NAME,
84+
namespace: CONFIG_NAMESPACE,
85+
});
8486

85-
const configData = response.body.data?.[CONFIG_KEY];
87+
const configData = response.data?.[CONFIG_KEY];
8688
if (configData) {
8789
this.cachedConfig = JSON.parse(configData) as AppConfig;
8890
this.initialized = true;
@@ -135,19 +137,19 @@ class ConfigService {
135137

136138
try {
137139
// Try to update existing ConfigMap
138-
await this.coreV1Api.replaceNamespacedConfigMap(
139-
CONFIG_NAME,
140-
CONFIG_NAMESPACE,
141-
configMapBody
142-
);
140+
await this.coreV1Api.replaceNamespacedConfigMap({
141+
name: CONFIG_NAME,
142+
namespace: CONFIG_NAMESPACE,
143+
body: configMapBody,
144+
});
143145
} catch (error: unknown) {
144146
const k8sError = error as { response?: { statusCode?: number } };
145147
if (k8sError?.response?.statusCode === 404) {
146148
// Create new ConfigMap
147-
await this.coreV1Api.createNamespacedConfigMap(
148-
CONFIG_NAMESPACE,
149-
configMapBody
150-
);
149+
await this.coreV1Api.createNamespacedConfigMap({
150+
namespace: CONFIG_NAMESPACE,
151+
body: configMapBody,
152+
});
151153
} else {
152154
throw error;
153155
}

backend/src/services/kubernetes-gateway.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ describe('kubernetesService.getGatewayStatus', () => {
1717
// The customObjectsApi is private; reach in just for tests so we can stub
1818
// listClusterCustomObject without spinning up a real Kubernetes API server.
1919
const svc = kubernetesService as unknown as {
20-
customObjectsApi: { listClusterCustomObject: (...args: unknown[]) => Promise<{ body: unknown }> };
20+
customObjectsApi: { listClusterCustomObject: (arg: any) => Promise<unknown> };
2121
};
2222

2323
function mockListGateways(items: unknown[] | Error) {
2424
const original = svc.customObjectsApi.listClusterCustomObject;
25-
svc.customObjectsApi.listClusterCustomObject = async (...args: unknown[]) => {
26-
const [group, , plural] = args;
25+
svc.customObjectsApi.listClusterCustomObject = async (arg: any) => {
26+
const { group, plural } = arg;
2727
if (group === 'gateway.networking.k8s.io' && plural === 'gateways') {
2828
if (items instanceof Error) throw items;
29-
return { body: { items } };
29+
return { items };
3030
}
31-
return { body: { items: [] } };
31+
return { items: [] };
3232
};
3333
restores.push(() => {
3434
svc.customObjectsApi.listClusterCustomObject = original;

backend/src/services/kubernetes-runtime-status.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('KubernetesService - Runtime Status', () => {
1717
function mockProviderConfigs(items: any[]) {
1818
const service = kubernetesService as any;
1919
const original = service.customObjectsApi.listClusterCustomObject;
20-
service.customObjectsApi.listClusterCustomObject = async () => ({ body: { items } });
20+
service.customObjectsApi.listClusterCustomObject = async () => ({ items });
2121
restores.push(() => {
2222
service.customObjectsApi.listClusterCustomObject = original;
2323
});
@@ -36,14 +36,14 @@ describe('KubernetesService - Runtime Status', () => {
3636
const service = kubernetesService as any;
3737
const originalNamespaced = service.coreV1Api.listNamespacedPod;
3838
const originalAllNamespaces = service.coreV1Api.listPodForAllNamespaces;
39-
service.coreV1Api.listNamespacedPod = async (...args: any[]) => {
40-
expect(args[0]).toBe(namespace);
41-
const requestedSelector = args[5];
42-
return { body: { items: requestedSelector === selector ? items : items.filter((pod) => podMatchesSelector(pod, requestedSelector)) } };
39+
service.coreV1Api.listNamespacedPod = async (arg: any) => {
40+
expect(arg.namespace).toBe(namespace);
41+
const requestedSelector = arg.labelSelector;
42+
return { items: requestedSelector === selector ? items : items.filter((pod) => podMatchesSelector(pod, requestedSelector)) };
4343
};
44-
service.coreV1Api.listPodForAllNamespaces = async (...args: any[]) => {
45-
const requestedSelector = args[3];
46-
return { body: { items: allNamespaceItems.filter((pod) => podMatchesSelector(pod, requestedSelector)) } };
44+
service.coreV1Api.listPodForAllNamespaces = async (arg: any) => {
45+
const requestedSelector = arg?.labelSelector;
46+
return { items: allNamespaceItems.filter((pod) => podMatchesSelector(pod, requestedSelector)) };
4747
};
4848
restores.push(() => {
4949
service.coreV1Api.listNamespacedPod = originalNamespaced;

0 commit comments

Comments
 (0)