@flowfuse/driver-kubernetes 2.29.1 → 2.29.2-1432630-202605070856.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.
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
name: Project automations
|
|
2
2
|
on:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
issues:
|
|
4
|
+
types:
|
|
5
|
+
- opened
|
|
6
6
|
jobs:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
add_issue_to_relevant_boards:
|
|
8
|
+
uses: flowfuse/github-actions-workflows/.github/workflows/project-automation.yaml@project-automation/v1
|
|
9
|
+
secrets:
|
|
10
|
+
app-client-id: ${{ secrets.GH_BOT_APP_ID }}
|
|
11
|
+
app-private-key: ${{ secrets.GH_BOT_APP_KEY }}
|
|
@@ -14,7 +14,7 @@ concurrency:
|
|
|
14
14
|
|
|
15
15
|
jobs:
|
|
16
16
|
build:
|
|
17
|
-
uses: 'flowfuse/github-actions-workflows/.github/workflows/build_node_package.yml@v0.
|
|
17
|
+
uses: 'flowfuse/github-actions-workflows/.github/workflows/build_node_package.yml@v0.76.0'
|
|
18
18
|
with:
|
|
19
19
|
node: '[
|
|
20
20
|
{"version": "24", "tests": false, "lint": true},
|
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
publish:
|
|
24
24
|
needs: build
|
|
25
25
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
26
|
-
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.
|
|
26
|
+
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.76.0'
|
|
27
27
|
with:
|
|
28
28
|
package_name: driver-k8s
|
|
29
29
|
publish_package: true
|
|
@@ -36,7 +36,7 @@ jobs:
|
|
|
36
36
|
steps:
|
|
37
37
|
- name: Generate a token
|
|
38
38
|
id: generate_token
|
|
39
|
-
uses: actions/create-github-app-token@
|
|
39
|
+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
|
|
40
40
|
with:
|
|
41
41
|
app-id: ${{ secrets.GH_BOT_APP_ID }}
|
|
42
42
|
private-key: ${{ secrets.GH_BOT_APP_KEY }}
|
|
@@ -9,7 +9,7 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
steps:
|
|
11
11
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
12
|
-
- uses: actions/setup-node@
|
|
12
|
+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
13
13
|
with:
|
|
14
14
|
node-version: 24
|
|
15
15
|
- run: npm ci
|
package/kubernetes.js
CHANGED
|
@@ -521,25 +521,6 @@ const createProject = async (project, options) => {
|
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
523
|
|
|
524
|
-
await new Promise((resolve, reject) => {
|
|
525
|
-
let counter = 0
|
|
526
|
-
const pollInterval = setInterval(async () => {
|
|
527
|
-
try {
|
|
528
|
-
await this._k8sAppApi.readNamespacedDeployment({ name: project.safeName, namespace: this._namespace })
|
|
529
|
-
clearInterval(pollInterval)
|
|
530
|
-
resolve()
|
|
531
|
-
} catch (err) {
|
|
532
|
-
// hmm
|
|
533
|
-
counter++
|
|
534
|
-
if (counter > this._k8sRetries) {
|
|
535
|
-
clearInterval(pollInterval)
|
|
536
|
-
this._app.log.error(`[k8s] Instance ${project.id} - timeout waiting for Deployment`)
|
|
537
|
-
reject(new Error('Timed out to creating Deployment'))
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
}, this._k8sDelay)
|
|
541
|
-
})
|
|
542
|
-
|
|
543
524
|
try {
|
|
544
525
|
await this._k8sApi.createNamespacedService({ namespace, body: localService })
|
|
545
526
|
} catch (err) {
|
|
@@ -553,25 +534,6 @@ const createProject = async (project, options) => {
|
|
|
553
534
|
}
|
|
554
535
|
}
|
|
555
536
|
|
|
556
|
-
const prefix = project.safeName.match(/^[0-9]/) ? 'srv-' : ''
|
|
557
|
-
await new Promise((resolve, reject) => {
|
|
558
|
-
let counter = 0
|
|
559
|
-
const pollInterval = setInterval(async () => {
|
|
560
|
-
try {
|
|
561
|
-
await this._k8sApi.readNamespacedService({ name: prefix + project.safeName, namespace: this._namespace })
|
|
562
|
-
clearInterval(pollInterval)
|
|
563
|
-
resolve()
|
|
564
|
-
} catch (err) {
|
|
565
|
-
counter++
|
|
566
|
-
if (counter > this._k8sRetries) {
|
|
567
|
-
clearInterval(pollInterval)
|
|
568
|
-
this._app.log.error(`[k8s] Instance ${project.id} - timeout waiting for Service`)
|
|
569
|
-
reject(new Error('Timed out to creating Service'))
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
}, this._k8sDelay)
|
|
573
|
-
})
|
|
574
|
-
|
|
575
537
|
try {
|
|
576
538
|
await this._k8sNetApi.createNamespacedIngress({ namespace, body: localIngress })
|
|
577
539
|
} catch (err) {
|
|
@@ -603,24 +565,6 @@ const createProject = async (project, options) => {
|
|
|
603
565
|
}
|
|
604
566
|
}
|
|
605
567
|
|
|
606
|
-
await new Promise((resolve, reject) => {
|
|
607
|
-
let counter = 0
|
|
608
|
-
const pollInterval = setInterval(async () => {
|
|
609
|
-
try {
|
|
610
|
-
await this._k8sNetApi.readNamespacedIngress({ name: project.safeName, namespace: this._namespace })
|
|
611
|
-
clearInterval(pollInterval)
|
|
612
|
-
resolve()
|
|
613
|
-
} catch (err) {
|
|
614
|
-
counter++
|
|
615
|
-
if (counter > this._k8sRetries) {
|
|
616
|
-
clearInterval(pollInterval)
|
|
617
|
-
this._app.log.error(`[k8s] Instance ${project.id} - timeout waiting for Ingress`)
|
|
618
|
-
reject(new Error('Timed out to creating Ingress'))
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
}, this._k8sDelay)
|
|
622
|
-
})
|
|
623
|
-
|
|
624
568
|
await project.updateSetting('k8sType', 'deployment')
|
|
625
569
|
|
|
626
570
|
this._app.log.debug(`[k8s] Container ${project.id} started`)
|