Skip to content

Commit 23556bc

Browse files
sartemovsmira
authored andcommitted
feat: set up default namespace for the InfrastructureTemplate in Talos CP
Use webhook to fix up things. Signed-off-by: Andrey Smirnov <[email protected]>
1 parent f38b240 commit 23556bc

File tree

6 files changed

+24
-31
lines changed

6 files changed

+24
-31
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-08-12T17:41:17Z by kres 79636f7.
3+
# Generated on 2025-10-20T18:00:43Z by kres 46e133d.
44

55
concurrency:
66
group: ${{ github.head_ref || github.run_id }}
@@ -26,13 +26,12 @@ jobs:
2626
packages: write
2727
pull-requests: read
2828
runs-on:
29-
- self-hosted
30-
- generic
29+
group: generic
3130
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/')) && github.event_name == 'pull_request'
3231
steps:
3332
- name: gather-system-info
3433
id: system-info
35-
uses: kenchan0130/actions-system-info@v1.3.1
34+
uses: kenchan0130/actions-system-info@v1.4.0
3635
continue-on-error: true
3736
- name: print-system-info
3837
run: |
@@ -56,7 +55,7 @@ jobs:
5655
done
5756
continue-on-error: true
5857
- name: checkout
59-
uses: actions/checkout@v4
58+
uses: actions/checkout@v5
6059
- name: Unshallow
6160
run: |
6261
git fetch --prune --unshallow
@@ -100,13 +99,12 @@ jobs:
10099
packages: write
101100
pull-requests: read
102101
runs-on:
103-
- self-hosted
104-
- generic
102+
group: generic
105103
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/')) && github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/')
106104
steps:
107105
- name: gather-system-info
108106
id: system-info
109-
uses: kenchan0130/actions-system-info@v1.3.1
107+
uses: kenchan0130/actions-system-info@v1.4.0
110108
continue-on-error: true
111109
- name: print-system-info
112110
run: |
@@ -130,7 +128,7 @@ jobs:
130128
done
131129
continue-on-error: true
132130
- name: checkout
133-
uses: actions/checkout@v4
131+
uses: actions/checkout@v5
134132
- name: Unshallow
135133
run: |
136134
git fetch --prune --unshallow
@@ -162,13 +160,12 @@ jobs:
162160
packages: write
163161
pull-requests: read
164162
runs-on:
165-
- self-hosted
166-
- generic
163+
group: generic
167164
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/')) && startsWith(github.ref, 'refs/tags/')
168165
steps:
169166
- name: gather-system-info
170167
id: system-info
171-
uses: kenchan0130/actions-system-info@v1.3.1
168+
uses: kenchan0130/actions-system-info@v1.4.0
172169
continue-on-error: true
173170
- name: print-system-info
174171
run: |
@@ -192,7 +189,7 @@ jobs:
192189
done
193190
continue-on-error: true
194191
- name: checkout
195-
uses: actions/checkout@v4
192+
uses: actions/checkout@v5
196193
- name: Unshallow
197194
run: |
198195
git fetch --prune --unshallow
@@ -230,7 +227,7 @@ jobs:
230227
sha256sum control-plane-talos/*/* > sha256sum.txt
231228
sha512sum control-plane-talos/*/* > sha512sum.txt
232229
- name: release
233-
uses: crazy-max/ghaction-github-release@v2
230+
uses: softprops/action-gh-release@v2
234231
with:
235232
body_path: _out/RELEASE_NOTES.md
236233
draft: "true"

.github/workflows/slack-notify-ci-failure.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-08-12T17:41:17Z by kres 79636f7.
3+
# Generated on 2025-10-20T18:00:43Z by kres 46e133d.
44

55
"on":
66
workflow_run:
@@ -14,8 +14,7 @@ name: slack-notify-failure
1414
jobs:
1515
slack-notify:
1616
runs-on:
17-
- self-hosted
18-
- generic
17+
group: generic
1918
if: github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event != 'pull_request'
2019
steps:
2120
- name: Slack Notify

.github/workflows/slack-notify.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-08-12T17:41:17Z by kres 79636f7.
3+
# Generated on 2025-10-20T18:00:43Z by kres 46e133d.
44

55
"on":
66
workflow_run:
@@ -12,8 +12,7 @@ name: slack-notify
1212
jobs:
1313
slack-notify:
1414
runs-on:
15-
- self-hosted
16-
- generic
15+
group: generic
1716
if: github.event.workflow_run.conclusion != 'skipped'
1817
steps:
1918
- name: Get PR number

.github/workflows/stale.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-08-12T17:41:17Z by kres 79636f7.
3+
# Generated on 2025-10-20T18:00:43Z by kres 46e133d.
44

55
"on":
66
schedule:
@@ -15,7 +15,7 @@ jobs:
1515
- ubuntu-latest
1616
steps:
1717
- name: Close stale issues and PRs
18-
uses: actions/stale@v9.1.0
18+
uses: actions/stale@v10.1.0
1919
with:
2020
close-issue-message: This issue was closed because it has been stalled for 7 days with no activity.
2121
days-before-issue-close: "5"

.kres.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ spec:
4444
sops: true
4545
buildxOptions:
4646
enabled: true
47-
runners:
48-
- self-hosted
49-
- generic
47+
runnerGroup: generic
5048
conditions:
5149
- on-pull-request
5250
steps:
@@ -64,9 +62,7 @@ spec:
6462
- name: push
6563
buildxOptions:
6664
enabled: true
67-
runners:
68-
- self-hosted
69-
- generic
65+
runnerGroup: generic
7066
conditions:
7167
- except-pull-request
7268
- not-on-tag
@@ -83,9 +79,7 @@ spec:
8379
sops: true
8480
buildxOptions:
8581
enabled: true
86-
runners:
87-
- self-hosted
88-
- generic
82+
runnerGroup: generic
8983
conditions:
9084
- only-on-tag
9185
steps:

api/v1alpha3/taloscontrolplane_webhook.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ func defaultTalosControlPlaneSpec(s *TalosControlPlaneSpec, namespace string) {
5151
s.Replicas = &replicas
5252
}
5353

54+
if s.InfrastructureTemplate.Namespace == "" {
55+
s.InfrastructureTemplate.Namespace = namespace
56+
}
57+
5458
if !strings.HasPrefix(s.Version, "v") {
5559
s.Version = "v" + s.Version
5660
}

0 commit comments

Comments
 (0)