@flowfuse/driver-kubernetes 2.22.1-a0ea26f-202509250952.0 → 2.22.1-ade66aa-202510010854.0

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.
@@ -13,6 +13,6 @@ jobs:
13
13
  with:
14
14
  node-version: 18
15
15
  - run: npm ci
16
- - uses: JS-DevTools/npm-publish@ad693561f8a5b5d4c76f14407da60aa15cb10f90 # v4.0.1
16
+ - uses: JS-DevTools/npm-publish@7f8fe47b3bea1be0c3aec2b717c5ec1f3e03410b # v4.1.1
17
17
  with:
18
18
  token: ${{ secrets.NPM_PUBLISH_TOKEN }}
package/kubernetes.js CHANGED
@@ -202,6 +202,17 @@ const createDeployment = async (project, options) => {
202
202
  localPod.spec.containers[0].resources.limits.cpu = `${stack.cpu * 10}m`
203
203
  }
204
204
 
205
+ if (this._app.config.driver.options?.projectLabels) {
206
+ localPod.metadata.labels = {
207
+ ...localPod.metadata.labels,
208
+ ...this._app.config.driver.options.projectLabels
209
+ }
210
+ localDeployment.metadata.labels = {
211
+ ...localDeployment.metadata.labels,
212
+ ...this._app.config.driver.options.projectLabels
213
+ }
214
+ }
215
+
205
216
  const ha = await project.getSetting('ha')
206
217
  if (ha?.replicas > 1) {
207
218
  localDeployment.spec.replicas = ha.replicas
@@ -225,6 +236,9 @@ const createService = async (project, options) => {
225
236
  throw new Error('Service type must be either NodePort or ClusterIP')
226
237
  }
227
238
  localService.spec.type = serviceType
239
+ if (this._app.config.driver.options?.projectLabels) {
240
+ localService.metadata.labels = this._app.config.driver.options.projectLabels
241
+ }
228
242
  return localService
229
243
  }
230
244
 
@@ -264,6 +278,10 @@ const createIngress = async (project, options) => {
264
278
  localIngress.metadata.annotations[key] = mustache(localIngress.metadata.annotations[key], exposedData)
265
279
  })
266
280
 
281
+ if (this._app.config.driver.options?.projectLabels) {
282
+ localIngress.metadata.labels = this._app.config.driver.options.projectLabels
283
+ }
284
+
267
285
  localIngress.metadata.name = project.safeName
268
286
  localIngress.spec.rules[0].host = url.host
269
287
  localIngress.spec.rules[0].http.paths[0].backend.service.name = `${prefix}${project.safeName}`
@@ -312,6 +330,10 @@ const createCustomIngress = async (project, hostname, options) => {
312
330
  customIngress.spec.ingressClassName = `${this._customHostname.ingressClass}`
313
331
  }
314
332
 
333
+ if (this._app.config.driver.options?.projectLabels) {
334
+ customIngress.metadata.labels = this._app.config.driver.options.projectLabels
335
+ }
336
+
315
337
  return customIngress
316
338
  }
317
339
 
@@ -337,6 +359,12 @@ const createPersistentVolumeClaim = async (project, options) => {
337
359
  'ff-project-id': project.id,
338
360
  'ff-project-name': project.safeName
339
361
  }
362
+ if (this._app.config.driver.options?.projectLabels) {
363
+ pvc.metadata.labels = {
364
+ ...pvc.metadata.labels,
365
+ ...this._app.config.driver.options.projectLabels
366
+ }
367
+ }
340
368
  console.log(`PVC: ${JSON.stringify(pvc, null, 2)}`)
341
369
  return pvc
342
370
  }
@@ -553,6 +581,16 @@ const createMQTTTopicAgent = async (broker) => {
553
581
  team: broker.Team.hashid,
554
582
  broker: agent ? 'team-broker' : broker.hashid
555
583
  }
584
+ if (this._app.config.driver.options?.projectLabels) {
585
+ localPod.metadata.labels = {
586
+ ...localPod.metadata.labels,
587
+ ...this._app.config.driver.options.projectLabels
588
+ }
589
+ localService.metadata.labels = {
590
+ ...localService.metadata.labels,
591
+ ...this._app.config.driver.options.projectLabels
592
+ }
593
+ }
556
594
  localService.spec.selector.name = `mqtt-schema-agent-${broker.Team.hashid.toLowerCase()}-${agent ? 'team-broker' : broker.hashid.toLowerCase()}`
557
595
 
558
596
  // TODO remove registry entry
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowfuse/driver-kubernetes",
3
- "version": "2.22.1-a0ea26f-202509250952.0",
3
+ "version": "2.22.1-ade66aa-202510010854.0",
4
4
  "description": "Kubernetes driver for FlowFuse",
5
5
  "main": "kubernetes.js",
6
6
  "scripts": {