Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit 013b959

Browse files
committed
Enable goheader linter and fix copyright headers
1 parent efedafe commit 013b959

File tree

17 files changed

+101
-11
lines changed

17 files changed

+101
-11
lines changed

virtualcluster/.golangci.yml

+25-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ linters:
1212
- gocritic
1313
- gocyclo
1414
- gofmt
15+
- goheader
1516
- goimports
1617
- goprintffuncname
1718
- gosec
@@ -56,6 +57,29 @@ linters-settings:
5657
# Controller Runtime
5758
- pkg: sigs.k8s.io/controller-runtime
5859
alias: ctrl
60+
goheader:
61+
values:
62+
const:
63+
AUTHOR: The Kubernetes Authors
64+
regexp:
65+
LICENSE_YEAR: 20\d\d
66+
SCHEME: http(s)?
67+
# The template use for checking.
68+
# Default: ""
69+
template: |-
70+
Copyright {{ LICENSE_YEAR }} {{ AUTHOR }}.
71+
72+
Licensed under the Apache License, Version 2.0 (the "License");
73+
you may not use this file except in compliance with the License.
74+
You may obtain a copy of the License at
75+
76+
{{ SCHEME }}://www.apache.org/licenses/LICENSE-2.0
77+
78+
Unless required by applicable law or agreed to in writing, software
79+
distributed under the License is distributed on an "AS IS" BASIS,
80+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
81+
See the License for the specific language governing permissions and
82+
limitations under the License.
5983
6084
issues:
6185
max-same-issues: 0
@@ -120,7 +144,7 @@ issues:
120144
text: "appendAssign: append result not assigned to the same slice"
121145

122146
run:
123-
timeout: 10m
147+
timeout: 20m
124148
skip-files:
125149
- "zz_generated.*\\.go$"
126150
- ".*conversion.*\\.go$"

virtualcluster/pkg/controller/controllers/metrics.go

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2022 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package controllers
218

319
import (

virtualcluster/pkg/controller/util/net/util.go

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2022 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package net
218

319
import (

virtualcluster/pkg/syncer/resources/configmap/checker.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
22
Copyright 2021 The Kubernetes Authors.
3-
Licensed under the Apache License, Version 2.0 (the "License");
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
67
7-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
89
910
Unless required by applicable law or agreed to in writing, software
1011
distributed under the License is distributed on an "AS IS" BASIS,

virtualcluster/pkg/syncer/resources/crd/checker.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2021 The Kubernetes Authors.
3-
Licensed under the Apache License, Version 2.0 (the "License");
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
6-
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

virtualcluster/pkg/syncer/resources/crd/controller.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2021 The Kubernetes Authors.
3+
34
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
7+
68
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

virtualcluster/pkg/syncer/resources/endpoints/checker.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
22
Copyright 2019 The Kubernetes Authors.
3-
Licensed under the Apache License, Version 2.0 (the "License");
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
67
7-
http://www.apache.org/licenses/LICENSE-2.0
8+
https://www.apache.org/licenses/LICENSE-2.0
89
910
Unless required by applicable law or agreed to in writing, software
1011
distributed under the License is distributed on an "AS IS" BASIS,

virtualcluster/pkg/syncer/resources/namespace/checker.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
22
Copyright 2019 The Kubernetes Authors.
3-
Licensed under the Apache License, Version 2.0 (the "License");
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
67
7-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
89
910
Unless required by applicable law or agreed to in writing, software
1011
distributed under the License is distributed on an "AS IS" BASIS,

virtualcluster/pkg/syncer/resources/persistentvolume/checker_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2020 The Kubernetes Authors.
3+
34
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
7+
68
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

virtualcluster/pkg/syncer/resources/pod/validationplugin/interface.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2022 The Kubernetes Authors.
3+
34
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
7+
68
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

virtualcluster/pkg/syncer/resources/service/checker_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2020 The Kubernetes Authors.
3+
34
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
7+
68
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

virtualcluster/pkg/syncer/resources/serviceaccount/checker.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
22
Copyright 2019 The Kubernetes Authors.
3-
Licensed under the Apache License, Version 2.0 (the "License");
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
67
7-
http://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
89
910
Unless required by applicable law or agreed to in writing, software
1011
distributed under the License is distributed on an "AS IS" BASIS,

virtualcluster/pkg/syncer/resources/serviceaccount/checker_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2020 The Kubernetes Authors.
3+
34
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
7+
68
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

virtualcluster/test/e2e/e2e.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2020 The Kubernetes Authors.
3+
34
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
7+
68
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

virtualcluster/test/e2e/framework/framework.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2020 The Kubernetes Authors.
3+
34
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
7+
68
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

virtualcluster/test/e2e/framework/text_context.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2020 The Kubernetes Authors.
3+
34
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
7+
68
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

virtualcluster/test/e2e/framework/util.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/*
22
Copyright 2020 The Kubernetes Authors.
3+
34
Licensed under the Apache License, Version 2.0 (the "License");
45
you may not use this file except in compliance with the License.
56
You may obtain a copy of the License at
7+
68
http://www.apache.org/licenses/LICENSE-2.0
9+
710
Unless required by applicable law or agreed to in writing, software
811
distributed under the License is distributed on an "AS IS" BASIS,
912
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

0 commit comments

Comments
 (0)