diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 000000000..5ab39f3a7 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,62 @@ +# +# Copyright 2022 The KubeSphere 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. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +header: + license: + spdx-id: Apache-2.0 + copyright-owner: KubeSphere Authors + + content: | + Copyright 2022 The KubeSphere 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. + See the License for the specific language governing permissions and + limitations under the License. + + + paths-ignore: + - 'api' + - 'build' + - 'docs' + - 'config' + - 'test' + - 'install' + - 'hack' + - 'vendor' + - 'staging' + - 'LICENSE' + - 'OWNERS' + - 'Makefile' + - 'pkg/client/**' + - 'pkg/simple/client/**' + - '**/*.md' + - '**/*.json' + - '**/go.mod' + - '**/go.sum' + - '.github/**' + - '.gitignore' + - '.gitattributes' + - 'pkg/controller/application/status.go' + + comment: on-failure diff --git a/Makefile b/Makefile index 4211d4e3a..bb5dc8669 100644 --- a/Makefile +++ b/Makefile @@ -155,3 +155,7 @@ clean: ;$(info $(M)...Begin to clean.) @ ## Clean. clientset: ;$(info $(M)...Begin to find or download controller-gen.) @ ## Find or download controller-gen,download controller-gen if necessary. ./hack/generate_client.sh ${GV} + +# Fix invalid file's license. +update-licenses: ;$(info $(M)...Begin to update licenses.) + @hack/update-licenses.sh diff --git a/cmd/controller-manager/app/options/options_test.go b/cmd/controller-manager/app/options/options_test.go index 05b56a61f..f7765f1c5 100644 --- a/cmd/controller-manager/app/options/options_test.go +++ b/cmd/controller-manager/app/options/options_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package options import ( diff --git a/hack/update-licenses.sh b/hack/update-licenses.sh new file mode 100755 index 000000000..ea4078f12 --- /dev/null +++ b/hack/update-licenses.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# Copyright 2022 The KubeSphere 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. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set -o errexit +set -o nounset +set -o pipefail + +KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +source "${KUBE_ROOT}/hack/lib/init.sh" + +if ! command -v license-eye &> /dev/null +then + # Ensure that we find the binaries we build before anything else. + export GOBIN="${KUBE_OUTPUT_BINPATH}" + PATH="${GOBIN}:${PATH}" + + # Explicitly opt into go modules, even though we're inside a GOPATH directory + export GO111MODULE=on + # Explicitly clear GOFLAGS, since GOFLAGS=-mod=vendor breaks dependency resolution while rebuilding vendor + export GOFLAGS= + + # Install skywalking-eyes + echo 'installing skywalking-eyes ' + pushd "${KUBE_ROOT}/hack/tools" >/dev/null + go install github.com/apache/skywalking-eyes/cmd/license-eye@v0.2.0 + popd >/dev/null +fi + +cd "${KUBE_ROOT}" + +echo 'running skywalking-eyes fix ' +license-eye header fix +exit 0 diff --git a/hack/verify-all.sh b/hack/verify-all.sh index 7013158d7..fdb510926 100755 --- a/hack/verify-all.sh +++ b/hack/verify-all.sh @@ -28,6 +28,7 @@ EXCLUDED_PATTERNS=( "verify-*-dockerized.sh" # Don't run any scripts that intended to be run dockerized "verify-govet-levee.sh" # Do not run levee analysis by default while KEP-1933 implementation is in alpha. "verify-golangci-lint.sh" # Experimental - intended to be run by hand periodically + "verify-licenses.sh" ) while IFS='' read -r line; do EXCLUDED_CHECKS+=("$line"); done < <(ls "${EXCLUDED_PATTERNS[@]/#/${KUBE_ROOT}/hack/}" 2>/dev/null || true) diff --git a/hack/verify-licenses.sh b/hack/verify-licenses.sh new file mode 100755 index 000000000..963d48caf --- /dev/null +++ b/hack/verify-licenses.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# Copyright 2022 The KubeSphere 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. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set -o errexit +set -o nounset +set -o pipefail + +KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +source "${KUBE_ROOT}/hack/lib/init.sh" + +if ! command -v license-eye &> /dev/null +then + # Ensure that we find the binaries we build before anything else. + export GOBIN="${KUBE_OUTPUT_BINPATH}" + PATH="${GOBIN}:${PATH}" + + # Explicitly opt into go modules, even though we're inside a GOPATH directory + export GO111MODULE=on + # Explicitly clear GOFLAGS, since GOFLAGS=-mod=vendor breaks dependency resolution while rebuilding vendor + export GOFLAGS= + + # Install skywalking-eyes + echo 'installing skywalking-eyes ' + pushd "${KUBE_ROOT}/hack/tools" >/dev/null + go install github.com/apache/skywalking-eyes/cmd/license-eye@v0.2.0 + popd >/dev/null +fi + +cd "${KUBE_ROOT}" + +echo 'running skywalking-eyes check ' +license-eye header check +exit 0 diff --git a/pkg/api/cluster/v1alpha1/types.go b/pkg/api/cluster/v1alpha1/types.go index 83e4d5899..4f947bc24 100644 --- a/pkg/api/cluster/v1alpha1/types.go +++ b/pkg/api/cluster/v1alpha1/types.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package v1alpha1 type UpdateClusterRequest struct { diff --git a/pkg/api/metering/v1alpha1/types.go b/pkg/api/metering/v1alpha1/types.go index f6917e971..ada5c83de 100644 --- a/pkg/api/metering/v1alpha1/types.go +++ b/pkg/api/metering/v1alpha1/types.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package v1alpha1 import ( diff --git a/pkg/apis/addtoscheme_dashboard_v1alpha1.go b/pkg/apis/addtoscheme_dashboard_v1alpha1.go index d454e32cf..657720852 100644 --- a/pkg/apis/addtoscheme_dashboard_v1alpha1.go +++ b/pkg/apis/addtoscheme_dashboard_v1alpha1.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package apis import monitoringdashboardv1alpha1 "kubesphere.io/monitoring-dashboard/api/v1alpha1" diff --git a/pkg/apis/addtoscheme_dashboard_v1alpha2.go b/pkg/apis/addtoscheme_dashboard_v1alpha2.go index f29e62703..fe7a737a5 100644 --- a/pkg/apis/addtoscheme_dashboard_v1alpha2.go +++ b/pkg/apis/addtoscheme_dashboard_v1alpha2.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package apis import monitoringdashboardv1alpha2 "kubesphere.io/monitoring-dashboard/api/v1alpha2" diff --git a/pkg/apiserver/metric.go b/pkg/apiserver/metric.go index 760b900a1..55160047c 100644 --- a/pkg/apiserver/metric.go +++ b/pkg/apiserver/metric.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package apiserver import ( diff --git a/pkg/controller/application/condition.go b/pkg/controller/application/condition.go index e590addca..9bd29c1fe 100644 --- a/pkg/controller/application/condition.go +++ b/pkg/controller/application/condition.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// // Copyright 2020 The Kubernetes Authors. // SPDX-License-Identifier: Apache-2.0 diff --git a/pkg/controller/network/utils/utils.go b/pkg/controller/network/utils/utils.go index 5fdb05225..06263445e 100644 --- a/pkg/controller/network/utils/utils.go +++ b/pkg/controller/network/utils/utils.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package utils import ( diff --git a/pkg/controller/network/webhooks/default.go b/pkg/controller/network/webhooks/default.go index 57abba155..1548d57a3 100644 --- a/pkg/controller/network/webhooks/default.go +++ b/pkg/controller/network/webhooks/default.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package webhooks import ( diff --git a/pkg/controller/utils/hash.go b/pkg/controller/utils/hash.go index 74ef05dca..ab55aadc6 100644 --- a/pkg/controller/utils/hash.go +++ b/pkg/controller/utils/hash.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package utils import ( diff --git a/pkg/controller/utils/servicemesh/application.go b/pkg/controller/utils/servicemesh/application.go index d5aa65ce2..d0f8cf15a 100644 --- a/pkg/controller/utils/servicemesh/application.go +++ b/pkg/controller/utils/servicemesh/application.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package servicemesh import ( diff --git a/pkg/controller/utils/servicemesh/application_test.go b/pkg/controller/utils/servicemesh/application_test.go index 20b044cd3..884eb9329 100644 --- a/pkg/controller/utils/servicemesh/application_test.go +++ b/pkg/controller/utils/servicemesh/application_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package servicemesh import "testing" diff --git a/pkg/controller/workspace/metrics.go b/pkg/controller/workspace/metrics.go index 3c2ac5ddc..fe96ae18b 100644 --- a/pkg/controller/workspace/metrics.go +++ b/pkg/controller/workspace/metrics.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package workspace import ( diff --git a/pkg/kapis/monitoring/v1alpha3/meter.go b/pkg/kapis/monitoring/v1alpha3/meter.go index d52bc5393..ac50c734a 100644 --- a/pkg/kapis/monitoring/v1alpha3/meter.go +++ b/pkg/kapis/monitoring/v1alpha3/meter.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package v1alpha3 import ( diff --git a/pkg/kapis/monitoring/v1alpha3/scripts/dashboard_template_debug.sh b/pkg/kapis/monitoring/v1alpha3/scripts/dashboard_template_debug.sh index 50ee1e279..f92c0a757 100644 --- a/pkg/kapis/monitoring/v1alpha3/scripts/dashboard_template_debug.sh +++ b/pkg/kapis/monitoring/v1alpha3/scripts/dashboard_template_debug.sh @@ -1,4 +1,18 @@ #! /bin/bash +# Copyright 2022 The KubeSphere 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. +# See the License for the specific language governing permissions and +# limitations under the License. +# curl -d '{"grafanaDashboardUrl":"https://grafana.com/api/dashboards/7362/revisions/5/download", "description":"this is a test clusterdashboard."}' -H "Content-Type: application/json" localhost:9090/kapis/monitoring.kubesphere.io/v1alpha3/clusterdashboards/test1/template curl -d '{"grafanaDashboardUrl":"https://grafana.com/api/dashboards/7362/revisions/5/download", "description":"this is a test dashboard."}' -H "Content-Type: application/json" localhost:9090/kapis/monitoring.kubesphere.io/v1alpha3/namespaces/default/dashboards/test2/template \ No newline at end of file diff --git a/pkg/kapis/notification/v2beta2/handler.go b/pkg/kapis/notification/v2beta2/handler.go index a9dc3bbcd..d091d2700 100644 --- a/pkg/kapis/notification/v2beta2/handler.go +++ b/pkg/kapis/notification/v2beta2/handler.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package v2beta2 import ( diff --git a/pkg/kapis/tenant/v1alpha2/metering.go b/pkg/kapis/tenant/v1alpha2/metering.go index d507ac469..c7b5ede0c 100644 --- a/pkg/kapis/tenant/v1alpha2/metering.go +++ b/pkg/kapis/tenant/v1alpha2/metering.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package v1alpha2 import ( diff --git a/pkg/models/alerting/alerting.go b/pkg/models/alerting/alerting.go index 1c191289a..04c9f0e9b 100644 --- a/pkg/models/alerting/alerting.go +++ b/pkg/models/alerting/alerting.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package alerting import ( diff --git a/pkg/models/alerting/rules/cache.go b/pkg/models/alerting/rules/cache.go index 3728c66f5..b677a13ca 100644 --- a/pkg/models/alerting/rules/cache.go +++ b/pkg/models/alerting/rules/cache.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package rules import ( diff --git a/pkg/models/alerting/rules/rule.go b/pkg/models/alerting/rules/rule.go index f8b405788..872f536a4 100644 --- a/pkg/models/alerting/rules/rule.go +++ b/pkg/models/alerting/rules/rule.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package rules import ( diff --git a/pkg/models/alerting/rules/ruler.go b/pkg/models/alerting/rules/ruler.go index 49094a497..6b67b0f37 100644 --- a/pkg/models/alerting/rules/ruler.go +++ b/pkg/models/alerting/rules/ruler.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package rules import ( diff --git a/pkg/models/alerting/rules/utils.go b/pkg/models/alerting/rules/utils.go index cc5359808..a6a4509e8 100644 --- a/pkg/models/alerting/rules/utils.go +++ b/pkg/models/alerting/rules/utils.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package rules import ( diff --git a/pkg/models/alerting/rules/utils_test.go b/pkg/models/alerting/rules/utils_test.go index e5b3e1bb8..0fdcebc0c 100644 --- a/pkg/models/alerting/rules/utils_test.go +++ b/pkg/models/alerting/rules/utils_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package rules import ( diff --git a/pkg/models/metering/type.go b/pkg/models/metering/type.go index 4c784af98..8f17a4c56 100644 --- a/pkg/models/metering/type.go +++ b/pkg/models/metering/type.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package metering type PriceInfo struct { diff --git a/pkg/models/monitoring/utils.go b/pkg/models/monitoring/utils.go index 7ab50e766..bf4a0ede7 100644 --- a/pkg/models/monitoring/utils.go +++ b/pkg/models/monitoring/utils.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package monitoring import ( diff --git a/pkg/models/monitoring/utils_test.go b/pkg/models/monitoring/utils_test.go index 52dcd9708..40dc21a94 100644 --- a/pkg/models/monitoring/utils_test.go +++ b/pkg/models/monitoring/utils_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package monitoring import ( diff --git a/pkg/models/notification/notification.go b/pkg/models/notification/notification.go index 6c99d1431..4b3f89582 100644 --- a/pkg/models/notification/notification.go +++ b/pkg/models/notification/notification.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package notification import ( diff --git a/pkg/models/registries/v2/options.go b/pkg/models/registries/v2/options.go index 4478db6b3..c879b3859 100644 --- a/pkg/models/registries/v2/options.go +++ b/pkg/models/registries/v2/options.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package v2 import ( diff --git a/pkg/models/registries/v2/registries.go b/pkg/models/registries/v2/registries.go index c408f29b4..563bb4bff 100644 --- a/pkg/models/registries/v2/registries.go +++ b/pkg/models/registries/v2/registries.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package v2 import ( diff --git a/pkg/models/registries/v2/registries_test.go b/pkg/models/registries/v2/registries_test.go index 0939a206f..5bb76519d 100644 --- a/pkg/models/registries/v2/registries_test.go +++ b/pkg/models/registries/v2/registries_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package v2 import ( diff --git a/pkg/models/registries/v2/registry_helper.go b/pkg/models/registries/v2/registry_helper.go index 256f2c021..c288231eb 100644 --- a/pkg/models/registries/v2/registry_helper.go +++ b/pkg/models/registries/v2/registry_helper.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package v2 import ( diff --git a/pkg/models/registries/v2/secret_authenticator.go b/pkg/models/registries/v2/secret_authenticator.go index d19f0bfab..49dc10c90 100644 --- a/pkg/models/registries/v2/secret_authenticator.go +++ b/pkg/models/registries/v2/secret_authenticator.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package v2 import ( diff --git a/pkg/models/registries/v2/secret_authenticator_test.go b/pkg/models/registries/v2/secret_authenticator_test.go index fcdd34ba3..9b8462180 100644 --- a/pkg/models/registries/v2/secret_authenticator_test.go +++ b/pkg/models/registries/v2/secret_authenticator_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package v2 import ( diff --git a/pkg/models/registries/v2/types.go b/pkg/models/registries/v2/types.go index 26c250fe2..040db36ab 100644 --- a/pkg/models/registries/v2/types.go +++ b/pkg/models/registries/v2/types.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package v2 import ( diff --git a/pkg/models/resources/v1alpha2/storageclass/storageclasses_test.go b/pkg/models/resources/v1alpha2/storageclass/storageclasses_test.go index 50295faad..4ffc3c769 100644 --- a/pkg/models/resources/v1alpha2/storageclass/storageclasses_test.go +++ b/pkg/models/resources/v1alpha2/storageclass/storageclasses_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package storageclass import ( diff --git a/pkg/models/resources/v1alpha3/volumesnapshotcontent/volumesnapshotcontent.go b/pkg/models/resources/v1alpha3/volumesnapshotcontent/volumesnapshotcontent.go index 9e9781472..7819bf12b 100644 --- a/pkg/models/resources/v1alpha3/volumesnapshotcontent/volumesnapshotcontent.go +++ b/pkg/models/resources/v1alpha3/volumesnapshotcontent/volumesnapshotcontent.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package volumesnapshotcontent import ( diff --git a/pkg/models/resources/v1alpha3/volumesnapshotcontent/volumesnapshotcontent_test.go b/pkg/models/resources/v1alpha3/volumesnapshotcontent/volumesnapshotcontent_test.go index bdd88c870..0acb06351 100644 --- a/pkg/models/resources/v1alpha3/volumesnapshotcontent/volumesnapshotcontent_test.go +++ b/pkg/models/resources/v1alpha3/volumesnapshotcontent/volumesnapshotcontent_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package volumesnapshotcontent import ( diff --git a/pkg/models/tenant/metering.go b/pkg/models/tenant/metering.go index 652a46a78..301fa8143 100644 --- a/pkg/models/tenant/metering.go +++ b/pkg/models/tenant/metering.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package tenant import ( diff --git a/pkg/models/tenant/metering_test.go b/pkg/models/tenant/metering_test.go index 89252395d..68852d0a3 100644 --- a/pkg/models/tenant/metering_test.go +++ b/pkg/models/tenant/metering_test.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package tenant import ( diff --git a/pkg/models/terminal/options.go b/pkg/models/terminal/options.go index 860f10d7c..8dd6a747d 100644 --- a/pkg/models/terminal/options.go +++ b/pkg/models/terminal/options.go @@ -1,3 +1,17 @@ +// Copyright 2022 The KubeSphere 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. +// See the License for the specific language governing permissions and +// limitations under the License. +// package terminal import "github.com/spf13/pflag"