Merge ~troyanov/maas:go-copyright-lint into maas:master

Proposed by Anton Troyanov
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)
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

To post a comment you must log in.
Revision history for this message
Wyatt Rees (wyattrees) wrote :

should this also be applied to Go files in src/host-info subdirectories?

Revision history for this message
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://maas-ci.internal:8080/job/maas-tester/5188/console
COMMIT: 17f77131dd9113b40fbf0d48fd0a998b94799e1a

review: Needs Fixing
Revision history for this message
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

~troyanov/maas:go-copyright-lint updated
12fc1f0... by Anton Troyanov

fixup! chore: lint copyright header in Go files

Revision history for this message
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: 8ab868e8cc5feed4ae47144318c172280797c588

review: Approve
Revision history for this message
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: 12fc1f0928da8ac830ce6bc1e1a54654d90d22f7

review: Approve
Revision history for this message
Jacopo Rota (r00ta) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/.golangci.yaml b/.golangci.yaml
index 9a383d8..09e40dd 100644
--- a/.golangci.yaml
+++ b/.golangci.yaml
@@ -71,6 +71,7 @@ linters:
71 - errcheck71 - errcheck
72 - exportloopref72 - exportloopref
73 - gocritic73 - gocritic
74 - goheader
74 - gofmt75 - gofmt
75 - goimports76 - goimports
76 - gosec77 - gosec
@@ -94,6 +95,25 @@ linters-settings:
94 errcheck:95 errcheck:
95 check-type-assertions: true96 check-type-assertions: true
96 check-blank: true97 check-blank: true
98 goheader:
99 values:
100 regexp:
101 YEAR: \d{4}(-\d{4})?
102 template: |-
103 Copyright (c) {{YEAR}} 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/>.
97 gosimple:117 gosimple:
98 checks: ["all"]118 checks: ["all"]
99 govet:119 govet:
diff --git a/src/host-info/cmd/machine-resources/main.go b/src/host-info/cmd/machine-resources/main.go
index 7557578..eb5a831 100644
--- a/src/host-info/cmd/machine-resources/main.go
+++ b/src/host-info/cmd/machine-resources/main.go
@@ -1,9 +1,21 @@
1// Copyright (c) 2014-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1//go:build linux16//go:build linux
2// +build linux17// +build linux
318
4// Copyright 2014-2020 Canonical Ltd. This software is licensed under the
5// GNU Affero General Public License version 3 (see the file LICENSE).
6
7package main19package main
820
9import (21import (
diff --git a/src/host-info/pkg/info/info.go b/src/host-info/pkg/info/info.go
index c7eb2ef..7be270d 100644
--- a/src/host-info/pkg/info/info.go
+++ b/src/host-info/pkg/info/info.go
@@ -1,9 +1,21 @@
1// Copyright (c) 2022-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1//go:build linux16//go:build linux
2// +build linux17// +build linux
318
4// Copyright 2022 Canonical Ltd. This software is licensed under the
5// GNU Affero General Public License version 3 (see the file LICENSE).
6
7//nolint:stylecheck // ignore ST100019//nolint:stylecheck // ignore ST1000
8package info20package info
921
diff --git a/src/maasagent/cmd/maas-agent/main.go b/src/maasagent/cmd/maas-agent/main.go
index 5ff28ea..c6b7f01 100644
--- a/src/maasagent/cmd/maas-agent/main.go
+++ b/src/maasagent/cmd/maas-agent/main.go
@@ -1,9 +1,19 @@
1package main1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
215
3/*16package main
4 Copyright 2023 Canonical Ltd. This software is licensed under the
5 GNU Affero General Public License version 3 (see the file LICENSE).
6*/
717
8import (18import (
9 "context"19 "context"
diff --git a/src/maasagent/cmd/maas-agent/main_test.go b/src/maasagent/cmd/maas-agent/main_test.go
index 0a8fdc1..249fa4c 100644
--- a/src/maasagent/cmd/maas-agent/main_test.go
+++ b/src/maasagent/cmd/maas-agent/main_test.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package main16package main
217
3import (18import (
diff --git a/src/maasagent/cmd/maas-netmon/main.go b/src/maasagent/cmd/maas-netmon/main.go
index 735a1f9..ee420bc 100644
--- a/src/maasagent/cmd/maas-netmon/main.go
+++ b/src/maasagent/cmd/maas-netmon/main.go
@@ -1,9 +1,19 @@
1package main1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
215
3/*16package main
4 Copyright 2023 Canonical Ltd. This software is licensed under the
5 GNU Affero General Public License version 3 (see the file LICENSE).
6*/
717
8import (18import (
9 "context"19 "context"
diff --git a/src/maasagent/internal/cache/buf.go b/src/maasagent/internal/cache/buf.go
index 5a1ad19..221dd5b 100644
--- a/src/maasagent/internal/cache/buf.go
+++ b/src/maasagent/internal/cache/buf.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package cache16package cache
217
3import (18import (
diff --git a/src/maasagent/internal/cache/fake.go b/src/maasagent/internal/cache/fake.go
index a4f8ffd..c3c83d6 100644
--- a/src/maasagent/internal/cache/fake.go
+++ b/src/maasagent/internal/cache/fake.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package cache16package cache
217
3import (18import (
diff --git a/src/maasagent/internal/cache/file.go b/src/maasagent/internal/cache/file.go
index a3bd9de..9aab35a 100644
--- a/src/maasagent/internal/cache/file.go
+++ b/src/maasagent/internal/cache/file.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package cache16package cache
217
3import (18import (
diff --git a/src/maasagent/internal/cache/file_test.go b/src/maasagent/internal/cache/file_test.go
index 4cc1fc7..1e8d24c 100644
--- a/src/maasagent/internal/cache/file_test.go
+++ b/src/maasagent/internal/cache/file_test.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package cache16package cache
217
3import (18import (
diff --git a/src/maasagent/internal/ethernet/arp.go b/src/maasagent/internal/ethernet/arp.go
index da3238f..7685fb9 100644
--- a/src/maasagent/internal/ethernet/arp.go
+++ b/src/maasagent/internal/ethernet/arp.go
@@ -1,9 +1,19 @@
1package ethernet1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
215
3/*16package ethernet
4 Copyright 2023 Canonical Ltd. This software is licensed under the
5 GNU Affero General Public License version 3 (see the file LICENSE).
6*/
717
8import (18import (
9 "encoding/binary"19 "encoding/binary"
diff --git a/src/maasagent/internal/ethernet/arp_test.go b/src/maasagent/internal/ethernet/arp_test.go
index 8e8ed28..aa2ab3f 100644
--- a/src/maasagent/internal/ethernet/arp_test.go
+++ b/src/maasagent/internal/ethernet/arp_test.go
@@ -1,9 +1,19 @@
1package ethernet1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
215
3/*16package ethernet
4 Copyright 2023 Canonical Ltd. This software is licensed under the
5 GNU Affero General Public License version 3 (see the file LICENSE).
6*/
717
8import (18import (
9 "io"19 "io"
diff --git a/src/maasagent/internal/ethernet/ethernet.go b/src/maasagent/internal/ethernet/ethernet.go
index 8356d54..e5f27c9 100644
--- a/src/maasagent/internal/ethernet/ethernet.go
+++ b/src/maasagent/internal/ethernet/ethernet.go
@@ -1,9 +1,19 @@
1package ethernet1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
215
3/*16package ethernet
4 Copyright 2023 Canonical Ltd. This software is licensed under the
5 GNU Affero General Public License version 3 (see the file LICENSE).
6*/
717
8import (18import (
9 "encoding/binary"19 "encoding/binary"
diff --git a/src/maasagent/internal/ethernet/ethernet_test.go b/src/maasagent/internal/ethernet/ethernet_test.go
index 523c9bc..3b95819 100644
--- a/src/maasagent/internal/ethernet/ethernet_test.go
+++ b/src/maasagent/internal/ethernet/ethernet_test.go
@@ -1,9 +1,19 @@
1package ethernet1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
215
3/*16package ethernet
4 Copyright 2023 Canonical Ltd. This software is licensed under the
5 GNU Affero General Public License version 3 (see the file LICENSE).
6*/
717
8import (18import (
9 "io"19 "io"
diff --git a/src/maasagent/internal/httpproxy/cache.go b/src/maasagent/internal/httpproxy/cache.go
index 2520e9c..0cf8b74 100644
--- a/src/maasagent/internal/httpproxy/cache.go
+++ b/src/maasagent/internal/httpproxy/cache.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package httpproxy16package httpproxy
217
3import (18import (
diff --git a/src/maasagent/internal/httpproxy/proxy.go b/src/maasagent/internal/httpproxy/proxy.go
index d3ef0c2..62205b6 100644
--- a/src/maasagent/internal/httpproxy/proxy.go
+++ b/src/maasagent/internal/httpproxy/proxy.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package httpproxy16package httpproxy
217
3import (18import (
diff --git a/src/maasagent/internal/httpproxy/proxy_test.go b/src/maasagent/internal/httpproxy/proxy_test.go
index 523ef37..6908a73 100644
--- a/src/maasagent/internal/httpproxy/proxy_test.go
+++ b/src/maasagent/internal/httpproxy/proxy_test.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package httpproxy16package httpproxy
217
3import (18import (
diff --git a/src/maasagent/internal/httpproxy/rewrite.go b/src/maasagent/internal/httpproxy/rewrite.go
index 4a452ea..928a86a 100644
--- a/src/maasagent/internal/httpproxy/rewrite.go
+++ b/src/maasagent/internal/httpproxy/rewrite.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package httpproxy16package httpproxy
217
3import (18import (
diff --git a/src/maasagent/internal/httpproxy/rewrite_test.go b/src/maasagent/internal/httpproxy/rewrite_test.go
index 3abfaad..696c936 100644
--- a/src/maasagent/internal/httpproxy/rewrite_test.go
+++ b/src/maasagent/internal/httpproxy/rewrite_test.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package httpproxy16package httpproxy
217
3import (18import (
diff --git a/src/maasagent/internal/httpproxy/service.go b/src/maasagent/internal/httpproxy/service.go
index 913b6d2..1aed46f 100644
--- a/src/maasagent/internal/httpproxy/service.go
+++ b/src/maasagent/internal/httpproxy/service.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package httpproxy16package httpproxy
217
3import (18import (
diff --git a/src/maasagent/internal/httpproxy/service_test.go b/src/maasagent/internal/httpproxy/service_test.go
index b894e17..0e65e4e 100644
--- a/src/maasagent/internal/httpproxy/service_test.go
+++ b/src/maasagent/internal/httpproxy/service_test.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package httpproxy16package httpproxy
217
3import (18import (
diff --git a/src/maasagent/internal/netmon/event.go b/src/maasagent/internal/netmon/event.go
index 19a2d72..4406ba7 100644
--- a/src/maasagent/internal/netmon/event.go
+++ b/src/maasagent/internal/netmon/event.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package netmon16package netmon
217
3import (18import (
diff --git a/src/maasagent/internal/netmon/event_test.go b/src/maasagent/internal/netmon/event_test.go
index 86ecff3..16b6ca8 100644
--- a/src/maasagent/internal/netmon/event_test.go
+++ b/src/maasagent/internal/netmon/event_test.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package netmon16package netmon
217
3import (18import (
diff --git a/src/maasagent/internal/netmon/scan.go b/src/maasagent/internal/netmon/scan.go
index ec71278..03c935f 100644
--- a/src/maasagent/internal/netmon/scan.go
+++ b/src/maasagent/internal/netmon/scan.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package netmon16package netmon
217
3import (18import (
diff --git a/src/maasagent/internal/netmon/scan_test.go b/src/maasagent/internal/netmon/scan_test.go
index af84e83..4add34d 100644
--- a/src/maasagent/internal/netmon/scan_test.go
+++ b/src/maasagent/internal/netmon/scan_test.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package netmon16package netmon
217
3import (18import (
diff --git a/src/maasagent/internal/netmon/service.go b/src/maasagent/internal/netmon/service.go
index ee61924..a56ed2d 100644
--- a/src/maasagent/internal/netmon/service.go
+++ b/src/maasagent/internal/netmon/service.go
@@ -1,9 +1,19 @@
1package netmon1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
215
3/*16package netmon
4 Copyright 2023 Canonical Ltd. This software is licensed under the
5 GNU Affero General Public License version 3 (see the file LICENSE).
6*/
717
8import (18import (
9 "bytes"19 "bytes"
diff --git a/src/maasagent/internal/netmon/service_test.go b/src/maasagent/internal/netmon/service_test.go
index 77abf9c..2389388 100644
--- a/src/maasagent/internal/netmon/service_test.go
+++ b/src/maasagent/internal/netmon/service_test.go
@@ -1,9 +1,19 @@
1package netmon1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
215
3/*16package netmon
4 Copyright 2023 Canonical Ltd. This software is licensed under the
5 GNU Affero General Public License version 3 (see the file LICENSE).
6*/
717
8import (18import (
9 "net"19 "net"
diff --git a/src/maasagent/internal/power/service.go b/src/maasagent/internal/power/service.go
index 3a22868..b33dd0f 100644
--- a/src/maasagent/internal/power/service.go
+++ b/src/maasagent/internal/power/service.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package power16package power
217
3import (18import (
diff --git a/src/maasagent/internal/power/service_test.go b/src/maasagent/internal/power/service_test.go
index 54d7df5..6213eb7 100644
--- a/src/maasagent/internal/power/service_test.go
+++ b/src/maasagent/internal/power/service_test.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package power16package power
217
3import (18import (
diff --git a/src/maasagent/internal/power/workflow.go b/src/maasagent/internal/power/workflow.go
index 7509c33..5611ca6 100644
--- a/src/maasagent/internal/power/workflow.go
+++ b/src/maasagent/internal/power/workflow.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package power16package power
217
3// TODO: implement workflow for each power action.18// TODO: implement workflow for each power action.
diff --git a/src/maasagent/internal/workflow/checkip.go b/src/maasagent/internal/workflow/checkip.go
index 1e56581..fddd8f6 100644
--- a/src/maasagent/internal/workflow/checkip.go
+++ b/src/maasagent/internal/workflow/checkip.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package workflow16package workflow
217
3import (18import (
diff --git a/src/maasagent/internal/workflow/log/tag/tags.go b/src/maasagent/internal/workflow/log/tag/tags.go
index dd37ef2..f421c0b 100644
--- a/src/maasagent/internal/workflow/log/tag/tags.go
+++ b/src/maasagent/internal/workflow/log/tag/tags.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package tag16package tag
217
3type builder struct {18type builder struct {
diff --git a/src/maasagent/internal/workflow/log/zerolog.go b/src/maasagent/internal/workflow/log/zerolog.go
index 128bbfd..d377c6a 100644
--- a/src/maasagent/internal/workflow/log/zerolog.go
+++ b/src/maasagent/internal/workflow/log/zerolog.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package log16package log
217
3import (18import (
diff --git a/src/maasagent/internal/workflow/worker/pool.go b/src/maasagent/internal/workflow/worker/pool.go
index 3fed8b6..ea543c1 100644
--- a/src/maasagent/internal/workflow/worker/pool.go
+++ b/src/maasagent/internal/workflow/worker/pool.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package worker16package worker
217
3import (18import (
diff --git a/src/maasagent/internal/workflow/worker/pool_test.go b/src/maasagent/internal/workflow/worker/pool_test.go
4deleted file mode 10064419deleted file mode 100644
index da2573c..0000000
--- a/src/maasagent/internal/workflow/worker/pool_test.go
+++ /dev/null
@@ -1,149 +0,0 @@
1package worker
2
3//
4// import (
5// "testing"
6//
7// "github.com/stretchr/testify/assert"
8// "go.temporal.io/sdk/activity"
9// "go.temporal.io/sdk/client"
10// "go.temporal.io/sdk/temporal"
11// "go.temporal.io/sdk/worker"
12// "go.temporal.io/sdk/workflow"
13// )
14//
15// type fakeWorker struct{}
16//
17// func (w *fakeWorker) Start() error { return nil }
18//
19// func (w *fakeWorker) Run(<-chan interface{}) error { return nil }
20//
21// func (w *fakeWorker) Stop() {}
22//
23// func (w *fakeWorker) RegisterWorkflow(interface{}) {}
24//
25// func (w *fakeWorker) RegisterWorkflowWithOptions(interface{}, workflow.RegisterOptions) {}
26//
27// func (w *fakeWorker) RegisterActivity(interface{}) {}
28//
29// func (w *fakeWorker) RegisterActivityWithOptions(interface{}, activity.RegisterOptions) {}
30//
31// var (
32// fakeWorkerConstructor = func(c client.Client, tq string,
33// opts worker.Options) worker.Worker {
34// return &fakeWorker{}
35// }
36// )
37//
38// func TestWorkerPoolConfigurationOverwrite(t *testing.T) {
39// pool := NewWorkerPool("systemID", nil, WithWorkerConstructor(fakeWorkerConstructor))
40// pool.workers["tq1"] = &fakeWorker{}
41// pool.workers["tq2"] = &fakeWorker{}
42// pool.workers["tq3"] = &fakeWorker{}
43// assert.Equal(t, 3, len(pool.workers))
44//
45// err := pool.configure([]configureParam{
46// {TaskQueue: "tq1new"},
47// {TaskQueue: "tq2new"},
48// })
49//
50// assert.NoError(t, err)
51// assert.Equal(t, 2, len(pool.workers))
52// }
53//
54// func TestWorkerPoolConfiguration(t *testing.T) {
55// testcases := map[string]struct {
56// pool *WorkerPool
57// in []configureParam
58// out int
59// err string
60// }{
61// "with allowed activity and workflow": {
62// pool: NewWorkerPool("systemID", nil,
63// WithWorkerConstructor(fakeWorkerConstructor),
64// WithAllowedWorkflows(map[string]interface{}{"workflow": nil}),
65// WithAllowedActivities(map[string]interface{}{"activity": nil}),
66// ),
67// in: []configureParam{
68// {
69// TaskQueue: "tq",
70// Workflows: []string{"workflow"},
71// Activities: []string{"activity"},
72// },
73// },
74// out: 1,
75// err: "",
76// },
77// "with allowed activity and not allowed workflow": {
78// pool: NewWorkerPool("systemID", nil,
79// WithWorkerConstructor(fakeWorkerConstructor),
80// WithAllowedActivities(map[string]interface{}{"activity": nil}),
81// ),
82// in: []configureParam{
83// {
84// TaskQueue: "tq",
85// Workflows: []string{"workflow"},
86// Activities: []string{"activity"},
87// },
88// },
89// out: 0,
90// err: "workflowNotAllowed",
91// },
92// "with allowed workflow and not allowed activity": {
93// pool: NewWorkerPool("systemID", nil,
94// WithWorkerConstructor(fakeWorkerConstructor),
95// WithAllowedWorkflows(map[string]interface{}{"workflow": nil}),
96// ),
97// in: []configureParam{
98// {
99// TaskQueue: "tq",
100// Workflows: []string{"workflow"},
101// Activities: []string{"activity"},
102// },
103// },
104// out: 0,
105// err: "activityNotAllowed",
106// },
107// "multiple task queues": {
108// pool: NewWorkerPool("systemID", nil,
109// WithWorkerConstructor(fakeWorkerConstructor),
110// WithAllowedWorkflows(map[string]interface{}{
111// "workflow1": nil,
112// "workflow2": nil,
113// }),
114// WithAllowedActivities(map[string]interface{}{
115// "activity1": nil,
116// "activity2": nil,
117// }),
118// ),
119// in: []configureParam{
120// {
121// TaskQueue: "tq1",
122// Workflows: []string{"workflow1"},
123// Activities: []string{"activity1"},
124// },
125// {
126// TaskQueue: "tq2",
127// Workflows: []string{"workflow2"},
128// Activities: []string{"activity2"},
129// },
130// },
131// out: 2,
132// err: "",
133// },
134// }
135//
136// for name, tc := range testcases {
137// tc := tc
138//
139// t.Run(name, func(t *testing.T) {
140// t.Parallel()
141//
142// err := tc.pool.configure(tc.in)
143// if tc.err != "" {
144// assert.Equal(t, tc.err, err.(*temporal.ApplicationError).Type())
145// }
146// assert.Equal(t, tc.out, len(tc.pool.workers))
147// })
148// }
149// }
diff --git a/src/maasagent/pkg/workflow/codec/encryptor.go b/src/maasagent/pkg/workflow/codec/encryptor.go
index 31b3e51..a5341a4 100644
--- a/src/maasagent/pkg/workflow/codec/encryptor.go
+++ b/src/maasagent/pkg/workflow/codec/encryptor.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1// Package codec provides Encryption Codec that can be used to encrypt16// Package codec provides Encryption Codec that can be used to encrypt
2// sensitive data passed to and from Temporal Server17// sensitive data passed to and from Temporal Server
3//18//
diff --git a/src/maasagent/pkg/workflow/codec/encryptor_test.go b/src/maasagent/pkg/workflow/codec/encryptor_test.go
index 809afca..ffcb726 100644
--- a/src/maasagent/pkg/workflow/codec/encryptor_test.go
+++ b/src/maasagent/pkg/workflow/codec/encryptor_test.go
@@ -1,3 +1,18 @@
1// Copyright (c) 2023-2024 Canonical Ltd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU Affero General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
1package codec16package codec
217
3import (18import (

Subscribers

People subscribed via source and target branches