Skip to content

Commit 364c7a6

Browse files
authored
fix(server): fixed runtime manifest labels (#1583)
1 parent b0128c5 commit 364c7a6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

server/src/instance/instance.service.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export class InstanceService {
111111
}
112112

113113
public async restart(appid: string) {
114+
const labels = this.getRuntimeLabel(appid)
114115
const app = await this.applicationService.findOneUnsafe(appid)
115116
const region = app.region
116117
const { deployment, hpa, service } = await this.get(appid)
@@ -119,10 +120,7 @@ export class InstanceService {
119120
return
120121
}
121122

122-
deployment.spec = await this.makeDeploymentSpec(
123-
app,
124-
deployment.spec.template.metadata.labels,
125-
)
123+
deployment.spec = await this.makeDeploymentSpec(app, labels)
126124
const appsV1Api = this.cluster.makeAppsV1Api(region)
127125
const namespace = GetApplicationNamespace(region, appid)
128126
const deploymentResult = await appsV1Api.replaceNamespacedDeployment(
@@ -136,7 +134,7 @@ export class InstanceService {
136134
)
137135

138136
// reapply service
139-
service.spec = this.makeServiceSpec(service.metadata.labels)
137+
service.spec = this.makeServiceSpec(labels)
140138
const coreV1Api = this.cluster.makeCoreV1Api(region)
141139
const serviceResult = await coreV1Api.replaceNamespacedService(
142140
service.metadata.name,

0 commit comments

Comments
 (0)