Skip to content

Commit f71a14a

Browse files
committed
feat: add advertised filters to discovery data
This is extracted part of PR siderolabs/talos#12758 The goal is to make each peer to publish its addresses and filters to the discovery service, so that other peers can apply the filters accordingly to build a proper view of advertised addresses. We don't apply filtering on "client" side as `Addresses` field is also used in generic discovery, so it's good to report all addresses and also KubeSpan-specific filter for advertised addresses. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent 64513a6 commit f71a14a

File tree

18 files changed

+756
-396
lines changed

18 files changed

+756
-396
lines changed

.conform.yaml

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 2024-03-12T12:26:58Z by kres latest.
3+
# Generated on 2026-02-10T16:35:49Z by kres f3ab59e.
44

55
policies:
66
- type: commit
@@ -12,7 +12,7 @@ policies:
1212
gitHubOrganization: siderolabs
1313
spellcheck:
1414
locale: US
15-
maximumOfOneCommit: true
15+
maximumOfOneCommit: false
1616
header:
1717
length: 89
1818
imperative: true

.dockerignore

Lines changed: 2 additions & 1 deletion
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 2023-01-30T14:34:24Z by kres latest.
3+
# Generated on 2026-02-10T16:35:49Z by kres f3ab59e.
44

55
*
66
!api
@@ -9,3 +9,4 @@
99
!.golangci.yml
1010
!README.md
1111
!.markdownlint.json
12+
!hack/govulncheck.sh

.github/workflows/ci.yaml

Lines changed: 104 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2024-10-22T08:55:07Z by kres 34e72ac.
3+
# Generated on 2026-02-10T16:35:49Z by kres f3ab59e.
44

5-
name: default
65
concurrency:
76
group: ${{ github.head_ref || github.run_id }}
87
cancel-in-progress: true
@@ -17,6 +16,7 @@ concurrency:
1716
branches:
1817
- main
1918
- release-*
19+
name: default
2020
jobs:
2121
default:
2222
permissions:
@@ -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/'))
3231
steps:
3332
- name: gather-system-info
3433
id: system-info
35-
uses: kenchan0130/actions-system-info@v1.3.0
34+
uses: kenchan0130/actions-system-info@59699597e84e80085a750998045983daa49274c4 # version: v1.4.0
3635
continue-on-error: true
3736
- name: print-system-info
3837
run: |
@@ -56,36 +55,124 @@ jobs:
5655
done
5756
continue-on-error: true
5857
- name: checkout
59-
uses: actions/checkout@v4
58+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # version: v6.0.1
6059
- name: Unshallow
6160
run: |
6261
git fetch --prune --unshallow
6362
- name: Set up Docker Buildx
6463
id: setup-buildx
65-
uses: docker/setup-buildx-action@v3
64+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # version: v3.12.0
6665
with:
6766
driver: remote
6867
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
6968
timeout-minutes: 10
7069
- name: base
7170
run: |
7271
make base
73-
- name: unit-tests
74-
run: |
75-
make unit-tests
76-
- name: unit-tests-race
77-
run: |
78-
make unit-tests-race
79-
- name: lint
80-
run: |
81-
make lint
8272
- name: release-notes
8373
if: startsWith(github.ref, 'refs/tags/')
8474
run: |
8575
make release-notes
8676
- name: Release
8777
if: startsWith(github.ref, 'refs/tags/')
88-
uses: crazy-max/ghaction-github-release@v2
78+
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # version: v2.5.0
8979
with:
9080
body_path: _out/RELEASE_NOTES.md
9181
draft: "true"
82+
lint:
83+
runs-on:
84+
group: generic
85+
if: github.event_name == 'pull_request'
86+
needs:
87+
- default
88+
steps:
89+
- name: gather-system-info
90+
id: system-info
91+
uses: kenchan0130/actions-system-info@59699597e84e80085a750998045983daa49274c4 # version: v1.4.0
92+
continue-on-error: true
93+
- name: print-system-info
94+
run: |
95+
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
96+
97+
OUTPUTS=(
98+
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
99+
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
100+
"Hostname: ${{ steps.system-info.outputs.hostname }}"
101+
"NodeName: ${NODE_NAME}"
102+
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
103+
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
104+
"Name: ${{ steps.system-info.outputs.name }}"
105+
"Platform: ${{ steps.system-info.outputs.platform }}"
106+
"Release: ${{ steps.system-info.outputs.release }}"
107+
"Total memory: ${MEMORY_GB} GB"
108+
)
109+
110+
for OUTPUT in "${OUTPUTS[@]}";do
111+
echo "${OUTPUT}"
112+
done
113+
continue-on-error: true
114+
- name: checkout
115+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # version: v6.0.1
116+
- name: Unshallow
117+
run: |
118+
git fetch --prune --unshallow
119+
- name: Set up Docker Buildx
120+
id: setup-buildx
121+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # version: v3.12.0
122+
with:
123+
driver: remote
124+
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
125+
timeout-minutes: 10
126+
- name: lint
127+
run: |
128+
make lint
129+
unit-tests:
130+
runs-on:
131+
group: generic
132+
if: github.event_name == 'pull_request'
133+
needs:
134+
- default
135+
steps:
136+
- name: gather-system-info
137+
id: system-info
138+
uses: kenchan0130/actions-system-info@59699597e84e80085a750998045983daa49274c4 # version: v1.4.0
139+
continue-on-error: true
140+
- name: print-system-info
141+
run: |
142+
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
143+
144+
OUTPUTS=(
145+
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
146+
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
147+
"Hostname: ${{ steps.system-info.outputs.hostname }}"
148+
"NodeName: ${NODE_NAME}"
149+
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
150+
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
151+
"Name: ${{ steps.system-info.outputs.name }}"
152+
"Platform: ${{ steps.system-info.outputs.platform }}"
153+
"Release: ${{ steps.system-info.outputs.release }}"
154+
"Total memory: ${MEMORY_GB} GB"
155+
)
156+
157+
for OUTPUT in "${OUTPUTS[@]}";do
158+
echo "${OUTPUT}"
159+
done
160+
continue-on-error: true
161+
- name: checkout
162+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # version: v6.0.1
163+
- name: Unshallow
164+
run: |
165+
git fetch --prune --unshallow
166+
- name: Set up Docker Buildx
167+
id: setup-buildx
168+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # version: v3.12.0
169+
with:
170+
driver: remote
171+
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
172+
timeout-minutes: 10
173+
- name: unit-tests
174+
run: |
175+
make unit-tests
176+
- name: unit-tests-race
177+
run: |
178+
make unit-tests-race

