diff --git a/virtualcluster/.golangci.yml b/virtualcluster/.golangci.yml index ab9ff1ac..d26d677a 100644 --- a/virtualcluster/.golangci.yml +++ b/virtualcluster/.golangci.yml @@ -12,6 +12,7 @@ linters: - gocritic - gocyclo - gofmt + - goheader - goimports - goprintffuncname - gosec @@ -56,6 +57,29 @@ linters-settings: # Controller Runtime - pkg: sigs.k8s.io/controller-runtime alias: ctrl + goheader: + values: + const: + AUTHOR: The Kubernetes Authors + regexp: + LICENSE_YEAR: 20\d\d + SCHEME: http(s)? + # The template use for checking. + # Default: "" + template: |- + Copyright {{ LICENSE_YEAR }} {{ AUTHOR }}. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + {{ SCHEME }}://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. issues: max-same-issues: 0 @@ -120,7 +144,7 @@ issues: text: "appendAssign: append result not assigned to the same slice" run: - timeout: 10m + timeout: 20m skip-files: - "zz_generated.*\\.go$" - ".*conversion.*\\.go$" diff --git a/virtualcluster/pkg/controller/controllers/metrics.go b/virtualcluster/pkg/controller/controllers/metrics.go index 35c5905f..ee789e62 100644 --- a/virtualcluster/pkg/controller/controllers/metrics.go +++ b/virtualcluster/pkg/controller/controllers/metrics.go @@ -1,3 +1,19 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + package controllers import ( diff --git a/virtualcluster/pkg/controller/util/net/util.go b/virtualcluster/pkg/controller/util/net/util.go index ffb54ec4..7b658402 100644 --- a/virtualcluster/pkg/controller/util/net/util.go +++ b/virtualcluster/pkg/controller/util/net/util.go @@ -1,3 +1,19 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + package net import ( diff --git a/virtualcluster/pkg/syncer/resources/configmap/checker.go b/virtualcluster/pkg/syncer/resources/configmap/checker.go index 694ab6d5..621f90cb 100644 --- a/virtualcluster/pkg/syncer/resources/configmap/checker.go +++ b/virtualcluster/pkg/syncer/resources/configmap/checker.go @@ -1,10 +1,11 @@ /* Copyright 2021 The Kubernetes Authors. - Licensed under the Apache License, Version 2.0 (the "License"); + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/virtualcluster/pkg/syncer/resources/crd/checker.go b/virtualcluster/pkg/syncer/resources/crd/checker.go index 8a6cf235..604b94a4 100644 --- a/virtualcluster/pkg/syncer/resources/crd/checker.go +++ b/virtualcluster/pkg/syncer/resources/crd/checker.go @@ -1,9 +1,12 @@ /* Copyright 2021 The Kubernetes Authors. - Licensed under the Apache License, Version 2.0 (the "License"); + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/virtualcluster/pkg/syncer/resources/crd/controller.go b/virtualcluster/pkg/syncer/resources/crd/controller.go index 1cb46451..d14eaaa1 100644 --- a/virtualcluster/pkg/syncer/resources/crd/controller.go +++ b/virtualcluster/pkg/syncer/resources/crd/controller.go @@ -1,9 +1,12 @@ /* Copyright 2021 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/virtualcluster/pkg/syncer/resources/endpoints/checker.go b/virtualcluster/pkg/syncer/resources/endpoints/checker.go index 8d96c6a6..bde9f97a 100644 --- a/virtualcluster/pkg/syncer/resources/endpoints/checker.go +++ b/virtualcluster/pkg/syncer/resources/endpoints/checker.go @@ -1,10 +1,11 @@ /* Copyright 2019 The Kubernetes Authors. - Licensed under the Apache License, Version 2.0 (the "License"); + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/virtualcluster/pkg/syncer/resources/namespace/checker.go b/virtualcluster/pkg/syncer/resources/namespace/checker.go index 3c28ac78..eea12667 100644 --- a/virtualcluster/pkg/syncer/resources/namespace/checker.go +++ b/virtualcluster/pkg/syncer/resources/namespace/checker.go @@ -1,10 +1,11 @@ /* Copyright 2019 The Kubernetes Authors. - Licensed under the Apache License, Version 2.0 (the "License"); + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/virtualcluster/pkg/syncer/resources/persistentvolume/checker_test.go b/virtualcluster/pkg/syncer/resources/persistentvolume/checker_test.go index 18a3f542..f01fa260 100644 --- a/virtualcluster/pkg/syncer/resources/persistentvolume/checker_test.go +++ b/virtualcluster/pkg/syncer/resources/persistentvolume/checker_test.go @@ -1,9 +1,12 @@ /* Copyright 2020 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/virtualcluster/pkg/syncer/resources/pod/validationplugin/interface.go b/virtualcluster/pkg/syncer/resources/pod/validationplugin/interface.go index ccaf0a09..a57e22a4 100644 --- a/virtualcluster/pkg/syncer/resources/pod/validationplugin/interface.go +++ b/virtualcluster/pkg/syncer/resources/pod/validationplugin/interface.go @@ -1,9 +1,12 @@ /* Copyright 2022 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/virtualcluster/pkg/syncer/resources/service/checker_test.go b/virtualcluster/pkg/syncer/resources/service/checker_test.go index e36426be..a07a24db 100644 --- a/virtualcluster/pkg/syncer/resources/service/checker_test.go +++ b/virtualcluster/pkg/syncer/resources/service/checker_test.go @@ -1,9 +1,12 @@ /* Copyright 2020 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/virtualcluster/pkg/syncer/resources/serviceaccount/checker.go b/virtualcluster/pkg/syncer/resources/serviceaccount/checker.go index ff80363f..19b739e7 100644 --- a/virtualcluster/pkg/syncer/resources/serviceaccount/checker.go +++ b/virtualcluster/pkg/syncer/resources/serviceaccount/checker.go @@ -1,10 +1,11 @@ /* Copyright 2019 The Kubernetes Authors. - Licensed under the Apache License, Version 2.0 (the "License"); + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/virtualcluster/pkg/syncer/resources/serviceaccount/checker_test.go b/virtualcluster/pkg/syncer/resources/serviceaccount/checker_test.go index 70f4521d..06df3253 100644 --- a/virtualcluster/pkg/syncer/resources/serviceaccount/checker_test.go +++ b/virtualcluster/pkg/syncer/resources/serviceaccount/checker_test.go @@ -1,9 +1,12 @@ /* Copyright 2020 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/virtualcluster/test/e2e/e2e.go b/virtualcluster/test/e2e/e2e.go index 9279e0c9..16dcf525 100644 --- a/virtualcluster/test/e2e/e2e.go +++ b/virtualcluster/test/e2e/e2e.go @@ -1,9 +1,12 @@ /* Copyright 2020 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/virtualcluster/test/e2e/framework/framework.go b/virtualcluster/test/e2e/framework/framework.go index 155b9dc5..cefdb0cb 100644 --- a/virtualcluster/test/e2e/framework/framework.go +++ b/virtualcluster/test/e2e/framework/framework.go @@ -1,9 +1,12 @@ /* Copyright 2020 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/virtualcluster/test/e2e/framework/text_context.go b/virtualcluster/test/e2e/framework/text_context.go index 97e5d27c..61c57d6f 100644 --- a/virtualcluster/test/e2e/framework/text_context.go +++ b/virtualcluster/test/e2e/framework/text_context.go @@ -1,9 +1,12 @@ /* Copyright 2020 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/virtualcluster/test/e2e/framework/util.go b/virtualcluster/test/e2e/framework/util.go index d3681fbb..8eb64a9d 100644 --- a/virtualcluster/test/e2e/framework/util.go +++ b/virtualcluster/test/e2e/framework/util.go @@ -1,9 +1,12 @@ /* Copyright 2020 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.