Skip to content

Commit

Permalink
fix(server): fixed runtime manifest labels (#1583)
Browse files Browse the repository at this point in the history
  • Loading branch information
HUAHUAI23 authored Oct 13, 2023
1 parent b0128c5 commit 364c7a6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions server/src/instance/instance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class InstanceService {
}

public async restart(appid: string) {
const labels = this.getRuntimeLabel(appid)
const app = await this.applicationService.findOneUnsafe(appid)
const region = app.region
const { deployment, hpa, service } = await this.get(appid)
Expand All @@ -119,10 +120,7 @@ export class InstanceService {
return
}

deployment.spec = await this.makeDeploymentSpec(
app,
deployment.spec.template.metadata.labels,
)
deployment.spec = await this.makeDeploymentSpec(app, labels)
const appsV1Api = this.cluster.makeAppsV1Api(region)
const namespace = GetApplicationNamespace(region, appid)
const deploymentResult = await appsV1Api.replaceNamespacedDeployment(
Expand All @@ -136,7 +134,7 @@ export class InstanceService {
)

// reapply service
service.spec = this.makeServiceSpec(service.metadata.labels)
service.spec = this.makeServiceSpec(labels)
const coreV1Api = this.cluster.makeCoreV1Api(region)
const serviceResult = await coreV1Api.replaceNamespacedService(
service.metadata.name,
Expand Down

0 comments on commit 364c7a6

Please sign in to comment.