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 | - errcheck |
7 | - exportloopref |
8 | - gocritic |
9 | + - goheader |
10 | - gofmt |
11 | - goimports |
12 | - gosec |
13 | @@ -94,6 +95,25 @@ linters-settings: |
14 | errcheck: |
15 | check-type-assertions: true |
16 | check-blank: true |
17 | + goheader: |
18 | + values: |
19 | + regexp: |
20 | + YEAR: \d{4}(-\d{4})? |
21 | + template: |- |
22 | + Copyright (c) {{YEAR}} Canonical Ltd |
23 | + |
24 | + This program is free software: you can redistribute it and/or modify |
25 | + it under the terms of the GNU Affero General Public License as published by |
26 | + the Free Software Foundation, either version 3 of the License, or |
27 | + (at your option) any later version. |
28 | + |
29 | + This program is distributed in the hope that it will be useful, |
30 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
31 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
32 | + GNU Affero General Public License for more details. |
33 | + |
34 | + You should have received a copy of the GNU Affero General Public License |
35 | + along with this program. If not, see <http://www.gnu.org/licenses/>. |
36 | gosimple: |
37 | checks: ["all"] |
38 | 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 | +// Copyright (c) 2014-2024 Canonical Ltd |
45 | +// |
46 | +// This program is free software: you can redistribute it and/or modify |
47 | +// it under the terms of the GNU Affero General Public License as published by |
48 | +// the Free Software Foundation, either version 3 of the License, or |
49 | +// (at your option) any later version. |
50 | +// |
51 | +// This program is distributed in the hope that it will be useful, |
52 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
53 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
54 | +// GNU Affero General Public License for more details. |
55 | +// |
56 | +// You should have received a copy of the GNU Affero General Public License |
57 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
58 | + |
59 | //go:build linux |
60 | // +build linux |
61 | |
62 | -// Copyright 2014-2020 Canonical Ltd. This software is licensed under the |
63 | -// GNU Affero General Public License version 3 (see the file LICENSE). |
64 | - |
65 | package main |
66 | |
67 | 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 | +// Copyright (c) 2022-2024 Canonical Ltd |
74 | +// |
75 | +// This program is free software: you can redistribute it and/or modify |
76 | +// it under the terms of the GNU Affero General Public License as published by |
77 | +// the Free Software Foundation, either version 3 of the License, or |
78 | +// (at your option) any later version. |
79 | +// |
80 | +// This program is distributed in the hope that it will be useful, |
81 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
82 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
83 | +// GNU Affero General Public License for more details. |
84 | +// |
85 | +// You should have received a copy of the GNU Affero General Public License |
86 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
87 | + |
88 | //go:build linux |
89 | // +build linux |
90 | |
91 | -// Copyright 2022 Canonical Ltd. This software is licensed under the |
92 | -// GNU Affero General Public License version 3 (see the file LICENSE). |
93 | - |
94 | //nolint:stylecheck // ignore ST1000 |
95 | package info |
96 | |
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 @@ |
102 | -package main |
103 | +// Copyright (c) 2023-2024 Canonical Ltd |
104 | +// |
105 | +// This program is free software: you can redistribute it and/or modify |
106 | +// it under the terms of the GNU Affero General Public License as published by |
107 | +// the Free Software Foundation, either version 3 of the License, or |
108 | +// (at your option) any later version. |
109 | +// |
110 | +// This program is distributed in the hope that it will be useful, |
111 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
112 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
113 | +// GNU Affero General Public License for more details. |
114 | +// |
115 | +// You should have received a copy of the GNU Affero General Public License |
116 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
117 | |
118 | -/* |
119 | - Copyright 2023 Canonical Ltd. This software is licensed under the |
120 | - GNU Affero General Public License version 3 (see the file LICENSE). |
121 | -*/ |
122 | +package main |
123 | |
124 | import ( |
125 | "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 | +// Copyright (c) 2023-2024 Canonical Ltd |
132 | +// |
133 | +// This program is free software: you can redistribute it and/or modify |
134 | +// it under the terms of the GNU Affero General Public License as published by |
135 | +// the Free Software Foundation, either version 3 of the License, or |
136 | +// (at your option) any later version. |
137 | +// |
138 | +// This program is distributed in the hope that it will be useful, |
139 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
140 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
141 | +// GNU Affero General Public License for more details. |
142 | +// |
143 | +// You should have received a copy of the GNU Affero General Public License |
144 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
145 | + |
146 | package main |
147 | |
148 | 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 @@ |
154 | -package main |
155 | +// Copyright (c) 2023-2024 Canonical Ltd |
156 | +// |
157 | +// This program is free software: you can redistribute it and/or modify |
158 | +// it under the terms of the GNU Affero General Public License as published by |
159 | +// the Free Software Foundation, either version 3 of the License, or |
160 | +// (at your option) any later version. |
161 | +// |
162 | +// This program is distributed in the hope that it will be useful, |
163 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
164 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
165 | +// GNU Affero General Public License for more details. |
166 | +// |
167 | +// You should have received a copy of the GNU Affero General Public License |
168 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
169 | |
170 | -/* |
171 | - Copyright 2023 Canonical Ltd. This software is licensed under the |
172 | - GNU Affero General Public License version 3 (see the file LICENSE). |
173 | -*/ |
174 | +package main |
175 | |
176 | import ( |
177 | "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 | +// Copyright (c) 2023-2024 Canonical Ltd |
184 | +// |
185 | +// This program is free software: you can redistribute it and/or modify |
186 | +// it under the terms of the GNU Affero General Public License as published by |
187 | +// the Free Software Foundation, either version 3 of the License, or |
188 | +// (at your option) any later version. |
189 | +// |
190 | +// This program is distributed in the hope that it will be useful, |
191 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
192 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
193 | +// GNU Affero General Public License for more details. |
194 | +// |
195 | +// You should have received a copy of the GNU Affero General Public License |
196 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
197 | + |
198 | package cache |
199 | |
200 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
207 | +// |
208 | +// This program is free software: you can redistribute it and/or modify |
209 | +// it under the terms of the GNU Affero General Public License as published by |
210 | +// the Free Software Foundation, either version 3 of the License, or |
211 | +// (at your option) any later version. |
212 | +// |
213 | +// This program is distributed in the hope that it will be useful, |
214 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
215 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
216 | +// GNU Affero General Public License for more details. |
217 | +// |
218 | +// You should have received a copy of the GNU Affero General Public License |
219 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
220 | + |
221 | package cache |
222 | |
223 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
230 | +// |
231 | +// This program is free software: you can redistribute it and/or modify |
232 | +// it under the terms of the GNU Affero General Public License as published by |
233 | +// the Free Software Foundation, either version 3 of the License, or |
234 | +// (at your option) any later version. |
235 | +// |
236 | +// This program is distributed in the hope that it will be useful, |
237 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
238 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
239 | +// GNU Affero General Public License for more details. |
240 | +// |
241 | +// You should have received a copy of the GNU Affero General Public License |
242 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
243 | + |
244 | package cache |
245 | |
246 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
253 | +// |
254 | +// This program is free software: you can redistribute it and/or modify |
255 | +// it under the terms of the GNU Affero General Public License as published by |
256 | +// the Free Software Foundation, either version 3 of the License, or |
257 | +// (at your option) any later version. |
258 | +// |
259 | +// This program is distributed in the hope that it will be useful, |
260 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
261 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
262 | +// GNU Affero General Public License for more details. |
263 | +// |
264 | +// You should have received a copy of the GNU Affero General Public License |
265 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
266 | + |
267 | package cache |
268 | |
269 | 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 @@ |
275 | -package ethernet |
276 | +// Copyright (c) 2023-2024 Canonical Ltd |
277 | +// |
278 | +// This program is free software: you can redistribute it and/or modify |
279 | +// it under the terms of the GNU Affero General Public License as published by |
280 | +// the Free Software Foundation, either version 3 of the License, or |
281 | +// (at your option) any later version. |
282 | +// |
283 | +// This program is distributed in the hope that it will be useful, |
284 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
285 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
286 | +// GNU Affero General Public License for more details. |
287 | +// |
288 | +// You should have received a copy of the GNU Affero General Public License |
289 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
290 | |
291 | -/* |
292 | - Copyright 2023 Canonical Ltd. This software is licensed under the |
293 | - GNU Affero General Public License version 3 (see the file LICENSE). |
294 | -*/ |
295 | +package ethernet |
296 | |
297 | import ( |
298 | "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 @@ |
304 | -package ethernet |
305 | +// Copyright (c) 2023-2024 Canonical Ltd |
306 | +// |
307 | +// This program is free software: you can redistribute it and/or modify |
308 | +// it under the terms of the GNU Affero General Public License as published by |
309 | +// the Free Software Foundation, either version 3 of the License, or |
310 | +// (at your option) any later version. |
311 | +// |
312 | +// This program is distributed in the hope that it will be useful, |
313 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
314 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
315 | +// GNU Affero General Public License for more details. |
316 | +// |
317 | +// You should have received a copy of the GNU Affero General Public License |
318 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
319 | |
320 | -/* |
321 | - Copyright 2023 Canonical Ltd. This software is licensed under the |
322 | - GNU Affero General Public License version 3 (see the file LICENSE). |
323 | -*/ |
324 | +package ethernet |
325 | |
326 | import ( |
327 | "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 @@ |
333 | -package ethernet |
334 | +// Copyright (c) 2023-2024 Canonical Ltd |
335 | +// |
336 | +// This program is free software: you can redistribute it and/or modify |
337 | +// it under the terms of the GNU Affero General Public License as published by |
338 | +// the Free Software Foundation, either version 3 of the License, or |
339 | +// (at your option) any later version. |
340 | +// |
341 | +// This program is distributed in the hope that it will be useful, |
342 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
343 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
344 | +// GNU Affero General Public License for more details. |
345 | +// |
346 | +// You should have received a copy of the GNU Affero General Public License |
347 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
348 | |
349 | -/* |
350 | - Copyright 2023 Canonical Ltd. This software is licensed under the |
351 | - GNU Affero General Public License version 3 (see the file LICENSE). |
352 | -*/ |
353 | +package ethernet |
354 | |
355 | import ( |
356 | "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 @@ |
362 | -package ethernet |
363 | +// Copyright (c) 2023-2024 Canonical Ltd |
364 | +// |
365 | +// This program is free software: you can redistribute it and/or modify |
366 | +// it under the terms of the GNU Affero General Public License as published by |
367 | +// the Free Software Foundation, either version 3 of the License, or |
368 | +// (at your option) any later version. |
369 | +// |
370 | +// This program is distributed in the hope that it will be useful, |
371 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
372 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
373 | +// GNU Affero General Public License for more details. |
374 | +// |
375 | +// You should have received a copy of the GNU Affero General Public License |
376 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
377 | |
378 | -/* |
379 | - Copyright 2023 Canonical Ltd. This software is licensed under the |
380 | - GNU Affero General Public License version 3 (see the file LICENSE). |
381 | -*/ |
382 | +package ethernet |
383 | |
384 | import ( |
385 | "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 | +// Copyright (c) 2023-2024 Canonical Ltd |
392 | +// |
393 | +// This program is free software: you can redistribute it and/or modify |
394 | +// it under the terms of the GNU Affero General Public License as published by |
395 | +// the Free Software Foundation, either version 3 of the License, or |
396 | +// (at your option) any later version. |
397 | +// |
398 | +// This program is distributed in the hope that it will be useful, |
399 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
400 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
401 | +// GNU Affero General Public License for more details. |
402 | +// |
403 | +// You should have received a copy of the GNU Affero General Public License |
404 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
405 | + |
406 | package httpproxy |
407 | |
408 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
415 | +// |
416 | +// This program is free software: you can redistribute it and/or modify |
417 | +// it under the terms of the GNU Affero General Public License as published by |
418 | +// the Free Software Foundation, either version 3 of the License, or |
419 | +// (at your option) any later version. |
420 | +// |
421 | +// This program is distributed in the hope that it will be useful, |
422 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
423 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
424 | +// GNU Affero General Public License for more details. |
425 | +// |
426 | +// You should have received a copy of the GNU Affero General Public License |
427 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
428 | + |
429 | package httpproxy |
430 | |
431 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
438 | +// |
439 | +// This program is free software: you can redistribute it and/or modify |
440 | +// it under the terms of the GNU Affero General Public License as published by |
441 | +// the Free Software Foundation, either version 3 of the License, or |
442 | +// (at your option) any later version. |
443 | +// |
444 | +// This program is distributed in the hope that it will be useful, |
445 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
446 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
447 | +// GNU Affero General Public License for more details. |
448 | +// |
449 | +// You should have received a copy of the GNU Affero General Public License |
450 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
451 | + |
452 | package httpproxy |
453 | |
454 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
461 | +// |
462 | +// This program is free software: you can redistribute it and/or modify |
463 | +// it under the terms of the GNU Affero General Public License as published by |
464 | +// the Free Software Foundation, either version 3 of the License, or |
465 | +// (at your option) any later version. |
466 | +// |
467 | +// This program is distributed in the hope that it will be useful, |
468 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
469 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
470 | +// GNU Affero General Public License for more details. |
471 | +// |
472 | +// You should have received a copy of the GNU Affero General Public License |
473 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
474 | + |
475 | package httpproxy |
476 | |
477 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
484 | +// |
485 | +// This program is free software: you can redistribute it and/or modify |
486 | +// it under the terms of the GNU Affero General Public License as published by |
487 | +// the Free Software Foundation, either version 3 of the License, or |
488 | +// (at your option) any later version. |
489 | +// |
490 | +// This program is distributed in the hope that it will be useful, |
491 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
492 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
493 | +// GNU Affero General Public License for more details. |
494 | +// |
495 | +// You should have received a copy of the GNU Affero General Public License |
496 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
497 | + |
498 | package httpproxy |
499 | |
500 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
507 | +// |
508 | +// This program is free software: you can redistribute it and/or modify |
509 | +// it under the terms of the GNU Affero General Public License as published by |
510 | +// the Free Software Foundation, either version 3 of the License, or |
511 | +// (at your option) any later version. |
512 | +// |
513 | +// This program is distributed in the hope that it will be useful, |
514 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
515 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
516 | +// GNU Affero General Public License for more details. |
517 | +// |
518 | +// You should have received a copy of the GNU Affero General Public License |
519 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
520 | + |
521 | package httpproxy |
522 | |
523 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
530 | +// |
531 | +// This program is free software: you can redistribute it and/or modify |
532 | +// it under the terms of the GNU Affero General Public License as published by |
533 | +// the Free Software Foundation, either version 3 of the License, or |
534 | +// (at your option) any later version. |
535 | +// |
536 | +// This program is distributed in the hope that it will be useful, |
537 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
538 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
539 | +// GNU Affero General Public License for more details. |
540 | +// |
541 | +// You should have received a copy of the GNU Affero General Public License |
542 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
543 | + |
544 | package httpproxy |
545 | |
546 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
553 | +// |
554 | +// This program is free software: you can redistribute it and/or modify |
555 | +// it under the terms of the GNU Affero General Public License as published by |
556 | +// the Free Software Foundation, either version 3 of the License, or |
557 | +// (at your option) any later version. |
558 | +// |
559 | +// This program is distributed in the hope that it will be useful, |
560 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
561 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
562 | +// GNU Affero General Public License for more details. |
563 | +// |
564 | +// You should have received a copy of the GNU Affero General Public License |
565 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
566 | + |
567 | package netmon |
568 | |
569 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
576 | +// |
577 | +// This program is free software: you can redistribute it and/or modify |
578 | +// it under the terms of the GNU Affero General Public License as published by |
579 | +// the Free Software Foundation, either version 3 of the License, or |
580 | +// (at your option) any later version. |
581 | +// |
582 | +// This program is distributed in the hope that it will be useful, |
583 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
584 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
585 | +// GNU Affero General Public License for more details. |
586 | +// |
587 | +// You should have received a copy of the GNU Affero General Public License |
588 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
589 | + |
590 | package netmon |
591 | |
592 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
599 | +// |
600 | +// This program is free software: you can redistribute it and/or modify |
601 | +// it under the terms of the GNU Affero General Public License as published by |
602 | +// the Free Software Foundation, either version 3 of the License, or |
603 | +// (at your option) any later version. |
604 | +// |
605 | +// This program is distributed in the hope that it will be useful, |
606 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
607 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
608 | +// GNU Affero General Public License for more details. |
609 | +// |
610 | +// You should have received a copy of the GNU Affero General Public License |
611 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
612 | + |
613 | package netmon |
614 | |
615 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
622 | +// |
623 | +// This program is free software: you can redistribute it and/or modify |
624 | +// it under the terms of the GNU Affero General Public License as published by |
625 | +// the Free Software Foundation, either version 3 of the License, or |
626 | +// (at your option) any later version. |
627 | +// |
628 | +// This program is distributed in the hope that it will be useful, |
629 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
630 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
631 | +// GNU Affero General Public License for more details. |
632 | +// |
633 | +// You should have received a copy of the GNU Affero General Public License |
634 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
635 | + |
636 | package netmon |
637 | |
638 | 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 @@ |
644 | -package netmon |
645 | +// Copyright (c) 2023-2024 Canonical Ltd |
646 | +// |
647 | +// This program is free software: you can redistribute it and/or modify |
648 | +// it under the terms of the GNU Affero General Public License as published by |
649 | +// the Free Software Foundation, either version 3 of the License, or |
650 | +// (at your option) any later version. |
651 | +// |
652 | +// This program is distributed in the hope that it will be useful, |
653 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
654 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
655 | +// GNU Affero General Public License for more details. |
656 | +// |
657 | +// You should have received a copy of the GNU Affero General Public License |
658 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
659 | |
660 | -/* |
661 | - Copyright 2023 Canonical Ltd. This software is licensed under the |
662 | - GNU Affero General Public License version 3 (see the file LICENSE). |
663 | -*/ |
664 | +package netmon |
665 | |
666 | import ( |
667 | "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 @@ |
673 | -package netmon |
674 | +// Copyright (c) 2023-2024 Canonical Ltd |
675 | +// |
676 | +// This program is free software: you can redistribute it and/or modify |
677 | +// it under the terms of the GNU Affero General Public License as published by |
678 | +// the Free Software Foundation, either version 3 of the License, or |
679 | +// (at your option) any later version. |
680 | +// |
681 | +// This program is distributed in the hope that it will be useful, |
682 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
683 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
684 | +// GNU Affero General Public License for more details. |
685 | +// |
686 | +// You should have received a copy of the GNU Affero General Public License |
687 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
688 | |
689 | -/* |
690 | - Copyright 2023 Canonical Ltd. This software is licensed under the |
691 | - GNU Affero General Public License version 3 (see the file LICENSE). |
692 | -*/ |
693 | +package netmon |
694 | |
695 | import ( |
696 | "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 | +// Copyright (c) 2023-2024 Canonical Ltd |
703 | +// |
704 | +// This program is free software: you can redistribute it and/or modify |
705 | +// it under the terms of the GNU Affero General Public License as published by |
706 | +// the Free Software Foundation, either version 3 of the License, or |
707 | +// (at your option) any later version. |
708 | +// |
709 | +// This program is distributed in the hope that it will be useful, |
710 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
711 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
712 | +// GNU Affero General Public License for more details. |
713 | +// |
714 | +// You should have received a copy of the GNU Affero General Public License |
715 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
716 | + |
717 | package power |
718 | |
719 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
726 | +// |
727 | +// This program is free software: you can redistribute it and/or modify |
728 | +// it under the terms of the GNU Affero General Public License as published by |
729 | +// the Free Software Foundation, either version 3 of the License, or |
730 | +// (at your option) any later version. |
731 | +// |
732 | +// This program is distributed in the hope that it will be useful, |
733 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
734 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
735 | +// GNU Affero General Public License for more details. |
736 | +// |
737 | +// You should have received a copy of the GNU Affero General Public License |
738 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
739 | + |
740 | package power |
741 | |
742 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
749 | +// |
750 | +// This program is free software: you can redistribute it and/or modify |
751 | +// it under the terms of the GNU Affero General Public License as published by |
752 | +// the Free Software Foundation, either version 3 of the License, or |
753 | +// (at your option) any later version. |
754 | +// |
755 | +// This program is distributed in the hope that it will be useful, |
756 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
757 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
758 | +// GNU Affero General Public License for more details. |
759 | +// |
760 | +// You should have received a copy of the GNU Affero General Public License |
761 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
762 | + |
763 | package power |
764 | |
765 | // 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
772 | +// |
773 | +// This program is free software: you can redistribute it and/or modify |
774 | +// it under the terms of the GNU Affero General Public License as published by |
775 | +// the Free Software Foundation, either version 3 of the License, or |
776 | +// (at your option) any later version. |
777 | +// |
778 | +// This program is distributed in the hope that it will be useful, |
779 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
780 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
781 | +// GNU Affero General Public License for more details. |
782 | +// |
783 | +// You should have received a copy of the GNU Affero General Public License |
784 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
785 | + |
786 | package workflow |
787 | |
788 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
795 | +// |
796 | +// This program is free software: you can redistribute it and/or modify |
797 | +// it under the terms of the GNU Affero General Public License as published by |
798 | +// the Free Software Foundation, either version 3 of the License, or |
799 | +// (at your option) any later version. |
800 | +// |
801 | +// This program is distributed in the hope that it will be useful, |
802 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
803 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
804 | +// GNU Affero General Public License for more details. |
805 | +// |
806 | +// You should have received a copy of the GNU Affero General Public License |
807 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
808 | + |
809 | package tag |
810 | |
811 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
818 | +// |
819 | +// This program is free software: you can redistribute it and/or modify |
820 | +// it under the terms of the GNU Affero General Public License as published by |
821 | +// the Free Software Foundation, either version 3 of the License, or |
822 | +// (at your option) any later version. |
823 | +// |
824 | +// This program is distributed in the hope that it will be useful, |
825 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
826 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
827 | +// GNU Affero General Public License for more details. |
828 | +// |
829 | +// You should have received a copy of the GNU Affero General Public License |
830 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
831 | + |
832 | package log |
833 | |
834 | 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 | +// Copyright (c) 2023-2024 Canonical Ltd |
841 | +// |
842 | +// This program is free software: you can redistribute it and/or modify |
843 | +// it under the terms of the GNU Affero General Public License as published by |
844 | +// the Free Software Foundation, either version 3 of the License, or |
845 | +// (at your option) any later version. |
846 | +// |
847 | +// This program is distributed in the hope that it will be useful, |
848 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
849 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
850 | +// GNU Affero General Public License for more details. |
851 | +// |
852 | +// You should have received a copy of the GNU Affero General Public License |
853 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
854 | + |
855 | package worker |
856 | |
857 | import ( |
858 | diff --git a/src/maasagent/internal/workflow/worker/pool_test.go b/src/maasagent/internal/workflow/worker/pool_test.go |
859 | 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 | -package worker |
865 | - |
866 | -// |
867 | -// import ( |
868 | -// "testing" |
869 | -// |
870 | -// "github.com/stretchr/testify/assert" |
871 | -// "go.temporal.io/sdk/activity" |
872 | -// "go.temporal.io/sdk/client" |
873 | -// "go.temporal.io/sdk/temporal" |
874 | -// "go.temporal.io/sdk/worker" |
875 | -// "go.temporal.io/sdk/workflow" |
876 | -// ) |
877 | -// |
878 | -// type fakeWorker struct{} |
879 | -// |
880 | -// func (w *fakeWorker) Start() error { return nil } |
881 | -// |
882 | -// func (w *fakeWorker) Run(<-chan interface{}) error { return nil } |
883 | -// |
884 | -// func (w *fakeWorker) Stop() {} |
885 | -// |
886 | -// func (w *fakeWorker) RegisterWorkflow(interface{}) {} |
887 | -// |
888 | -// func (w *fakeWorker) RegisterWorkflowWithOptions(interface{}, workflow.RegisterOptions) {} |
889 | -// |
890 | -// func (w *fakeWorker) RegisterActivity(interface{}) {} |
891 | -// |
892 | -// func (w *fakeWorker) RegisterActivityWithOptions(interface{}, activity.RegisterOptions) {} |
893 | -// |
894 | -// var ( |
895 | -// fakeWorkerConstructor = func(c client.Client, tq string, |
896 | -// opts worker.Options) worker.Worker { |
897 | -// return &fakeWorker{} |
898 | -// } |
899 | -// ) |
900 | -// |
901 | -// func TestWorkerPoolConfigurationOverwrite(t *testing.T) { |
902 | -// pool := NewWorkerPool("systemID", nil, WithWorkerConstructor(fakeWorkerConstructor)) |
903 | -// pool.workers["tq1"] = &fakeWorker{} |
904 | -// pool.workers["tq2"] = &fakeWorker{} |
905 | -// pool.workers["tq3"] = &fakeWorker{} |
906 | -// assert.Equal(t, 3, len(pool.workers)) |
907 | -// |
908 | -// err := pool.configure([]configureParam{ |
909 | -// {TaskQueue: "tq1new"}, |
910 | -// {TaskQueue: "tq2new"}, |
911 | -// }) |
912 | -// |
913 | -// assert.NoError(t, err) |
914 | -// assert.Equal(t, 2, len(pool.workers)) |
915 | -// } |
916 | -// |
917 | -// func TestWorkerPoolConfiguration(t *testing.T) { |
918 | -// testcases := map[string]struct { |
919 | -// pool *WorkerPool |
920 | -// in []configureParam |
921 | -// out int |
922 | -// err string |
923 | -// }{ |
924 | -// "with allowed activity and workflow": { |
925 | -// pool: NewWorkerPool("systemID", nil, |
926 | -// WithWorkerConstructor(fakeWorkerConstructor), |
927 | -// WithAllowedWorkflows(map[string]interface{}{"workflow": nil}), |
928 | -// WithAllowedActivities(map[string]interface{}{"activity": nil}), |
929 | -// ), |
930 | -// in: []configureParam{ |
931 | -// { |
932 | -// TaskQueue: "tq", |
933 | -// Workflows: []string{"workflow"}, |
934 | -// Activities: []string{"activity"}, |
935 | -// }, |
936 | -// }, |
937 | -// out: 1, |
938 | -// err: "", |
939 | -// }, |
940 | -// "with allowed activity and not allowed workflow": { |
941 | -// pool: NewWorkerPool("systemID", nil, |
942 | -// WithWorkerConstructor(fakeWorkerConstructor), |
943 | -// WithAllowedActivities(map[string]interface{}{"activity": nil}), |
944 | -// ), |
945 | -// in: []configureParam{ |
946 | -// { |
947 | -// TaskQueue: "tq", |
948 | -// Workflows: []string{"workflow"}, |
949 | -// Activities: []string{"activity"}, |
950 | -// }, |
951 | -// }, |
952 | -// out: 0, |
953 | -// err: "workflowNotAllowed", |
954 | -// }, |
955 | -// "with allowed workflow and not allowed activity": { |
956 | -// pool: NewWorkerPool("systemID", nil, |
957 | -// WithWorkerConstructor(fakeWorkerConstructor), |
958 | -// WithAllowedWorkflows(map[string]interface{}{"workflow": nil}), |
959 | -// ), |
960 | -// in: []configureParam{ |
961 | -// { |
962 | -// TaskQueue: "tq", |
963 | -// Workflows: []string{"workflow"}, |
964 | -// Activities: []string{"activity"}, |
965 | -// }, |
966 | -// }, |
967 | -// out: 0, |
968 | -// err: "activityNotAllowed", |
969 | -// }, |
970 | -// "multiple task queues": { |
971 | -// pool: NewWorkerPool("systemID", nil, |
972 | -// WithWorkerConstructor(fakeWorkerConstructor), |
973 | -// WithAllowedWorkflows(map[string]interface{}{ |
974 | -// "workflow1": nil, |
975 | -// "workflow2": nil, |
976 | -// }), |
977 | -// WithAllowedActivities(map[string]interface{}{ |
978 | -// "activity1": nil, |
979 | -// "activity2": nil, |
980 | -// }), |
981 | -// ), |
982 | -// in: []configureParam{ |
983 | -// { |
984 | -// TaskQueue: "tq1", |
985 | -// Workflows: []string{"workflow1"}, |
986 | -// Activities: []string{"activity1"}, |
987 | -// }, |
988 | -// { |
989 | -// TaskQueue: "tq2", |
990 | -// Workflows: []string{"workflow2"}, |
991 | -// Activities: []string{"activity2"}, |
992 | -// }, |
993 | -// }, |
994 | -// out: 2, |
995 | -// err: "", |
996 | -// }, |
997 | -// } |
998 | -// |
999 | -// for name, tc := range testcases { |
1000 | -// tc := tc |
1001 | -// |
1002 | -// t.Run(name, func(t *testing.T) { |
1003 | -// t.Parallel() |
1004 | -// |
1005 | -// err := tc.pool.configure(tc.in) |
1006 | -// if tc.err != "" { |
1007 | -// assert.Equal(t, tc.err, err.(*temporal.ApplicationError).Type()) |
1008 | -// } |
1009 | -// assert.Equal(t, tc.out, len(tc.pool.workers)) |
1010 | -// }) |
1011 | -// } |
1012 | -// } |
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 | +// Copyright (c) 2023-2024 Canonical Ltd |
1019 | +// |
1020 | +// This program is free software: you can redistribute it and/or modify |
1021 | +// it under the terms of the GNU Affero General Public License as published by |
1022 | +// the Free Software Foundation, either version 3 of the License, or |
1023 | +// (at your option) any later version. |
1024 | +// |
1025 | +// This program is distributed in the hope that it will be useful, |
1026 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
1027 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1028 | +// GNU Affero General Public License for more details. |
1029 | +// |
1030 | +// You should have received a copy of the GNU Affero General Public License |
1031 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
1032 | + |
1033 | // Package codec provides Encryption Codec that can be used to encrypt |
1034 | // sensitive data passed to and from Temporal Server |
1035 | // |
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 | +// Copyright (c) 2023-2024 Canonical Ltd |
1042 | +// |
1043 | +// This program is free software: you can redistribute it and/or modify |
1044 | +// it under the terms of the GNU Affero General Public License as published by |
1045 | +// the Free Software Foundation, either version 3 of the License, or |
1046 | +// (at your option) any later version. |
1047 | +// |
1048 | +// This program is distributed in the hope that it will be useful, |
1049 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
1050 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1051 | +// GNU Affero General Public License for more details. |
1052 | +// |
1053 | +// You should have received a copy of the GNU Affero General Public License |
1054 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
1055 | + |
1056 | package codec |
1057 | |
1058 | import ( |
should this also be applied to Go files in src/host-info subdirectories?