Merge ~troyanov/maas:go-copyright-lint into maas:master
- Git
- lp:~troyanov/maas
- go-copyright-lint
- Merge into master
Status: | Merged |
---|---|
Approved by: | Anton Troyanov |
Approved revision: | 12fc1f0928da8ac830ce6bc1e1a54654d90d22f7 |
Merge reported by: | MAAS Lander |
Merged at revision: | not available |
Proposed branch: | ~troyanov/maas:go-copyright-lint |
Merge into: | maas:master |
Diff against target: |
1058 lines (+545/-195) 37 files modified
.golangci.yaml (+20/-0) dev/null (+0/-149) src/host-info/cmd/machine-resources/main.go (+15/-3) src/host-info/pkg/info/info.go (+15/-3) src/maasagent/cmd/maas-agent/main.go (+15/-5) src/maasagent/cmd/maas-agent/main_test.go (+15/-0) src/maasagent/cmd/maas-netmon/main.go (+15/-5) src/maasagent/internal/cache/buf.go (+15/-0) src/maasagent/internal/cache/fake.go (+15/-0) src/maasagent/internal/cache/file.go (+15/-0) src/maasagent/internal/cache/file_test.go (+15/-0) src/maasagent/internal/ethernet/arp.go (+15/-5) src/maasagent/internal/ethernet/arp_test.go (+15/-5) src/maasagent/internal/ethernet/ethernet.go (+15/-5) src/maasagent/internal/ethernet/ethernet_test.go (+15/-5) src/maasagent/internal/httpproxy/cache.go (+15/-0) src/maasagent/internal/httpproxy/proxy.go (+15/-0) src/maasagent/internal/httpproxy/proxy_test.go (+15/-0) src/maasagent/internal/httpproxy/rewrite.go (+15/-0) src/maasagent/internal/httpproxy/rewrite_test.go (+15/-0) src/maasagent/internal/httpproxy/service.go (+15/-0) src/maasagent/internal/httpproxy/service_test.go (+15/-0) src/maasagent/internal/netmon/event.go (+15/-0) src/maasagent/internal/netmon/event_test.go (+15/-0) src/maasagent/internal/netmon/scan.go (+15/-0) src/maasagent/internal/netmon/scan_test.go (+15/-0) src/maasagent/internal/netmon/service.go (+15/-5) src/maasagent/internal/netmon/service_test.go (+15/-5) src/maasagent/internal/power/service.go (+15/-0) src/maasagent/internal/power/service_test.go (+15/-0) src/maasagent/internal/power/workflow.go (+15/-0) src/maasagent/internal/workflow/checkip.go (+15/-0) src/maasagent/internal/workflow/log/tag/tags.go (+15/-0) src/maasagent/internal/workflow/log/zerolog.go (+15/-0) src/maasagent/internal/workflow/worker/pool.go (+15/-0) src/maasagent/pkg/workflow/codec/encryptor.go (+15/-0) src/maasagent/pkg/workflow/codec/encryptor_test.go (+15/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jacopo Rota | Approve | ||
MAAS Lander | Approve | ||
Review via email: mp+463699@code.launchpad.net |
Commit message
chore: lint copyright header in Go files
Description of the change
Wyatt Rees (wyattrees) wrote : | # |
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b go-copyright-lint lp:~troyanov/maas/+git/maas into -b master lp:~maas-committers/maas
STATUS: FAILED
LOG: http://
COMMIT: 17f77131dd9113b
Anton Troyanov (troyanov) wrote : | # |
Good catch. I missed them because of a local cache of golangci-lint (it was skipping those files). Should be fixed now
- 12fc1f0... by Anton Troyanov
-
fixup! chore: lint copyright header in Go files
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b go-copyright-lint lp:~troyanov/maas/+git/maas into -b master lp:~maas-committers/maas
STATUS: SUCCESS
COMMIT: 8ab868e8cc5feed
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b go-copyright-lint lp:~troyanov/maas/+git/maas into -b master lp:~maas-committers/maas
STATUS: SUCCESS
COMMIT: 12fc1f0928da8ac
Preview Diff
1 | diff --git a/.golangci.yaml b/.golangci.yaml | |||
2 | index 9a383d8..09e40dd 100644 | |||
3 | --- a/.golangci.yaml | |||
4 | +++ b/.golangci.yaml | |||
5 | @@ -71,6 +71,7 @@ linters: | |||
6 | 71 | - errcheck | 71 | - errcheck |
7 | 72 | - exportloopref | 72 | - exportloopref |
8 | 73 | - gocritic | 73 | - gocritic |
9 | 74 | - goheader | ||
10 | 74 | - gofmt | 75 | - gofmt |
11 | 75 | - goimports | 76 | - goimports |
12 | 76 | - gosec | 77 | - gosec |
13 | @@ -94,6 +95,25 @@ linters-settings: | |||
14 | 94 | errcheck: | 95 | errcheck: |
15 | 95 | check-type-assertions: true | 96 | check-type-assertions: true |
16 | 96 | check-blank: true | 97 | check-blank: true |
17 | 98 | goheader: | ||
18 | 99 | values: | ||
19 | 100 | regexp: | ||
20 | 101 | YEAR: \d{4}(-\d{4})? | ||
21 | 102 | template: |- | ||
22 | 103 | Copyright (c) {{YEAR}} Canonical Ltd | ||
23 | 104 | |||
24 | 105 | This program is free software: you can redistribute it and/or modify | ||
25 | 106 | it under the terms of the GNU Affero General Public License as published by | ||
26 | 107 | the Free Software Foundation, either version 3 of the License, or | ||
27 | 108 | (at your option) any later version. | ||
28 | 109 | |||
29 | 110 | This program is distributed in the hope that it will be useful, | ||
30 | 111 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
31 | 112 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
32 | 113 | GNU Affero General Public License for more details. | ||
33 | 114 | |||
34 | 115 | You should have received a copy of the GNU Affero General Public License | ||
35 | 116 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
36 | 97 | gosimple: | 117 | gosimple: |
37 | 98 | checks: ["all"] | 118 | checks: ["all"] |
38 | 99 | govet: | 119 | govet: |
39 | diff --git a/src/host-info/cmd/machine-resources/main.go b/src/host-info/cmd/machine-resources/main.go | |||
40 | index 7557578..eb5a831 100644 | |||
41 | --- a/src/host-info/cmd/machine-resources/main.go | |||
42 | +++ b/src/host-info/cmd/machine-resources/main.go | |||
43 | @@ -1,9 +1,21 @@ | |||
44 | 1 | // Copyright (c) 2014-2024 Canonical Ltd | ||
45 | 2 | // | ||
46 | 3 | // This program is free software: you can redistribute it and/or modify | ||
47 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
48 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
49 | 6 | // (at your option) any later version. | ||
50 | 7 | // | ||
51 | 8 | // This program is distributed in the hope that it will be useful, | ||
52 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
53 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
54 | 11 | // GNU Affero General Public License for more details. | ||
55 | 12 | // | ||
56 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
57 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
58 | 15 | |||
59 | 1 | //go:build linux | 16 | //go:build linux |
60 | 2 | // +build linux | 17 | // +build linux |
61 | 3 | 18 | ||
62 | 4 | // Copyright 2014-2020 Canonical Ltd. This software is licensed under the | ||
63 | 5 | // GNU Affero General Public License version 3 (see the file LICENSE). | ||
64 | 6 | |||
65 | 7 | package main | 19 | package main |
66 | 8 | 20 | ||
67 | 9 | import ( | 21 | import ( |
68 | diff --git a/src/host-info/pkg/info/info.go b/src/host-info/pkg/info/info.go | |||
69 | index c7eb2ef..7be270d 100644 | |||
70 | --- a/src/host-info/pkg/info/info.go | |||
71 | +++ b/src/host-info/pkg/info/info.go | |||
72 | @@ -1,9 +1,21 @@ | |||
73 | 1 | // Copyright (c) 2022-2024 Canonical Ltd | ||
74 | 2 | // | ||
75 | 3 | // This program is free software: you can redistribute it and/or modify | ||
76 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
77 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
78 | 6 | // (at your option) any later version. | ||
79 | 7 | // | ||
80 | 8 | // This program is distributed in the hope that it will be useful, | ||
81 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
82 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
83 | 11 | // GNU Affero General Public License for more details. | ||
84 | 12 | // | ||
85 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
86 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
87 | 15 | |||
88 | 1 | //go:build linux | 16 | //go:build linux |
89 | 2 | // +build linux | 17 | // +build linux |
90 | 3 | 18 | ||
91 | 4 | // Copyright 2022 Canonical Ltd. This software is licensed under the | ||
92 | 5 | // GNU Affero General Public License version 3 (see the file LICENSE). | ||
93 | 6 | |||
94 | 7 | //nolint:stylecheck // ignore ST1000 | 19 | //nolint:stylecheck // ignore ST1000 |
95 | 8 | package info | 20 | package info |
96 | 9 | 21 | ||
97 | diff --git a/src/maasagent/cmd/maas-agent/main.go b/src/maasagent/cmd/maas-agent/main.go | |||
98 | index 5ff28ea..c6b7f01 100644 | |||
99 | --- a/src/maasagent/cmd/maas-agent/main.go | |||
100 | +++ b/src/maasagent/cmd/maas-agent/main.go | |||
101 | @@ -1,9 +1,19 @@ | |||
103 | 1 | package main | 1 | // Copyright (c) 2023-2024 Canonical Ltd |
104 | 2 | // | ||
105 | 3 | // This program is free software: you can redistribute it and/or modify | ||
106 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
107 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
108 | 6 | // (at your option) any later version. | ||
109 | 7 | // | ||
110 | 8 | // This program is distributed in the hope that it will be useful, | ||
111 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
112 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
113 | 11 | // GNU Affero General Public License for more details. | ||
114 | 12 | // | ||
115 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
116 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
117 | 2 | 15 | ||
122 | 3 | /* | 16 | package main |
119 | 4 | Copyright 2023 Canonical Ltd. This software is licensed under the | ||
120 | 5 | GNU Affero General Public License version 3 (see the file LICENSE). | ||
121 | 6 | */ | ||
123 | 7 | 17 | ||
124 | 8 | import ( | 18 | import ( |
125 | 9 | "context" | 19 | "context" |
126 | diff --git a/src/maasagent/cmd/maas-agent/main_test.go b/src/maasagent/cmd/maas-agent/main_test.go | |||
127 | index 0a8fdc1..249fa4c 100644 | |||
128 | --- a/src/maasagent/cmd/maas-agent/main_test.go | |||
129 | +++ b/src/maasagent/cmd/maas-agent/main_test.go | |||
130 | @@ -1,3 +1,18 @@ | |||
131 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
132 | 2 | // | ||
133 | 3 | // This program is free software: you can redistribute it and/or modify | ||
134 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
135 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
136 | 6 | // (at your option) any later version. | ||
137 | 7 | // | ||
138 | 8 | // This program is distributed in the hope that it will be useful, | ||
139 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
140 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
141 | 11 | // GNU Affero General Public License for more details. | ||
142 | 12 | // | ||
143 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
144 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
145 | 15 | |||
146 | 1 | package main | 16 | package main |
147 | 2 | 17 | ||
148 | 3 | import ( | 18 | import ( |
149 | diff --git a/src/maasagent/cmd/maas-netmon/main.go b/src/maasagent/cmd/maas-netmon/main.go | |||
150 | index 735a1f9..ee420bc 100644 | |||
151 | --- a/src/maasagent/cmd/maas-netmon/main.go | |||
152 | +++ b/src/maasagent/cmd/maas-netmon/main.go | |||
153 | @@ -1,9 +1,19 @@ | |||
155 | 1 | package main | 1 | // Copyright (c) 2023-2024 Canonical Ltd |
156 | 2 | // | ||
157 | 3 | // This program is free software: you can redistribute it and/or modify | ||
158 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
159 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
160 | 6 | // (at your option) any later version. | ||
161 | 7 | // | ||
162 | 8 | // This program is distributed in the hope that it will be useful, | ||
163 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
164 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
165 | 11 | // GNU Affero General Public License for more details. | ||
166 | 12 | // | ||
167 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
168 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
169 | 2 | 15 | ||
174 | 3 | /* | 16 | package main |
171 | 4 | Copyright 2023 Canonical Ltd. This software is licensed under the | ||
172 | 5 | GNU Affero General Public License version 3 (see the file LICENSE). | ||
173 | 6 | */ | ||
175 | 7 | 17 | ||
176 | 8 | import ( | 18 | import ( |
177 | 9 | "context" | 19 | "context" |
178 | diff --git a/src/maasagent/internal/cache/buf.go b/src/maasagent/internal/cache/buf.go | |||
179 | index 5a1ad19..221dd5b 100644 | |||
180 | --- a/src/maasagent/internal/cache/buf.go | |||
181 | +++ b/src/maasagent/internal/cache/buf.go | |||
182 | @@ -1,3 +1,18 @@ | |||
183 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
184 | 2 | // | ||
185 | 3 | // This program is free software: you can redistribute it and/or modify | ||
186 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
187 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
188 | 6 | // (at your option) any later version. | ||
189 | 7 | // | ||
190 | 8 | // This program is distributed in the hope that it will be useful, | ||
191 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
192 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
193 | 11 | // GNU Affero General Public License for more details. | ||
194 | 12 | // | ||
195 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
196 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
197 | 15 | |||
198 | 1 | package cache | 16 | package cache |
199 | 2 | 17 | ||
200 | 3 | import ( | 18 | import ( |
201 | diff --git a/src/maasagent/internal/cache/fake.go b/src/maasagent/internal/cache/fake.go | |||
202 | index a4f8ffd..c3c83d6 100644 | |||
203 | --- a/src/maasagent/internal/cache/fake.go | |||
204 | +++ b/src/maasagent/internal/cache/fake.go | |||
205 | @@ -1,3 +1,18 @@ | |||
206 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
207 | 2 | // | ||
208 | 3 | // This program is free software: you can redistribute it and/or modify | ||
209 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
210 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
211 | 6 | // (at your option) any later version. | ||
212 | 7 | // | ||
213 | 8 | // This program is distributed in the hope that it will be useful, | ||
214 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
215 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
216 | 11 | // GNU Affero General Public License for more details. | ||
217 | 12 | // | ||
218 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
219 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
220 | 15 | |||
221 | 1 | package cache | 16 | package cache |
222 | 2 | 17 | ||
223 | 3 | import ( | 18 | import ( |
224 | diff --git a/src/maasagent/internal/cache/file.go b/src/maasagent/internal/cache/file.go | |||
225 | index a3bd9de..9aab35a 100644 | |||
226 | --- a/src/maasagent/internal/cache/file.go | |||
227 | +++ b/src/maasagent/internal/cache/file.go | |||
228 | @@ -1,3 +1,18 @@ | |||
229 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
230 | 2 | // | ||
231 | 3 | // This program is free software: you can redistribute it and/or modify | ||
232 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
233 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
234 | 6 | // (at your option) any later version. | ||
235 | 7 | // | ||
236 | 8 | // This program is distributed in the hope that it will be useful, | ||
237 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
238 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
239 | 11 | // GNU Affero General Public License for more details. | ||
240 | 12 | // | ||
241 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
242 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
243 | 15 | |||
244 | 1 | package cache | 16 | package cache |
245 | 2 | 17 | ||
246 | 3 | import ( | 18 | import ( |
247 | diff --git a/src/maasagent/internal/cache/file_test.go b/src/maasagent/internal/cache/file_test.go | |||
248 | index 4cc1fc7..1e8d24c 100644 | |||
249 | --- a/src/maasagent/internal/cache/file_test.go | |||
250 | +++ b/src/maasagent/internal/cache/file_test.go | |||
251 | @@ -1,3 +1,18 @@ | |||
252 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
253 | 2 | // | ||
254 | 3 | // This program is free software: you can redistribute it and/or modify | ||
255 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
256 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
257 | 6 | // (at your option) any later version. | ||
258 | 7 | // | ||
259 | 8 | // This program is distributed in the hope that it will be useful, | ||
260 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
261 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
262 | 11 | // GNU Affero General Public License for more details. | ||
263 | 12 | // | ||
264 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
265 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
266 | 15 | |||
267 | 1 | package cache | 16 | package cache |
268 | 2 | 17 | ||
269 | 3 | import ( | 18 | import ( |
270 | diff --git a/src/maasagent/internal/ethernet/arp.go b/src/maasagent/internal/ethernet/arp.go | |||
271 | index da3238f..7685fb9 100644 | |||
272 | --- a/src/maasagent/internal/ethernet/arp.go | |||
273 | +++ b/src/maasagent/internal/ethernet/arp.go | |||
274 | @@ -1,9 +1,19 @@ | |||
276 | 1 | package ethernet | 1 | // Copyright (c) 2023-2024 Canonical Ltd |
277 | 2 | // | ||
278 | 3 | // This program is free software: you can redistribute it and/or modify | ||
279 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
280 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
281 | 6 | // (at your option) any later version. | ||
282 | 7 | // | ||
283 | 8 | // This program is distributed in the hope that it will be useful, | ||
284 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
285 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
286 | 11 | // GNU Affero General Public License for more details. | ||
287 | 12 | // | ||
288 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
289 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
290 | 2 | 15 | ||
295 | 3 | /* | 16 | package ethernet |
292 | 4 | Copyright 2023 Canonical Ltd. This software is licensed under the | ||
293 | 5 | GNU Affero General Public License version 3 (see the file LICENSE). | ||
294 | 6 | */ | ||
296 | 7 | 17 | ||
297 | 8 | import ( | 18 | import ( |
298 | 9 | "encoding/binary" | 19 | "encoding/binary" |
299 | diff --git a/src/maasagent/internal/ethernet/arp_test.go b/src/maasagent/internal/ethernet/arp_test.go | |||
300 | index 8e8ed28..aa2ab3f 100644 | |||
301 | --- a/src/maasagent/internal/ethernet/arp_test.go | |||
302 | +++ b/src/maasagent/internal/ethernet/arp_test.go | |||
303 | @@ -1,9 +1,19 @@ | |||
305 | 1 | package ethernet | 1 | // Copyright (c) 2023-2024 Canonical Ltd |
306 | 2 | // | ||
307 | 3 | // This program is free software: you can redistribute it and/or modify | ||
308 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
309 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
310 | 6 | // (at your option) any later version. | ||
311 | 7 | // | ||
312 | 8 | // This program is distributed in the hope that it will be useful, | ||
313 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
314 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
315 | 11 | // GNU Affero General Public License for more details. | ||
316 | 12 | // | ||
317 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
318 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
319 | 2 | 15 | ||
324 | 3 | /* | 16 | package ethernet |
321 | 4 | Copyright 2023 Canonical Ltd. This software is licensed under the | ||
322 | 5 | GNU Affero General Public License version 3 (see the file LICENSE). | ||
323 | 6 | */ | ||
325 | 7 | 17 | ||
326 | 8 | import ( | 18 | import ( |
327 | 9 | "io" | 19 | "io" |
328 | diff --git a/src/maasagent/internal/ethernet/ethernet.go b/src/maasagent/internal/ethernet/ethernet.go | |||
329 | index 8356d54..e5f27c9 100644 | |||
330 | --- a/src/maasagent/internal/ethernet/ethernet.go | |||
331 | +++ b/src/maasagent/internal/ethernet/ethernet.go | |||
332 | @@ -1,9 +1,19 @@ | |||
334 | 1 | package ethernet | 1 | // Copyright (c) 2023-2024 Canonical Ltd |
335 | 2 | // | ||
336 | 3 | // This program is free software: you can redistribute it and/or modify | ||
337 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
338 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
339 | 6 | // (at your option) any later version. | ||
340 | 7 | // | ||
341 | 8 | // This program is distributed in the hope that it will be useful, | ||
342 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
343 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
344 | 11 | // GNU Affero General Public License for more details. | ||
345 | 12 | // | ||
346 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
347 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
348 | 2 | 15 | ||
353 | 3 | /* | 16 | package ethernet |
350 | 4 | Copyright 2023 Canonical Ltd. This software is licensed under the | ||
351 | 5 | GNU Affero General Public License version 3 (see the file LICENSE). | ||
352 | 6 | */ | ||
354 | 7 | 17 | ||
355 | 8 | import ( | 18 | import ( |
356 | 9 | "encoding/binary" | 19 | "encoding/binary" |
357 | diff --git a/src/maasagent/internal/ethernet/ethernet_test.go b/src/maasagent/internal/ethernet/ethernet_test.go | |||
358 | index 523c9bc..3b95819 100644 | |||
359 | --- a/src/maasagent/internal/ethernet/ethernet_test.go | |||
360 | +++ b/src/maasagent/internal/ethernet/ethernet_test.go | |||
361 | @@ -1,9 +1,19 @@ | |||
363 | 1 | package ethernet | 1 | // Copyright (c) 2023-2024 Canonical Ltd |
364 | 2 | // | ||
365 | 3 | // This program is free software: you can redistribute it and/or modify | ||
366 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
367 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
368 | 6 | // (at your option) any later version. | ||
369 | 7 | // | ||
370 | 8 | // This program is distributed in the hope that it will be useful, | ||
371 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
372 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
373 | 11 | // GNU Affero General Public License for more details. | ||
374 | 12 | // | ||
375 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
376 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
377 | 2 | 15 | ||
382 | 3 | /* | 16 | package ethernet |
379 | 4 | Copyright 2023 Canonical Ltd. This software is licensed under the | ||
380 | 5 | GNU Affero General Public License version 3 (see the file LICENSE). | ||
381 | 6 | */ | ||
383 | 7 | 17 | ||
384 | 8 | import ( | 18 | import ( |
385 | 9 | "io" | 19 | "io" |
386 | diff --git a/src/maasagent/internal/httpproxy/cache.go b/src/maasagent/internal/httpproxy/cache.go | |||
387 | index 2520e9c..0cf8b74 100644 | |||
388 | --- a/src/maasagent/internal/httpproxy/cache.go | |||
389 | +++ b/src/maasagent/internal/httpproxy/cache.go | |||
390 | @@ -1,3 +1,18 @@ | |||
391 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
392 | 2 | // | ||
393 | 3 | // This program is free software: you can redistribute it and/or modify | ||
394 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
395 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
396 | 6 | // (at your option) any later version. | ||
397 | 7 | // | ||
398 | 8 | // This program is distributed in the hope that it will be useful, | ||
399 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
400 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
401 | 11 | // GNU Affero General Public License for more details. | ||
402 | 12 | // | ||
403 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
404 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
405 | 15 | |||
406 | 1 | package httpproxy | 16 | package httpproxy |
407 | 2 | 17 | ||
408 | 3 | import ( | 18 | import ( |
409 | diff --git a/src/maasagent/internal/httpproxy/proxy.go b/src/maasagent/internal/httpproxy/proxy.go | |||
410 | index d3ef0c2..62205b6 100644 | |||
411 | --- a/src/maasagent/internal/httpproxy/proxy.go | |||
412 | +++ b/src/maasagent/internal/httpproxy/proxy.go | |||
413 | @@ -1,3 +1,18 @@ | |||
414 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
415 | 2 | // | ||
416 | 3 | // This program is free software: you can redistribute it and/or modify | ||
417 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
418 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
419 | 6 | // (at your option) any later version. | ||
420 | 7 | // | ||
421 | 8 | // This program is distributed in the hope that it will be useful, | ||
422 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
423 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
424 | 11 | // GNU Affero General Public License for more details. | ||
425 | 12 | // | ||
426 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
427 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
428 | 15 | |||
429 | 1 | package httpproxy | 16 | package httpproxy |
430 | 2 | 17 | ||
431 | 3 | import ( | 18 | import ( |
432 | diff --git a/src/maasagent/internal/httpproxy/proxy_test.go b/src/maasagent/internal/httpproxy/proxy_test.go | |||
433 | index 523ef37..6908a73 100644 | |||
434 | --- a/src/maasagent/internal/httpproxy/proxy_test.go | |||
435 | +++ b/src/maasagent/internal/httpproxy/proxy_test.go | |||
436 | @@ -1,3 +1,18 @@ | |||
437 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
438 | 2 | // | ||
439 | 3 | // This program is free software: you can redistribute it and/or modify | ||
440 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
441 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
442 | 6 | // (at your option) any later version. | ||
443 | 7 | // | ||
444 | 8 | // This program is distributed in the hope that it will be useful, | ||
445 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
446 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
447 | 11 | // GNU Affero General Public License for more details. | ||
448 | 12 | // | ||
449 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
450 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
451 | 15 | |||
452 | 1 | package httpproxy | 16 | package httpproxy |
453 | 2 | 17 | ||
454 | 3 | import ( | 18 | import ( |
455 | diff --git a/src/maasagent/internal/httpproxy/rewrite.go b/src/maasagent/internal/httpproxy/rewrite.go | |||
456 | index 4a452ea..928a86a 100644 | |||
457 | --- a/src/maasagent/internal/httpproxy/rewrite.go | |||
458 | +++ b/src/maasagent/internal/httpproxy/rewrite.go | |||
459 | @@ -1,3 +1,18 @@ | |||
460 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
461 | 2 | // | ||
462 | 3 | // This program is free software: you can redistribute it and/or modify | ||
463 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
464 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
465 | 6 | // (at your option) any later version. | ||
466 | 7 | // | ||
467 | 8 | // This program is distributed in the hope that it will be useful, | ||
468 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
469 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
470 | 11 | // GNU Affero General Public License for more details. | ||
471 | 12 | // | ||
472 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
473 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
474 | 15 | |||
475 | 1 | package httpproxy | 16 | package httpproxy |
476 | 2 | 17 | ||
477 | 3 | import ( | 18 | import ( |
478 | diff --git a/src/maasagent/internal/httpproxy/rewrite_test.go b/src/maasagent/internal/httpproxy/rewrite_test.go | |||
479 | index 3abfaad..696c936 100644 | |||
480 | --- a/src/maasagent/internal/httpproxy/rewrite_test.go | |||
481 | +++ b/src/maasagent/internal/httpproxy/rewrite_test.go | |||
482 | @@ -1,3 +1,18 @@ | |||
483 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
484 | 2 | // | ||
485 | 3 | // This program is free software: you can redistribute it and/or modify | ||
486 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
487 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
488 | 6 | // (at your option) any later version. | ||
489 | 7 | // | ||
490 | 8 | // This program is distributed in the hope that it will be useful, | ||
491 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
492 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
493 | 11 | // GNU Affero General Public License for more details. | ||
494 | 12 | // | ||
495 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
496 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
497 | 15 | |||
498 | 1 | package httpproxy | 16 | package httpproxy |
499 | 2 | 17 | ||
500 | 3 | import ( | 18 | import ( |
501 | diff --git a/src/maasagent/internal/httpproxy/service.go b/src/maasagent/internal/httpproxy/service.go | |||
502 | index 913b6d2..1aed46f 100644 | |||
503 | --- a/src/maasagent/internal/httpproxy/service.go | |||
504 | +++ b/src/maasagent/internal/httpproxy/service.go | |||
505 | @@ -1,3 +1,18 @@ | |||
506 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
507 | 2 | // | ||
508 | 3 | // This program is free software: you can redistribute it and/or modify | ||
509 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
510 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
511 | 6 | // (at your option) any later version. | ||
512 | 7 | // | ||
513 | 8 | // This program is distributed in the hope that it will be useful, | ||
514 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
515 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
516 | 11 | // GNU Affero General Public License for more details. | ||
517 | 12 | // | ||
518 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
519 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
520 | 15 | |||
521 | 1 | package httpproxy | 16 | package httpproxy |
522 | 2 | 17 | ||
523 | 3 | import ( | 18 | import ( |
524 | diff --git a/src/maasagent/internal/httpproxy/service_test.go b/src/maasagent/internal/httpproxy/service_test.go | |||
525 | index b894e17..0e65e4e 100644 | |||
526 | --- a/src/maasagent/internal/httpproxy/service_test.go | |||
527 | +++ b/src/maasagent/internal/httpproxy/service_test.go | |||
528 | @@ -1,3 +1,18 @@ | |||
529 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
530 | 2 | // | ||
531 | 3 | // This program is free software: you can redistribute it and/or modify | ||
532 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
533 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
534 | 6 | // (at your option) any later version. | ||
535 | 7 | // | ||
536 | 8 | // This program is distributed in the hope that it will be useful, | ||
537 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
538 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
539 | 11 | // GNU Affero General Public License for more details. | ||
540 | 12 | // | ||
541 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
542 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
543 | 15 | |||
544 | 1 | package httpproxy | 16 | package httpproxy |
545 | 2 | 17 | ||
546 | 3 | import ( | 18 | import ( |
547 | diff --git a/src/maasagent/internal/netmon/event.go b/src/maasagent/internal/netmon/event.go | |||
548 | index 19a2d72..4406ba7 100644 | |||
549 | --- a/src/maasagent/internal/netmon/event.go | |||
550 | +++ b/src/maasagent/internal/netmon/event.go | |||
551 | @@ -1,3 +1,18 @@ | |||
552 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
553 | 2 | // | ||
554 | 3 | // This program is free software: you can redistribute it and/or modify | ||
555 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
556 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
557 | 6 | // (at your option) any later version. | ||
558 | 7 | // | ||
559 | 8 | // This program is distributed in the hope that it will be useful, | ||
560 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
561 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
562 | 11 | // GNU Affero General Public License for more details. | ||
563 | 12 | // | ||
564 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
565 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
566 | 15 | |||
567 | 1 | package netmon | 16 | package netmon |
568 | 2 | 17 | ||
569 | 3 | import ( | 18 | import ( |
570 | diff --git a/src/maasagent/internal/netmon/event_test.go b/src/maasagent/internal/netmon/event_test.go | |||
571 | index 86ecff3..16b6ca8 100644 | |||
572 | --- a/src/maasagent/internal/netmon/event_test.go | |||
573 | +++ b/src/maasagent/internal/netmon/event_test.go | |||
574 | @@ -1,3 +1,18 @@ | |||
575 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
576 | 2 | // | ||
577 | 3 | // This program is free software: you can redistribute it and/or modify | ||
578 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
579 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
580 | 6 | // (at your option) any later version. | ||
581 | 7 | // | ||
582 | 8 | // This program is distributed in the hope that it will be useful, | ||
583 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
584 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
585 | 11 | // GNU Affero General Public License for more details. | ||
586 | 12 | // | ||
587 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
588 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
589 | 15 | |||
590 | 1 | package netmon | 16 | package netmon |
591 | 2 | 17 | ||
592 | 3 | import ( | 18 | import ( |
593 | diff --git a/src/maasagent/internal/netmon/scan.go b/src/maasagent/internal/netmon/scan.go | |||
594 | index ec71278..03c935f 100644 | |||
595 | --- a/src/maasagent/internal/netmon/scan.go | |||
596 | +++ b/src/maasagent/internal/netmon/scan.go | |||
597 | @@ -1,3 +1,18 @@ | |||
598 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
599 | 2 | // | ||
600 | 3 | // This program is free software: you can redistribute it and/or modify | ||
601 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
602 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
603 | 6 | // (at your option) any later version. | ||
604 | 7 | // | ||
605 | 8 | // This program is distributed in the hope that it will be useful, | ||
606 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
607 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
608 | 11 | // GNU Affero General Public License for more details. | ||
609 | 12 | // | ||
610 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
611 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
612 | 15 | |||
613 | 1 | package netmon | 16 | package netmon |
614 | 2 | 17 | ||
615 | 3 | import ( | 18 | import ( |
616 | diff --git a/src/maasagent/internal/netmon/scan_test.go b/src/maasagent/internal/netmon/scan_test.go | |||
617 | index af84e83..4add34d 100644 | |||
618 | --- a/src/maasagent/internal/netmon/scan_test.go | |||
619 | +++ b/src/maasagent/internal/netmon/scan_test.go | |||
620 | @@ -1,3 +1,18 @@ | |||
621 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
622 | 2 | // | ||
623 | 3 | // This program is free software: you can redistribute it and/or modify | ||
624 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
625 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
626 | 6 | // (at your option) any later version. | ||
627 | 7 | // | ||
628 | 8 | // This program is distributed in the hope that it will be useful, | ||
629 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
630 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
631 | 11 | // GNU Affero General Public License for more details. | ||
632 | 12 | // | ||
633 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
634 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
635 | 15 | |||
636 | 1 | package netmon | 16 | package netmon |
637 | 2 | 17 | ||
638 | 3 | import ( | 18 | import ( |
639 | diff --git a/src/maasagent/internal/netmon/service.go b/src/maasagent/internal/netmon/service.go | |||
640 | index ee61924..a56ed2d 100644 | |||
641 | --- a/src/maasagent/internal/netmon/service.go | |||
642 | +++ b/src/maasagent/internal/netmon/service.go | |||
643 | @@ -1,9 +1,19 @@ | |||
645 | 1 | package netmon | 1 | // Copyright (c) 2023-2024 Canonical Ltd |
646 | 2 | // | ||
647 | 3 | // This program is free software: you can redistribute it and/or modify | ||
648 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
649 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
650 | 6 | // (at your option) any later version. | ||
651 | 7 | // | ||
652 | 8 | // This program is distributed in the hope that it will be useful, | ||
653 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
654 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
655 | 11 | // GNU Affero General Public License for more details. | ||
656 | 12 | // | ||
657 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
658 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
659 | 2 | 15 | ||
664 | 3 | /* | 16 | package netmon |
661 | 4 | Copyright 2023 Canonical Ltd. This software is licensed under the | ||
662 | 5 | GNU Affero General Public License version 3 (see the file LICENSE). | ||
663 | 6 | */ | ||
665 | 7 | 17 | ||
666 | 8 | import ( | 18 | import ( |
667 | 9 | "bytes" | 19 | "bytes" |
668 | diff --git a/src/maasagent/internal/netmon/service_test.go b/src/maasagent/internal/netmon/service_test.go | |||
669 | index 77abf9c..2389388 100644 | |||
670 | --- a/src/maasagent/internal/netmon/service_test.go | |||
671 | +++ b/src/maasagent/internal/netmon/service_test.go | |||
672 | @@ -1,9 +1,19 @@ | |||
674 | 1 | package netmon | 1 | // Copyright (c) 2023-2024 Canonical Ltd |
675 | 2 | // | ||
676 | 3 | // This program is free software: you can redistribute it and/or modify | ||
677 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
678 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
679 | 6 | // (at your option) any later version. | ||
680 | 7 | // | ||
681 | 8 | // This program is distributed in the hope that it will be useful, | ||
682 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
683 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
684 | 11 | // GNU Affero General Public License for more details. | ||
685 | 12 | // | ||
686 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
687 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
688 | 2 | 15 | ||
693 | 3 | /* | 16 | package netmon |
690 | 4 | Copyright 2023 Canonical Ltd. This software is licensed under the | ||
691 | 5 | GNU Affero General Public License version 3 (see the file LICENSE). | ||
692 | 6 | */ | ||
694 | 7 | 17 | ||
695 | 8 | import ( | 18 | import ( |
696 | 9 | "net" | 19 | "net" |
697 | diff --git a/src/maasagent/internal/power/service.go b/src/maasagent/internal/power/service.go | |||
698 | index 3a22868..b33dd0f 100644 | |||
699 | --- a/src/maasagent/internal/power/service.go | |||
700 | +++ b/src/maasagent/internal/power/service.go | |||
701 | @@ -1,3 +1,18 @@ | |||
702 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
703 | 2 | // | ||
704 | 3 | // This program is free software: you can redistribute it and/or modify | ||
705 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
706 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
707 | 6 | // (at your option) any later version. | ||
708 | 7 | // | ||
709 | 8 | // This program is distributed in the hope that it will be useful, | ||
710 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
711 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
712 | 11 | // GNU Affero General Public License for more details. | ||
713 | 12 | // | ||
714 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
715 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
716 | 15 | |||
717 | 1 | package power | 16 | package power |
718 | 2 | 17 | ||
719 | 3 | import ( | 18 | import ( |
720 | diff --git a/src/maasagent/internal/power/service_test.go b/src/maasagent/internal/power/service_test.go | |||
721 | index 54d7df5..6213eb7 100644 | |||
722 | --- a/src/maasagent/internal/power/service_test.go | |||
723 | +++ b/src/maasagent/internal/power/service_test.go | |||
724 | @@ -1,3 +1,18 @@ | |||
725 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
726 | 2 | // | ||
727 | 3 | // This program is free software: you can redistribute it and/or modify | ||
728 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
729 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
730 | 6 | // (at your option) any later version. | ||
731 | 7 | // | ||
732 | 8 | // This program is distributed in the hope that it will be useful, | ||
733 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
734 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
735 | 11 | // GNU Affero General Public License for more details. | ||
736 | 12 | // | ||
737 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
738 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
739 | 15 | |||
740 | 1 | package power | 16 | package power |
741 | 2 | 17 | ||
742 | 3 | import ( | 18 | import ( |
743 | diff --git a/src/maasagent/internal/power/workflow.go b/src/maasagent/internal/power/workflow.go | |||
744 | index 7509c33..5611ca6 100644 | |||
745 | --- a/src/maasagent/internal/power/workflow.go | |||
746 | +++ b/src/maasagent/internal/power/workflow.go | |||
747 | @@ -1,3 +1,18 @@ | |||
748 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
749 | 2 | // | ||
750 | 3 | // This program is free software: you can redistribute it and/or modify | ||
751 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
752 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
753 | 6 | // (at your option) any later version. | ||
754 | 7 | // | ||
755 | 8 | // This program is distributed in the hope that it will be useful, | ||
756 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
757 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
758 | 11 | // GNU Affero General Public License for more details. | ||
759 | 12 | // | ||
760 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
761 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
762 | 15 | |||
763 | 1 | package power | 16 | package power |
764 | 2 | 17 | ||
765 | 3 | // TODO: implement workflow for each power action. | 18 | // TODO: implement workflow for each power action. |
766 | diff --git a/src/maasagent/internal/workflow/checkip.go b/src/maasagent/internal/workflow/checkip.go | |||
767 | index 1e56581..fddd8f6 100644 | |||
768 | --- a/src/maasagent/internal/workflow/checkip.go | |||
769 | +++ b/src/maasagent/internal/workflow/checkip.go | |||
770 | @@ -1,3 +1,18 @@ | |||
771 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
772 | 2 | // | ||
773 | 3 | // This program is free software: you can redistribute it and/or modify | ||
774 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
775 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
776 | 6 | // (at your option) any later version. | ||
777 | 7 | // | ||
778 | 8 | // This program is distributed in the hope that it will be useful, | ||
779 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
780 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
781 | 11 | // GNU Affero General Public License for more details. | ||
782 | 12 | // | ||
783 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
784 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
785 | 15 | |||
786 | 1 | package workflow | 16 | package workflow |
787 | 2 | 17 | ||
788 | 3 | import ( | 18 | import ( |
789 | diff --git a/src/maasagent/internal/workflow/log/tag/tags.go b/src/maasagent/internal/workflow/log/tag/tags.go | |||
790 | index dd37ef2..f421c0b 100644 | |||
791 | --- a/src/maasagent/internal/workflow/log/tag/tags.go | |||
792 | +++ b/src/maasagent/internal/workflow/log/tag/tags.go | |||
793 | @@ -1,3 +1,18 @@ | |||
794 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
795 | 2 | // | ||
796 | 3 | // This program is free software: you can redistribute it and/or modify | ||
797 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
798 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
799 | 6 | // (at your option) any later version. | ||
800 | 7 | // | ||
801 | 8 | // This program is distributed in the hope that it will be useful, | ||
802 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
803 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
804 | 11 | // GNU Affero General Public License for more details. | ||
805 | 12 | // | ||
806 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
807 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
808 | 15 | |||
809 | 1 | package tag | 16 | package tag |
810 | 2 | 17 | ||
811 | 3 | type builder struct { | 18 | type builder struct { |
812 | diff --git a/src/maasagent/internal/workflow/log/zerolog.go b/src/maasagent/internal/workflow/log/zerolog.go | |||
813 | index 128bbfd..d377c6a 100644 | |||
814 | --- a/src/maasagent/internal/workflow/log/zerolog.go | |||
815 | +++ b/src/maasagent/internal/workflow/log/zerolog.go | |||
816 | @@ -1,3 +1,18 @@ | |||
817 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
818 | 2 | // | ||
819 | 3 | // This program is free software: you can redistribute it and/or modify | ||
820 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
821 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
822 | 6 | // (at your option) any later version. | ||
823 | 7 | // | ||
824 | 8 | // This program is distributed in the hope that it will be useful, | ||
825 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
826 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
827 | 11 | // GNU Affero General Public License for more details. | ||
828 | 12 | // | ||
829 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
830 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
831 | 15 | |||
832 | 1 | package log | 16 | package log |
833 | 2 | 17 | ||
834 | 3 | import ( | 18 | import ( |
835 | diff --git a/src/maasagent/internal/workflow/worker/pool.go b/src/maasagent/internal/workflow/worker/pool.go | |||
836 | index 3fed8b6..ea543c1 100644 | |||
837 | --- a/src/maasagent/internal/workflow/worker/pool.go | |||
838 | +++ b/src/maasagent/internal/workflow/worker/pool.go | |||
839 | @@ -1,3 +1,18 @@ | |||
840 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
841 | 2 | // | ||
842 | 3 | // This program is free software: you can redistribute it and/or modify | ||
843 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
844 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
845 | 6 | // (at your option) any later version. | ||
846 | 7 | // | ||
847 | 8 | // This program is distributed in the hope that it will be useful, | ||
848 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
849 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
850 | 11 | // GNU Affero General Public License for more details. | ||
851 | 12 | // | ||
852 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
853 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
854 | 15 | |||
855 | 1 | package worker | 16 | package worker |
856 | 2 | 17 | ||
857 | 3 | import ( | 18 | import ( |
858 | diff --git a/src/maasagent/internal/workflow/worker/pool_test.go b/src/maasagent/internal/workflow/worker/pool_test.go | |||
859 | 4 | deleted file mode 100644 | 19 | deleted file mode 100644 |
860 | index da2573c..0000000 | |||
861 | --- a/src/maasagent/internal/workflow/worker/pool_test.go | |||
862 | +++ /dev/null | |||
863 | @@ -1,149 +0,0 @@ | |||
864 | 1 | package worker | ||
865 | 2 | |||
866 | 3 | // | ||
867 | 4 | // import ( | ||
868 | 5 | // "testing" | ||
869 | 6 | // | ||
870 | 7 | // "github.com/stretchr/testify/assert" | ||
871 | 8 | // "go.temporal.io/sdk/activity" | ||
872 | 9 | // "go.temporal.io/sdk/client" | ||
873 | 10 | // "go.temporal.io/sdk/temporal" | ||
874 | 11 | // "go.temporal.io/sdk/worker" | ||
875 | 12 | // "go.temporal.io/sdk/workflow" | ||
876 | 13 | // ) | ||
877 | 14 | // | ||
878 | 15 | // type fakeWorker struct{} | ||
879 | 16 | // | ||
880 | 17 | // func (w *fakeWorker) Start() error { return nil } | ||
881 | 18 | // | ||
882 | 19 | // func (w *fakeWorker) Run(<-chan interface{}) error { return nil } | ||
883 | 20 | // | ||
884 | 21 | // func (w *fakeWorker) Stop() {} | ||
885 | 22 | // | ||
886 | 23 | // func (w *fakeWorker) RegisterWorkflow(interface{}) {} | ||
887 | 24 | // | ||
888 | 25 | // func (w *fakeWorker) RegisterWorkflowWithOptions(interface{}, workflow.RegisterOptions) {} | ||
889 | 26 | // | ||
890 | 27 | // func (w *fakeWorker) RegisterActivity(interface{}) {} | ||
891 | 28 | // | ||
892 | 29 | // func (w *fakeWorker) RegisterActivityWithOptions(interface{}, activity.RegisterOptions) {} | ||
893 | 30 | // | ||
894 | 31 | // var ( | ||
895 | 32 | // fakeWorkerConstructor = func(c client.Client, tq string, | ||
896 | 33 | // opts worker.Options) worker.Worker { | ||
897 | 34 | // return &fakeWorker{} | ||
898 | 35 | // } | ||
899 | 36 | // ) | ||
900 | 37 | // | ||
901 | 38 | // func TestWorkerPoolConfigurationOverwrite(t *testing.T) { | ||
902 | 39 | // pool := NewWorkerPool("systemID", nil, WithWorkerConstructor(fakeWorkerConstructor)) | ||
903 | 40 | // pool.workers["tq1"] = &fakeWorker{} | ||
904 | 41 | // pool.workers["tq2"] = &fakeWorker{} | ||
905 | 42 | // pool.workers["tq3"] = &fakeWorker{} | ||
906 | 43 | // assert.Equal(t, 3, len(pool.workers)) | ||
907 | 44 | // | ||
908 | 45 | // err := pool.configure([]configureParam{ | ||
909 | 46 | // {TaskQueue: "tq1new"}, | ||
910 | 47 | // {TaskQueue: "tq2new"}, | ||
911 | 48 | // }) | ||
912 | 49 | // | ||
913 | 50 | // assert.NoError(t, err) | ||
914 | 51 | // assert.Equal(t, 2, len(pool.workers)) | ||
915 | 52 | // } | ||
916 | 53 | // | ||
917 | 54 | // func TestWorkerPoolConfiguration(t *testing.T) { | ||
918 | 55 | // testcases := map[string]struct { | ||
919 | 56 | // pool *WorkerPool | ||
920 | 57 | // in []configureParam | ||
921 | 58 | // out int | ||
922 | 59 | // err string | ||
923 | 60 | // }{ | ||
924 | 61 | // "with allowed activity and workflow": { | ||
925 | 62 | // pool: NewWorkerPool("systemID", nil, | ||
926 | 63 | // WithWorkerConstructor(fakeWorkerConstructor), | ||
927 | 64 | // WithAllowedWorkflows(map[string]interface{}{"workflow": nil}), | ||
928 | 65 | // WithAllowedActivities(map[string]interface{}{"activity": nil}), | ||
929 | 66 | // ), | ||
930 | 67 | // in: []configureParam{ | ||
931 | 68 | // { | ||
932 | 69 | // TaskQueue: "tq", | ||
933 | 70 | // Workflows: []string{"workflow"}, | ||
934 | 71 | // Activities: []string{"activity"}, | ||
935 | 72 | // }, | ||
936 | 73 | // }, | ||
937 | 74 | // out: 1, | ||
938 | 75 | // err: "", | ||
939 | 76 | // }, | ||
940 | 77 | // "with allowed activity and not allowed workflow": { | ||
941 | 78 | // pool: NewWorkerPool("systemID", nil, | ||
942 | 79 | // WithWorkerConstructor(fakeWorkerConstructor), | ||
943 | 80 | // WithAllowedActivities(map[string]interface{}{"activity": nil}), | ||
944 | 81 | // ), | ||
945 | 82 | // in: []configureParam{ | ||
946 | 83 | // { | ||
947 | 84 | // TaskQueue: "tq", | ||
948 | 85 | // Workflows: []string{"workflow"}, | ||
949 | 86 | // Activities: []string{"activity"}, | ||
950 | 87 | // }, | ||
951 | 88 | // }, | ||
952 | 89 | // out: 0, | ||
953 | 90 | // err: "workflowNotAllowed", | ||
954 | 91 | // }, | ||
955 | 92 | // "with allowed workflow and not allowed activity": { | ||
956 | 93 | // pool: NewWorkerPool("systemID", nil, | ||
957 | 94 | // WithWorkerConstructor(fakeWorkerConstructor), | ||
958 | 95 | // WithAllowedWorkflows(map[string]interface{}{"workflow": nil}), | ||
959 | 96 | // ), | ||
960 | 97 | // in: []configureParam{ | ||
961 | 98 | // { | ||
962 | 99 | // TaskQueue: "tq", | ||
963 | 100 | // Workflows: []string{"workflow"}, | ||
964 | 101 | // Activities: []string{"activity"}, | ||
965 | 102 | // }, | ||
966 | 103 | // }, | ||
967 | 104 | // out: 0, | ||
968 | 105 | // err: "activityNotAllowed", | ||
969 | 106 | // }, | ||
970 | 107 | // "multiple task queues": { | ||
971 | 108 | // pool: NewWorkerPool("systemID", nil, | ||
972 | 109 | // WithWorkerConstructor(fakeWorkerConstructor), | ||
973 | 110 | // WithAllowedWorkflows(map[string]interface{}{ | ||
974 | 111 | // "workflow1": nil, | ||
975 | 112 | // "workflow2": nil, | ||
976 | 113 | // }), | ||
977 | 114 | // WithAllowedActivities(map[string]interface{}{ | ||
978 | 115 | // "activity1": nil, | ||
979 | 116 | // "activity2": nil, | ||
980 | 117 | // }), | ||
981 | 118 | // ), | ||
982 | 119 | // in: []configureParam{ | ||
983 | 120 | // { | ||
984 | 121 | // TaskQueue: "tq1", | ||
985 | 122 | // Workflows: []string{"workflow1"}, | ||
986 | 123 | // Activities: []string{"activity1"}, | ||
987 | 124 | // }, | ||
988 | 125 | // { | ||
989 | 126 | // TaskQueue: "tq2", | ||
990 | 127 | // Workflows: []string{"workflow2"}, | ||
991 | 128 | // Activities: []string{"activity2"}, | ||
992 | 129 | // }, | ||
993 | 130 | // }, | ||
994 | 131 | // out: 2, | ||
995 | 132 | // err: "", | ||
996 | 133 | // }, | ||
997 | 134 | // } | ||
998 | 135 | // | ||
999 | 136 | // for name, tc := range testcases { | ||
1000 | 137 | // tc := tc | ||
1001 | 138 | // | ||
1002 | 139 | // t.Run(name, func(t *testing.T) { | ||
1003 | 140 | // t.Parallel() | ||
1004 | 141 | // | ||
1005 | 142 | // err := tc.pool.configure(tc.in) | ||
1006 | 143 | // if tc.err != "" { | ||
1007 | 144 | // assert.Equal(t, tc.err, err.(*temporal.ApplicationError).Type()) | ||
1008 | 145 | // } | ||
1009 | 146 | // assert.Equal(t, tc.out, len(tc.pool.workers)) | ||
1010 | 147 | // }) | ||
1011 | 148 | // } | ||
1012 | 149 | // } | ||
1013 | diff --git a/src/maasagent/pkg/workflow/codec/encryptor.go b/src/maasagent/pkg/workflow/codec/encryptor.go | |||
1014 | index 31b3e51..a5341a4 100644 | |||
1015 | --- a/src/maasagent/pkg/workflow/codec/encryptor.go | |||
1016 | +++ b/src/maasagent/pkg/workflow/codec/encryptor.go | |||
1017 | @@ -1,3 +1,18 @@ | |||
1018 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
1019 | 2 | // | ||
1020 | 3 | // This program is free software: you can redistribute it and/or modify | ||
1021 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
1022 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
1023 | 6 | // (at your option) any later version. | ||
1024 | 7 | // | ||
1025 | 8 | // This program is distributed in the hope that it will be useful, | ||
1026 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1027 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1028 | 11 | // GNU Affero General Public License for more details. | ||
1029 | 12 | // | ||
1030 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
1031 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1032 | 15 | |||
1033 | 1 | // Package codec provides Encryption Codec that can be used to encrypt | 16 | // Package codec provides Encryption Codec that can be used to encrypt |
1034 | 2 | // sensitive data passed to and from Temporal Server | 17 | // sensitive data passed to and from Temporal Server |
1035 | 3 | // | 18 | // |
1036 | diff --git a/src/maasagent/pkg/workflow/codec/encryptor_test.go b/src/maasagent/pkg/workflow/codec/encryptor_test.go | |||
1037 | index 809afca..ffcb726 100644 | |||
1038 | --- a/src/maasagent/pkg/workflow/codec/encryptor_test.go | |||
1039 | +++ b/src/maasagent/pkg/workflow/codec/encryptor_test.go | |||
1040 | @@ -1,3 +1,18 @@ | |||
1041 | 1 | // Copyright (c) 2023-2024 Canonical Ltd | ||
1042 | 2 | // | ||
1043 | 3 | // This program is free software: you can redistribute it and/or modify | ||
1044 | 4 | // it under the terms of the GNU Affero General Public License as published by | ||
1045 | 5 | // the Free Software Foundation, either version 3 of the License, or | ||
1046 | 6 | // (at your option) any later version. | ||
1047 | 7 | // | ||
1048 | 8 | // This program is distributed in the hope that it will be useful, | ||
1049 | 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1050 | 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1051 | 11 | // GNU Affero General Public License for more details. | ||
1052 | 12 | // | ||
1053 | 13 | // You should have received a copy of the GNU Affero General Public License | ||
1054 | 14 | // along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1055 | 15 | |||
1056 | 1 | package codec | 16 | package codec |
1057 | 2 | 17 | ||
1058 | 3 | import ( | 18 | import ( |
should this also be applied to Go files in src/host-info subdirectories?