.github/workflows/lock.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
2+
#
3+
# Generated on 2026-02-10T16:35:49Z by kres f3ab59e.
4+
5+
"on":
6+
schedule:
7+
- cron: 0 2 * * *
8+
name: Lock old issues
9+
permissions:
10+
issues: write
11+
jobs:
12+
action:
13+
runs-on:
14+
- ubuntu-latest
15+
steps:
16+
- name: Lock old issues
17+
uses: dessant/lock-threads@7266a7ce5c1df01b1c6db85bf8cd86c737dadbe7 # version: v6.0.0
18+
with:
19+
issue-inactive-days: "60"
20+
log-output: "true"
21+
process-only: issues
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
2+
#
3+
# Generated on 2026-02-10T16:35:49Z by kres f3ab59e.
4+
5+
"on":
6+
workflow_run:
7+
workflows:
8+
- default
9+
types:
10+
- completed
11+
branches:
12+
- main
13+
name: slack-notify-failure
14+
jobs:
15+
slack-notify:
16+
runs-on:
17+
group: generic
18+
if: github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event != 'pull_request'
19+
steps:
20+
- name: Slack Notify
21+
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # version: v2.1.1
22+
with:
23+
method: chat.postMessage
24+
payload: |
25+
{
26+
"channel": "ci-failure",
27+
"text": "${{ github.event.workflow_run.conclusion }} - ${{ github.repository }}",
28+
"icon_emoji": "${{ github.event.workflow_run.conclusion == 'success' && ':white_check_mark:' || github.event.workflow_run.conclusion == 'failure' && ':x:' || ':warning:' }}",
29+
"username": "GitHub Actions",
30+
"attachments": [
31+
{
32+
"blocks": [
33+
{
34+
"fields": [
35+
{
36+
"text": "${{ github.event.workflow_run.event == 'pull_request' && format('*Pull Request:* {0} (`{1}`)\n<{2}/pull/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, steps.get-pr-number.outputs.pull_request_number, github.event.workflow_run.display_title) || format('*Build:* {0} (`{1}`)\n<{2}/commit/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, github.sha, github.event.workflow_run.display_title) }}",
37+
"type": "mrkdwn"
38+
},
39+
{
40+
"text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`",
41+
"type": "mrkdwn"
42+
}
43+
],
44+
"type": "section"
45+
},
46+
{
47+
"fields": [
48+
{
49+
"text": "*Author:*\n`${{ github.actor }}`",
50+
"type": "mrkdwn"
51+
},
52+
{
53+
"text": "*Event:*\n`${{ github.event.workflow_run.event }}`",
54+
"type": "mrkdwn"
55+
}
56+
],
57+
"type": "section"
58+
},
59+
{
60+
"type": "divider"
61+
},
62+
{
63+
"elements": [
64+
{
65+
"text": {
66+
"text": "Logs",
67+
"type": "plain_text"
68+
},
69+
"type": "button",
70+
"url": "${{ github.event.workflow_run.html_url }}"
71+
},
72+
{
73+
"text": {
74+
"text": "Commit",
75+
"type": "plain_text"
76+
},
77+
"type": "button",
78+
"url": "${{ github.event.repository.html_url }}/commit/${{ github.sha }}"
79+
}
80+
],
81+
"type": "actions"
82+
}
83+
],
84+
"color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}"
85+
}
86+
]
87+
}
88+
token: ${{ secrets.SLACK_BOT_TOKEN_V2 }}

0 commit comments

Comments
 (0)