diff --git a/cmd/controller-manager/app/controllers.go b/cmd/controller-manager/app/controllers.go index 78608a17e..f8d73e428 100644 --- a/cmd/controller-manager/app/controllers.go +++ b/cmd/controller-manager/app/controllers.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 app import ( @@ -124,7 +123,7 @@ func AddControllers( csrController := certificatesigningrequest.NewController(client.Kubernetes(), kubernetesInformer, client.Config()) - clusterRoleBindingController := clusterrolebinding.NewController(client.Kubernetes(), kubernetesInformer) + clusterRoleBindingController := clusterrolebinding.NewController(client.Kubernetes(), kubernetesInformer, kubesphereInformer) clusterController := cluster.NewClusterController( client.Kubernetes(), diff --git a/cmd/controller-manager/app/server.go b/cmd/controller-manager/app/server.go index 7a2a2833c..6028ec334 100644 --- a/cmd/controller-manager/app/server.go +++ b/cmd/controller-manager/app/server.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 app diff --git a/cmd/ks-apiserver/apiserver.go b/cmd/ks-apiserver/apiserver.go index 1704a4385..1e0710ef5 100644 --- a/cmd/ks-apiserver/apiserver.go +++ b/cmd/ks-apiserver/apiserver.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 main import ( diff --git a/cmd/ks-apiserver/app/server.go b/cmd/ks-apiserver/app/server.go index 59dba6336..33e91e3d6 100644 --- a/cmd/ks-apiserver/app/server.go +++ b/cmd/ks-apiserver/app/server.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 app import ( diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index 2be4bf457..c8484fbb4 100644 --- a/hack/boilerplate.go.txt +++ b/hack/boilerplate.go.txt @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2020 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. @@ -13,3 +13,4 @@ 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. */ + diff --git a/pkg/api/auth/types.go b/pkg/api/auth/types.go index 63a80e747..a5bfccf2b 100644 --- a/pkg/api/auth/types.go +++ b/pkg/api/auth/types.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 auth diff --git a/pkg/api/logging/v1alpha2/types.go b/pkg/api/logging/v1alpha2/types.go index 30a64ac68..a63e9f46d 100644 --- a/pkg/api/logging/v1alpha2/types.go +++ b/pkg/api/logging/v1alpha2/types.go @@ -1,9 +1,103 @@ package v1alpha2 -import "kubesphere.io/kubesphere/pkg/simple/client/logging" +import ( + "github.com/emicklei/go-restful" + "kubesphere.io/kubesphere/pkg/simple/client/logging" + "strconv" + "time" +) + +const ( + OperationStatistics = "statistics" + OperationHistogram = "histogram" + OperationQuery = "query" + OperationExport = "export" + + DefaultInterval = "15m" + DefaultSize = 10 + OrderAscending = "asc" + OrderDescending = "desc" +) type APIResponse struct { Logs *logging.Logs `json:"query,omitempty" description:"query results"` Statistics *logging.Statistics `json:"statistics,omitempty" description:"statistics results"` Histogram *logging.Histogram `json:"histogram,omitempty" description:"histogram results"` } + +type Query struct { + Operation string + WorkspaceFilter string + WorkspaceSearch string + NamespaceFilter string + NamespaceSearch string + WorkloadFilter string + WorkloadSearch string + PodFilter string + PodSearch string + ContainerFilter string + ContainerSearch string + LogSearch string + StartTime time.Time + EndTime time.Time + Interval string + Sort string + From int64 + Size int64 +} + +func ParseQueryParameter(req *restful.Request) (*Query, error) { + var q Query + q.Operation = req.QueryParameter("operation") + q.WorkspaceFilter = req.QueryParameter("workspaces") + q.WorkspaceSearch = req.QueryParameter("workspace_query") + q.NamespaceFilter = req.QueryParameter("namespaces") + q.NamespaceSearch = req.QueryParameter("namespace_query") + q.WorkloadFilter = req.QueryParameter("workloads") + q.WorkloadSearch = req.QueryParameter("workload_query") + q.PodFilter = req.QueryParameter("pods") + q.PodSearch = req.QueryParameter("pod_query") + q.ContainerFilter = req.QueryParameter("containers") + q.ContainerSearch = req.QueryParameter("container_query") + q.LogSearch = req.QueryParameter("log_query") + + if q.Operation == "" { + q.Operation = OperationQuery + } + + if tstr := req.QueryParameter("start_time"); tstr != "" { + sec, err := strconv.ParseInt(tstr, 10, 64) + if err != nil { + return nil, err + } + q.StartTime = time.Unix(sec, 0) + } + if tstr := req.QueryParameter("end_time"); tstr != "" { + sec, err := strconv.ParseInt(tstr, 10, 64) + if err != nil { + return nil, err + } + q.EndTime = time.Unix(sec, 0) + } + + switch q.Operation { + case OperationHistogram: + q.Interval = req.QueryParameter("interval") + if q.Interval == "" { + q.Interval = DefaultInterval + } + case OperationQuery: + q.From, _ = strconv.ParseInt(req.QueryParameter("from"), 10, 64) + size, err := strconv.ParseInt(req.QueryParameter("size"), 10, 64) + if err != nil { + size = DefaultSize + } + q.Size = size + q.Sort = req.QueryParameter("sort") + if q.Sort != OrderAscending { + q.Sort = OrderDescending + } + } + + return &q, nil +} diff --git a/pkg/api/resource/resource.go b/pkg/api/resource/resource.go deleted file mode 100644 index 958e3540f..000000000 --- a/pkg/api/resource/resource.go +++ /dev/null @@ -1 +0,0 @@ -package resource diff --git a/pkg/api/resource/v1alpha2/types.go b/pkg/api/resource/v1alpha2/types.go index a263140da..2fcc42692 100644 --- a/pkg/api/resource/v1alpha2/types.go +++ b/pkg/api/resource/v1alpha2/types.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 "time" diff --git a/pkg/api/types.go b/pkg/api/types.go index 42863886d..5e10391e0 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 api import ( diff --git a/pkg/api/utils.go b/pkg/api/utils.go index 26d9f4108..781dcdd64 100644 --- a/pkg/api/utils.go +++ b/pkg/api/utils.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 api import ( diff --git a/pkg/apis/addtoscheme_cluster_v1alpha1.go b/pkg/apis/addtoscheme_cluster_v1alpha1.go index 8722b3516..f03a9de73 100644 --- a/pkg/apis/addtoscheme_cluster_v1alpha1.go +++ b/pkg/apis/addtoscheme_cluster_v1alpha1.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 ( diff --git a/pkg/apis/addtoscheme_devops_v1alpha1.go b/pkg/apis/addtoscheme_devops_v1alpha1.go index 8a09ff3ee..59b3e3112 100644 --- a/pkg/apis/addtoscheme_devops_v1alpha1.go +++ b/pkg/apis/addtoscheme_devops_v1alpha1.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/addtoscheme_devops_v1alpha3.go b/pkg/apis/addtoscheme_devops_v1alpha3.go index 1e169cc2d..352d73514 100644 --- a/pkg/apis/addtoscheme_devops_v1alpha3.go +++ b/pkg/apis/addtoscheme_devops_v1alpha3.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/addtoscheme_iam_v1alpha2.go b/pkg/apis/addtoscheme_iam_v1alpha2.go index 3f2a962a5..a74ef9612 100644 --- a/pkg/apis/addtoscheme_iam_v1alpha2.go +++ b/pkg/apis/addtoscheme_iam_v1alpha2.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/addtoscheme_network_v1alpha1.go b/pkg/apis/addtoscheme_network_v1alpha1.go index 76ae9985a..7523f691b 100644 --- a/pkg/apis/addtoscheme_network_v1alpha1.go +++ b/pkg/apis/addtoscheme_network_v1alpha1.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/addtoscheme_servicemesh_v1alpha2.go b/pkg/apis/addtoscheme_servicemesh_v1alpha2.go index 3d5ac365a..31692dacb 100644 --- a/pkg/apis/addtoscheme_servicemesh_v1alpha2.go +++ b/pkg/apis/addtoscheme_servicemesh_v1alpha2.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/addtoscheme_tenant_v1alpha1.go b/pkg/apis/addtoscheme_tenant_v1alpha1.go index 6d40a1afc..abed94755 100644 --- a/pkg/apis/addtoscheme_tenant_v1alpha1.go +++ b/pkg/apis/addtoscheme_tenant_v1alpha1.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 ( diff --git a/pkg/apis/addtoscheme_tenant_v1alpha2.go b/pkg/apis/addtoscheme_tenant_v1alpha2.go index dfa72eb69..1e533c294 100644 --- a/pkg/apis/addtoscheme_tenant_v1alpha2.go +++ b/pkg/apis/addtoscheme_tenant_v1alpha2.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/apis.go b/pkg/apis/apis.go index c7919b499..b17c050f8 100644 --- a/pkg/apis/apis.go +++ b/pkg/apis/apis.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/devops/OWNERS b/pkg/apis/devops/OWNERS index 6f948683d..c26fda1a9 100644 --- a/pkg/apis/devops/OWNERS +++ b/pkg/apis/devops/OWNERS @@ -1,10 +1,12 @@ approvers: - runzexia - soulseen + - shaowenchen reviewers: - runzexia - soulseen + - shaowenchen labels: - area/api diff --git a/pkg/apis/iam/group.go b/pkg/apis/iam/group.go index cd47ea564..862f62a3e 100644 --- a/pkg/apis/iam/group.go +++ b/pkg/apis/iam/group.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/iam/v1alpha2/doc.go b/pkg/apis/iam/v1alpha2/doc.go index 5ddef225c..cc2b6133d 100644 --- a/pkg/apis/iam/v1alpha2/doc.go +++ b/pkg/apis/iam/v1alpha2/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/iam/v1alpha2/register.go b/pkg/apis/iam/v1alpha2/register.go index ddb23db84..1e2c87954 100644 --- a/pkg/apis/iam/v1alpha2/register.go +++ b/pkg/apis/iam/v1alpha2/register.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/iam/v1alpha2/types.go b/pkg/apis/iam/v1alpha2/types.go index e4f5717c2..a45fd1b70 100644 --- a/pkg/apis/iam/v1alpha2/types.go +++ b/pkg/apis/iam/v1alpha2/types.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/iam/v1alpha2/types_test.go b/pkg/apis/iam/v1alpha2/types_test.go index a47667ef7..6101c88a5 100644 --- a/pkg/apis/iam/v1alpha2/types_test.go +++ b/pkg/apis/iam/v1alpha2/types_test.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 2019 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 diff --git a/pkg/apis/iam/v1alpha2/v1alpha2_suite_test.go b/pkg/apis/iam/v1alpha2/v1alpha2_suite_test.go index 17192bd5f..8730454a8 100644 --- a/pkg/apis/iam/v1alpha2/v1alpha2_suite_test.go +++ b/pkg/apis/iam/v1alpha2/v1alpha2_suite_test.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/iam/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/iam/v1alpha2/zz_generated.deepcopy.go index a0c8f4a30..3250eef04 100644 --- a/pkg/apis/iam/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/iam/v1alpha2/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/tenant/crdinstall/install.go b/pkg/apis/tenant/crdinstall/install.go index 96f5241e3..49028b1ae 100644 --- a/pkg/apis/tenant/crdinstall/install.go +++ b/pkg/apis/tenant/crdinstall/install.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 install import ( diff --git a/pkg/apis/tenant/group.go b/pkg/apis/tenant/group.go index 365293be8..1f78c7f77 100644 --- a/pkg/apis/tenant/group.go +++ b/pkg/apis/tenant/group.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 contains tenant API versions diff --git a/pkg/apis/tenant/v1alpha1/doc.go b/pkg/apis/tenant/v1alpha1/doc.go index 5ff815ff2..35e734bff 100644 --- a/pkg/apis/tenant/v1alpha1/doc.go +++ b/pkg/apis/tenant/v1alpha1/doc.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 contains API Schema definitions for the tenant v1alpha1 API group diff --git a/pkg/apis/tenant/v1alpha1/openapi_generated.go b/pkg/apis/tenant/v1alpha1/openapi_generated.go index b78398b71..e74e30efe 100644 --- a/pkg/apis/tenant/v1alpha1/openapi_generated.go +++ b/pkg/apis/tenant/v1alpha1/openapi_generated.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/tenant/v1alpha1/register.go b/pkg/apis/tenant/v1alpha1/register.go index fcc919186..30d7a7b23 100644 --- a/pkg/apis/tenant/v1alpha1/register.go +++ b/pkg/apis/tenant/v1alpha1/register.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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. */ // NOTE: Boilerplate only. Ignore this file. diff --git a/pkg/apis/tenant/v1alpha1/v1alpha1_suite_test.go b/pkg/apis/tenant/v1alpha1/v1alpha1_suite_test.go index 991502bad..70d9a172a 100644 --- a/pkg/apis/tenant/v1alpha1/v1alpha1_suite_test.go +++ b/pkg/apis/tenant/v1alpha1/v1alpha1_suite_test.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 diff --git a/pkg/apis/tenant/v1alpha1/workspace_types.go b/pkg/apis/tenant/v1alpha1/workspace_types.go index be3c4a991..a77d7df85 100644 --- a/pkg/apis/tenant/v1alpha1/workspace_types.go +++ b/pkg/apis/tenant/v1alpha1/workspace_types.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 diff --git a/pkg/apis/tenant/v1alpha1/workspace_types_test.go b/pkg/apis/tenant/v1alpha1/workspace_types_test.go index 9de5c9b70..4110663d4 100644 --- a/pkg/apis/tenant/v1alpha1/workspace_types_test.go +++ b/pkg/apis/tenant/v1alpha1/workspace_types_test.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 diff --git a/pkg/apis/tenant/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/tenant/v1alpha1/zz_generated.deepcopy.go index a9319670d..f489cb6d6 100644 --- a/pkg/apis/tenant/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/tenant/v1alpha1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/tenant/v1alpha2/doc.go b/pkg/apis/tenant/v1alpha2/doc.go index 7f665151c..bf7541473 100644 --- a/pkg/apis/tenant/v1alpha2/doc.go +++ b/pkg/apis/tenant/v1alpha2/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/tenant/v1alpha2/register.go b/pkg/apis/tenant/v1alpha2/register.go index d4a0300a7..36549793d 100644 --- a/pkg/apis/tenant/v1alpha2/register.go +++ b/pkg/apis/tenant/v1alpha2/register.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/tenant/v1alpha2/v1alpha2_suite_test.go b/pkg/apis/tenant/v1alpha2/v1alpha2_suite_test.go index 17192bd5f..8730454a8 100644 --- a/pkg/apis/tenant/v1alpha2/v1alpha2_suite_test.go +++ b/pkg/apis/tenant/v1alpha2/v1alpha2_suite_test.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/tenant/v1alpha2/workspacetemplate_types.go b/pkg/apis/tenant/v1alpha2/workspacetemplate_types.go index 9719340f2..ab95e576d 100644 --- a/pkg/apis/tenant/v1alpha2/workspacetemplate_types.go +++ b/pkg/apis/tenant/v1alpha2/workspacetemplate_types.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/tenant/v1alpha2/workspacetemplate_types_test.go b/pkg/apis/tenant/v1alpha2/workspacetemplate_types_test.go index 9f412492e..4f1482651 100644 --- a/pkg/apis/tenant/v1alpha2/workspacetemplate_types_test.go +++ b/pkg/apis/tenant/v1alpha2/workspacetemplate_types_test.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apis/tenant/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/tenant/v1alpha2/zz_generated.deepcopy.go index f29b05b05..8a3346eec 100644 --- a/pkg/apis/tenant/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/tenant/v1alpha2/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index 0fe589aba..83ec0a061 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 ( @@ -33,7 +49,6 @@ import ( devopsv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/devops/v1alpha2" devopsv1alpha3 "kubesphere.io/kubesphere/pkg/kapis/devops/v1alpha3" iamapi "kubesphere.io/kubesphere/pkg/kapis/iam/v1alpha2" - loggingv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/logging/v1alpha2" monitoringv1alpha3 "kubesphere.io/kubesphere/pkg/kapis/monitoring/v1alpha3" networkv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/network/v1alpha2" notificationv1 "kubesphere.io/kubesphere/pkg/kapis/notification/v1" @@ -149,7 +164,6 @@ func (s *APIServer) PrepareRun() error { func (s *APIServer) installKubeSphereAPIs() { urlruntime.Must(configv1alpha2.AddToContainer(s.container, s.Config)) urlruntime.Must(resourcev1alpha3.AddToContainer(s.container, s.InformerFactory)) - urlruntime.Must(loggingv1alpha2.AddToContainer(s.container, s.KubernetesClient, s.LoggingClient)) urlruntime.Must(monitoringv1alpha3.AddToContainer(s.container, s.KubernetesClient.Kubernetes(), s.MonitoringClient, s.InformerFactory, s.OpenpitrixClient)) urlruntime.Must(openpitrixv1.AddToContainer(s.container, s.InformerFactory, s.OpenpitrixClient)) urlruntime.Must(networkv1alpha2.AddToContainer(s.container, s.Config.NetworkOptions.WeaveScopeHost)) @@ -157,7 +171,7 @@ func (s *APIServer) installKubeSphereAPIs() { urlruntime.Must(resourcesv1alpha2.AddToContainer(s.container, s.KubernetesClient.Kubernetes(), s.InformerFactory, s.KubernetesClient.Master())) urlruntime.Must(tenantv1alpha2.AddToContainer(s.container, s.InformerFactory, s.KubernetesClient.Kubernetes(), - s.KubernetesClient.KubeSphere(), s.EventsClient)) + s.KubernetesClient.KubeSphere(), s.EventsClient, s.LoggingClient)) urlruntime.Must(terminalv1alpha2.AddToContainer(s.container, s.KubernetesClient.Kubernetes(), s.KubernetesClient.Config())) urlruntime.Must(clusterkapisv1alpha1.AddToContainer(s.container, s.InformerFactory.KubernetesSharedInformerFactory(), diff --git a/pkg/apiserver/authentication/authenticators/basic/basic.go b/pkg/apiserver/authentication/authenticators/basic/basic.go index 434de152c..37fae5e0a 100644 --- a/pkg/apiserver/authentication/authenticators/basic/basic.go +++ b/pkg/apiserver/authentication/authenticators/basic/basic.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 basic diff --git a/pkg/apiserver/authentication/authenticators/jwttoken/jwt_token.go b/pkg/apiserver/authentication/authenticators/jwttoken/jwt_token.go index a8bea8f18..e694e3f83 100644 --- a/pkg/apiserver/authentication/authenticators/jwttoken/jwt_token.go +++ b/pkg/apiserver/authentication/authenticators/jwttoken/jwt_token.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 jwttoken import ( diff --git a/pkg/apiserver/authentication/identityprovider/github/github.go b/pkg/apiserver/authentication/identityprovider/github/github.go index d20d118c7..a8a493883 100644 --- a/pkg/apiserver/authentication/identityprovider/github/github.go +++ b/pkg/apiserver/authentication/identityprovider/github/github.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 github diff --git a/pkg/apiserver/authentication/identityprovider/identity_provider.go b/pkg/apiserver/authentication/identityprovider/identity_provider.go index 71f8fb075..680f06e35 100644 --- a/pkg/apiserver/authentication/identityprovider/identity_provider.go +++ b/pkg/apiserver/authentication/identityprovider/identity_provider.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 identityprovider diff --git a/pkg/apiserver/authentication/oauth/oauth_options.go b/pkg/apiserver/authentication/oauth/oauth_options.go index d36567d5e..f9c141dc5 100644 --- a/pkg/apiserver/authentication/oauth/oauth_options.go +++ b/pkg/apiserver/authentication/oauth/oauth_options.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 oauth diff --git a/pkg/apiserver/authentication/oauth/oauth_options_test.go b/pkg/apiserver/authentication/oauth/oauth_options_test.go index c7af42075..3f79fa752 100644 --- a/pkg/apiserver/authentication/oauth/oauth_options_test.go +++ b/pkg/apiserver/authentication/oauth/oauth_options_test.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 oauth diff --git a/pkg/apiserver/authentication/options/authenticate_options.go b/pkg/apiserver/authentication/options/authenticate_options.go index 5ee72532f..91b6f845e 100644 --- a/pkg/apiserver/authentication/options/authenticate_options.go +++ b/pkg/apiserver/authentication/options/authenticate_options.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 diff --git a/pkg/apiserver/authentication/request/anonymous/anonymous.go b/pkg/apiserver/authentication/request/anonymous/anonymous.go index 9ff1115a2..ce1e7effd 100644 --- a/pkg/apiserver/authentication/request/anonymous/anonymous.go +++ b/pkg/apiserver/authentication/request/anonymous/anonymous.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 anonymous diff --git a/pkg/apiserver/authentication/request/basictoken/basic_token.go b/pkg/apiserver/authentication/request/basictoken/basic_token.go index ebb75f6a5..e6adb3170 100644 --- a/pkg/apiserver/authentication/request/basictoken/basic_token.go +++ b/pkg/apiserver/authentication/request/basictoken/basic_token.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Following code copied from k8s.io/apiserver/pkg/authorization/authorizerfactory to avoid import collision + package basictoken import ( diff --git a/pkg/apiserver/authentication/request/bearertoken/bearertoken.go b/pkg/apiserver/authentication/request/bearertoken/bearertoken.go index e637fb17a..f84b7229a 100644 --- a/pkg/apiserver/authentication/request/bearertoken/bearertoken.go +++ b/pkg/apiserver/authentication/request/bearertoken/bearertoken.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Following code copied from k8s.io/apiserver/pkg/authentication/request/bearertoken to avoid import collision + package bearertoken import ( diff --git a/pkg/apiserver/authentication/request/bearertoken/bearertoken_test.go b/pkg/apiserver/authentication/request/bearertoken/bearertoken_test.go index 14125ccc9..c129e30fd 100644 --- a/pkg/apiserver/authentication/request/bearertoken/bearertoken_test.go +++ b/pkg/apiserver/authentication/request/bearertoken/bearertoken_test.go @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Following code copied from k8s.io/apiserver/pkg/authentication/request/bearertoken to avoid import collision + package bearertoken import ( diff --git a/pkg/apiserver/authentication/token/issuer.go b/pkg/apiserver/authentication/token/issuer.go index 1661592ca..c1daaee2d 100644 --- a/pkg/apiserver/authentication/token/issuer.go +++ b/pkg/apiserver/authentication/token/issuer.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 token diff --git a/pkg/apiserver/authentication/token/jwt.go b/pkg/apiserver/authentication/token/jwt.go index cae79371d..48fe961b1 100644 --- a/pkg/apiserver/authentication/token/jwt.go +++ b/pkg/apiserver/authentication/token/jwt.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 token diff --git a/pkg/apiserver/authentication/token/jwt_test.go b/pkg/apiserver/authentication/token/jwt_test.go index c326cfa36..86c53c52c 100644 --- a/pkg/apiserver/authentication/token/jwt_test.go +++ b/pkg/apiserver/authentication/token/jwt_test.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 token diff --git a/pkg/apiserver/authentication/token/user.go b/pkg/apiserver/authentication/token/user.go index ccae5b6ee..3801596f3 100644 --- a/pkg/apiserver/authentication/token/user.go +++ b/pkg/apiserver/authentication/token/user.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 token diff --git a/pkg/apiserver/authorization/authorizer/interfaces.go b/pkg/apiserver/authorization/authorizer/interfaces.go index af67af2b5..10069b5b4 100644 --- a/pkg/apiserver/authorization/authorizer/interfaces.go +++ b/pkg/apiserver/authorization/authorizer/interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2014 The Kubernetes Authors. +Copyright 2020 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. @@ -22,6 +22,9 @@ import ( "k8s.io/apiserver/pkg/authentication/user" ) +// NOTE: This file is copied from k8s.io/kubernetes/apiserver/pkg/authorization/authorizer. +// We have expanded some attributes, such as workspace and cluster. + // Attributes is an interface used by an Authorizer to get information about a request // that is used to make an authorization decision. type Attributes interface { diff --git a/pkg/apiserver/authorization/authorizerfactory/builtin.go b/pkg/apiserver/authorization/authorizerfactory/builtin.go index 6d2f4d650..883017a9b 100644 --- a/pkg/apiserver/authorization/authorizerfactory/builtin.go +++ b/pkg/apiserver/authorization/authorizerfactory/builtin.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 2016 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. +See the License for the specific language governing permissions and +limitations under the License. +*/ package authorizerfactory @@ -22,6 +20,8 @@ import ( "kubesphere.io/kubesphere/pkg/apiserver/authorization/authorizer" ) +// Following code copied from k8s.io/apiserver/pkg/authorization/authorizerfactory to avoid import collision + // alwaysAllowAuthorizer is an implementation of authorizer.Attributes // which always says yes to an authorization request. // It is useful in tests and when using kubernetes in an open manner. diff --git a/pkg/apiserver/authorization/authorizerfactory/builtin_test.go b/pkg/apiserver/authorization/authorizerfactory/builtin_test.go index 67cd5595e..828ad5bbb 100644 --- a/pkg/apiserver/authorization/authorizerfactory/builtin_test.go +++ b/pkg/apiserver/authorization/authorizerfactory/builtin_test.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 2016 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. +See the License for the specific language governing permissions and +limitations under the License. +*/ package authorizerfactory @@ -23,6 +21,8 @@ import ( "testing" ) +// Following code copied from k8s.io/apiserver/pkg/authorization/authorizerfactory to avoid import collision + func TestNewAlwaysAllowAuthorizer(t *testing.T) { aaa := NewAlwaysAllowAuthorizer() if decision, _, _ := aaa.Authorize(nil); decision != authorizer.DecisionAllow { diff --git a/pkg/apiserver/authorization/authorizerfactory/rbac.go b/pkg/apiserver/authorization/authorizerfactory/rbac.go index ca4a096a2..035a3cff1 100644 --- a/pkg/apiserver/authorization/authorizerfactory/rbac.go +++ b/pkg/apiserver/authorization/authorizerfactory/rbac.go @@ -1,20 +1,20 @@ /* - * - * Copyright 2020 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 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. +*/ + +// NOTE: This file is copied from k8s.io/kubernetes/plugin/pkg/auth/authorizer/rbac. package authorizerfactory diff --git a/pkg/apiserver/authorization/options/authorization_options.go b/pkg/apiserver/authorization/options/authorization_options.go index 0a2a5e8f2..39c04a682 100644 --- a/pkg/apiserver/authorization/options/authorization_options.go +++ b/pkg/apiserver/authorization/options/authorization_options.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 diff --git a/pkg/apiserver/authorization/path/doc.go b/pkg/apiserver/authorization/path/doc.go index 743d945b4..bc2cb6e1d 100644 --- a/pkg/apiserver/authorization/path/doc.go +++ b/pkg/apiserver/authorization/path/doc.go @@ -14,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// Following code copied from k8s.io/apiserver/pkg/authorization/authorizer/path to avoid import collision + // Package path contains an authorizer that allows certain paths and path prefixes. package path diff --git a/pkg/apiserver/authorization/union/union.go b/pkg/apiserver/authorization/union/union.go index 1e3dfac97..dfcf8d240 100644 --- a/pkg/apiserver/authorization/union/union.go +++ b/pkg/apiserver/authorization/union/union.go @@ -32,6 +32,8 @@ import ( "k8s.io/apiserver/pkg/authentication/user" ) +// Following code copied from k8s.io/apiserver/pkg/authorization/union to avoid import collision + // unionAuthzHandler authorizer against a chain of authorizer.Authorizer type unionAuthzHandler []authorizer.Authorizer diff --git a/pkg/apiserver/config/config.go b/pkg/apiserver/config/config.go index aba99c1f3..9c4cd7892 100644 --- a/pkg/apiserver/config/config.go +++ b/pkg/apiserver/config/config.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 config import ( diff --git a/pkg/apiserver/config/config_test.go b/pkg/apiserver/config/config_test.go index eaf3c05b5..041a78359 100644 --- a/pkg/apiserver/config/config_test.go +++ b/pkg/apiserver/config/config_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 config import ( diff --git a/pkg/apiserver/dispatch/dispatch.go b/pkg/apiserver/dispatch/dispatch.go index b90bbd476..05d1837e6 100644 --- a/pkg/apiserver/dispatch/dispatch.go +++ b/pkg/apiserver/dispatch/dispatch.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 dispatch import ( diff --git a/pkg/apiserver/filters/authentication.go b/pkg/apiserver/filters/authentication.go index 09e38b0de..c5bd5fdc4 100644 --- a/pkg/apiserver/filters/authentication.go +++ b/pkg/apiserver/filters/authentication.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 filters import ( diff --git a/pkg/apiserver/filters/authorization.go b/pkg/apiserver/filters/authorization.go index 588ce7bef..d241949cf 100644 --- a/pkg/apiserver/filters/authorization.go +++ b/pkg/apiserver/filters/authorization.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 filters import ( diff --git a/pkg/apiserver/filters/dispatch.go b/pkg/apiserver/filters/dispatch.go index 842336b4f..3e2820da9 100644 --- a/pkg/apiserver/filters/dispatch.go +++ b/pkg/apiserver/filters/dispatch.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 filters import ( diff --git a/pkg/apiserver/filters/kubeapiserver.go b/pkg/apiserver/filters/kubeapiserver.go index d86a9ea9f..5ddc2c2b4 100644 --- a/pkg/apiserver/filters/kubeapiserver.go +++ b/pkg/apiserver/filters/kubeapiserver.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 filters import ( diff --git a/pkg/apiserver/filters/requestinfo.go b/pkg/apiserver/filters/requestinfo.go index c1d605b36..c2e4dcbfa 100644 --- a/pkg/apiserver/filters/requestinfo.go +++ b/pkg/apiserver/filters/requestinfo.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 filters import ( diff --git a/pkg/apiserver/query/field.go b/pkg/apiserver/query/field.go index 5d2fd3e85..1a2d9f445 100644 --- a/pkg/apiserver/query/field.go +++ b/pkg/apiserver/query/field.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 query type Field string diff --git a/pkg/apiserver/query/types.go b/pkg/apiserver/query/types.go index 2ad1ca36e..e115cbd0f 100644 --- a/pkg/apiserver/query/types.go +++ b/pkg/apiserver/query/types.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 query import ( diff --git a/pkg/apiserver/query/types_test.go b/pkg/apiserver/query/types_test.go index d4de9cb09..e5d0e6e60 100644 --- a/pkg/apiserver/query/types_test.go +++ b/pkg/apiserver/query/types_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 query import ( diff --git a/pkg/apiserver/request/context.go b/pkg/apiserver/request/context.go index fe3ae38ed..d10bf1075 100644 --- a/pkg/apiserver/request/context.go +++ b/pkg/apiserver/request/context.go @@ -24,6 +24,8 @@ import ( "k8s.io/apiserver/pkg/authentication/user" ) +// Following code copied from k8s.io/apiserver/pkg/endpoints/request to avoid import collision + // The key type is unexported to prevent collisions type key int diff --git a/pkg/apiserver/request/context_test.go b/pkg/apiserver/request/context_test.go index 72b3124b4..5609b8b14 100644 --- a/pkg/apiserver/request/context_test.go +++ b/pkg/apiserver/request/context_test.go @@ -23,6 +23,8 @@ import ( "k8s.io/apiserver/pkg/authentication/user" ) +// Following code copied from k8s.io/apiserver/pkg/endpoints/request to avoid import collision + // TestNamespaceContext validates that a namespace can be get/set on a context object func TestNamespaceContext(t *testing.T) { ctx := NewDefaultContext() diff --git a/pkg/apiserver/request/requestinfo.go b/pkg/apiserver/request/requestinfo.go index 7c627d5c6..cae39643d 100644 --- a/pkg/apiserver/request/requestinfo.go +++ b/pkg/apiserver/request/requestinfo.go @@ -1,3 +1,22 @@ +/* +Copyright 2019 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. +*/ + +// NOTE: This file is copied from k8s.io/apiserver/pkg/endpoints/request. +// We expanded requestInfo. + package request import ( diff --git a/pkg/apiserver/request/requestinfo_test.go b/pkg/apiserver/request/requestinfo_test.go index c7d63a134..c7cbc02be 100644 --- a/pkg/apiserver/request/requestinfo_test.go +++ b/pkg/apiserver/request/requestinfo_test.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 request diff --git a/pkg/apiserver/runtime/runtime.go b/pkg/apiserver/runtime/runtime.go index 376d2e29a..6b82923ac 100644 --- a/pkg/apiserver/runtime/runtime.go +++ b/pkg/apiserver/runtime/runtime.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 runtime import ( diff --git a/pkg/apiserver/server/handler.go b/pkg/apiserver/server/handler.go index abb4e431a..51f0868b6 100644 --- a/pkg/apiserver/server/handler.go +++ b/pkg/apiserver/server/handler.go @@ -1 +1,17 @@ +/* +Copyright 2019 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 server diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 273ea00a1..dd9e089cd 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/doc.go b/pkg/client/clientset/versioned/doc.go index 2d06b330b..d1f15b523 100644 --- a/pkg/client/clientset/versioned/doc.go +++ b/pkg/client/clientset/versioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index e89c758f1..22d4611c4 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/fake/doc.go b/pkg/client/clientset/versioned/fake/doc.go index 393014797..f3e875b2b 100644 --- a/pkg/client/clientset/versioned/fake/doc.go +++ b/pkg/client/clientset/versioned/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index ca6e339b5..e1621a4fe 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/scheme/doc.go b/pkg/client/clientset/versioned/scheme/doc.go index 3a7b07294..e3923c984 100644 --- a/pkg/client/clientset/versioned/scheme/doc.go +++ b/pkg/client/clientset/versioned/scheme/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 59becdc0f..faae466bf 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/cluster.go b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/cluster.go index d5fc7e6d8..e91401d6f 100644 --- a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/cluster.go +++ b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/cluster.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go index fef8f441c..e5d2f0d8e 100644 --- a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go +++ b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/doc.go index f2efa4141..211cbcb77 100644 --- a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/doc.go +++ b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/fake/doc.go index 329c98fb5..8d523a0ee 100644 --- a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster.go b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster.go index 6691c17bd..a80e111e1 100644 --- a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster.go +++ b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster_client.go b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster_client.go index 8168d68fb..fd51b108b 100644 --- a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster_client.go +++ b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go index 8a541985e..1ef0e6e20 100644 --- a/pkg/client/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/devops_client.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/devops_client.go index c74a68e5f..e83552f82 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/devops_client.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/devops_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/doc.go index f2efa4141..211cbcb77 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/doc.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/doc.go index 329c98fb5..8d523a0ee 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_devops_client.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_devops_client.go index 18561e813..f8d91bf38 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_devops_client.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_devops_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2ibinary.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2ibinary.go index 82805e78e..a731c5f94 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2ibinary.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2ibinary.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2ibuilder.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2ibuilder.go index bd38feef7..95fefbb6c 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2ibuilder.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2ibuilder.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2ibuildertemplate.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2ibuildertemplate.go index 372d4f05a..e966ea9e9 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2ibuildertemplate.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2ibuildertemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2irun.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2irun.go index d3bf81db5..7aa08daf2 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2irun.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/fake/fake_s2irun.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/generated_expansion.go index df67162b9..780f87eaf 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2ibinary.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2ibinary.go index 28da3bcdb..5ec2cdcfa 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2ibinary.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2ibinary.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2ibuilder.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2ibuilder.go index 34b37a777..d81dcf60a 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2ibuilder.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2ibuilder.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2ibuildertemplate.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2ibuildertemplate.go index ee6ceacb3..e9547b2bf 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2ibuildertemplate.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2ibuildertemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2irun.go b/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2irun.go index c7eb01513..5bb5a4a43 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2irun.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha1/s2irun.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha3/devops_client.go b/pkg/client/clientset/versioned/typed/devops/v1alpha3/devops_client.go index 8884644db..5458b6208 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha3/devops_client.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha3/devops_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha3/devopsproject.go b/pkg/client/clientset/versioned/typed/devops/v1alpha3/devopsproject.go index f923e6e9d..39d5d9dc8 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha3/devopsproject.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha3/devopsproject.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha3/doc.go b/pkg/client/clientset/versioned/typed/devops/v1alpha3/doc.go index a4ae49dd1..d4c6516df 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha3/doc.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha3/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/doc.go b/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/doc.go index 329c98fb5..8d523a0ee 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/fake_devops_client.go b/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/fake_devops_client.go index ba7a1ebc0..41f4215a5 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/fake_devops_client.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/fake_devops_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/fake_devopsproject.go b/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/fake_devopsproject.go index 1fb7fe594..88bccb4a3 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/fake_devopsproject.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/fake_devopsproject.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/fake_pipeline.go b/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/fake_pipeline.go index 5622bc57f..057ad3c38 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/fake_pipeline.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha3/fake/fake_pipeline.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha3/generated_expansion.go b/pkg/client/clientset/versioned/typed/devops/v1alpha3/generated_expansion.go index e854e495d..15e67e7c8 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha3/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha3/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/devops/v1alpha3/pipeline.go b/pkg/client/clientset/versioned/typed/devops/v1alpha3/pipeline.go index 675e4bfbf..8bb99cd40 100644 --- a/pkg/client/clientset/versioned/typed/devops/v1alpha3/pipeline.go +++ b/pkg/client/clientset/versioned/typed/devops/v1alpha3/pipeline.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/doc.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/doc.go index 02d20203a..8af33123a 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/doc.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/doc.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/doc.go index 329c98fb5..8d523a0ee 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_globalrole.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_globalrole.go index 5393ec2d2..d3741221a 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_globalrole.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_globalrole.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_globalrolebinding.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_globalrolebinding.go index 161de682a..ac91cbd06 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_globalrolebinding.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_globalrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_iam_client.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_iam_client.go index ce41b4a89..94547392a 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_iam_client.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_iam_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_user.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_user.go index f8a507714..b8ca55692 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_user.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_user.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_workspacerole.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_workspacerole.go index b7f81ed2e..4c7e98f59 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_workspacerole.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_workspacerole.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_workspacerolebinding.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_workspacerolebinding.go index 96504cdcb..78dc1b01f 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_workspacerolebinding.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/fake/fake_workspacerolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/generated_expansion.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/generated_expansion.go index edc5b88b5..68d328a69 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/globalrole.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/globalrole.go index ae6e9eeb3..3d699ef86 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/globalrole.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/globalrole.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/globalrolebinding.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/globalrolebinding.go index 8fdec09aa..e52c0ebe3 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/globalrolebinding.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/globalrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/iam_client.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/iam_client.go index be20644fb..489b71b02 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/iam_client.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/iam_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/user.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/user.go index ea25d4ac2..f229fca4c 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/user.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/user.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/workspacerole.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/workspacerole.go index e47e4c871..32bb08aaf 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/workspacerole.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/workspacerole.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/iam/v1alpha2/workspacerolebinding.go b/pkg/client/clientset/versioned/typed/iam/v1alpha2/workspacerolebinding.go index 17c4406e4..677292583 100644 --- a/pkg/client/clientset/versioned/typed/iam/v1alpha2/workspacerolebinding.go +++ b/pkg/client/clientset/versioned/typed/iam/v1alpha2/workspacerolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/network/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/network/v1alpha1/doc.go index f2efa4141..211cbcb77 100644 --- a/pkg/client/clientset/versioned/typed/network/v1alpha1/doc.go +++ b/pkg/client/clientset/versioned/typed/network/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/doc.go index 329c98fb5..8d523a0ee 100644 --- a/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_namespacenetworkpolicy.go b/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_namespacenetworkpolicy.go index b2611d8de..e00aca455 100644 --- a/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_namespacenetworkpolicy.go +++ b/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_namespacenetworkpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_network_client.go b/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_network_client.go index 571150be6..e18393d40 100644 --- a/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_network_client.go +++ b/pkg/client/clientset/versioned/typed/network/v1alpha1/fake/fake_network_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/network/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/network/v1alpha1/generated_expansion.go index e4de164f8..8a6dca547 100644 --- a/pkg/client/clientset/versioned/typed/network/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/network/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/network/v1alpha1/namespacenetworkpolicy.go b/pkg/client/clientset/versioned/typed/network/v1alpha1/namespacenetworkpolicy.go index 88f115706..ebe8da055 100644 --- a/pkg/client/clientset/versioned/typed/network/v1alpha1/namespacenetworkpolicy.go +++ b/pkg/client/clientset/versioned/typed/network/v1alpha1/namespacenetworkpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/network/v1alpha1/network_client.go b/pkg/client/clientset/versioned/typed/network/v1alpha1/network_client.go index 92f0d3277..22d5b9ef4 100644 --- a/pkg/client/clientset/versioned/typed/network/v1alpha1/network_client.go +++ b/pkg/client/clientset/versioned/typed/network/v1alpha1/network_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/doc.go b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/doc.go index 02d20203a..8af33123a 100644 --- a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/doc.go +++ b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/doc.go b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/doc.go index 329c98fb5..8d523a0ee 100644 --- a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/fake_servicemesh_client.go b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/fake_servicemesh_client.go index a37c4de66..611785c31 100644 --- a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/fake_servicemesh_client.go +++ b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/fake_servicemesh_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/fake_servicepolicy.go b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/fake_servicepolicy.go index 507a0d4d4..ff24c494b 100644 --- a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/fake_servicepolicy.go +++ b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/fake_servicepolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/fake_strategy.go b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/fake_strategy.go index 18cfb7aa9..e83e9f4f0 100644 --- a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/fake_strategy.go +++ b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/fake/fake_strategy.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/generated_expansion.go b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/generated_expansion.go index cf35e491c..804800a22 100644 --- a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/servicemesh_client.go b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/servicemesh_client.go index 88b5f7d33..b8354a540 100644 --- a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/servicemesh_client.go +++ b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/servicemesh_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/servicepolicy.go b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/servicepolicy.go index 1f0aa0b5a..98078c3f1 100644 --- a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/servicepolicy.go +++ b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/servicepolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/strategy.go b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/strategy.go index 5b2469c58..c8549c6e1 100644 --- a/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/strategy.go +++ b/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2/strategy.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/doc.go index f2efa4141..211cbcb77 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/doc.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/fake/doc.go index 329c98fb5..8d523a0ee 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/fake/fake_tenant_client.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/fake/fake_tenant_client.go index 9697e9625..9d7fb8ebc 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/fake/fake_tenant_client.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/fake/fake_tenant_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/fake/fake_workspace.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/fake/fake_workspace.go index 55bf90dc9..c9e935663 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/fake/fake_workspace.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/fake/fake_workspace.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/generated_expansion.go index db49967c4..c7d3f38ce 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/tenant_client.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/tenant_client.go index d896f6171..d1fe163db 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/tenant_client.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/tenant_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/workspace.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/workspace.go index dcf0752af..a3bf55269 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha1/workspace.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha1/workspace.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/doc.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/doc.go index 02d20203a..8af33123a 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/doc.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake/doc.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake/doc.go index 329c98fb5..8d523a0ee 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake/fake_tenant_client.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake/fake_tenant_client.go index 63e53c7b0..1fc791129 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake/fake_tenant_client.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake/fake_tenant_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake/fake_workspacetemplate.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake/fake_workspacetemplate.go index b93c01090..5706cc899 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake/fake_workspacetemplate.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake/fake_workspacetemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/generated_expansion.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/generated_expansion.go index 97e4e56b3..a9f9f5025 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/tenant_client.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/tenant_client.go index 10dee2753..e84520c97 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/tenant_client.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/tenant_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/workspacetemplate.go b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/workspacetemplate.go index 26a88529b..9fe5cd79c 100644 --- a/pkg/client/clientset/versioned/typed/tenant/v1alpha2/workspacetemplate.go +++ b/pkg/client/clientset/versioned/typed/tenant/v1alpha2/workspacetemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/cluster/interface.go b/pkg/client/informers/externalversions/cluster/interface.go index fd741d36b..e34756d56 100644 --- a/pkg/client/informers/externalversions/cluster/interface.go +++ b/pkg/client/informers/externalversions/cluster/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/cluster/v1alpha1/cluster.go b/pkg/client/informers/externalversions/cluster/v1alpha1/cluster.go index 883314e59..77d9a2a6a 100644 --- a/pkg/client/informers/externalversions/cluster/v1alpha1/cluster.go +++ b/pkg/client/informers/externalversions/cluster/v1alpha1/cluster.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/cluster/v1alpha1/interface.go b/pkg/client/informers/externalversions/cluster/v1alpha1/interface.go index 383f79e85..ebb3bbbe9 100644 --- a/pkg/client/informers/externalversions/cluster/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/cluster/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/devops/interface.go b/pkg/client/informers/externalversions/devops/interface.go index f5e53aa44..723171c04 100644 --- a/pkg/client/informers/externalversions/devops/interface.go +++ b/pkg/client/informers/externalversions/devops/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/devops/v1alpha1/interface.go b/pkg/client/informers/externalversions/devops/v1alpha1/interface.go index adadc49aa..626124d07 100644 --- a/pkg/client/informers/externalversions/devops/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/devops/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/devops/v1alpha1/s2ibinary.go b/pkg/client/informers/externalversions/devops/v1alpha1/s2ibinary.go index 7bfe71587..fa67f97bc 100644 --- a/pkg/client/informers/externalversions/devops/v1alpha1/s2ibinary.go +++ b/pkg/client/informers/externalversions/devops/v1alpha1/s2ibinary.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/devops/v1alpha1/s2ibuilder.go b/pkg/client/informers/externalversions/devops/v1alpha1/s2ibuilder.go index e3aa128b9..55b775fdd 100644 --- a/pkg/client/informers/externalversions/devops/v1alpha1/s2ibuilder.go +++ b/pkg/client/informers/externalversions/devops/v1alpha1/s2ibuilder.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/devops/v1alpha1/s2ibuildertemplate.go b/pkg/client/informers/externalversions/devops/v1alpha1/s2ibuildertemplate.go index 2b97ae99d..89958029e 100644 --- a/pkg/client/informers/externalversions/devops/v1alpha1/s2ibuildertemplate.go +++ b/pkg/client/informers/externalversions/devops/v1alpha1/s2ibuildertemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/devops/v1alpha1/s2irun.go b/pkg/client/informers/externalversions/devops/v1alpha1/s2irun.go index f34e5233b..6025fda14 100644 --- a/pkg/client/informers/externalversions/devops/v1alpha1/s2irun.go +++ b/pkg/client/informers/externalversions/devops/v1alpha1/s2irun.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/devops/v1alpha3/devopsproject.go b/pkg/client/informers/externalversions/devops/v1alpha3/devopsproject.go index 23de56b29..8be637df9 100644 --- a/pkg/client/informers/externalversions/devops/v1alpha3/devopsproject.go +++ b/pkg/client/informers/externalversions/devops/v1alpha3/devopsproject.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/devops/v1alpha3/interface.go b/pkg/client/informers/externalversions/devops/v1alpha3/interface.go index 90b80745a..cdb37eae7 100644 --- a/pkg/client/informers/externalversions/devops/v1alpha3/interface.go +++ b/pkg/client/informers/externalversions/devops/v1alpha3/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/devops/v1alpha3/pipeline.go b/pkg/client/informers/externalversions/devops/v1alpha3/pipeline.go index b1b6cce96..644e26587 100644 --- a/pkg/client/informers/externalversions/devops/v1alpha3/pipeline.go +++ b/pkg/client/informers/externalversions/devops/v1alpha3/pipeline.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index ae9c313aa..7f1733bf6 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 8e0008a15..d4a780d78 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/iam/interface.go b/pkg/client/informers/externalversions/iam/interface.go index 544e94cd4..e2313ee56 100644 --- a/pkg/client/informers/externalversions/iam/interface.go +++ b/pkg/client/informers/externalversions/iam/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/iam/v1alpha2/globalrole.go b/pkg/client/informers/externalversions/iam/v1alpha2/globalrole.go index c02b92031..0b0d3f115 100644 --- a/pkg/client/informers/externalversions/iam/v1alpha2/globalrole.go +++ b/pkg/client/informers/externalversions/iam/v1alpha2/globalrole.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/iam/v1alpha2/globalrolebinding.go b/pkg/client/informers/externalversions/iam/v1alpha2/globalrolebinding.go index d5376608b..3781cf7db 100644 --- a/pkg/client/informers/externalversions/iam/v1alpha2/globalrolebinding.go +++ b/pkg/client/informers/externalversions/iam/v1alpha2/globalrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/iam/v1alpha2/interface.go b/pkg/client/informers/externalversions/iam/v1alpha2/interface.go index f6765fd61..92e92c54e 100644 --- a/pkg/client/informers/externalversions/iam/v1alpha2/interface.go +++ b/pkg/client/informers/externalversions/iam/v1alpha2/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/iam/v1alpha2/user.go b/pkg/client/informers/externalversions/iam/v1alpha2/user.go index c2cfb157f..7e7679f16 100644 --- a/pkg/client/informers/externalversions/iam/v1alpha2/user.go +++ b/pkg/client/informers/externalversions/iam/v1alpha2/user.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/iam/v1alpha2/workspacerole.go b/pkg/client/informers/externalversions/iam/v1alpha2/workspacerole.go index be8b37540..10b31e9dc 100644 --- a/pkg/client/informers/externalversions/iam/v1alpha2/workspacerole.go +++ b/pkg/client/informers/externalversions/iam/v1alpha2/workspacerole.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/iam/v1alpha2/workspacerolebinding.go b/pkg/client/informers/externalversions/iam/v1alpha2/workspacerolebinding.go index 18b18b4d7..9d5faf32b 100644 --- a/pkg/client/informers/externalversions/iam/v1alpha2/workspacerolebinding.go +++ b/pkg/client/informers/externalversions/iam/v1alpha2/workspacerolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index c5c445ea5..1f337ed44 100644 --- a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/network/interface.go b/pkg/client/informers/externalversions/network/interface.go index 51959bb09..2d307e4a3 100644 --- a/pkg/client/informers/externalversions/network/interface.go +++ b/pkg/client/informers/externalversions/network/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/network/v1alpha1/interface.go b/pkg/client/informers/externalversions/network/v1alpha1/interface.go index 5185f51af..2155792da 100644 --- a/pkg/client/informers/externalversions/network/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/network/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/network/v1alpha1/namespacenetworkpolicy.go b/pkg/client/informers/externalversions/network/v1alpha1/namespacenetworkpolicy.go index 6e8deeafe..263a9bb80 100644 --- a/pkg/client/informers/externalversions/network/v1alpha1/namespacenetworkpolicy.go +++ b/pkg/client/informers/externalversions/network/v1alpha1/namespacenetworkpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/servicemesh/interface.go b/pkg/client/informers/externalversions/servicemesh/interface.go index f2098734b..c7cdc74db 100644 --- a/pkg/client/informers/externalversions/servicemesh/interface.go +++ b/pkg/client/informers/externalversions/servicemesh/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/servicemesh/v1alpha2/interface.go b/pkg/client/informers/externalversions/servicemesh/v1alpha2/interface.go index 904bda411..909885917 100644 --- a/pkg/client/informers/externalversions/servicemesh/v1alpha2/interface.go +++ b/pkg/client/informers/externalversions/servicemesh/v1alpha2/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/servicemesh/v1alpha2/servicepolicy.go b/pkg/client/informers/externalversions/servicemesh/v1alpha2/servicepolicy.go index b38295c0d..65382070f 100644 --- a/pkg/client/informers/externalversions/servicemesh/v1alpha2/servicepolicy.go +++ b/pkg/client/informers/externalversions/servicemesh/v1alpha2/servicepolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/servicemesh/v1alpha2/strategy.go b/pkg/client/informers/externalversions/servicemesh/v1alpha2/strategy.go index b95cff2dc..179b379ec 100644 --- a/pkg/client/informers/externalversions/servicemesh/v1alpha2/strategy.go +++ b/pkg/client/informers/externalversions/servicemesh/v1alpha2/strategy.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/tenant/interface.go b/pkg/client/informers/externalversions/tenant/interface.go index b455f0d0c..08a114d73 100644 --- a/pkg/client/informers/externalversions/tenant/interface.go +++ b/pkg/client/informers/externalversions/tenant/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/tenant/v1alpha1/interface.go b/pkg/client/informers/externalversions/tenant/v1alpha1/interface.go index ddddde363..991da0bb4 100644 --- a/pkg/client/informers/externalversions/tenant/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/tenant/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/tenant/v1alpha1/workspace.go b/pkg/client/informers/externalversions/tenant/v1alpha1/workspace.go index 0ddce9464..8428201a9 100644 --- a/pkg/client/informers/externalversions/tenant/v1alpha1/workspace.go +++ b/pkg/client/informers/externalversions/tenant/v1alpha1/workspace.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/tenant/v1alpha2/interface.go b/pkg/client/informers/externalversions/tenant/v1alpha2/interface.go index 8f4d4100f..c6eae9ee4 100644 --- a/pkg/client/informers/externalversions/tenant/v1alpha2/interface.go +++ b/pkg/client/informers/externalversions/tenant/v1alpha2/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/informers/externalversions/tenant/v1alpha2/workspacetemplate.go b/pkg/client/informers/externalversions/tenant/v1alpha2/workspacetemplate.go index e38d37cfc..93a34771c 100644 --- a/pkg/client/informers/externalversions/tenant/v1alpha2/workspacetemplate.go +++ b/pkg/client/informers/externalversions/tenant/v1alpha2/workspacetemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/cluster/v1alpha1/cluster.go b/pkg/client/listers/cluster/v1alpha1/cluster.go index 8408a6994..01a5fc078 100644 --- a/pkg/client/listers/cluster/v1alpha1/cluster.go +++ b/pkg/client/listers/cluster/v1alpha1/cluster.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/cluster/v1alpha1/expansion_generated.go b/pkg/client/listers/cluster/v1alpha1/expansion_generated.go index 2711d0848..8e0795525 100644 --- a/pkg/client/listers/cluster/v1alpha1/expansion_generated.go +++ b/pkg/client/listers/cluster/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/devops/v1alpha1/expansion_generated.go b/pkg/client/listers/devops/v1alpha1/expansion_generated.go index e048c7050..3dabf8476 100644 --- a/pkg/client/listers/devops/v1alpha1/expansion_generated.go +++ b/pkg/client/listers/devops/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/devops/v1alpha1/s2ibinary.go b/pkg/client/listers/devops/v1alpha1/s2ibinary.go index 99e9a7ede..9c8a880de 100644 --- a/pkg/client/listers/devops/v1alpha1/s2ibinary.go +++ b/pkg/client/listers/devops/v1alpha1/s2ibinary.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/devops/v1alpha1/s2ibuilder.go b/pkg/client/listers/devops/v1alpha1/s2ibuilder.go index 4e1ab1697..ccead0a2c 100644 --- a/pkg/client/listers/devops/v1alpha1/s2ibuilder.go +++ b/pkg/client/listers/devops/v1alpha1/s2ibuilder.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/devops/v1alpha1/s2ibuildertemplate.go b/pkg/client/listers/devops/v1alpha1/s2ibuildertemplate.go index d1d7ab543..06e794a0b 100644 --- a/pkg/client/listers/devops/v1alpha1/s2ibuildertemplate.go +++ b/pkg/client/listers/devops/v1alpha1/s2ibuildertemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/devops/v1alpha1/s2irun.go b/pkg/client/listers/devops/v1alpha1/s2irun.go index a9234bf67..1cd11628a 100644 --- a/pkg/client/listers/devops/v1alpha1/s2irun.go +++ b/pkg/client/listers/devops/v1alpha1/s2irun.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/devops/v1alpha3/devopsproject.go b/pkg/client/listers/devops/v1alpha3/devopsproject.go index 8174f1873..265a9274a 100644 --- a/pkg/client/listers/devops/v1alpha3/devopsproject.go +++ b/pkg/client/listers/devops/v1alpha3/devopsproject.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/devops/v1alpha3/expansion_generated.go b/pkg/client/listers/devops/v1alpha3/expansion_generated.go index 919ab74c3..28698a077 100644 --- a/pkg/client/listers/devops/v1alpha3/expansion_generated.go +++ b/pkg/client/listers/devops/v1alpha3/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/devops/v1alpha3/pipeline.go b/pkg/client/listers/devops/v1alpha3/pipeline.go index 2a26d23b6..7194c4127 100644 --- a/pkg/client/listers/devops/v1alpha3/pipeline.go +++ b/pkg/client/listers/devops/v1alpha3/pipeline.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/iam/v1alpha2/expansion_generated.go b/pkg/client/listers/iam/v1alpha2/expansion_generated.go index 7d88b069d..81164a3b0 100644 --- a/pkg/client/listers/iam/v1alpha2/expansion_generated.go +++ b/pkg/client/listers/iam/v1alpha2/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/iam/v1alpha2/globalrole.go b/pkg/client/listers/iam/v1alpha2/globalrole.go index b601db313..0cc49a30d 100644 --- a/pkg/client/listers/iam/v1alpha2/globalrole.go +++ b/pkg/client/listers/iam/v1alpha2/globalrole.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/iam/v1alpha2/globalrolebinding.go b/pkg/client/listers/iam/v1alpha2/globalrolebinding.go index ea549adc1..d5682c4bb 100644 --- a/pkg/client/listers/iam/v1alpha2/globalrolebinding.go +++ b/pkg/client/listers/iam/v1alpha2/globalrolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/iam/v1alpha2/user.go b/pkg/client/listers/iam/v1alpha2/user.go index 99090df75..30ff479e0 100644 --- a/pkg/client/listers/iam/v1alpha2/user.go +++ b/pkg/client/listers/iam/v1alpha2/user.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/iam/v1alpha2/workspacerole.go b/pkg/client/listers/iam/v1alpha2/workspacerole.go index 8e9e74965..d96b2afbd 100644 --- a/pkg/client/listers/iam/v1alpha2/workspacerole.go +++ b/pkg/client/listers/iam/v1alpha2/workspacerole.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/iam/v1alpha2/workspacerolebinding.go b/pkg/client/listers/iam/v1alpha2/workspacerolebinding.go index 175f17d31..fcf112d27 100644 --- a/pkg/client/listers/iam/v1alpha2/workspacerolebinding.go +++ b/pkg/client/listers/iam/v1alpha2/workspacerolebinding.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/network/v1alpha1/expansion_generated.go b/pkg/client/listers/network/v1alpha1/expansion_generated.go index 664c9488c..681ea94be 100644 --- a/pkg/client/listers/network/v1alpha1/expansion_generated.go +++ b/pkg/client/listers/network/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/network/v1alpha1/namespacenetworkpolicy.go b/pkg/client/listers/network/v1alpha1/namespacenetworkpolicy.go index f7451c9f1..78af4f5cb 100644 --- a/pkg/client/listers/network/v1alpha1/namespacenetworkpolicy.go +++ b/pkg/client/listers/network/v1alpha1/namespacenetworkpolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/servicemesh/v1alpha2/expansion_generated.go b/pkg/client/listers/servicemesh/v1alpha2/expansion_generated.go index ace9254ed..b85dad0a7 100644 --- a/pkg/client/listers/servicemesh/v1alpha2/expansion_generated.go +++ b/pkg/client/listers/servicemesh/v1alpha2/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/servicemesh/v1alpha2/servicepolicy.go b/pkg/client/listers/servicemesh/v1alpha2/servicepolicy.go index e1a77ec6f..ef5109174 100644 --- a/pkg/client/listers/servicemesh/v1alpha2/servicepolicy.go +++ b/pkg/client/listers/servicemesh/v1alpha2/servicepolicy.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/servicemesh/v1alpha2/strategy.go b/pkg/client/listers/servicemesh/v1alpha2/strategy.go index 8e24be869..aeb3fa734 100644 --- a/pkg/client/listers/servicemesh/v1alpha2/strategy.go +++ b/pkg/client/listers/servicemesh/v1alpha2/strategy.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/tenant/v1alpha1/expansion_generated.go b/pkg/client/listers/tenant/v1alpha1/expansion_generated.go index 18dda6df2..f97f7fdbd 100644 --- a/pkg/client/listers/tenant/v1alpha1/expansion_generated.go +++ b/pkg/client/listers/tenant/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/tenant/v1alpha1/workspace.go b/pkg/client/listers/tenant/v1alpha1/workspace.go index f1f3cc27b..0bf6a461a 100644 --- a/pkg/client/listers/tenant/v1alpha1/workspace.go +++ b/pkg/client/listers/tenant/v1alpha1/workspace.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/tenant/v1alpha2/expansion_generated.go b/pkg/client/listers/tenant/v1alpha2/expansion_generated.go index c70e01d7f..27e8cd815 100644 --- a/pkg/client/listers/tenant/v1alpha2/expansion_generated.go +++ b/pkg/client/listers/tenant/v1alpha2/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/client/listers/tenant/v1alpha2/workspacetemplate.go b/pkg/client/listers/tenant/v1alpha2/workspacetemplate.go index 94320ee51..de1c8ee0f 100644 --- a/pkg/client/listers/tenant/v1alpha2/workspacetemplate.go +++ b/pkg/client/listers/tenant/v1alpha2/workspacetemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 53ad7c534..b9a65069c 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 constants const ( @@ -38,7 +37,7 @@ const ( DisplayNameAnnotationKey = "kubesphere.io/alias-name" DescriptionAnnotationKey = "kubesphere.io/description" CreatorAnnotationKey = "kubesphere.io/creator" - UsernameAnnotationKey = "kubesphere.io/username" + UsernameLabelKey = "kubesphere.io/username" System = "system" OpenPitrixRuntimeAnnotationKey = "openpitrix_runtime" WorkspaceAdmin = "workspace-admin" diff --git a/pkg/controller/certificatesigningrequest/certificatesigningrequest_controller.go b/pkg/controller/certificatesigningrequest/certificatesigningrequest_controller.go index 484876c2f..350fd8df0 100644 --- a/pkg/controller/certificatesigningrequest/certificatesigningrequest_controller.go +++ b/pkg/controller/certificatesigningrequest/certificatesigningrequest_controller.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. @@ -221,7 +221,7 @@ func (c *Controller) reconcile(key string) error { } // csr create by kubesphere auto approve - if username := csr.Annotations[constants.UsernameAnnotationKey]; username != "" { + if username := csr.Labels[constants.UsernameLabelKey]; username != "" { err = c.Approve(csr) if err != nil { klog.Error(err) @@ -280,7 +280,7 @@ func (c *Controller) Approve(csr *certificatesv1beta1.CertificateSigningRequest) } func (c *Controller) UpdateKubeconfig(csr *certificatesv1beta1.CertificateSigningRequest) error { - username := csr.Annotations[constants.UsernameAnnotationKey] + username := csr.Labels[constants.UsernameLabelKey] err := c.kubeconfigOperator.UpdateKubeconfig(username, csr.Status.Certificate) diff --git a/pkg/controller/clusterrolebinding/clusterrolebinding_controller.go b/pkg/controller/clusterrolebinding/clusterrolebinding_controller.go index 7b4ff8592..2b6a43e45 100644 --- a/pkg/controller/clusterrolebinding/clusterrolebinding_controller.go +++ b/pkg/controller/clusterrolebinding/clusterrolebinding_controller.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. @@ -23,7 +23,7 @@ import ( "k8s.io/apimachinery/pkg/api/errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/informers" + k8sinformers "k8s.io/client-go/informers" rbacv1informers "k8s.io/client-go/informers/rbac/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" @@ -34,6 +34,7 @@ import ( "k8s.io/client-go/util/workqueue" "k8s.io/klog" iamv1alpha2 "kubesphere.io/kubesphere/pkg/apis/iam/v1alpha2" + ksinformers "kubesphere.io/kubesphere/pkg/client/informers/externalversions" "kubesphere.io/kubesphere/pkg/models/kubectl" "time" ) @@ -63,7 +64,7 @@ type Controller struct { kubectlOperator kubectl.Interface } -func NewController(k8sClient kubernetes.Interface, informerFactory informers.SharedInformerFactory) *Controller { +func NewController(k8sClient kubernetes.Interface, k8sInformer k8sinformers.SharedInformerFactory, ksInformer ksinformers.SharedInformerFactory) *Controller { // Create event broadcaster // Add sample-controller types to the default Kubernetes Scheme so Events can be // logged for sample-controller types. @@ -73,13 +74,13 @@ func NewController(k8sClient kubernetes.Interface, informerFactory informers.Sha eventBroadcaster.StartLogging(klog.Infof) eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: k8sClient.CoreV1().Events("")}) recorder := eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: controllerName}) - informer := informerFactory.Rbac().V1().ClusterRoleBindings() + informer := k8sInformer.Rbac().V1().ClusterRoleBindings() ctl := &Controller{ k8sClient: k8sClient, informer: informer, lister: informer.Lister(), synced: informer.Informer().HasSynced, - kubectlOperator: kubectl.NewOperator(k8sClient, informerFactory), + kubectlOperator: kubectl.NewOperator(k8sClient, k8sInformer, ksInformer), workqueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "ClusterRoleBinding"), recorder: recorder, } diff --git a/pkg/controller/job/job_controller.go b/pkg/controller/job/job_controller.go index b4257f8a4..3da602b21 100644 --- a/pkg/controller/job/job_controller.go +++ b/pkg/controller/job/job_controller.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 job import ( diff --git a/pkg/controller/job/job_controller_test.go b/pkg/controller/job/job_controller_test.go index 2edb598f1..0a96111e9 100644 --- a/pkg/controller/job/job_controller_test.go +++ b/pkg/controller/job/job_controller_test.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 job import ( diff --git a/pkg/controller/job/types.go b/pkg/controller/job/types.go index 999df657a..3f0342bfc 100644 --- a/pkg/controller/job/types.go +++ b/pkg/controller/job/types.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 job import "time" diff --git a/pkg/controller/namespace/namespace_controller.go b/pkg/controller/namespace/namespace_controller.go index e3cdd94df..8b0e332b4 100644 --- a/pkg/controller/namespace/namespace_controller.go +++ b/pkg/controller/namespace/namespace_controller.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 namespace diff --git a/pkg/controller/namespace/namespace_controller_suite_test.go b/pkg/controller/namespace/namespace_controller_suite_test.go index 96ac00c93..93fef48cd 100644 --- a/pkg/controller/namespace/namespace_controller_suite_test.go +++ b/pkg/controller/namespace/namespace_controller_suite_test.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 namespace diff --git a/pkg/controller/namespace/namespace_controller_test.go b/pkg/controller/namespace/namespace_controller_test.go index 5dbadba54..945a61ad4 100644 --- a/pkg/controller/namespace/namespace_controller_test.go +++ b/pkg/controller/namespace/namespace_controller_test.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 namespace diff --git a/pkg/controller/user/user_controller.go b/pkg/controller/user/user_controller.go index a47833d2b..6505fc78b 100644 --- a/pkg/controller/user/user_controller.go +++ b/pkg/controller/user/user_controller.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/controller/user/user_controller_test.go b/pkg/controller/user/user_controller_test.go index c5277bd23..a6de14d2f 100644 --- a/pkg/controller/user/user_controller_test.go +++ b/pkg/controller/user/user_controller_test.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/controller/user/user_webhook.go b/pkg/controller/user/user_webhook.go index 748e1f655..c53861096 100644 --- a/pkg/controller/user/user_webhook.go +++ b/pkg/controller/user/user_webhook.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 user diff --git a/pkg/controller/workspace/workspace_controller.go b/pkg/controller/workspace/workspace_controller.go index 5792d226e..acb0d5bba 100644 --- a/pkg/controller/workspace/workspace_controller.go +++ b/pkg/controller/workspace/workspace_controller.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 diff --git a/pkg/controller/workspace/workspace_controller_suite_test.go b/pkg/controller/workspace/workspace_controller_suite_test.go index 9fe761d0c..edc3396b6 100644 --- a/pkg/controller/workspace/workspace_controller_suite_test.go +++ b/pkg/controller/workspace/workspace_controller_suite_test.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 diff --git a/pkg/controller/workspace/workspace_controller_test.go b/pkg/controller/workspace/workspace_controller_test.go index 6f0345f56..6915f9731 100644 --- a/pkg/controller/workspace/workspace_controller_test.go +++ b/pkg/controller/workspace/workspace_controller_test.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 diff --git a/pkg/informers/informers.go b/pkg/informers/informers.go index d6f38a49b..4847d43c3 100644 --- a/pkg/informers/informers.go +++ b/pkg/informers/informers.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 informers import ( diff --git a/pkg/kapis/config/v1alpha2/register.go b/pkg/kapis/config/v1alpha2/register.go index 96845e5ad..f73d5efe2 100644 --- a/pkg/kapis/config/v1alpha2/register.go +++ b/pkg/kapis/config/v1alpha2/register.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 diff --git a/pkg/kapis/iam/v1alpha2/register.go b/pkg/kapis/iam/v1alpha2/register.go index ed9995740..a8b109ac2 100644 --- a/pkg/kapis/iam/v1alpha2/register.go +++ b/pkg/kapis/iam/v1alpha2/register.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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/kapis/logging/group.go b/pkg/kapis/logging/group.go deleted file mode 100644 index 4cc500d07..000000000 --- a/pkg/kapis/logging/group.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2019 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 logging contains logging API versions -package logging diff --git a/pkg/kapis/logging/v1alpha2/handler.go b/pkg/kapis/logging/v1alpha2/handler.go deleted file mode 100644 index 585099466..000000000 --- a/pkg/kapis/logging/v1alpha2/handler.go +++ /dev/null @@ -1,156 +0,0 @@ -package v1alpha2 - -import ( - "github.com/emicklei/go-restful" - "kubesphere.io/kubesphere/pkg/api" - "kubesphere.io/kubesphere/pkg/models/logging" - "kubesphere.io/kubesphere/pkg/simple/client/k8s" - loggingclient "kubesphere.io/kubesphere/pkg/simple/client/logging" - util "kubesphere.io/kubesphere/pkg/utils/stringutils" - "strconv" - "strings" - "time" -) - -const ( - LevelCluster = iota - LevelContainer - - // query type, default to `query` - TypeStat = "statistics" - TypeHist = "histogram" - TypeExport = "export" - - Ascending = "asc" - Descending = "desc" -) - -type handler struct { - k k8s.Client - lo logging.LoggingOperator -} - -func newHandler(k k8s.Client, l loggingclient.Interface) *handler { - return &handler{k, logging.NewLoggingOperator(l)} -} - -func (h handler) handleClusterQuery(req *restful.Request, resp *restful.Response) { - h.get(req, LevelCluster, resp) -} - -func (h handler) handleContainerQuery(req *restful.Request, resp *restful.Response) { - h.get(req, LevelContainer, resp) -} - -func (h handler) get(req *restful.Request, lvl int, resp *restful.Response) { - typ := req.QueryParameter("type") - - noHit, sf, err := h.newSearchFilter(req, lvl) - if err != nil { - api.HandleBadRequest(resp, nil, err) - } - if noHit { - handleNoHit(typ, resp) - return - } - - switch typ { - case TypeStat: - res, err := h.lo.GetCurrentStats(sf) - if err != nil { - api.HandleInternalError(resp, nil, err) - } - resp.WriteAsJson(res) - case TypeHist: - interval := req.QueryParameter("interval") - res, err := h.lo.CountLogsByInterval(sf, interval) - if err != nil { - api.HandleInternalError(resp, nil, err) - } - resp.WriteAsJson(res) - case TypeExport: - resp.Header().Set(restful.HEADER_ContentType, "text/plain") - resp.Header().Set("Content-Disposition", "attachment") - err := h.lo.ExportLogs(sf, resp.ResponseWriter) - if err != nil { - api.HandleInternalError(resp, nil, err) - } - default: - from, _ := strconv.ParseInt(req.QueryParameter("from"), 10, 64) - size, err := strconv.ParseInt(req.QueryParameter("size"), 10, 64) - if err != nil { - size = 10 - } - order := req.QueryParameter("sort") - if order != Ascending { - order = Descending - } - res, err := h.lo.SearchLogs(sf, from, size, order) - if err != nil { - api.HandleInternalError(resp, nil, err) - } - resp.WriteAsJson(res) - } -} - -func (h handler) newSearchFilter(req *restful.Request, level int) (bool, loggingclient.SearchFilter, error) { - var sf loggingclient.SearchFilter - - switch level { - case LevelCluster: - sf.NamespaceFilter = h.intersect( - util.Split(req.QueryParameter("namespaces"), ","), - util.Split(strings.ToLower(req.QueryParameter("namespace_query")), ","), - util.Split(req.QueryParameter("workspaces"), ","), - util.Split(strings.ToLower(req.QueryParameter("workspace_query")), ",")) - sf.WorkloadFilter = util.Split(req.QueryParameter("workloads"), ",") - sf.WorkloadSearch = util.Split(req.QueryParameter("workload_query"), ",") - sf.PodFilter = util.Split(req.QueryParameter("pods"), ",") - sf.PodSearch = util.Split(req.QueryParameter("pod_query"), ",") - sf.ContainerFilter = util.Split(req.QueryParameter("containers"), ",") - sf.ContainerSearch = util.Split(req.QueryParameter("container_query"), ",") - case LevelContainer: - sf.NamespaceFilter = h.withCreationTime(req.PathParameter("namespace")) - sf.PodFilter = []string{req.PathParameter("pod")} - sf.ContainerFilter = []string{req.PathParameter("container")} - } - - sf.LogSearch = util.Split(req.QueryParameter("log_query"), ",") - - var err error - now := time.Now() - // If time is not given, set it to now. - if req.QueryParameter("start_time") == "" { - sf.Starttime = now - } else { - sf.Starttime, err = time.Parse(time.RFC3339, req.QueryParameter("start_time")) - if err != nil { - return false, sf, err - } - } - if req.QueryParameter("end_time") == "" { - sf.Endtime = now - } else { - sf.Endtime, err = time.Parse(time.RFC3339, req.QueryParameter("end_time")) - if err != nil { - return false, sf, err - } - } - - return len(sf.NamespaceFilter) == 0, sf, nil -} - -func handleNoHit(typ string, resp *restful.Response) { - switch typ { - case TypeStat: - resp.WriteAsJson(new(loggingclient.Statistics)) - case TypeHist: - resp.WriteAsJson(new(loggingclient.Histogram)) - case TypeExport: - resp.Header().Set(restful.HEADER_ContentType, "text/plain") - resp.Header().Set("Content-Disposition", "attachment") - resp.Write(nil) - default: - resp.WriteAsJson(new(loggingclient.Logs)) - } -} diff --git a/pkg/kapis/logging/v1alpha2/helper.go b/pkg/kapis/logging/v1alpha2/helper.go deleted file mode 100644 index 1acb22a9e..000000000 --- a/pkg/kapis/logging/v1alpha2/helper.go +++ /dev/null @@ -1,56 +0,0 @@ -package v1alpha2 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/klog" - "kubesphere.io/kubesphere/pkg/constants" - "kubesphere.io/kubesphere/pkg/utils/stringutils" - "strings" - "time" -) - -func (h handler) intersect(nsFilter []string, nsSearch []string, wsFilter []string, wsSearch []string) map[string]time.Time { - nsList, err := h.k.Kubernetes().CoreV1().Namespaces().List(v1.ListOptions{}) - if err != nil { - klog.Errorf("failed to list namespace, error: %s", err) - return nil - } - - inner := make(map[string]time.Time) - - // if no search condition is set on both namespace and workspace, - // then return all namespaces - if nsSearch == nil && nsFilter == nil && wsSearch == nil && wsFilter == nil { - for _, ns := range nsList.Items { - inner[ns.Name] = ns.CreationTimestamp.Time - } - } else { - for _, ns := range nsList.Items { - if stringutils.StringIn(ns.Name, nsFilter) || - stringutils.StringIn(ns.Annotations[constants.WorkspaceLabelKey], wsFilter) || - containsIn(ns.Name, nsSearch) || - containsIn(ns.Annotations[constants.WorkspaceLabelKey], wsSearch) { - inner[ns.Name] = ns.CreationTimestamp.Time - } - } - } - - return inner -} - -func containsIn(str string, subStrs []string) bool { - for _, sub := range subStrs { - if strings.Contains(str, sub) { - return true - } - } - return false -} - -func (h handler) withCreationTime(name string) map[string]time.Time { - ns, err := h.k.Kubernetes().CoreV1().Namespaces().Get(name, v1.GetOptions{}) - if err == nil { - return map[string]time.Time{name: ns.CreationTimestamp.Time} - } - return nil -} diff --git a/pkg/kapis/logging/v1alpha2/register.go b/pkg/kapis/logging/v1alpha2/register.go deleted file mode 100644 index efd268d70..000000000 --- a/pkg/kapis/logging/v1alpha2/register.go +++ /dev/null @@ -1,93 +0,0 @@ -/* - - Copyright 2019 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 ( - "github.com/emicklei/go-restful" - "github.com/emicklei/go-restful-openapi" - "k8s.io/apimachinery/pkg/runtime/schema" - "kubesphere.io/kubesphere/pkg/api/logging/v1alpha2" - "kubesphere.io/kubesphere/pkg/apiserver/runtime" - "kubesphere.io/kubesphere/pkg/constants" - "kubesphere.io/kubesphere/pkg/simple/client/k8s" - "kubesphere.io/kubesphere/pkg/simple/client/logging" - "net/http" -) - -const ( - GroupName = "logging.kubesphere.io" - RespOK = "ok" -) - -var GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"} - -func AddToContainer(c *restful.Container, k8sClient k8s.Client, loggingClient logging.Interface) error { - ws := runtime.NewWebService(GroupVersion) - - h := newHandler(k8sClient, loggingClient) - - ws.Route(ws.GET("/cluster"). - To(h.handleClusterQuery). - Doc("Query logs against the cluster."). - Param(ws.QueryParameter("operation", "Operation type. This can be one of four types: query (for querying logs), statistics (for retrieving statistical data), histogram (for displaying log count by time interval) and export (for exporting logs). Defaults to query.").DefaultValue("query").DataType("string").Required(false)). - Param(ws.QueryParameter("workspaces", "A comma-separated list of workspaces. This field restricts the query to specified workspaces. For example, the following filter matches the workspace my-ws and demo-ws: `my-ws,demo-ws`").DataType("string").Required(false)). - Param(ws.QueryParameter("workspace_query", "A comma-separated list of keywords. Differing from **workspaces**, this field performs fuzzy matching on workspaces. For example, the following value limits the query to workspaces whose name contains the word my(My,MY,...) *OR* demo(Demo,DemO,...): `my,demo`.").DataType("string").Required(false)). - Param(ws.QueryParameter("namespaces", "A comma-separated list of namespaces. This field restricts the query to specified namespaces. For example, the following filter matches the namespace my-ns and demo-ns: `my-ns,demo-ns`").DataType("string").Required(false)). - Param(ws.QueryParameter("namespace_query", "A comma-separated list of keywords. Differing from **namespaces**, this field performs fuzzy matching on namespaces. For example, the following value limits the query to namespaces whose name contains the word my(My,MY,...) *OR* demo(Demo,DemO,...): `my,demo`.").DataType("string").Required(false)). - Param(ws.QueryParameter("workloads", "A comma-separated list of workloads. This field restricts the query to specified workloads. For example, the following filter matches the workload my-wl and demo-wl: `my-wl,demo-wl`").DataType("string").Required(false)). - Param(ws.QueryParameter("workload_query", "A comma-separated list of keywords. Differing from **workloads**, this field performs fuzzy matching on workloads. For example, the following value limits the query to workloads whose name contains the word my(My,MY,...) *OR* demo(Demo,DemO,...): `my,demo`.").DataType("string").Required(false)). - Param(ws.QueryParameter("pods", "A comma-separated list of pods. This field restricts the query to specified pods. For example, the following filter matches the pod my-po and demo-po: `my-po,demo-po`").DataType("string").Required(false)). - Param(ws.QueryParameter("pod_query", "A comma-separated list of keywords. Differing from **pods**, this field performs fuzzy matching on pods. For example, the following value limits the query to pods whose name contains the word my(My,MY,...) *OR* demo(Demo,DemO,...): `my,demo`.").DataType("string").Required(false)). - Param(ws.QueryParameter("containers", "A comma-separated list of containers. This field restricts the query to specified containers. For example, the following filter matches the container my-cont and demo-cont: `my-cont,demo-cont`").DataType("string").Required(false)). - Param(ws.QueryParameter("container_query", "A comma-separated list of keywords. Differing from **containers**, this field performs fuzzy matching on containers. For example, the following value limits the query to containers whose name contains the word my(My,MY,...) *OR* demo(Demo,DemO,...): `my,demo`.").DataType("string").Required(false)). - Param(ws.QueryParameter("log_query", "A comma-separated list of keywords. The query returns logs which contain at least one keyword. Case-insensitive matching. For example, if the field is set to `err,INFO`, the query returns any log containing err(ERR,Err,...) *OR* INFO(info,InFo,...).").DataType("string").Required(false)). - Param(ws.QueryParameter("interval", "Time interval. It requires **operation** is set to histogram. The format is [0-9]+[smhdwMqy]. Defaults to 15m (i.e. 15 min).").DefaultValue("15m").DataType("string").Required(false)). - Param(ws.QueryParameter("start_time", "Start time of query. Default to 0. The format is a string representing milliseconds since the epoch, eg. 1559664000000.").DataType("string").Required(false)). - Param(ws.QueryParameter("end_time", "End time of query. Default to now. The format is a string representing milliseconds since the epoch, eg. 1559664000000.").DataType("string").Required(false)). - Param(ws.QueryParameter("sort", "Sort order. One of acs, desc. This field sorts logs by timestamp.").DataType("string").DefaultValue("desc").Required(false)). - Param(ws.QueryParameter("from", "The offset from the result set. This field returns query results from the specified offset. It requires **operation** is set to query. Defaults to 0 (i.e. from the beginning of the result set).").DataType("integer").DefaultValue("0").Required(false)). - Param(ws.QueryParameter("size", "Size of result to return. It requires **operation** is set to query. Defaults to 10 (i.e. 10 log records).").DataType("integer").DefaultValue("10").Required(false)). - Metadata(restfulspec.KeyOpenAPITags, []string{constants.LogQueryTag}). - Writes(v1alpha2.APIResponse{}). - Returns(http.StatusOK, RespOK, v1alpha2.APIResponse{})). - Consumes(restful.MIME_JSON, restful.MIME_XML). - Produces(restful.MIME_JSON, "text/plain") - - ws.Route(ws.GET("/namespaces/{namespace}/pods/{pod}/containers/{container}"). - To(h.handleContainerQuery). - Doc("Query logs against the specific container."). - Param(ws.PathParameter("namespace", "The name of the namespace.").DataType("string").Required(true)). - Param(ws.PathParameter("pod", "Pod name.").DataType("string").Required(true)). - Param(ws.PathParameter("container", "Container name.").DataType("string").Required(true)). - Param(ws.QueryParameter("operation", "Operation type. This can be one of four types: query (for querying logs), statistics (for retrieving statistical data), histogram (for displaying log count by time interval) and export (for exporting logs). Defaults to query.").DefaultValue("query").DataType("string").Required(false)). - Param(ws.QueryParameter("log_query", "A comma-separated list of keywords. The query returns logs which contain at least one keyword. Case-insensitive matching. For example, if the field is set to `err,INFO`, the query returns any log containing err(ERR,Err,...) *OR* INFO(info,InFo,...).").DataType("string").Required(false)). - Param(ws.QueryParameter("interval", "Time interval. It requires **operation** is set to histogram. The format is [0-9]+[smhdwMqy]. Defaults to 15m (i.e. 15 min).").DefaultValue("15m").DataType("string").Required(false)). - Param(ws.QueryParameter("start_time", "Start time of query. Default to 0. The format is a string representing milliseconds since the epoch, eg. 1559664000000.").DataType("string").Required(false)). - Param(ws.QueryParameter("end_time", "End time of query. Default to now. The format is a string representing milliseconds since the epoch, eg. 1559664000000.").DataType("string").Required(false)). - Param(ws.QueryParameter("sort", "Sort order. One of acs, desc. This field sorts logs by timestamp.").DataType("string").DefaultValue("desc").Required(false)). - Param(ws.QueryParameter("from", "The offset from the result set. This field returns query results from the specified offset. It requires **operation** is set to query. Defaults to 0 (i.e. from the beginning of the result set).").DataType("integer").DefaultValue("0").Required(false)). - Param(ws.QueryParameter("size", "Size of result to return. It requires **operation** is set to query. Defaults to 10 (i.e. 10 log records).").DataType("integer").DefaultValue("10").Required(false)). - Metadata(restfulspec.KeyOpenAPITags, []string{constants.LogQueryTag}). - Writes(v1alpha2.APIResponse{}). - Returns(http.StatusOK, RespOK, v1alpha2.APIResponse{})). - Consumes(restful.MIME_JSON, restful.MIME_XML). - Produces(restful.MIME_JSON, restful.MIME_OCTET) - - c.Add(ws) - return nil -} diff --git a/pkg/kapis/oauth/handler.go b/pkg/kapis/oauth/handler.go index 276dac7f3..0c71fc4fc 100644 --- a/pkg/kapis/oauth/handler.go +++ b/pkg/kapis/oauth/handler.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 oauth diff --git a/pkg/kapis/oauth/register.go b/pkg/kapis/oauth/register.go index 179fa653e..acd6cf820 100644 --- a/pkg/kapis/oauth/register.go +++ b/pkg/kapis/oauth/register.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 oauth diff --git a/pkg/kapis/openpitrix/v1/register.go b/pkg/kapis/openpitrix/v1/register.go index c75b71e67..e52af6ac5 100644 --- a/pkg/kapis/openpitrix/v1/register.go +++ b/pkg/kapis/openpitrix/v1/register.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2019 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 2019 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 v1 import ( diff --git a/pkg/kapis/operations/v1alpha2/register.go b/pkg/kapis/operations/v1alpha2/register.go index d6f60805b..321484f57 100644 --- a/pkg/kapis/operations/v1alpha2/register.go +++ b/pkg/kapis/operations/v1alpha2/register.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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/kapis/resources/group.go b/pkg/kapis/resources/group.go index 07be6e161..2382cba8d 100644 --- a/pkg/kapis/resources/group.go +++ b/pkg/kapis/resources/group.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/pkg/kapis/resources/v1alpha2/handler.go b/pkg/kapis/resources/v1alpha2/handler.go index 2ee6b2a82..41fdf1bae 100644 --- a/pkg/kapis/resources/v1alpha2/handler.go +++ b/pkg/kapis/resources/v1alpha2/handler.go @@ -49,7 +49,8 @@ func newResourceHandler(k8sClient kubernetes.Interface, factory informers.Inform gitVerifier: git.NewGitVerifier(factory.KubernetesSharedInformerFactory()), registryGetter: registries.NewRegistryGetter(factory.KubernetesSharedInformerFactory()), kubeconfigOperator: kubeconfig.NewOperator(k8sClient, nil, masterURL), - kubectlOperator: kubectl.NewOperator(k8sClient, factory.KubernetesSharedInformerFactory()), + kubectlOperator: kubectl.NewOperator(k8sClient, factory.KubernetesSharedInformerFactory(), + factory.KubeSphereSharedInformerFactory()), } } diff --git a/pkg/kapis/resources/v1alpha2/register.go b/pkg/kapis/resources/v1alpha2/register.go index 39b203866..fda31a218 100644 --- a/pkg/kapis/resources/v1alpha2/register.go +++ b/pkg/kapis/resources/v1alpha2/register.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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/kapis/resources/v1alpha3/register.go b/pkg/kapis/resources/v1alpha3/register.go index fe81be8ab..2fd69fa54 100644 --- a/pkg/kapis/resources/v1alpha3/register.go +++ b/pkg/kapis/resources/v1alpha3/register.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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/tenant/v1alpha2/handler.go b/pkg/kapis/tenant/v1alpha2/handler.go index 162bd3138..e267eb9be 100644 --- a/pkg/kapis/tenant/v1alpha2/handler.go +++ b/pkg/kapis/tenant/v1alpha2/handler.go @@ -9,6 +9,7 @@ import ( "k8s.io/klog" "kubesphere.io/kubesphere/pkg/api" eventsv1alpha1 "kubesphere.io/kubesphere/pkg/api/events/v1alpha1" + loggingv1alpha2 "kubesphere.io/kubesphere/pkg/api/logging/v1alpha2" tenantv1alpha2 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha2" "kubesphere.io/kubesphere/pkg/apiserver/query" "kubesphere.io/kubesphere/pkg/apiserver/request" @@ -17,16 +18,17 @@ import ( "kubesphere.io/kubesphere/pkg/models/tenant" servererr "kubesphere.io/kubesphere/pkg/server/errors" "kubesphere.io/kubesphere/pkg/simple/client/events" + "kubesphere.io/kubesphere/pkg/simple/client/logging" ) type tenantHandler struct { tenant tenant.Interface } -func newTenantHandler(factory informers.InformerFactory, k8sclient kubernetes.Interface, ksclient kubesphere.Interface, evtsClient events.Client) *tenantHandler { +func newTenantHandler(factory informers.InformerFactory, k8sclient kubernetes.Interface, ksclient kubesphere.Interface, evtsClient events.Client, loggingClient logging.Interface) *tenantHandler { return &tenantHandler{ - tenant: tenant.New(factory, k8sclient, ksclient, evtsClient), + tenant: tenant.New(factory, k8sclient, ksclient, evtsClient, loggingClient), } } @@ -245,3 +247,38 @@ func (h *tenantHandler) Events(req *restful.Request, resp *restful.Response) { resp.WriteEntity(result) } + +func (h *tenantHandler) QueryLogs(req *restful.Request, resp *restful.Response) { + user, ok := request.UserFrom(req.Request.Context()) + if !ok { + err := fmt.Errorf("cannot obtain user info") + klog.Errorln(err) + api.HandleForbidden(resp, req, err) + return + } + queryParam, err := loggingv1alpha2.ParseQueryParameter(req) + if err != nil { + klog.Errorln(err) + api.HandleInternalError(resp, req, err) + return + } + + if queryParam.Operation == loggingv1alpha2.OperationExport { + resp.Header().Set(restful.HEADER_ContentType, "text/plain") + resp.Header().Set("Content-Disposition", "attachment") + err := h.tenant.ExportLogs(user, queryParam, resp) + if err != nil { + klog.Errorln(err) + api.HandleInternalError(resp, req, err) + return + } + } else { + result, err := h.tenant.QueryLogs(user, queryParam) + if err != nil { + klog.Errorln(err) + api.HandleInternalError(resp, req, err) + return + } + resp.WriteAsJson(result) + } +} diff --git a/pkg/kapis/tenant/v1alpha2/register.go b/pkg/kapis/tenant/v1alpha2/register.go index 3e5c3a579..4a924abb5 100644 --- a/pkg/kapis/tenant/v1alpha2/register.go +++ b/pkg/kapis/tenant/v1alpha2/register.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 ( @@ -25,6 +24,7 @@ import ( "k8s.io/client-go/kubernetes" "kubesphere.io/kubesphere/pkg/api" eventsv1alpha1 "kubesphere.io/kubesphere/pkg/api/events/v1alpha1" + loggingv1alpha2 "kubesphere.io/kubesphere/pkg/api/logging/v1alpha2" tenantv1alpha2 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha2" "kubesphere.io/kubesphere/pkg/apiserver/runtime" kubesphere "kubesphere.io/kubesphere/pkg/client/clientset/versioned" @@ -33,6 +33,7 @@ import ( "kubesphere.io/kubesphere/pkg/models" "kubesphere.io/kubesphere/pkg/server/errors" "kubesphere.io/kubesphere/pkg/simple/client/events" + "kubesphere.io/kubesphere/pkg/simple/client/logging" "net/http" ) @@ -42,9 +43,9 @@ const ( var GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"} -func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8sclient kubernetes.Interface, ksclient kubesphere.Interface, evtsClient events.Client) error { +func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8sclient kubernetes.Interface, ksclient kubesphere.Interface, evtsClient events.Client, loggingClient logging.Interface) error { ws := runtime.NewWebService(GroupVersion) - handler := newTenantHandler(factory, k8sclient, ksclient, evtsClient) + handler := newTenantHandler(factory, k8sclient, ksclient, evtsClient, loggingClient) ws.Route(ws.POST("/workspaces"). To(handler.CreateWorkspace). @@ -96,7 +97,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s ws.Route(ws.GET("/events"). To(handler.Events). Doc("Query events against the cluster"). - Param(ws.QueryParameter("operation", "Operation type. This can be one of four types: `query` (for querying events), `statistics` (for retrieving statistical data), `histogram` (for displaying events count by time interval). Defaults to query.").DefaultValue("query")). + Param(ws.QueryParameter("operation", "Operation type. This can be one of three types: `query` (for querying events), `statistics` (for retrieving statistical data), `histogram` (for displaying events count by time interval). Defaults to query.").DefaultValue("query")). Param(ws.QueryParameter("workspace_filter", "A comma-separated list of workspaces. This field restricts the query to specified workspaces. For example, the following filter matches the workspace my-ws and demo-ws: `my-ws,demo-ws`.")). Param(ws.QueryParameter("workspace_search", "A comma-separated list of keywords. Differing from **workspace_filter**, this field performs fuzzy matching on workspaces. For example, the following value limits the query to workspaces whose name contains the word my(My,MY,...) *OR* demo(Demo,DemO,...): `my,demo`.")). Param(ws.QueryParameter("involved_object_namespace_filter", "A comma-separated list of namespaces. This field restricts the query to specified `involvedObject.namespace`.")). @@ -118,6 +119,33 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s Writes(eventsv1alpha1.APIResponse{}). Returns(http.StatusOK, api.StatusOK, eventsv1alpha1.APIResponse{})) + ws.Route(ws.GET("/logs"). + To(handler.QueryLogs). + Doc("Query logs against the cluster."). + Param(ws.QueryParameter("operation", "Operation type. This can be one of four types: query (for querying logs), statistics (for retrieving statistical data), histogram (for displaying log count by time interval) and export (for exporting logs). Defaults to query.").DefaultValue("query").DataType("string").Required(false)). + Param(ws.QueryParameter("workspaces", "A comma-separated list of workspaces. This field restricts the query to specified workspaces. For example, the following filter matches the workspace my-ws and demo-ws: `my-ws,demo-ws`").DataType("string").Required(false)). + Param(ws.QueryParameter("workspace_query", "A comma-separated list of keywords. Differing from **workspaces**, this field performs fuzzy matching on workspaces. For example, the following value limits the query to workspaces whose name contains the word my(My,MY,...) *OR* demo(Demo,DemO,...): `my,demo`.").DataType("string").Required(false)). + Param(ws.QueryParameter("namespaces", "A comma-separated list of namespaces. This field restricts the query to specified namespaces. For example, the following filter matches the namespace my-ns and demo-ns: `my-ns,demo-ns`").DataType("string").Required(false)). + Param(ws.QueryParameter("namespace_query", "A comma-separated list of keywords. Differing from **namespaces**, this field performs fuzzy matching on namespaces. For example, the following value limits the query to namespaces whose name contains the word my(My,MY,...) *OR* demo(Demo,DemO,...): `my,demo`.").DataType("string").Required(false)). + Param(ws.QueryParameter("workloads", "A comma-separated list of workloads. This field restricts the query to specified workloads. For example, the following filter matches the workload my-wl and demo-wl: `my-wl,demo-wl`").DataType("string").Required(false)). + Param(ws.QueryParameter("workload_query", "A comma-separated list of keywords. Differing from **workloads**, this field performs fuzzy matching on workloads. For example, the following value limits the query to workloads whose name contains the word my(My,MY,...) *OR* demo(Demo,DemO,...): `my,demo`.").DataType("string").Required(false)). + Param(ws.QueryParameter("pods", "A comma-separated list of pods. This field restricts the query to specified pods. For example, the following filter matches the pod my-po and demo-po: `my-po,demo-po`").DataType("string").Required(false)). + Param(ws.QueryParameter("pod_query", "A comma-separated list of keywords. Differing from **pods**, this field performs fuzzy matching on pods. For example, the following value limits the query to pods whose name contains the word my(My,MY,...) *OR* demo(Demo,DemO,...): `my,demo`.").DataType("string").Required(false)). + Param(ws.QueryParameter("containers", "A comma-separated list of containers. This field restricts the query to specified containers. For example, the following filter matches the container my-cont and demo-cont: `my-cont,demo-cont`").DataType("string").Required(false)). + Param(ws.QueryParameter("container_query", "A comma-separated list of keywords. Differing from **containers**, this field performs fuzzy matching on containers. For example, the following value limits the query to containers whose name contains the word my(My,MY,...) *OR* demo(Demo,DemO,...): `my,demo`.").DataType("string").Required(false)). + Param(ws.QueryParameter("log_query", "A comma-separated list of keywords. The query returns logs which contain at least one keyword. Case-insensitive matching. For example, if the field is set to `err,INFO`, the query returns any log containing err(ERR,Err,...) *OR* INFO(info,InFo,...).").DataType("string").Required(false)). + Param(ws.QueryParameter("interval", "Time interval. It requires **operation** is set to histogram. The format is [0-9]+[smhdwMqy]. Defaults to 15m (i.e. 15 min).").DefaultValue("15m").DataType("string").Required(false)). + Param(ws.QueryParameter("start_time", "Start time of query. Default to 0. The format is a string representing seconds since the epoch, eg. 1559664000.").DataType("string").Required(false)). + Param(ws.QueryParameter("end_time", "End time of query. Default to now. The format is a string representing seconds since the epoch, eg. 1559664000.").DataType("string").Required(false)). + Param(ws.QueryParameter("sort", "Sort order. One of asc, desc. This field sorts logs by timestamp.").DataType("string").DefaultValue("desc").Required(false)). + Param(ws.QueryParameter("from", "The offset from the result set. This field returns query results from the specified offset. It requires **operation** is set to query. Defaults to 0 (i.e. from the beginning of the result set).").DataType("integer").DefaultValue("0").Required(false)). + Param(ws.QueryParameter("size", "Size of result to return. It requires **operation** is set to query. Defaults to 10 (i.e. 10 log records).").DataType("integer").DefaultValue("10").Required(false)). + Metadata(restfulspec.KeyOpenAPITags, []string{constants.LogQueryTag}). + Writes(loggingv1alpha2.APIResponse{}). + Returns(http.StatusOK, api.StatusOK, loggingv1alpha2.APIResponse{})). + Consumes(restful.MIME_JSON, restful.MIME_XML). + Produces(restful.MIME_JSON, "text/plain") + c.Add(ws) return nil } diff --git a/pkg/kapis/terminal/v1alpha2/register.go b/pkg/kapis/terminal/v1alpha2/register.go index 7997ccfae..2a8b815e8 100644 --- a/pkg/kapis/terminal/v1alpha2/register.go +++ b/pkg/kapis/terminal/v1alpha2/register.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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/components/components.go b/pkg/models/components/components.go index bd27a6f20..dc0bc9f62 100644 --- a/pkg/models/components/components.go +++ b/pkg/models/components/components.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 components import ( diff --git a/pkg/models/devops/OWNERS b/pkg/models/devops/OWNERS index 535b1e27d..9b558a233 100644 --- a/pkg/models/devops/OWNERS +++ b/pkg/models/devops/OWNERS @@ -1,10 +1,12 @@ approvers: - runzexia - soulseen + - shaowenchen reviewers: - runzexia - soulseen + - shaowenchen labels: - area/devops diff --git a/pkg/models/iam/am/am.go b/pkg/models/iam/am/am.go index b61a9d721..b359b5c72 100644 --- a/pkg/models/iam/am/am.go +++ b/pkg/models/iam/am/am.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 am import ( diff --git a/pkg/models/iam/im/fake_operator.go b/pkg/models/iam/im/fake_operator.go index e6186e044..ea79b299c 100644 --- a/pkg/models/iam/im/fake_operator.go +++ b/pkg/models/iam/im/fake_operator.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 im diff --git a/pkg/models/iam/im/im.go b/pkg/models/iam/im/im.go index 0fc24e09e..ef672771e 100644 --- a/pkg/models/iam/im/im.go +++ b/pkg/models/iam/im/im.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 im import ( diff --git a/pkg/models/iam/im/im_test.go b/pkg/models/iam/im/im_test.go index a23dd9370..a069a4571 100644 --- a/pkg/models/iam/im/im_test.go +++ b/pkg/models/iam/im/im_test.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 im diff --git a/pkg/models/iam/im/ldap_operator.go b/pkg/models/iam/im/ldap_operator.go index c606b1e82..ff60a6a00 100644 --- a/pkg/models/iam/im/ldap_operator.go +++ b/pkg/models/iam/im/ldap_operator.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 im diff --git a/pkg/models/kubeconfig/kubeconfig.go b/pkg/models/kubeconfig/kubeconfig.go index 3c84c62f6..d4b8b0005 100644 --- a/pkg/models/kubeconfig/kubeconfig.go +++ b/pkg/models/kubeconfig/kubeconfig.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 kubeconfig @@ -58,7 +56,6 @@ const ( type Interface interface { GetKubeConfig(username string) (string, error) CreateKubeConfig(user *iamv1alpha2.User) error - DelKubeConfig(username string) error UpdateKubeconfig(username string, certificate []byte) error } @@ -135,7 +132,7 @@ func (o *operator) CreateKubeConfig(user *iamv1alpha2.User) error { } cm := &corev1.ConfigMap{TypeMeta: metav1.TypeMeta{Kind: configMapKind, APIVersion: configMapAPIVersion}, - ObjectMeta: metav1.ObjectMeta{Name: configName, Annotations: map[string]string{constants.UsernameAnnotationKey: user.Name}}, + ObjectMeta: metav1.ObjectMeta{Name: configName, Labels: map[string]string{constants.UsernameLabelKey: user.Name}}, Data: map[string]string{kubeconfigFileName: string(kubeconfig)}} err = controllerutil.SetControllerReference(user, cm, scheme.Scheme) @@ -188,18 +185,6 @@ func (o *operator) GetKubeConfig(username string) (string, error) { return string(data), nil } -func (o *operator) DelKubeConfig(username string) error { - configName := fmt.Sprintf(kubeconfigNameFormat, username) - - deletePolicy := metav1.DeletePropagationBackground - err := o.k8sclient.CoreV1().ConfigMaps(constants.KubeSphereControlNamespace).Delete(configName, &metav1.DeleteOptions{PropagationPolicy: &deletePolicy}) - if err != nil { - klog.Errorln(err) - return err - } - return nil -} - func (o *operator) createCSR(username string) ([]byte, error) { csrConfig := &certutil.Config{ CommonName: username, @@ -247,8 +232,8 @@ func (o *operator) createCSR(username string) ([]byte, error) { APIVersion: "certificates.k8s.io/v1beta1", }, ObjectMeta: metav1.ObjectMeta{ - Name: csrName, - Annotations: map[string]string{constants.UsernameAnnotationKey: username}, + Name: csrName, + Labels: map[string]string{constants.UsernameLabelKey: username}, }, Spec: certificatesv1beta1.CertificateSigningRequestSpec{ Request: csr, diff --git a/pkg/models/kubectl/kubectl.go b/pkg/models/kubectl/kubectl.go index 933af075c..bf0a1f4b6 100644 --- a/pkg/models/kubectl/kubectl.go +++ b/pkg/models/kubectl/kubectl.go @@ -1,37 +1,37 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 kubectl import ( "fmt" + appsv1 "k8s.io/api/apps/v1" + "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/client-go/informers" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + k8sinformers "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" "k8s.io/klog" + "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme" + ksinformers "kubesphere.io/kubesphere/pkg/client/informers/externalversions" "kubesphere.io/kubesphere/pkg/models" "math/rand" "os" - - appsv1 "k8s.io/api/apps/v1" - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "kubesphere.io/kubesphere/pkg/constants" ) @@ -44,16 +44,16 @@ const ( type Interface interface { GetKubectlPod(username string) (models.PodInfo, error) CreateKubectlDeploy(username string) error - DeleteKubectlDeploy(username string) error } type operator struct { - k8sClient kubernetes.Interface - informers informers.SharedInformerFactory + k8sClient kubernetes.Interface + k8sInformer k8sinformers.SharedInformerFactory + ksInformer ksinformers.SharedInformerFactory } -func NewOperator(k8sClient kubernetes.Interface, informers informers.SharedInformerFactory) Interface { - return &operator{k8sClient: k8sClient, informers: informers} +func NewOperator(k8sClient kubernetes.Interface, k8sInformer k8sinformers.SharedInformerFactory, ksInformer ksinformers.SharedInformerFactory) Interface { + return &operator{k8sClient: k8sClient, k8sInformer: k8sInformer, ksInformer: ksInformer} } var DefaultImage = "kubesphere/kubectl:advanced-1.0.0" @@ -66,7 +66,7 @@ func init() { func (o *operator) GetKubectlPod(username string) (models.PodInfo, error) { deployName := fmt.Sprintf(deployNameFormat, username) - deploy, err := o.informers.Apps().V1().Deployments().Lister().Deployments(namespace).Get(deployName) + deploy, err := o.k8sInformer.Apps().V1().Deployments().Lister().Deployments(namespace).Get(deployName) if err != nil { klog.Errorln(err) return models.PodInfo{}, err @@ -74,7 +74,7 @@ func (o *operator) GetKubectlPod(username string) (models.PodInfo, error) { selectors := deploy.Spec.Selector.MatchLabels labelSelector := labels.Set(selectors).AsSelector() - pods, err := o.informers.Core().V1().Pods().Lister().Pods(namespace).List(labelSelector) + pods, err := o.k8sInformer.Core().V1().Pods().Lister().Pods(namespace).List(labelSelector) if err != nil { klog.Errorln(err) return models.PodInfo{}, err @@ -115,9 +115,20 @@ func selectCorrectPod(namespace string, pods []*v1.Pod) (kubectlPod *v1.Pod, err func (o *operator) CreateKubectlDeploy(username string) error { deployName := fmt.Sprintf(deployNameFormat, username) + user, err := o.ksInformer.Iam().V1alpha2().Users().Lister().Get(username) + + if err != nil { + klog.Error(err) + // ignore if user not exist + if errors.IsNotFound(err) { + return nil + } + return err + } + replica := int32(1) - selector := metav1.LabelSelector{MatchLabels: map[string]string{"username": username}} - deployment := appsv1.Deployment{ + selector := metav1.LabelSelector{MatchLabels: map[string]string{constants.UsernameLabelKey: username}} + deployment := &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: deployName, }, @@ -127,7 +138,7 @@ func (o *operator) CreateKubectlDeploy(username string) error { Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ - "username": username, + constants.UsernameLabelKey: username, }, }, Spec: v1.PodSpec{ @@ -142,7 +153,14 @@ func (o *operator) CreateKubectlDeploy(username string) error { }, } - _, err := o.k8sClient.AppsV1().Deployments(namespace).Create(&deployment) + err = controllerutil.SetControllerReference(user, deployment, scheme.Scheme) + + if err != nil { + klog.Errorln(err) + return err + } + + _, err = o.k8sClient.AppsV1().Deployments(namespace).Create(deployment) if err != nil { if errors.IsAlreadyExists(err) { @@ -154,18 +172,3 @@ func (o *operator) CreateKubectlDeploy(username string) error { return nil } - -func (o *operator) DeleteKubectlDeploy(username string) error { - deployName := fmt.Sprintf(deployNameFormat, username) - - err := o.k8sClient.AppsV1().Deployments(namespace).Delete(deployName, metav1.NewDeleteOptions(0)) - if err != nil { - if errors.IsNotFound(err) { - return nil - } - klog.Error(err) - return err - } - - return nil -} diff --git a/pkg/models/monitoring/monitoring.go b/pkg/models/monitoring/monitoring.go index 186360a24..9261afdfe 100644 --- a/pkg/models/monitoring/monitoring.go +++ b/pkg/models/monitoring/monitoring.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 diff --git a/pkg/models/monitoring/namespaces.go b/pkg/models/monitoring/namespaces.go index 44a809bc9..b05d3414b 100644 --- a/pkg/models/monitoring/namespaces.go +++ b/pkg/models/monitoring/namespaces.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 "k8s.io/api/core/v1" diff --git a/pkg/models/monitoring/sort_page.go b/pkg/models/monitoring/sort_page.go index b80296c36..97d0a76f5 100644 --- a/pkg/models/monitoring/sort_page.go +++ b/pkg/models/monitoring/sort_page.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 diff --git a/pkg/models/openpitrix/applications.go b/pkg/models/openpitrix/applications.go index 7eb726b63..c2de1a2f9 100644 --- a/pkg/models/openpitrix/applications.go +++ b/pkg/models/openpitrix/applications.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 openpitrix import ( diff --git a/pkg/models/openpitrix/applications_test.go b/pkg/models/openpitrix/applications_test.go index 0dff68d0c..48d33d84b 100644 --- a/pkg/models/openpitrix/applications_test.go +++ b/pkg/models/openpitrix/applications_test.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 openpitrix diff --git a/pkg/models/openpitrix/apps.go b/pkg/models/openpitrix/apps.go index 121c127e7..f5b1d7042 100644 --- a/pkg/models/openpitrix/apps.go +++ b/pkg/models/openpitrix/apps.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 openpitrix diff --git a/pkg/models/openpitrix/attachments.go b/pkg/models/openpitrix/attachments.go index aec779ca0..4d19c2d05 100644 --- a/pkg/models/openpitrix/attachments.go +++ b/pkg/models/openpitrix/attachments.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2019 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 2019 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 openpitrix diff --git a/pkg/models/openpitrix/categories.go b/pkg/models/openpitrix/categories.go index 0a238e1c0..519e32b7f 100644 --- a/pkg/models/openpitrix/categories.go +++ b/pkg/models/openpitrix/categories.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 openpitrix diff --git a/pkg/models/openpitrix/interface.go b/pkg/models/openpitrix/interface.go index 15b133a47..9eae5a1c2 100644 --- a/pkg/models/openpitrix/interface.go +++ b/pkg/models/openpitrix/interface.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 openpitrix diff --git a/pkg/models/openpitrix/repos.go b/pkg/models/openpitrix/repos.go index 43900df91..25d75821b 100644 --- a/pkg/models/openpitrix/repos.go +++ b/pkg/models/openpitrix/repos.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 openpitrix diff --git a/pkg/models/openpitrix/utils.go b/pkg/models/openpitrix/utils.go index d3c8c049d..a660aef12 100644 --- a/pkg/models/openpitrix/utils.go +++ b/pkg/models/openpitrix/utils.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2019 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 2019 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 openpitrix diff --git a/pkg/models/quotas/quotas.go b/pkg/models/quotas/quotas.go index 6ab606adb..32b68f961 100644 --- a/pkg/models/quotas/quotas.go +++ b/pkg/models/quotas/quotas.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 quotas diff --git a/pkg/models/registries/registries.go b/pkg/models/registries/registries.go index e176a1090..1b6e36cf0 100644 --- a/pkg/models/registries/registries.go +++ b/pkg/models/registries/registries.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 registries import ( @@ -112,16 +111,19 @@ func (c *registryGetter) getEntryBySecret(namespace, secretName, imageName strin Message: "", } + var config *DockerConfigEntry + if namespace == "" || secretName == "" { - return failedImageDetails, fmt.Errorf("namespace or secret name not provided") - } - secret, err := c.informers.Core().V1().Secrets().Lister().Secrets(namespace).Get(secretName) - if err != nil { - return failedImageDetails, err - } - entry, err := getDockerEntryFromDockerSecret(secret) - if err != nil { - return failedImageDetails, err + config = &DockerConfigEntry{} + } else { + secret, err := c.informers.Core().V1().Secrets().Lister().Secrets(namespace).Get(secretName) + if err != nil { + return failedImageDetails, err + } + config, err = getDockerEntryFromDockerSecret(secret) + if err != nil { + return failedImageDetails, err + } } // default use ssl @@ -147,10 +149,10 @@ func (c *registryGetter) getEntryBySecret(namespace, secretName, imageName strin return failedImageDetails, err } - useSSL := checkSSl(entry.ServerAddress) + useSSL := checkSSl(config.ServerAddress) // Create the registry client. - r, err := CreateRegistryClient(entry.Username, entry.Password, image.Domain, useSSL) + r, err := CreateRegistryClient(config.Username, config.Password, image.Domain, useSSL) if err != nil { return failedImageDetails, err } diff --git a/pkg/models/resources/v1alpha2/application/appplications.go b/pkg/models/resources/v1alpha2/application/appplications.go index c0994134e..e94fed663 100644 --- a/pkg/models/resources/v1alpha2/application/appplications.go +++ b/pkg/models/resources/v1alpha2/application/appplications.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2019 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 2019 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 application diff --git a/pkg/models/resources/v1alpha2/clusterrole/clusterroles.go b/pkg/models/resources/v1alpha2/clusterrole/clusterroles.go index a1722813b..b7f1b30f4 100644 --- a/pkg/models/resources/v1alpha2/clusterrole/clusterroles.go +++ b/pkg/models/resources/v1alpha2/clusterrole/clusterroles.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 clusterrole import ( diff --git a/pkg/models/resources/v1alpha2/configmap/configmaps.go b/pkg/models/resources/v1alpha2/configmap/configmaps.go index bcb50fce5..cbdbfa8e6 100644 --- a/pkg/models/resources/v1alpha2/configmap/configmaps.go +++ b/pkg/models/resources/v1alpha2/configmap/configmaps.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 configmap import ( diff --git a/pkg/models/resources/v1alpha2/cronjob/cronjobs.go b/pkg/models/resources/v1alpha2/cronjob/cronjobs.go index 1fdbd029c..6bd33933f 100644 --- a/pkg/models/resources/v1alpha2/cronjob/cronjobs.go +++ b/pkg/models/resources/v1alpha2/cronjob/cronjobs.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 cronjob import ( diff --git a/pkg/models/resources/v1alpha2/daemonset/daemonsets.go b/pkg/models/resources/v1alpha2/daemonset/daemonsets.go index 99705fa6f..26680f0fb 100644 --- a/pkg/models/resources/v1alpha2/daemonset/daemonsets.go +++ b/pkg/models/resources/v1alpha2/daemonset/daemonsets.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 daemonset import ( diff --git a/pkg/models/resources/v1alpha2/deployment/deployments.go b/pkg/models/resources/v1alpha2/deployment/deployments.go index f7bdf783a..2aa8d05d8 100644 --- a/pkg/models/resources/v1alpha2/deployment/deployments.go +++ b/pkg/models/resources/v1alpha2/deployment/deployments.go @@ -1,38 +1,35 @@ /* - * - * Copyright 2020 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 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 - Copyright 2019 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. + 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 2019 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 deployment import ( diff --git a/pkg/models/resources/v1alpha2/hpa/horizontalpodautoscalers.go b/pkg/models/resources/v1alpha2/hpa/horizontalpodautoscalers.go index 7aa119776..342f4069e 100644 --- a/pkg/models/resources/v1alpha2/hpa/horizontalpodautoscalers.go +++ b/pkg/models/resources/v1alpha2/hpa/horizontalpodautoscalers.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2019 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 2019 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 hpa import ( diff --git a/pkg/models/resources/v1alpha2/ingress/ingresses.go b/pkg/models/resources/v1alpha2/ingress/ingresses.go index 9bfc3e9eb..46fc5f889 100644 --- a/pkg/models/resources/v1alpha2/ingress/ingresses.go +++ b/pkg/models/resources/v1alpha2/ingress/ingresses.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 ingress import ( diff --git a/pkg/models/resources/v1alpha2/job/jobs.go b/pkg/models/resources/v1alpha2/job/jobs.go index 9530d6c7b..3fde10e2c 100644 --- a/pkg/models/resources/v1alpha2/job/jobs.go +++ b/pkg/models/resources/v1alpha2/job/jobs.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 job import ( diff --git a/pkg/models/resources/v1alpha2/namespace/namespaces.go b/pkg/models/resources/v1alpha2/namespace/namespaces.go index 1faf5987d..30ab09c99 100644 --- a/pkg/models/resources/v1alpha2/namespace/namespaces.go +++ b/pkg/models/resources/v1alpha2/namespace/namespaces.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 namespace import ( diff --git a/pkg/models/resources/v1alpha2/node/nodes.go b/pkg/models/resources/v1alpha2/node/nodes.go index 62865a311..102f15d25 100644 --- a/pkg/models/resources/v1alpha2/node/nodes.go +++ b/pkg/models/resources/v1alpha2/node/nodes.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 node import ( diff --git a/pkg/models/resources/v1alpha2/persistentvolumeclaim/persistentvolumeclaims.go b/pkg/models/resources/v1alpha2/persistentvolumeclaim/persistentvolumeclaims.go index e2a54c4a7..c650a216c 100644 --- a/pkg/models/resources/v1alpha2/persistentvolumeclaim/persistentvolumeclaims.go +++ b/pkg/models/resources/v1alpha2/persistentvolumeclaim/persistentvolumeclaims.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 persistentvolumeclaim import ( diff --git a/pkg/models/resources/v1alpha2/pod/pods.go b/pkg/models/resources/v1alpha2/pod/pods.go index fa980b46c..6139107d4 100644 --- a/pkg/models/resources/v1alpha2/pod/pods.go +++ b/pkg/models/resources/v1alpha2/pod/pods.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 pod import ( diff --git a/pkg/models/resources/v1alpha2/resource/resource_test.go b/pkg/models/resources/v1alpha2/resource/resource_test.go index 7cd04ceb2..20b9d466d 100644 --- a/pkg/models/resources/v1alpha2/resource/resource_test.go +++ b/pkg/models/resources/v1alpha2/resource/resource_test.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 resource diff --git a/pkg/models/resources/v1alpha2/resource/resources.go b/pkg/models/resources/v1alpha2/resource/resources.go index bd3330564..9b2f95859 100644 --- a/pkg/models/resources/v1alpha2/resource/resources.go +++ b/pkg/models/resources/v1alpha2/resource/resources.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 resource import ( diff --git a/pkg/models/resources/v1alpha2/role/roles.go b/pkg/models/resources/v1alpha2/role/roles.go index b045a28ff..f3faeea07 100644 --- a/pkg/models/resources/v1alpha2/role/roles.go +++ b/pkg/models/resources/v1alpha2/role/roles.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 role import ( diff --git a/pkg/models/resources/v1alpha2/s2buildertemplate/s2ibuildertemplate.go b/pkg/models/resources/v1alpha2/s2buildertemplate/s2ibuildertemplate.go index b2d81c93d..e369af1fc 100644 --- a/pkg/models/resources/v1alpha2/s2buildertemplate/s2ibuildertemplate.go +++ b/pkg/models/resources/v1alpha2/s2buildertemplate/s2ibuildertemplate.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 s2buildertemplate import ( diff --git a/pkg/models/resources/v1alpha2/s2ibuilder/s2ibuilder.go b/pkg/models/resources/v1alpha2/s2ibuilder/s2ibuilder.go index 2f99f721e..95e475750 100644 --- a/pkg/models/resources/v1alpha2/s2ibuilder/s2ibuilder.go +++ b/pkg/models/resources/v1alpha2/s2ibuilder/s2ibuilder.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 s2ibuilder diff --git a/pkg/models/resources/v1alpha2/s2irun/s2irun.go b/pkg/models/resources/v1alpha2/s2irun/s2irun.go index 47997fa72..4aa3a340b 100644 --- a/pkg/models/resources/v1alpha2/s2irun/s2irun.go +++ b/pkg/models/resources/v1alpha2/s2irun/s2irun.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 s2irun diff --git a/pkg/models/resources/v1alpha2/secret/secrets.go b/pkg/models/resources/v1alpha2/secret/secrets.go index f7b115549..43a5e6a01 100644 --- a/pkg/models/resources/v1alpha2/secret/secrets.go +++ b/pkg/models/resources/v1alpha2/secret/secrets.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 secret import ( diff --git a/pkg/models/resources/v1alpha2/service/services.go b/pkg/models/resources/v1alpha2/service/services.go index cf0f0930b..450c755e7 100644 --- a/pkg/models/resources/v1alpha2/service/services.go +++ b/pkg/models/resources/v1alpha2/service/services.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 service import ( diff --git a/pkg/models/resources/v1alpha2/statefulset/statefulsets.go b/pkg/models/resources/v1alpha2/statefulset/statefulsets.go index c2e8ffee2..246c9491d 100644 --- a/pkg/models/resources/v1alpha2/statefulset/statefulsets.go +++ b/pkg/models/resources/v1alpha2/statefulset/statefulsets.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 statefulset import ( diff --git a/pkg/models/resources/v1alpha2/storageclass/storageclasses.go b/pkg/models/resources/v1alpha2/storageclass/storageclasses.go index a018f6a0c..f0d466e5d 100644 --- a/pkg/models/resources/v1alpha2/storageclass/storageclasses.go +++ b/pkg/models/resources/v1alpha2/storageclass/storageclasses.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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/v1alpha2/workspace/workspaces.go b/pkg/models/resources/v1alpha2/workspace/workspaces.go index 77a15af4f..159027d8f 100644 --- a/pkg/models/resources/v1alpha2/workspace/workspaces.go +++ b/pkg/models/resources/v1alpha2/workspace/workspaces.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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/models/resources/v1alpha3/application/applications.go b/pkg/models/resources/v1alpha3/application/applications.go index ecab5263b..c7c70d43c 100644 --- a/pkg/models/resources/v1alpha3/application/applications.go +++ b/pkg/models/resources/v1alpha3/application/applications.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 application import ( diff --git a/pkg/models/resources/v1alpha3/application/applications_test.go b/pkg/models/resources/v1alpha3/application/applications_test.go index 41c988e1e..ec7d205a6 100644 --- a/pkg/models/resources/v1alpha3/application/applications_test.go +++ b/pkg/models/resources/v1alpha3/application/applications_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 application import ( diff --git a/pkg/models/resources/v1alpha3/cluster/clusters.go b/pkg/models/resources/v1alpha3/cluster/clusters.go index 01382503c..8d75f6db2 100644 --- a/pkg/models/resources/v1alpha3/cluster/clusters.go +++ b/pkg/models/resources/v1alpha3/cluster/clusters.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 cluster import ( diff --git a/pkg/models/resources/v1alpha3/cluster/clusters_test.go b/pkg/models/resources/v1alpha3/cluster/clusters_test.go index 8fdc3f4a7..051f0fdc9 100644 --- a/pkg/models/resources/v1alpha3/cluster/clusters_test.go +++ b/pkg/models/resources/v1alpha3/cluster/clusters_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 cluster import ( diff --git a/pkg/models/resources/v1alpha3/clusterrole/clusterroles.go b/pkg/models/resources/v1alpha3/clusterrole/clusterroles.go index 5bb8ecbcb..7d9efcfe1 100644 --- a/pkg/models/resources/v1alpha3/clusterrole/clusterroles.go +++ b/pkg/models/resources/v1alpha3/clusterrole/clusterroles.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 clusterrole import ( diff --git a/pkg/models/resources/v1alpha3/clusterrole/clusterroles_test.go b/pkg/models/resources/v1alpha3/clusterrole/clusterroles_test.go index 7e8f60c24..e8edbdc8f 100644 --- a/pkg/models/resources/v1alpha3/clusterrole/clusterroles_test.go +++ b/pkg/models/resources/v1alpha3/clusterrole/clusterroles_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 clusterrole import ( diff --git a/pkg/models/resources/v1alpha3/clusterrolebinding/clusterrolebindings.go b/pkg/models/resources/v1alpha3/clusterrolebinding/clusterrolebindings.go index 64a42b21a..116af454f 100644 --- a/pkg/models/resources/v1alpha3/clusterrolebinding/clusterrolebindings.go +++ b/pkg/models/resources/v1alpha3/clusterrolebinding/clusterrolebindings.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 clusterrolebinding import ( diff --git a/pkg/models/resources/v1alpha3/clusterrolebinding/clusterrolebindings_test.go b/pkg/models/resources/v1alpha3/clusterrolebinding/clusterrolebindings_test.go index cc6957c68..c4fcb4f90 100644 --- a/pkg/models/resources/v1alpha3/clusterrolebinding/clusterrolebindings_test.go +++ b/pkg/models/resources/v1alpha3/clusterrolebinding/clusterrolebindings_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 clusterrolebinding import ( diff --git a/pkg/models/resources/v1alpha3/configmap/configmaps.go b/pkg/models/resources/v1alpha3/configmap/configmaps.go index c469ce988..4457f359d 100644 --- a/pkg/models/resources/v1alpha3/configmap/configmaps.go +++ b/pkg/models/resources/v1alpha3/configmap/configmaps.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 configmap import ( diff --git a/pkg/models/resources/v1alpha3/configmap/configmaps_test.go b/pkg/models/resources/v1alpha3/configmap/configmaps_test.go index bc99a632c..3089fe193 100644 --- a/pkg/models/resources/v1alpha3/configmap/configmaps_test.go +++ b/pkg/models/resources/v1alpha3/configmap/configmaps_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 configmap import ( diff --git a/pkg/models/resources/v1alpha3/customresourcedefinition/customresourcedefinitions.go b/pkg/models/resources/v1alpha3/customresourcedefinition/customresourcedefinitions.go index 6b5456019..d40daa600 100644 --- a/pkg/models/resources/v1alpha3/customresourcedefinition/customresourcedefinitions.go +++ b/pkg/models/resources/v1alpha3/customresourcedefinition/customresourcedefinitions.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 customresourcedefinition import ( diff --git a/pkg/models/resources/v1alpha3/customresourcedefinition/customresourcedefinitions_test.go b/pkg/models/resources/v1alpha3/customresourcedefinition/customresourcedefinitions_test.go index ab74ced39..4986c996e 100644 --- a/pkg/models/resources/v1alpha3/customresourcedefinition/customresourcedefinitions_test.go +++ b/pkg/models/resources/v1alpha3/customresourcedefinition/customresourcedefinitions_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 customresourcedefinition import ( diff --git a/pkg/models/resources/v1alpha3/deployment/deployments.go b/pkg/models/resources/v1alpha3/deployment/deployments.go index 0bb913529..8d422d05e 100644 --- a/pkg/models/resources/v1alpha3/deployment/deployments.go +++ b/pkg/models/resources/v1alpha3/deployment/deployments.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 deployment import ( diff --git a/pkg/models/resources/v1alpha3/deployment/deployments_test.go b/pkg/models/resources/v1alpha3/deployment/deployments_test.go index caad84fad..daea8b46c 100644 --- a/pkg/models/resources/v1alpha3/deployment/deployments_test.go +++ b/pkg/models/resources/v1alpha3/deployment/deployments_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 deployment import ( diff --git a/pkg/models/resources/v1alpha3/devops/devops.go b/pkg/models/resources/v1alpha3/devops/devops.go index da260c87f..22f49136d 100644 --- a/pkg/models/resources/v1alpha3/devops/devops.go +++ b/pkg/models/resources/v1alpha3/devops/devops.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 devops import ( diff --git a/pkg/models/resources/v1alpha3/devops/devops_test.go b/pkg/models/resources/v1alpha3/devops/devops_test.go index 583141b5e..4ccbfc386 100644 --- a/pkg/models/resources/v1alpha3/devops/devops_test.go +++ b/pkg/models/resources/v1alpha3/devops/devops_test.go @@ -1 +1,17 @@ +/* +Copyright 2019 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 devops diff --git a/pkg/models/resources/v1alpha3/globalrole/globalroles.go b/pkg/models/resources/v1alpha3/globalrole/globalroles.go index 1b8f9234e..49633726c 100644 --- a/pkg/models/resources/v1alpha3/globalrole/globalroles.go +++ b/pkg/models/resources/v1alpha3/globalrole/globalroles.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 globalrole import ( diff --git a/pkg/models/resources/v1alpha3/globalrole/globalroles_test.go b/pkg/models/resources/v1alpha3/globalrole/globalroles_test.go index 85e32ce29..1a2d0f981 100644 --- a/pkg/models/resources/v1alpha3/globalrole/globalroles_test.go +++ b/pkg/models/resources/v1alpha3/globalrole/globalroles_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 globalrole import ( diff --git a/pkg/models/resources/v1alpha3/globalrolebinding/globalrolebindings.go b/pkg/models/resources/v1alpha3/globalrolebinding/globalrolebindings.go index ad4639db5..83d9df077 100644 --- a/pkg/models/resources/v1alpha3/globalrolebinding/globalrolebindings.go +++ b/pkg/models/resources/v1alpha3/globalrolebinding/globalrolebindings.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 globalrolebinding import ( diff --git a/pkg/models/resources/v1alpha3/globalrolebinding/globalrolebindings_test.go b/pkg/models/resources/v1alpha3/globalrolebinding/globalrolebindings_test.go index 23d32a501..e5a34e594 100644 --- a/pkg/models/resources/v1alpha3/globalrolebinding/globalrolebindings_test.go +++ b/pkg/models/resources/v1alpha3/globalrolebinding/globalrolebindings_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 globalrolebinding import ( diff --git a/pkg/models/resources/v1alpha3/namespace/namespaces.go b/pkg/models/resources/v1alpha3/namespace/namespaces.go index bf48f3057..6f90090ee 100644 --- a/pkg/models/resources/v1alpha3/namespace/namespaces.go +++ b/pkg/models/resources/v1alpha3/namespace/namespaces.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 namespace import ( diff --git a/pkg/models/resources/v1alpha3/namespace/namespaces_test.go b/pkg/models/resources/v1alpha3/namespace/namespaces_test.go index df9055971..945a61ad4 100644 --- a/pkg/models/resources/v1alpha3/namespace/namespaces_test.go +++ b/pkg/models/resources/v1alpha3/namespace/namespaces_test.go @@ -1 +1,17 @@ +/* +Copyright 2019 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 namespace diff --git a/pkg/models/resources/v1alpha3/networkpolicy/networkpolicies.go b/pkg/models/resources/v1alpha3/networkpolicy/networkpolicies.go index e02c18251..d42147559 100644 --- a/pkg/models/resources/v1alpha3/networkpolicy/networkpolicies.go +++ b/pkg/models/resources/v1alpha3/networkpolicy/networkpolicies.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 networkpolicy import ( diff --git a/pkg/models/resources/v1alpha3/networkpolicy/networkpolicies_test.go b/pkg/models/resources/v1alpha3/networkpolicy/networkpolicies_test.go index d673be9d0..31d8e43c8 100644 --- a/pkg/models/resources/v1alpha3/networkpolicy/networkpolicies_test.go +++ b/pkg/models/resources/v1alpha3/networkpolicy/networkpolicies_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 networkpolicy import ( diff --git a/pkg/models/resources/v1alpha3/node/nodes.go b/pkg/models/resources/v1alpha3/node/nodes.go index 1a549cddc..edfe8b8db 100644 --- a/pkg/models/resources/v1alpha3/node/nodes.go +++ b/pkg/models/resources/v1alpha3/node/nodes.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 node import ( diff --git a/pkg/models/resources/v1alpha3/node/nodes_test.go b/pkg/models/resources/v1alpha3/node/nodes_test.go index c29021d56..3576fb21f 100644 --- a/pkg/models/resources/v1alpha3/node/nodes_test.go +++ b/pkg/models/resources/v1alpha3/node/nodes_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 node import ( diff --git a/pkg/models/resources/v1alpha3/persistentvolumeclaim/persistentvolumeclaim.go b/pkg/models/resources/v1alpha3/persistentvolumeclaim/persistentvolumeclaim.go index 6f9f99342..c85e47747 100644 --- a/pkg/models/resources/v1alpha3/persistentvolumeclaim/persistentvolumeclaim.go +++ b/pkg/models/resources/v1alpha3/persistentvolumeclaim/persistentvolumeclaim.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 persistentvolumeclaim import ( diff --git a/pkg/models/resources/v1alpha3/persistentvolumeclaim/persistentvolumeclaim_test.go b/pkg/models/resources/v1alpha3/persistentvolumeclaim/persistentvolumeclaim_test.go index 3a7dc6751..72f9a459a 100644 --- a/pkg/models/resources/v1alpha3/persistentvolumeclaim/persistentvolumeclaim_test.go +++ b/pkg/models/resources/v1alpha3/persistentvolumeclaim/persistentvolumeclaim_test.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 persistentvolumeclaim import ( diff --git a/pkg/models/resources/v1alpha3/pod/pods.go b/pkg/models/resources/v1alpha3/pod/pods.go index 085f3d18e..c4f15594e 100644 --- a/pkg/models/resources/v1alpha3/pod/pods.go +++ b/pkg/models/resources/v1alpha3/pod/pods.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 pod import ( diff --git a/pkg/models/resources/v1alpha3/pod/pods_test.go b/pkg/models/resources/v1alpha3/pod/pods_test.go index 12d739a4e..959117250 100644 --- a/pkg/models/resources/v1alpha3/pod/pods_test.go +++ b/pkg/models/resources/v1alpha3/pod/pods_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 pod import ( diff --git a/pkg/models/resources/v1alpha3/resource/resource.go b/pkg/models/resources/v1alpha3/resource/resource.go index dceb7f7a7..384fd00ed 100644 --- a/pkg/models/resources/v1alpha3/resource/resource.go +++ b/pkg/models/resources/v1alpha3/resource/resource.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 resource diff --git a/pkg/models/resources/v1alpha3/resource/resource_test.go b/pkg/models/resources/v1alpha3/resource/resource_test.go index c7947245f..e19304c2f 100644 --- a/pkg/models/resources/v1alpha3/resource/resource_test.go +++ b/pkg/models/resources/v1alpha3/resource/resource_test.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 resource diff --git a/pkg/models/resources/v1alpha3/role/roles.go b/pkg/models/resources/v1alpha3/role/roles.go index 4e30b149c..dc1e79f6e 100644 --- a/pkg/models/resources/v1alpha3/role/roles.go +++ b/pkg/models/resources/v1alpha3/role/roles.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 role import ( diff --git a/pkg/models/resources/v1alpha3/role/roles_test.go b/pkg/models/resources/v1alpha3/role/roles_test.go index 7097831f9..a45dfbf06 100644 --- a/pkg/models/resources/v1alpha3/role/roles_test.go +++ b/pkg/models/resources/v1alpha3/role/roles_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 role import ( diff --git a/pkg/models/resources/v1alpha3/rolebinding/rolebindings.go b/pkg/models/resources/v1alpha3/rolebinding/rolebindings.go index b6fd7e142..ed43bda65 100644 --- a/pkg/models/resources/v1alpha3/rolebinding/rolebindings.go +++ b/pkg/models/resources/v1alpha3/rolebinding/rolebindings.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 rolebinding import ( diff --git a/pkg/models/resources/v1alpha3/rolebinding/rolebindings_test.go b/pkg/models/resources/v1alpha3/rolebinding/rolebindings_test.go index bafc46203..635d7819e 100644 --- a/pkg/models/resources/v1alpha3/rolebinding/rolebindings_test.go +++ b/pkg/models/resources/v1alpha3/rolebinding/rolebindings_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 rolebinding import ( diff --git a/pkg/models/resources/v1alpha3/user/users.go b/pkg/models/resources/v1alpha3/user/users.go index 936997838..93bc125c5 100644 --- a/pkg/models/resources/v1alpha3/user/users.go +++ b/pkg/models/resources/v1alpha3/user/users.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 user import ( diff --git a/pkg/models/resources/v1alpha3/user/users_test.go b/pkg/models/resources/v1alpha3/user/users_test.go index 226c13677..c901a6d21 100644 --- a/pkg/models/resources/v1alpha3/user/users_test.go +++ b/pkg/models/resources/v1alpha3/user/users_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 user import ( diff --git a/pkg/models/resources/v1alpha3/volumesnapshot/volumesnapshot.go b/pkg/models/resources/v1alpha3/volumesnapshot/volumesnapshot.go index 4e7ddc57d..00a94247f 100644 --- a/pkg/models/resources/v1alpha3/volumesnapshot/volumesnapshot.go +++ b/pkg/models/resources/v1alpha3/volumesnapshot/volumesnapshot.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 volumesnapshot import ( diff --git a/pkg/models/resources/v1alpha3/volumesnapshot/volumesnapshot_test.go b/pkg/models/resources/v1alpha3/volumesnapshot/volumesnapshot_test.go index 8778f33b3..0159ff33e 100644 --- a/pkg/models/resources/v1alpha3/volumesnapshot/volumesnapshot_test.go +++ b/pkg/models/resources/v1alpha3/volumesnapshot/volumesnapshot_test.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 volumesnapshot import ( diff --git a/pkg/models/resources/v1alpha3/workspace/workspaces.go b/pkg/models/resources/v1alpha3/workspace/workspaces.go index 6a1559ba6..949a66909 100644 --- a/pkg/models/resources/v1alpha3/workspace/workspaces.go +++ b/pkg/models/resources/v1alpha3/workspace/workspaces.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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/models/resources/v1alpha3/workspace/workspaces_test.go b/pkg/models/resources/v1alpha3/workspace/workspaces_test.go index 3c748399d..3d162c221 100644 --- a/pkg/models/resources/v1alpha3/workspace/workspaces_test.go +++ b/pkg/models/resources/v1alpha3/workspace/workspaces_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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/models/resources/v1alpha3/workspacerole/workspaceroles.go b/pkg/models/resources/v1alpha3/workspacerole/workspaceroles.go index 723403d99..b6a30df0b 100644 --- a/pkg/models/resources/v1alpha3/workspacerole/workspaceroles.go +++ b/pkg/models/resources/v1alpha3/workspacerole/workspaceroles.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 workspacerole import ( diff --git a/pkg/models/resources/v1alpha3/workspacerole/workspaceroles_test.go b/pkg/models/resources/v1alpha3/workspacerole/workspaceroles_test.go index 56b7b8187..a1c8da77c 100644 --- a/pkg/models/resources/v1alpha3/workspacerole/workspaceroles_test.go +++ b/pkg/models/resources/v1alpha3/workspacerole/workspaceroles_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 workspacerole import ( diff --git a/pkg/models/resources/v1alpha3/workspacerolebinding/workspacerolebindings.go b/pkg/models/resources/v1alpha3/workspacerolebinding/workspacerolebindings.go index e3d5a2f3a..cfea258be 100644 --- a/pkg/models/resources/v1alpha3/workspacerolebinding/workspacerolebindings.go +++ b/pkg/models/resources/v1alpha3/workspacerolebinding/workspacerolebindings.go @@ -1,20 +1,19 @@ /* +Copyright 2020 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 workspacerolebinding import ( diff --git a/pkg/models/resources/v1alpha3/workspacerolebinding/workspacerolebindings_test.go b/pkg/models/resources/v1alpha3/workspacerolebinding/workspacerolebindings_test.go index e02ebbaf1..483f3c680 100644 --- a/pkg/models/resources/v1alpha3/workspacerolebinding/workspacerolebindings_test.go +++ b/pkg/models/resources/v1alpha3/workspacerolebinding/workspacerolebindings_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 workspacerolebinding import ( diff --git a/pkg/models/resources/v1alpha3/workspacetemplate/workspacetemplates.go b/pkg/models/resources/v1alpha3/workspacetemplate/workspacetemplates.go index 6d2438722..9fcca5885 100644 --- a/pkg/models/resources/v1alpha3/workspacetemplate/workspacetemplates.go +++ b/pkg/models/resources/v1alpha3/workspacetemplate/workspacetemplates.go @@ -1,20 +1,19 @@ /* +Copyright 2020 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 workspacetemplate import ( diff --git a/pkg/models/resources/v1alpha3/workspacetemplate/workspacetemplates_test.go b/pkg/models/resources/v1alpha3/workspacetemplate/workspacetemplates_test.go index 61ee44187..bb1aefb62 100644 --- a/pkg/models/resources/v1alpha3/workspacetemplate/workspacetemplates_test.go +++ b/pkg/models/resources/v1alpha3/workspacetemplate/workspacetemplates_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 workspacetemplate import ( diff --git a/pkg/models/revisions/revisions.go b/pkg/models/revisions/revisions.go index c5e3f0687..ab0a55443 100644 --- a/pkg/models/revisions/revisions.go +++ b/pkg/models/revisions/revisions.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 revisions diff --git a/pkg/models/routers/routers.go b/pkg/models/routers/routers.go index 20ba1520e..e22b73a09 100644 --- a/pkg/models/routers/routers.go +++ b/pkg/models/routers/routers.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 routers diff --git a/pkg/models/servicemesh/application.go b/pkg/models/servicemesh/application.go index 1c4db0710..0ef3023a6 100644 --- a/pkg/models/servicemesh/application.go +++ b/pkg/models/servicemesh/application.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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/models/servicemesh/metrics/handlers.go b/pkg/models/servicemesh/metrics/handlers.go index 7792328e2..3655f3a30 100644 --- a/pkg/models/servicemesh/metrics/handlers.go +++ b/pkg/models/servicemesh/metrics/handlers.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 metrics import "github.com/emicklei/go-restful" diff --git a/pkg/models/storage/storage.go b/pkg/models/storage/storage.go index 88dca126c..9fd96dc0c 100644 --- a/pkg/models/storage/storage.go +++ b/pkg/models/storage/storage.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 storage import ( diff --git a/pkg/models/tenant/devops.go b/pkg/models/tenant/devops.go index bb0bfcbc4..6236e66a9 100644 --- a/pkg/models/tenant/devops.go +++ b/pkg/models/tenant/devops.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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/tenant.go b/pkg/models/tenant/tenant.go index fdefeae36..959523714 100644 --- a/pkg/models/tenant/tenant.go +++ b/pkg/models/tenant/tenant.go @@ -1,24 +1,24 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 ( "fmt" + "io" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -28,9 +28,9 @@ import ( "k8s.io/klog" "kubesphere.io/kubesphere/pkg/api" eventsv1alpha1 "kubesphere.io/kubesphere/pkg/api/events/v1alpha1" + loggingv1alpha2 "kubesphere.io/kubesphere/pkg/api/logging/v1alpha2" clusterv1alpha1 "kubesphere.io/kubesphere/pkg/apis/cluster/v1alpha1" tenantv1alpha1 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha1" - tenantv1alpha2 "kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha2" "kubesphere.io/kubesphere/pkg/apiserver/authorization/authorizer" "kubesphere.io/kubesphere/pkg/apiserver/authorization/authorizerfactory" @@ -39,9 +39,11 @@ import ( "kubesphere.io/kubesphere/pkg/informers" "kubesphere.io/kubesphere/pkg/models/events" "kubesphere.io/kubesphere/pkg/models/iam/am" + "kubesphere.io/kubesphere/pkg/models/logging" resources "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3" resourcesv1alpha3 "kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/resource" eventsclient "kubesphere.io/kubesphere/pkg/simple/client/events" + loggingclient "kubesphere.io/kubesphere/pkg/simple/client/logging" "kubesphere.io/kubesphere/pkg/utils/stringutils" "strings" "time" @@ -58,6 +60,8 @@ type Interface interface { ListWorkspaceClusters(workspace string) (*api.ListResult, error) Events(user user.Info, queryParam *eventsv1alpha1.Query) (*eventsv1alpha1.APIResponse, error) + QueryLogs(user user.Info, query *loggingv1alpha2.Query) (*loggingv1alpha2.APIResponse, error) + ExportLogs(user user.Info, query *loggingv1alpha2.Query, writer io.Writer) error } type tenantOperator struct { @@ -67,9 +71,10 @@ type tenantOperator struct { ksclient kubesphere.Interface resourceGetter *resourcesv1alpha3.ResourceGetter events events.Interface + lo logging.LoggingOperator } -func New(informers informers.InformerFactory, k8sclient kubernetes.Interface, ksclient kubesphere.Interface, evtsClient eventsclient.Client) Interface { +func New(informers informers.InformerFactory, k8sclient kubernetes.Interface, ksclient kubesphere.Interface, evtsClient eventsclient.Client, loggingClient loggingclient.Interface) Interface { amOperator := am.NewReadOnlyOperator(informers) authorizer := authorizerfactory.NewRBACAuthorizer(amOperator) return &tenantOperator{ @@ -79,6 +84,7 @@ func New(informers informers.InformerFactory, k8sclient kubernetes.Interface, ks k8sclient: k8sclient, ksclient: ksclient, events: events.NewEventsOperator(evtsClient), + lo: logging.NewLoggingOperator(loggingClient), } } @@ -407,6 +413,129 @@ func (t *tenantOperator) Events(user user.Info, queryParam *eventsv1alpha1.Query }) } +func (t *tenantOperator) QueryLogs(user user.Info, query *loggingv1alpha2.Query) (*loggingv1alpha2.APIResponse, error) { + iNamespaces, err := t.listIntersectedNamespaces(user, + stringutils.Split(query.WorkspaceFilter, ","), + stringutils.Split(query.WorkspaceSearch, ","), + stringutils.Split(query.NamespaceFilter, ","), + stringutils.Split(query.NamespaceSearch, ",")) + if err != nil { + klog.Error(err) + return nil, err + } + + namespaceCreateTimeMap := make(map[string]time.Time) + for _, ns := range iNamespaces { + podLogs := authorizer.AttributesRecord{ + User: user, + Verb: "get", + APIGroup: "", + APIVersion: "v1", + Namespace: ns.Name, + Resource: "pods", + Subresource: "log", + ResourceRequest: true, + } + decision, _, err := t.authorizer.Authorize(podLogs) + if err != nil { + klog.Error(err) + return nil, err + } + if decision == authorizer.DecisionAllow { + namespaceCreateTimeMap[ns.Name] = ns.CreationTimestamp.Time + } + } + + sf := loggingclient.SearchFilter{ + NamespaceFilter: namespaceCreateTimeMap, + WorkloadSearch: stringutils.Split(query.WorkloadSearch, ","), + WorkloadFilter: stringutils.Split(query.WorkloadFilter, ","), + PodSearch: stringutils.Split(query.PodSearch, ","), + PodFilter: stringutils.Split(query.PodFilter, ","), + ContainerSearch: stringutils.Split(query.ContainerSearch, ","), + ContainerFilter: stringutils.Split(query.ContainerFilter, ","), + LogSearch: stringutils.Split(query.LogSearch, ","), + Starttime: query.StartTime, + Endtime: query.EndTime, + } + + var ar loggingv1alpha2.APIResponse + switch query.Operation { + case loggingv1alpha2.OperationStatistics: + if len(namespaceCreateTimeMap) == 0 { + ar.Statistics = &loggingclient.Statistics{} + } else { + ar, err = t.lo.GetCurrentStats(sf) + } + case loggingv1alpha2.OperationHistogram: + if len(namespaceCreateTimeMap) == 0 { + ar.Histogram = &loggingclient.Histogram{} + } else { + ar, err = t.lo.CountLogsByInterval(sf, query.Interval) + } + default: + if len(namespaceCreateTimeMap) == 0 { + ar.Logs = &loggingclient.Logs{} + } else { + ar, err = t.lo.SearchLogs(sf, query.From, query.Size, query.Sort) + } + } + return &ar, err +} + +func (t *tenantOperator) ExportLogs(user user.Info, query *loggingv1alpha2.Query, writer io.Writer) error { + iNamespaces, err := t.listIntersectedNamespaces(user, + stringutils.Split(query.WorkspaceFilter, ","), + stringutils.Split(query.WorkspaceSearch, ","), + stringutils.Split(query.NamespaceFilter, ","), + stringutils.Split(query.NamespaceSearch, ",")) + if err != nil { + klog.Error(err) + return err + } + + namespaceCreateTimeMap := make(map[string]time.Time) + for _, ns := range iNamespaces { + podLogs := authorizer.AttributesRecord{ + User: user, + Verb: "get", + APIGroup: "", + APIVersion: "v1", + Namespace: ns.Name, + Resource: "pods", + Subresource: "log", + ResourceRequest: true, + } + decision, _, err := t.authorizer.Authorize(podLogs) + if err != nil { + klog.Error(err) + return err + } + if decision == authorizer.DecisionAllow { + namespaceCreateTimeMap[ns.Name] = ns.CreationTimestamp.Time + } + } + + sf := loggingclient.SearchFilter{ + NamespaceFilter: namespaceCreateTimeMap, + WorkloadSearch: stringutils.Split(query.WorkloadSearch, ","), + WorkloadFilter: stringutils.Split(query.WorkloadFilter, ","), + PodSearch: stringutils.Split(query.PodSearch, ","), + PodFilter: stringutils.Split(query.PodFilter, ","), + ContainerSearch: stringutils.Split(query.ContainerSearch, ","), + ContainerFilter: stringutils.Split(query.ContainerFilter, ","), + LogSearch: stringutils.Split(query.LogSearch, ","), + Starttime: query.StartTime, + Endtime: query.EndTime, + } + + if len(namespaceCreateTimeMap) == 0 { + return nil + } else { + return t.lo.ExportLogs(sf, writer) + } +} + func contains(objects []runtime.Object, object runtime.Object) bool { for _, item := range objects { if item == object { diff --git a/pkg/models/tenant/tenent_test.go b/pkg/models/tenant/tenent_test.go index adc24cb1c..765c437b3 100644 --- a/pkg/models/tenant/tenent_test.go +++ b/pkg/models/tenant/tenent_test.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 @@ -330,5 +328,5 @@ func prepare() Interface { RoleBindings().Informer().GetIndexer().Add(roleBinding) } - return New(fakeInformerFactory, nil, nil, nil) + return New(fakeInformerFactory, nil, nil, nil, nil) } diff --git a/pkg/models/terminal/terminal.go b/pkg/models/terminal/terminal.go index 45943252c..212c21425 100644 --- a/pkg/models/terminal/terminal.go +++ b/pkg/models/terminal/terminal.go @@ -1,17 +1,19 @@ -// Copyright 2018 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 2018 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. +*/ + // the code is mainly from: // https://github.com/kubernetes/dashboard/blob/master/src/app/backend/handler/terminal.go // thanks to the related developer diff --git a/pkg/models/types.go b/pkg/models/types.go index fccff9c87..6f729287f 100644 --- a/pkg/models/types.go +++ b/pkg/models/types.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 models type PageableResponse struct { diff --git a/pkg/models/workloads/jobs.go b/pkg/models/workloads/jobs.go index f639f866a..0e79d7f10 100644 --- a/pkg/models/workloads/jobs.go +++ b/pkg/models/workloads/jobs.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 workloads import ( diff --git a/pkg/server/errors/errors.go b/pkg/server/errors/errors.go index c08138e31..9c50fbbfd 100644 --- a/pkg/server/errors/errors.go +++ b/pkg/server/errors/errors.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 errors import ( diff --git a/pkg/server/options/options.go b/pkg/server/options/options.go index 54dca7f56..f8575c51d 100644 --- a/pkg/server/options/options.go +++ b/pkg/server/options/options.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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/pkg/server/params/params.go b/pkg/server/params/params.go index f558ed3ad..4962b2c4d 100644 --- a/pkg/server/params/params.go +++ b/pkg/server/params/params.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 params import ( diff --git a/pkg/simple/client/cache/cache.go b/pkg/simple/client/cache/cache.go index 4d8712674..c48232ec1 100644 --- a/pkg/simple/client/cache/cache.go +++ b/pkg/simple/client/cache/cache.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 cache import "time" diff --git a/pkg/simple/client/cache/options.go b/pkg/simple/client/cache/options.go index 3422c1f81..3590acbc6 100644 --- a/pkg/simple/client/cache/options.go +++ b/pkg/simple/client/cache/options.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 cache import ( diff --git a/pkg/simple/client/cache/redis.go b/pkg/simple/client/cache/redis.go index 54db227bf..a98d0a038 100644 --- a/pkg/simple/client/cache/redis.go +++ b/pkg/simple/client/cache/redis.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 cache import ( diff --git a/pkg/simple/client/cache/simple_cache.go b/pkg/simple/client/cache/simple_cache.go index 55dc54428..bb196c2cf 100644 --- a/pkg/simple/client/cache/simple_cache.go +++ b/pkg/simple/client/cache/simple_cache.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 cache import ( diff --git a/pkg/simple/client/cache/simple_cache_test.go b/pkg/simple/client/cache/simple_cache_test.go index d2fae499b..4b2ec73ae 100644 --- a/pkg/simple/client/cache/simple_cache_test.go +++ b/pkg/simple/client/cache/simple_cache_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 cache import ( diff --git a/pkg/simple/client/devops/OWNERS b/pkg/simple/client/devops/OWNERS index 535b1e27d..9b558a233 100644 --- a/pkg/simple/client/devops/OWNERS +++ b/pkg/simple/client/devops/OWNERS @@ -1,10 +1,12 @@ approvers: - runzexia - soulseen + - shaowenchen reviewers: - runzexia - soulseen + - shaowenchen labels: - area/devops diff --git a/pkg/simple/client/ldap/channel.go b/pkg/simple/client/ldap/channel.go index 04f72530f..d826c5742 100644 --- a/pkg/simple/client/ldap/channel.go +++ b/pkg/simple/client/ldap/channel.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 ldap import ( diff --git a/pkg/simple/client/ldap/conn.go b/pkg/simple/client/ldap/conn.go index c10d3b90c..41189aa2b 100644 --- a/pkg/simple/client/ldap/conn.go +++ b/pkg/simple/client/ldap/conn.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 ldap import ( diff --git a/pkg/simple/client/ldap/interface.go b/pkg/simple/client/ldap/interface.go index ea83b769b..805870af2 100644 --- a/pkg/simple/client/ldap/interface.go +++ b/pkg/simple/client/ldap/interface.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 ldap import ( diff --git a/pkg/simple/client/ldap/ldap.go b/pkg/simple/client/ldap/ldap.go index 1372551e2..f2f62bd5f 100644 --- a/pkg/simple/client/ldap/ldap.go +++ b/pkg/simple/client/ldap/ldap.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 ldap import ( diff --git a/pkg/simple/client/ldap/options.go b/pkg/simple/client/ldap/options.go index cc631aa8e..12cc74729 100644 --- a/pkg/simple/client/ldap/options.go +++ b/pkg/simple/client/ldap/options.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 ldap import ( diff --git a/pkg/simple/client/ldap/pool.go b/pkg/simple/client/ldap/pool.go index c576587b0..851933e5e 100644 --- a/pkg/simple/client/ldap/pool.go +++ b/pkg/simple/client/ldap/pool.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 ldap import ( diff --git a/pkg/simple/client/ldap/simple_ldap.go b/pkg/simple/client/ldap/simple_ldap.go index 38a4ab855..f347c29e0 100644 --- a/pkg/simple/client/ldap/simple_ldap.go +++ b/pkg/simple/client/ldap/simple_ldap.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 ldap import ( diff --git a/pkg/simple/client/ldap/simple_ldap_test.go b/pkg/simple/client/ldap/simple_ldap_test.go index 62dff8764..213a0d8a7 100644 --- a/pkg/simple/client/ldap/simple_ldap_test.go +++ b/pkg/simple/client/ldap/simple_ldap_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 ldap import ( diff --git a/pkg/simple/client/logging/elasticsearch/api_body.go b/pkg/simple/client/logging/elasticsearch/api_body.go index 72b9d6fed..aea26dc72 100644 --- a/pkg/simple/client/logging/elasticsearch/api_body.go +++ b/pkg/simple/client/logging/elasticsearch/api_body.go @@ -2,6 +2,7 @@ package elasticsearch import ( "fmt" + "github.com/json-iterator/go" "k8s.io/klog" "kubesphere.io/kubesphere/pkg/simple/client/logging" "time" @@ -13,6 +14,9 @@ const ( replicaSetSuffixMaxLength = 11 // max 10 characters + 1 hyphen ) +// TODO: elastic/go-elasticsearch is working on Query DSL support. +// See https://github.com/elastic/go-elasticsearch/issues/42. +// We need refactor our query body builder when that is ready. type bodyBuilder struct { Body } @@ -22,75 +26,9 @@ func newBodyBuilder() *bodyBuilder { } func (bb *bodyBuilder) bytes() ([]byte, error) { - return json.Marshal(bb.Body) + return jsoniter.Marshal(bb.Body) } -// The mainBody func builds api body for query. -// TODO: Should use an elegant pakcage for building query body, but `elastic/go-elasticsearch` doesn't provide it currently. -// -// Example: -// GET kapis/logging.kubesphere.io/v1alpha2/cluster?start_time=0&end_time=156576063993&namespaces=kubesphere-system&pod_query=ks-apiserver -// ----- -//{ -// "from":0, -// "size":10, -// "sort":[ -// { -// "time": "desc" -// } -// ], -// "query":{ -// "bool":{ -// "filter":[ -// { -// "bool":{ -// "should":[ -// { -// "bool":{ -// "filter":[ -// { -// "match_phrase":{ -// "kubernetes.namespace_name.keyword":"kubesphere-system" -// } -// }, -// { -// "range":{ -// "time":{ -// "gte":"1572315987000" -// } -// } -// } -// ] -// } -// } -// ], -// "minimum_should_match":1 -// } -// }, -// { -// "bool":{ -// "should":[ -// { -// "match_phrase_prefix":{ -// "kubernetes.pod_name":"ks-apiserver" -// } -// } -// ], -// "minimum_should_match":1 -// } -// }, -// { -// "range":{ -// "time":{ -// "gte":"0", -// "lte":"156576063993" -// } -// } -// } -// ] -// } -// } -//} func (bb *bodyBuilder) mainBool(sf logging.SearchFilter) *bodyBuilder { var ms []Match @@ -207,10 +145,6 @@ func (bb *bodyBuilder) cardinalityAggregation() *bodyBuilder { } func (bb *bodyBuilder) dateHistogramAggregation(interval string) *bodyBuilder { - if interval == "" { - interval = "15m" - } - bb.Body.Aggs = &Aggs{ DateHistogramAggregation: &DateHistogramAggregation{ &DateHistogram{ @@ -232,12 +166,8 @@ func (bb *bodyBuilder) size(n int64) *bodyBuilder { return bb } -func (bb *bodyBuilder) sort(o string) *bodyBuilder { - if o != "asc" { - o = "desc" - } - - bb.Sorts = []map[string]string{{"time": o}} +func (bb *bodyBuilder) sort(order string) *bodyBuilder { + bb.Sorts = []map[string]string{{"time": order}} return bb } @@ -268,7 +198,7 @@ func podNameRegexp(workloadName string) string { func parseResponse(body []byte) (Response, error) { var res Response - err := json.Unmarshal(body, &res) + err := jsoniter.Unmarshal(body, &res) if err != nil { klog.Error(err) return Response{}, err diff --git a/pkg/simple/client/logging/elasticsearch/api_body_test.go b/pkg/simple/client/logging/elasticsearch/api_body_test.go index 6e160f358..8e13a6ccc 100644 --- a/pkg/simple/client/logging/elasticsearch/api_body_test.go +++ b/pkg/simple/client/logging/elasticsearch/api_body_test.go @@ -1,50 +1,117 @@ package elasticsearch import ( + "fmt" "github.com/google/go-cmp/cmp" "kubesphere.io/kubesphere/pkg/simple/client/logging" + "reflect" "testing" + "time" ) -func TestCardinalityAggregation(t *testing.T) { - var test = struct { - description string - searchFilter logging.SearchFilter - expected *bodyBuilder +func TestMainBool(t *testing.T) { + var tests = []struct { + filter logging.SearchFilter + expected string }{ - description: "add cardinality aggregation", - searchFilter: logging.SearchFilter{ - LogSearch: []string{"info"}, + { + filter: logging.SearchFilter{ + NamespaceFilter: map[string]time.Time{ + "default": time.Unix(1589981934, 0), + }, + }, + expected: "api_body_1.json", }, - expected: &bodyBuilder{Body{ - Query: &Query{ - Bool: Bool{ - Filter: []Match{ - { - Bool: &Bool{ - Should: []Match{ - { - MatchPhrasePrefix: map[string]string{"log": "info"}, - }, - }, - MinimumShouldMatch: 1, - }, - }, - }, - }, + { + filter: logging.SearchFilter{ + WorkloadFilter: []string{"mysql"}, + Starttime: time.Unix(1589980934, 0), + Endtime: time.Unix(1589981934, 0), }, - Aggs: &Aggs{ - CardinalityAggregation: &CardinalityAggregation{ - Cardinality: &Cardinality{Field: "kubernetes.docker_id.keyword"}, - }, + expected: "api_body_2.json", + }, + { + filter: logging.SearchFilter{ + PodFilter: []string{"mysql"}, + PodSearch: []string{"mysql-a8w3s-10945j"}, + LogSearch: []string{"info"}, }, - }}, + expected: "api_body_3.json", + }, + { + filter: logging.SearchFilter{ + ContainerFilter: []string{"mysql-1"}, + ContainerSearch: []string{"mysql-3"}, + }, + expected: "api_body_4.json", + }, } - t.Run(test.description, func(t *testing.T) { - body := newBodyBuilder().mainBool(test.searchFilter).cardinalityAggregation() - if diff := cmp.Diff(body, test.expected); diff != "" { - t.Fatalf("%T differ (-got, +want): %s", test.expected, diff) - } - }) + for i, test := range tests { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + var expected Body + err := JsonFromFile(test.expected, &expected) + if err != nil { + t.Fatal(err) + } + + result := newBodyBuilder().mainBool(test.filter).Body + + if diff := cmp.Diff(result, expected); diff != "" { + fmt.Printf("%T differ (-got, +want): %s", expected, diff) + } + }) + } +} + +func TestCardinalityAggregation(t *testing.T) { + var tests = []struct { + expected string + }{ + { + expected: "api_body_5.json", + }, + } + + for i, test := range tests { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + var expected Body + err := JsonFromFile(test.expected, &expected) + if err != nil { + t.Fatal(err) + } + + result := newBodyBuilder().cardinalityAggregation().Body + + if !reflect.DeepEqual(result, expected) { + t.Fatalf("expected: %v, but got %v", expected, result) + } + }) + } +} + +func TestDateHistogramAggregation(t *testing.T) { + var tests = []struct { + expected string + }{ + { + expected: "api_body_6.json", + }, + } + + for i, test := range tests { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + var expected Body + err := JsonFromFile(test.expected, &expected) + if err != nil { + t.Fatal(err) + } + + result := newBodyBuilder().dateHistogramAggregation("15m").Body + + if !reflect.DeepEqual(result, expected) { + t.Fatalf("expected: %v, but got %v", expected, result) + } + }) + } } diff --git a/pkg/simple/client/logging/elasticsearch/elasticsearch.go b/pkg/simple/client/logging/elasticsearch/elasticsearch.go index 30a3b2619..0b3d22fe3 100644 --- a/pkg/simple/client/logging/elasticsearch/elasticsearch.go +++ b/pkg/simple/client/logging/elasticsearch/elasticsearch.go @@ -4,12 +4,12 @@ import ( "bytes" "context" "fmt" - jsoniter "github.com/json-iterator/go" + "github.com/json-iterator/go" "io" "kubesphere.io/kubesphere/pkg/simple/client/logging" - v5 "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch/versions/v5" - v6 "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch/versions/v6" - v7 "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch/versions/v7" + "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch/versions/v5" + "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch/versions/v6" + "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch/versions/v7" "kubesphere.io/kubesphere/pkg/utils/stringutils" "strings" ) @@ -20,8 +20,6 @@ const ( ElasticV7 = "7" ) -var json = jsoniter.ConfigCompatibleWithStandardLibrary - // Elasticsearch implement logging interface type Elasticsearch struct { c client @@ -29,8 +27,7 @@ type Elasticsearch struct { // versioned es client interface type client interface { - // Perform Search API - Search(body []byte) ([]byte, error) + Search(body []byte, scroll bool) ([]byte, error) Scroll(id string) ([]byte, error) ClearScroll(id string) GetTotalHitCount(v interface{}) int64 @@ -83,11 +80,10 @@ func detectVersionMajor(host string) (string, error) { if err != nil { return "", err } - defer res.Body.Close() var b map[string]interface{} - if err = json.NewDecoder(res.Body).Decode(&b); err != nil { + if err = jsoniter.NewDecoder(res.Body).Decode(&b); err != nil { return "", err } if res.IsError() { @@ -116,7 +112,7 @@ func (es Elasticsearch) GetCurrentStats(sf logging.SearchFilter) (logging.Statis return logging.Statistics{}, err } - b, err := es.c.Search(body) + b, err := es.c.Search(body, true) if err != nil { return logging.Statistics{}, err } @@ -142,7 +138,7 @@ func (es Elasticsearch) CountLogsByInterval(sf logging.SearchFilter, interval st return logging.Histogram{}, err } - b, err := es.c.Search(body) + b, err := es.c.Search(body, false) if err != nil { return logging.Histogram{}, err } @@ -174,7 +170,7 @@ func (es Elasticsearch) SearchLogs(sf logging.SearchFilter, f, s int64, o string return logging.Logs{}, err } - b, err := es.c.Search(body) + b, err := es.c.Search(body, false) if err != nil { return logging.Logs{}, err } @@ -200,33 +196,50 @@ func (es Elasticsearch) SearchLogs(sf logging.SearchFilter, f, s int64, o string func (es Elasticsearch) ExportLogs(sf logging.SearchFilter, w io.Writer) error { var id string - var from int64 = 0 - var size int64 = 1000 + var data []string - res, err := es.SearchLogs(sf, from, size, "desc") - defer es.ClearScroll(id) + // Initial Search + body, err := newBodyBuilder(). + mainBool(sf). + from(0). + size(1000). + sort("desc"). + bytes() if err != nil { return err } - if res.Records == nil || len(res.Records) == 0 { + b, err := es.c.Search(body, true) + defer es.ClearScroll(id) + if err != nil { + return err + } + res, err := parseResponse(b) + if err != nil { + return err + } + + id = res.ScrollId + for _, hit := range res.AllHits { + data = append(data, hit.Log) + } + if len(data) == 0 { return nil } // limit to retrieve max 100k records for i := 0; i < 100; i++ { - res, id, err = es.scroll(id) + data, id, err = es.scroll(id) if err != nil { return err } - - if res.Records == nil || len(res.Records) == 0 { + if len(data) == 0 { return nil } output := new(bytes.Buffer) - for _, r := range res.Records { - output.WriteString(fmt.Sprintf(`%s`, stringutils.StripAnsi(r.Log))) + for _, l := range data { + output.WriteString(fmt.Sprintf(`%s`, stringutils.StripAnsi(l))) } _, err = io.Copy(w, output) if err != nil { @@ -236,24 +249,22 @@ func (es Elasticsearch) ExportLogs(sf logging.SearchFilter, w io.Writer) error { return nil } -func (es *Elasticsearch) scroll(id string) (logging.Logs, string, error) { +func (es *Elasticsearch) scroll(id string) ([]string, string, error) { b, err := es.c.Scroll(id) if err != nil { - return logging.Logs{}, id, err + return nil, id, err } res, err := parseResponse(b) if err != nil { - return logging.Logs{}, id, err + return nil, id, err } - var l logging.Logs + var data []string for _, hit := range res.AllHits { - l.Records = append(l.Records, logging.Record{ - Log: hit.Log, - }) + data = append(data, hit.Log) } - return l, res.ScrollId, nil + return data, res.ScrollId, nil } func (es *Elasticsearch) ClearScroll(id string) { diff --git a/pkg/simple/client/logging/elasticsearch/elasticsearch_test.go b/pkg/simple/client/logging/elasticsearch/elasticsearch_test.go index 2907ee159..5c43370c3 100644 --- a/pkg/simple/client/logging/elasticsearch/elasticsearch_test.go +++ b/pkg/simple/client/logging/elasticsearch/elasticsearch_test.go @@ -1,70 +1,46 @@ package elasticsearch import ( + "fmt" "github.com/google/go-cmp/cmp" + "github.com/json-iterator/go" + "io/ioutil" "kubesphere.io/kubesphere/pkg/simple/client/logging" - v5 "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch/versions/v5" - v6 "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch/versions/v6" - v7 "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch/versions/v7" + "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch/versions/v5" + "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch/versions/v6" + "kubesphere.io/kubesphere/pkg/simple/client/logging/elasticsearch/versions/v7" "net/http" "net/http/httptest" "testing" - "time" ) -func MockElasticsearchService(pattern string, fakeResp string) *httptest.Server { - mux := http.NewServeMux() - mux.HandleFunc(pattern, func(res http.ResponseWriter, req *http.Request) { - res.Write([]byte(fakeResp)) - }) - return httptest.NewServer(mux) -} - func TestDetectVersionMajor(t *testing.T) { var tests = []struct { - description string - fakeResp string - expected string - expectedError bool + fakeResp string + expected string }{ { - description: "detect es 6.x version number", - fakeResp: `{ - "name" : "elasticsearch-logging-data-0", - "cluster_name" : "elasticsearch", - "cluster_uuid" : "uLm0838MSd60T1XEh5P2Qg", - "version" : { - "number" : "6.7.0", - "build_flavor" : "oss", - "build_type" : "docker", - "build_hash" : "8453f77", - "build_date" : "2019-03-21T15:32:29.844721Z", - "build_snapshot" : false, - "lucene_version" : "7.7.0", - "minimum_wire_compatibility_version" : "5.6.0", - "minimum_index_compatibility_version" : "5.0.0" - }, - "tagline" : "You Know, for Search" -}`, - expected: ElasticV6, - expectedError: false, + fakeResp: "es6_detect_version_major_200.json", + expected: ElasticV6, + }, + { + fakeResp: "es7_detect_version_major_200.json", + expected: ElasticV7, }, } - for _, test := range tests { - t.Run(test.description, func(t *testing.T) { - es := MockElasticsearchService("/", test.fakeResp) + for i, test := range tests { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + es := mockElasticsearchService("/", test.fakeResp, http.StatusOK) defer es.Close() - v, err := detectVersionMajor(es.URL) - if err == nil && test.expectedError { - t.Fatalf("expected error while got nothing") - } else if err != nil && !test.expectedError { + result, err := detectVersionMajor(es.URL) + if err != nil { t.Fatal(err) } - if v != test.expected { - t.Fatalf("expected get version %s, but got %s", test.expected, v) + if diff := cmp.Diff(result, test.expected); diff != "" { + t.Fatalf("%T differ (-got, +want): %s", test.expected, diff) } }) } @@ -72,297 +48,202 @@ func TestDetectVersionMajor(t *testing.T) { func TestGetCurrentStats(t *testing.T) { var tests = []struct { - description string - searchFilter logging.SearchFilter - fakeVersion string - fakeResp string - expected logging.Statistics - expectedError bool + fakeVersion string + fakeResp string + fakeCode int + expected logging.Statistics + expectedErr string }{ { - description: "[es 6.x] run as admin", - searchFilter: logging.SearchFilter{}, - fakeVersion: ElasticV6, - fakeResp: `{ - "took": 171, - "timed_out": false, - "_shards": { - "total": 10, - "successful": 10, - "skipped": 0, - "failed": 0 - }, - "hits": { - "total": 241222, - "max_score": 1.0, - "hits": [ - { - "_index": "ks-logstash-log-2020.02.28", - "_type": "flb_type", - "_id": "Hn1GjXABMO5aQxyNsyxy", - "_score": 1.0, - "_source": { - "@timestamp": "2020-02-28T19:25:29.015Z", - "log": " value: \"hostpath\"\n", - "time": "2020-02-28T19:25:29.015492329Z", - "kubernetes": { - "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", - "namespace_name": "kube-system", - "host": "ks-allinone", - "container_name": "openebs-localpv-provisioner", - "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", - "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" - } - } - }, - { - "_index": "ks-logstash-log-2020.02.28", - "_type": "flb_type", - "_id": "I31GjXABMO5aQxyNsyxy", - "_score": 1.0, - "_source": { - "@timestamp": "2020-02-28T19:25:33.103Z", - "log": "I0228 19:25:33.102631 1 controller.go:1040] provision \"kubesphere-system/redis-pvc\" class \"local\": trying to save persistentvolume \"pvc-be6d127d-9366-4ea8-b1ce-f30c1b3a447b\"\n", - "time": "2020-02-28T19:25:33.103075891Z", - "kubernetes": { - "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", - "namespace_name": "kube-system", - "host": "ks-allinone", - "container_name": "openebs-localpv-provisioner", - "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", - "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" - } - } - }, - { - "_index": "ks-logstash-log-2020.02.28", - "_type": "flb_type", - "_id": "JX1GjXABMO5aQxyNsyxy", - "_score": 1.0, - "_source": { - "@timestamp": "2020-02-28T19:25:33.113Z", - "log": "I0228 19:25:33.112200 1 controller.go:1088] provision \"kubesphere-system/redis-pvc\" class \"local\": succeeded\n", - "time": "2020-02-28T19:25:33.113110332Z", - "kubernetes": { - "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", - "namespace_name": "kube-system", - "host": "ks-allinone", - "container_name": "openebs-localpv-provisioner", - "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", - "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" - } - } - }, - { - "_index": "ks-logstash-log-2020.02.28", - "_type": "flb_type", - "_id": "Kn1GjXABMO5aQxyNsyxy", - "_score": 1.0, - "_source": { - "@timestamp": "2020-02-28T19:25:34.168Z", - "log": " value: \"hostpath\"\n", - "time": "2020-02-28T19:25:34.168983384Z", - "kubernetes": { - "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", - "namespace_name": "kube-system", - "host": "ks-allinone", - "container_name": "openebs-localpv-provisioner", - "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", - "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" - } - } - }, - { - "_index": "ks-logstash-log-2020.02.28", - "_type": "flb_type", - "_id": "LH1GjXABMO5aQxyNsyxy", - "_score": 1.0, - "_source": { - "@timestamp": "2020-02-28T19:25:34.168Z", - "log": " value: \"/var/openebs/local/\"\n", - "time": "2020-02-28T19:25:34.168997393Z", - "kubernetes": { - "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", - "namespace_name": "kube-system", - "host": "ks-allinone", - "container_name": "openebs-localpv-provisioner", - "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", - "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" - } - } - }, - { - "_index": "ks-logstash-log-2020.02.28", - "_type": "flb_type", - "_id": "NX1GjXABMO5aQxyNsyxy", - "_score": 1.0, - "_source": { - "@timestamp": "2020-02-28T19:25:42.868Z", - "log": "I0228 19:25:42.868413 1 config.go:83] SC local has config:- name: StorageType\n", - "time": "2020-02-28T19:25:42.868578188Z", - "kubernetes": { - "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", - "namespace_name": "kube-system", - "host": "ks-allinone", - "container_name": "openebs-localpv-provisioner", - "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", - "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" - } - } - }, - { - "_index": "ks-logstash-log-2020.02.28", - "_type": "flb_type", - "_id": "Q31GjXABMO5aQxyNsyxy", - "_score": 1.0, - "_source": { - "@timestamp": "2020-02-28T19:26:13.881Z", - "log": "- name: BasePath\n", - "time": "2020-02-28T19:26:13.881180681Z", - "kubernetes": { - "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", - "namespace_name": "kube-system", - "host": "ks-allinone", - "container_name": "openebs-localpv-provisioner", - "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", - "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" - } - } - }, - { - "_index": "ks-logstash-log-2020.02.28", - "_type": "flb_type", - "_id": "S31GjXABMO5aQxyNsyxy", - "_score": 1.0, - "_source": { - "@timestamp": "2020-02-28T19:26:14.597Z", - "log": " value: \"/var/openebs/local/\"\n", - "time": "2020-02-28T19:26:14.597702238Z", - "kubernetes": { - "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", - "namespace_name": "kube-system", - "host": "ks-allinone", - "container_name": "openebs-localpv-provisioner", - "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", - "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" - } - } - }, - { - "_index": "ks-logstash-log-2020.02.28", - "_type": "flb_type", - "_id": "TH1GjXABMO5aQxyNsyxy", - "_score": 1.0, - "_source": { - "@timestamp": "2020-02-28T19:26:14.597Z", - "log": "I0228 19:26:14.597007 1 provisioner_hostpath.go:42] Creating volume pvc-c3b1e67f-00d2-407d-8c45-690bb273c16a at ks-allinone:/var/openebs/local/pvc-c3b1e67f-00d2-407d-8c45-690bb273c16a\n", - "time": "2020-02-28T19:26:14.597708432Z", - "kubernetes": { - "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", - "namespace_name": "kube-system", - "host": "ks-allinone", - "container_name": "openebs-localpv-provisioner", - "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", - "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" - } - } - }, - { - "_index": "ks-logstash-log-2020.02.28", - "_type": "flb_type", - "_id": "UX1GjXABMO5aQxyNsyxy", - "_score": 1.0, - "_source": { - "@timestamp": "2020-02-28T19:26:15.920Z", - "log": "I0228 19:26:15.915071 1 event.go:221] Event(v1.ObjectReference{Kind:\"PersistentVolumeClaim\", Namespace:\"kubesphere-system\", Name:\"mysql-pvc\", UID:\"1e87deb5-eaec-475f-8eb6-8613b3be80a4\", APIVersion:\"v1\", ResourceVersion:\"2397\", FieldPath:\"\"}): type: 'Normal' reason: 'ProvisioningSucceeded' Successfully provisioned volume pvc-1e87deb5-eaec-475f-8eb6-8613b3be80a4\n", - "time": "2020-02-28T19:26:15.920650572Z", - "kubernetes": { - "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", - "namespace_name": "kube-system", - "host": "ks-allinone", - "container_name": "openebs-localpv-provisioner", - "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", - "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" - } - } - } - ] - }, - "aggregations": { - "container_count": { - "value": 93 - } - } -}`, + fakeVersion: ElasticV6, + fakeResp: "es6_get_current_stats_200.json", + fakeCode: http.StatusOK, expected: logging.Statistics{ Containers: 93, Logs: 241222, }, - expectedError: false, }, { - description: "[es 6.x] index not found", - searchFilter: logging.SearchFilter{ - NamespaceFilter: map[string]time.Time{ - "workspace-1-project-a": time.Unix(1582000000, 0), - "workspace-1-project-b": time.Unix(1582333333, 0), - }, - }, fakeVersion: ElasticV6, - fakeResp: `{ - "error": { - "root_cause": [ - { - "type": "index_not_found_exception", - "reason": "no such index", - "resource.type": "index_or_alias", - "resource.id": "ks-lsdfsdfsdfs", - "index_uuid": "_na_", - "index": "ks-lsdfsdfsdfs" - } - ], - "type": "index_not_found_exception", - "reason": "no such index", - "resource.type": "index_or_alias", - "resource.id": "ks-lsdfsdfsdfs", - "index_uuid": "_na_", - "index": "ks-lsdfsdfsdfs" - }, - "status": 404 -}`, + fakeResp: "es6_get_current_stats_404.json", + fakeCode: http.StatusNotFound, + expectedErr: "type: index_not_found_exception, reason: no such index", + }, + { + fakeVersion: ElasticV7, + fakeResp: "es7_get_current_stats_200.json", + fakeCode: http.StatusOK, expected: logging.Statistics{ - Containers: 0, - Logs: 0, + Containers: 48, + Logs: 9726, }, - expectedError: true, + }, + { + fakeVersion: ElasticV7, + fakeResp: "es7_get_current_stats_404.json", + fakeCode: http.StatusNotFound, + expectedErr: "type: index_not_found_exception, reason: no such index [ks-logstash-log-2020.05.2]", }, } - for _, test := range tests { - t.Run(test.description, func(t *testing.T) { - es := MockElasticsearchService("/", test.fakeResp) - defer es.Close() + for i, test := range tests { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + srv := mockElasticsearchService("/ks-logstash-log*/_search", test.fakeResp, test.fakeCode) + defer srv.Close() - clientv5 := Elasticsearch{c: v5.New(es.URL, "ks-logstash-log")} - clientv6 := Elasticsearch{c: v6.New(es.URL, "ks-logstash-log")} - clientv7 := Elasticsearch{c: v7.New(es.URL, "ks-logstash-log")} + es := newElasticsearchClient(srv, test.fakeVersion) - var stats logging.Statistics - var err error - switch test.fakeVersion { - case ElasticV5: - stats, err = clientv5.GetCurrentStats(test.searchFilter) - case ElasticV6: - stats, err = clientv6.GetCurrentStats(test.searchFilter) - case ElasticV7: - stats, err = clientv7.GetCurrentStats(test.searchFilter) + result, err := es.GetCurrentStats(logging.SearchFilter{}) + if test.expectedErr != "" { + if diff := cmp.Diff(fmt.Sprint(err), test.expectedErr); diff != "" { + t.Fatalf("%T differ (-got, +want): %s", test.expectedErr, diff) + } } - - if err != nil && !test.expectedError { - t.Fatal(err) - } else if diff := cmp.Diff(stats, test.expected); diff != "" { + if diff := cmp.Diff(result, test.expected); diff != "" { t.Fatalf("%T differ (-got, +want): %s", test.expected, diff) } }) } } + +func TestCountLogsByInterval(t *testing.T) { + var tests = []struct { + fakeVersion string + fakeResp string + fakeCode int + expected logging.Histogram + expectedErr string + }{ + { + fakeVersion: ElasticV7, + fakeResp: "es7_count_logs_by_interval_200.json", + fakeCode: http.StatusOK, + expected: logging.Histogram{ + Total: 10000, + Buckets: []logging.Bucket{ + { + Time: 1589644800000, + Count: 410, + }, + { + Time: 1589646600000, + Count: 7465, + }, + { + Time: 1589648400000, + Count: 12790, + }, + }, + }, + }, + { + fakeVersion: ElasticV7, + fakeResp: "es7_count_logs_by_interval_400.json", + fakeCode: http.StatusBadRequest, + expectedErr: "type: search_phase_execution_exception, reason: all shards failed", + }, + { + fakeVersion: ElasticV7, + fakeResp: "es7_count_logs_by_interval_404.json", + fakeCode: http.StatusNotFound, + expectedErr: "type: index_not_found_exception, reason: no such index [ks-logstash-log-20]", + }, + } + + for i, test := range tests { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + srv := mockElasticsearchService("/ks-logstash-log*/_search", test.fakeResp, test.fakeCode) + defer srv.Close() + + es := newElasticsearchClient(srv, test.fakeVersion) + + result, err := es.CountLogsByInterval(logging.SearchFilter{}, "15m") + if test.expectedErr != "" { + if diff := cmp.Diff(fmt.Sprint(err), test.expectedErr); diff != "" { + t.Fatalf("%T differ (-got, +want): %s", test.expectedErr, diff) + } + } + if diff := cmp.Diff(result, test.expected); diff != "" { + t.Fatalf("%T differ (-got, +want): %s", test.expected, diff) + } + }) + } +} + +func TestSearchLogs(t *testing.T) { + var tests = []struct { + fakeVersion string + fakeResp string + fakeCode int + expected string + expectedErr string + }{ + { + fakeVersion: ElasticV7, + fakeResp: "es7_search_logs_200.json", + fakeCode: http.StatusOK, + expected: "es7_search_logs_200_result.json", + }, + } + + for i, test := range tests { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + var expected logging.Logs + err := JsonFromFile(test.expected, &expected) + if err != nil { + t.Fatal(err) + } + + srv := mockElasticsearchService("/ks-logstash-log*/_search", test.fakeResp, test.fakeCode) + defer srv.Close() + + es := newElasticsearchClient(srv, test.fakeVersion) + + result, err := es.SearchLogs(logging.SearchFilter{}, 0, 10, "asc") + if test.expectedErr != "" { + if diff := cmp.Diff(fmt.Sprint(err), test.expectedErr); diff != "" { + t.Fatalf("%T differ (-got, +want): %s", test.expectedErr, diff) + } + } + if diff := cmp.Diff(result, expected); diff != "" { + t.Fatalf("%T differ (-got, +want): %s", expected, diff) + } + }) + } +} + +func mockElasticsearchService(pattern, fakeResp string, fakeCode int) *httptest.Server { + mux := http.NewServeMux() + mux.HandleFunc(pattern, func(res http.ResponseWriter, req *http.Request) { + b, _ := ioutil.ReadFile(fmt.Sprintf("./testdata/%s", fakeResp)) + res.WriteHeader(fakeCode) + res.Write(b) + }) + return httptest.NewServer(mux) +} + +func newElasticsearchClient(srv *httptest.Server, version string) Elasticsearch { + var es Elasticsearch + switch version { + case ElasticV5: + es = Elasticsearch{c: v5.New(srv.URL, "ks-logstash-log")} + case ElasticV6: + es = Elasticsearch{c: v6.New(srv.URL, "ks-logstash-log")} + case ElasticV7: + es = Elasticsearch{c: v7.New(srv.URL, "ks-logstash-log")} + } + return es +} + +func JsonFromFile(expectedFile string, expectedJsonPtr interface{}) error { + json, err := ioutil.ReadFile(fmt.Sprintf("./testdata/%s", expectedFile)) + if err != nil { + return err + } + err = jsoniter.Unmarshal(json, expectedJsonPtr) + if err != nil { + return err + } + + return nil +} diff --git a/pkg/simple/client/logging/elasticsearch/testdata/api_body_1.json b/pkg/simple/client/logging/elasticsearch/testdata/api_body_1.json new file mode 100644 index 000000000..7a70dc874 --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/api_body_1.json @@ -0,0 +1,33 @@ +{ + "query":{ + "bool":{ + "filter":[ + { + "bool":{ + "should":[ + { + "bool":{ + "filter":[ + { + "match_phrase":{ + "kubernetes.namespace_name.keyword":"default" + } + }, + { + "range":{ + "time":{ + "gte":"2020-05-20T21:38:54+08:00" + } + } + } + ] + } + } + ], + "minimum_should_match":1 + } + } + ] + } + } +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/api_body_2.json b/pkg/simple/client/logging/elasticsearch/testdata/api_body_2.json new file mode 100644 index 000000000..a6de9e65d --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/api_body_2.json @@ -0,0 +1,28 @@ +{ + "query":{ + "bool":{ + "filter":[ + { + "bool":{ + "should":[ + { + "regexp":{ + "kubernetes.pod_name.keyword":"mysql-[bcdfghjklmnpqrstvwxz2456789]{1,10}-[a-z0-9]{5}|mysql-[0-9]+|mysql-[a-z0-9]{5}" + } + } + ], + "minimum_should_match":1 + } + }, + { + "range":{ + "time":{ + "gte":"2020-05-20T21:22:14+08:00", + "lte":"2020-05-20T21:38:54+08:00" + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/api_body_3.json b/pkg/simple/client/logging/elasticsearch/testdata/api_body_3.json new file mode 100644 index 000000000..9ec247fb2 --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/api_body_3.json @@ -0,0 +1,44 @@ +{ + "query":{ + "bool":{ + "filter":[ + { + "bool":{ + "should":[ + { + "match_phrase":{ + "kubernetes.pod_name.keyword":"mysql" + } + } + ], + "minimum_should_match":1 + } + }, + { + "bool":{ + "should":[ + { + "match_phrase_prefix":{ + "kubernetes.pod_name":"mysql-a8w3s-10945j" + } + } + ], + "minimum_should_match":1 + } + }, + { + "bool":{ + "should":[ + { + "match_phrase_prefix":{ + "log":"info" + } + } + ], + "minimum_should_match":1 + } + } + ] + } + } +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/api_body_4.json b/pkg/simple/client/logging/elasticsearch/testdata/api_body_4.json new file mode 100644 index 000000000..b8180e000 --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/api_body_4.json @@ -0,0 +1,32 @@ +{ + "query":{ + "bool":{ + "filter":[ + { + "bool":{ + "should":[ + { + "match_phrase":{ + "kubernetes.container_name.keyword":"mysql-1" + } + } + ], + "minimum_should_match":1 + } + }, + { + "bool":{ + "should":[ + { + "match_phrase_prefix":{ + "kubernetes.container_name":"mysql-3" + } + } + ], + "minimum_should_match":1 + } + } + ] + } + } +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/api_body_5.json b/pkg/simple/client/logging/elasticsearch/testdata/api_body_5.json new file mode 100644 index 000000000..f46804d52 --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/api_body_5.json @@ -0,0 +1,9 @@ +{ + "aggs":{ + "container_count":{ + "cardinality":{ + "field":"kubernetes.docker_id.keyword" + } + } + } +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/api_body_6.json b/pkg/simple/client/logging/elasticsearch/testdata/api_body_6.json new file mode 100644 index 000000000..9da99500b --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/api_body_6.json @@ -0,0 +1,10 @@ +{ + "aggs":{ + "log_count_over_time":{ + "date_histogram":{ + "field":"time", + "interval":"15m" + } + } + } +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/es6_detect_version_major_200.json b/pkg/simple/client/logging/elasticsearch/testdata/es6_detect_version_major_200.json new file mode 100644 index 000000000..f0ffed604 --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/es6_detect_version_major_200.json @@ -0,0 +1,17 @@ +{ + "name" : "elasticsearch-logging-data-0", + "cluster_name" : "elasticsearch", + "cluster_uuid" : "uLm0838MSd60T1XEh5P2Qg", + "version" : { + "number" : "6.7.0", + "build_flavor" : "oss", + "build_type" : "docker", + "build_hash" : "8453f77", + "build_date" : "2019-03-21T15:32:29.844721Z", + "build_snapshot" : false, + "lucene_version" : "7.7.0", + "minimum_wire_compatibility_version" : "5.6.0", + "minimum_index_compatibility_version" : "5.0.0" + }, + "tagline" : "You Know, for Search" +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/es6_get_current_stats_200.json b/pkg/simple/client/logging/elasticsearch/testdata/es6_get_current_stats_200.json new file mode 100644 index 000000000..db91c786c --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/es6_get_current_stats_200.json @@ -0,0 +1,211 @@ +{ + "took": 171, + "timed_out": false, + "_shards": { + "total": 10, + "successful": 10, + "skipped": 0, + "failed": 0 + }, + "hits": { + "total": 241222, + "max_score": 1.0, + "hits": [ + { + "_index": "ks-logstash-log-2020.02.28", + "_type": "flb_type", + "_id": "Hn1GjXABMO5aQxyNsyxy", + "_score": 1.0, + "_source": { + "@timestamp": "2020-02-28T19:25:29.015Z", + "log": " value: \"hostpath\"\n", + "time": "2020-02-28T19:25:29.015492329Z", + "kubernetes": { + "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", + "namespace_name": "kube-system", + "host": "ks-allinone", + "container_name": "openebs-localpv-provisioner", + "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", + "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" + } + } + }, + { + "_index": "ks-logstash-log-2020.02.28", + "_type": "flb_type", + "_id": "I31GjXABMO5aQxyNsyxy", + "_score": 1.0, + "_source": { + "@timestamp": "2020-02-28T19:25:33.103Z", + "log": "I0228 19:25:33.102631 1 controller.go:1040] provision \"kubesphere-system/redis-pvc\" class \"local\": trying to save persistentvolume \"pvc-be6d127d-9366-4ea8-b1ce-f30c1b3a447b\"\n", + "time": "2020-02-28T19:25:33.103075891Z", + "kubernetes": { + "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", + "namespace_name": "kube-system", + "host": "ks-allinone", + "container_name": "openebs-localpv-provisioner", + "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", + "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" + } + } + }, + { + "_index": "ks-logstash-log-2020.02.28", + "_type": "flb_type", + "_id": "JX1GjXABMO5aQxyNsyxy", + "_score": 1.0, + "_source": { + "@timestamp": "2020-02-28T19:25:33.113Z", + "log": "I0228 19:25:33.112200 1 controller.go:1088] provision \"kubesphere-system/redis-pvc\" class \"local\": succeeded\n", + "time": "2020-02-28T19:25:33.113110332Z", + "kubernetes": { + "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", + "namespace_name": "kube-system", + "host": "ks-allinone", + "container_name": "openebs-localpv-provisioner", + "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", + "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" + } + } + }, + { + "_index": "ks-logstash-log-2020.02.28", + "_type": "flb_type", + "_id": "Kn1GjXABMO5aQxyNsyxy", + "_score": 1.0, + "_source": { + "@timestamp": "2020-02-28T19:25:34.168Z", + "log": " value: \"hostpath\"\n", + "time": "2020-02-28T19:25:34.168983384Z", + "kubernetes": { + "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", + "namespace_name": "kube-system", + "host": "ks-allinone", + "container_name": "openebs-localpv-provisioner", + "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", + "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" + } + } + }, + { + "_index": "ks-logstash-log-2020.02.28", + "_type": "flb_type", + "_id": "LH1GjXABMO5aQxyNsyxy", + "_score": 1.0, + "_source": { + "@timestamp": "2020-02-28T19:25:34.168Z", + "log": " value: \"/var/openebs/local/\"\n", + "time": "2020-02-28T19:25:34.168997393Z", + "kubernetes": { + "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", + "namespace_name": "kube-system", + "host": "ks-allinone", + "container_name": "openebs-localpv-provisioner", + "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", + "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" + } + } + }, + { + "_index": "ks-logstash-log-2020.02.28", + "_type": "flb_type", + "_id": "NX1GjXABMO5aQxyNsyxy", + "_score": 1.0, + "_source": { + "@timestamp": "2020-02-28T19:25:42.868Z", + "log": "I0228 19:25:42.868413 1 config.go:83] SC local has config:- name: StorageType\n", + "time": "2020-02-28T19:25:42.868578188Z", + "kubernetes": { + "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", + "namespace_name": "kube-system", + "host": "ks-allinone", + "container_name": "openebs-localpv-provisioner", + "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", + "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" + } + } + }, + { + "_index": "ks-logstash-log-2020.02.28", + "_type": "flb_type", + "_id": "Q31GjXABMO5aQxyNsyxy", + "_score": 1.0, + "_source": { + "@timestamp": "2020-02-28T19:26:13.881Z", + "log": "- name: BasePath\n", + "time": "2020-02-28T19:26:13.881180681Z", + "kubernetes": { + "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", + "namespace_name": "kube-system", + "host": "ks-allinone", + "container_name": "openebs-localpv-provisioner", + "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", + "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" + } + } + }, + { + "_index": "ks-logstash-log-2020.02.28", + "_type": "flb_type", + "_id": "S31GjXABMO5aQxyNsyxy", + "_score": 1.0, + "_source": { + "@timestamp": "2020-02-28T19:26:14.597Z", + "log": " value: \"/var/openebs/local/\"\n", + "time": "2020-02-28T19:26:14.597702238Z", + "kubernetes": { + "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", + "namespace_name": "kube-system", + "host": "ks-allinone", + "container_name": "openebs-localpv-provisioner", + "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", + "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" + } + } + }, + { + "_index": "ks-logstash-log-2020.02.28", + "_type": "flb_type", + "_id": "TH1GjXABMO5aQxyNsyxy", + "_score": 1.0, + "_source": { + "@timestamp": "2020-02-28T19:26:14.597Z", + "log": "I0228 19:26:14.597007 1 provisioner_hostpath.go:42] Creating volume pvc-c3b1e67f-00d2-407d-8c45-690bb273c16a at ks-allinone:/var/openebs/local/pvc-c3b1e67f-00d2-407d-8c45-690bb273c16a\n", + "time": "2020-02-28T19:26:14.597708432Z", + "kubernetes": { + "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", + "namespace_name": "kube-system", + "host": "ks-allinone", + "container_name": "openebs-localpv-provisioner", + "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", + "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" + } + } + }, + { + "_index": "ks-logstash-log-2020.02.28", + "_type": "flb_type", + "_id": "UX1GjXABMO5aQxyNsyxy", + "_score": 1.0, + "_source": { + "@timestamp": "2020-02-28T19:26:15.920Z", + "log": "I0228 19:26:15.915071 1 event.go:221] Event(v1.ObjectReference{Kind:\"PersistentVolumeClaim\", Namespace:\"kubesphere-system\", Name:\"mysql-pvc\", UID:\"1e87deb5-eaec-475f-8eb6-8613b3be80a4\", APIVersion:\"v1\", ResourceVersion:\"2397\", FieldPath:\"\"}): type: 'Normal' reason: 'ProvisioningSucceeded' Successfully provisioned volume pvc-1e87deb5-eaec-475f-8eb6-8613b3be80a4\n", + "time": "2020-02-28T19:26:15.920650572Z", + "kubernetes": { + "pod_name": "openebs-localpv-provisioner-55c66b57b4-jgtjc", + "namespace_name": "kube-system", + "host": "ks-allinone", + "container_name": "openebs-localpv-provisioner", + "docker_id": "cac01cd01cc79d8a8903ddbe6fbde9ac7497919a3f33c61861443703a9e08b39", + "container_hash": "25d789bcd3d12a4ba50bbb56eed1de33279d04352adbba8fd7e3b7b938aec806" + } + } + } + ] + }, + "aggregations": { + "container_count": { + "value": 93 + } + } +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/es6_get_current_stats_404.json b/pkg/simple/client/logging/elasticsearch/testdata/es6_get_current_stats_404.json new file mode 100644 index 000000000..a930e366c --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/es6_get_current_stats_404.json @@ -0,0 +1,21 @@ +{ + "error": { + "root_cause": [ + { + "type": "index_not_found_exception", + "reason": "no such index", + "resource.type": "index_or_alias", + "resource.id": "ks-lsdfsdfsdfs", + "index_uuid": "_na_", + "index": "ks-lsdfsdfsdfs" + } + ], + "type": "index_not_found_exception", + "reason": "no such index", + "resource.type": "index_or_alias", + "resource.id": "ks-lsdfsdfsdfs", + "index_uuid": "_na_", + "index": "ks-lsdfsdfsdfs" + }, + "status": 404 +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/es7_count_logs_by_interval_200.json b/pkg/simple/client/logging/elasticsearch/testdata/es7_count_logs_by_interval_200.json new file mode 100644 index 000000000..ab014e8be --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/es7_count_logs_by_interval_200.json @@ -0,0 +1,230 @@ +{ + "took": 23, + "timed_out": false, + "_shards": { + "total": 2, + "successful": 2, + "skipped": 0, + "failed": 0 + }, + "hits": { + "total": { + "value": 10000, + "relation": "gte" + }, + "max_score": 1.0, + "hits": [ + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "tRt2MXIBlcWZ594bqIUO", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:42.608Z", + "log": "10.233.30.76 redis-ha-announce-0.kubesphere-system.svc.cluster.local\n", + "time": "2020-05-16T16:00:42.608962452Z", + "kubernetes": { + "pod_name": "redis-ha-haproxy-ffb8d889d-8x9kj", + "namespace_name": "kubesphere-system", + "host": "master0", + "container_name": "config-init", + "docker_id": "a673327e5e3dfefca3e773273e69eca64baaa4499fdc04e6eb9d621ad8688ad0", + "container_hash": "cd4b3d4d27ae5931dc96b9632188590b7a6880469bcf07f478a3280dd0955336" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "tht2MXIBlcWZ594bqIUO", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:42.670Z", + "log": "10.233.30.204 redis-ha-announce-1.kubesphere-system.svc.cluster.local\n", + "time": "2020-05-16T16:00:42.670430525Z", + "kubernetes": { + "pod_name": "redis-ha-haproxy-ffb8d889d-8x9kj", + "namespace_name": "kubesphere-system", + "host": "master0", + "container_name": "config-init", + "docker_id": "a673327e5e3dfefca3e773273e69eca64baaa4499fdc04e6eb9d621ad8688ad0", + "container_hash": "cd4b3d4d27ae5931dc96b9632188590b7a6880469bcf07f478a3280dd0955336" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "txt2MXIBlcWZ594bqIUO", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:42.731Z", + "log": "10.233.56.100 redis-ha-announce-2.kubesphere-system.svc.cluster.local\n", + "time": "2020-05-16T16:00:42.731865428Z", + "kubernetes": { + "pod_name": "redis-ha-haproxy-ffb8d889d-8x9kj", + "namespace_name": "kubesphere-system", + "host": "master0", + "container_name": "config-init", + "docker_id": "a673327e5e3dfefca3e773273e69eca64baaa4499fdc04e6eb9d621ad8688ad0", + "container_hash": "cd4b3d4d27ae5931dc96b9632188590b7a6880469bcf07f478a3280dd0955336" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "jxt2MXIBlcWZ594bpIVN", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:07.648Z", + "log": "ls: cannot access '/calico-secrets': No such file or directory\n", + "time": "2020-05-16T16:00:07.64848716Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "kBt2MXIBlcWZ594bpIV0", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:08.164Z", + "log": "Wrote Calico CNI binaries to /host/opt/cni/bin\n", + "time": "2020-05-16T16:00:08.164003996Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "kRt2MXIBlcWZ594bpIV0", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:08.350Z", + "log": "CNI plugin version: v3.7.3\n", + "time": "2020-05-16T16:00:08.350585959Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "kht2MXIBlcWZ594bpIV0", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:08.350Z", + "log": "/host/secondary-bin-dir is non-writeable, skipping\n", + "time": "2020-05-16T16:00:08.350625112Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "kxt2MXIBlcWZ594bpIV0", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:08.350Z", + "log": "Using CNI config template from /host/etc/cni/net.d/calico.conflist.template.\n", + "time": "2020-05-16T16:00:08.350692011Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "lBt2MXIBlcWZ594bpIV0", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:08.454Z", + "log": "CNI config: {\n", + "time": "2020-05-16T16:00:08.454417144Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "lRt2MXIBlcWZ594bpIV0", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:08.454Z", + "log": " \"name\": \"cni0\",\n", + "time": "2020-05-16T16:00:08.454452649Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + } + ] + }, + "aggregations": { + "log_count_over_time": { + "buckets": [ + { + "key_as_string": "2020-05-16T16:00:00.000Z", + "key": 1589644800000, + "doc_count": 410 + }, + { + "key_as_string": "2020-05-16T16:30:00.000Z", + "key": 1589646600000, + "doc_count": 7465 + }, + { + "key_as_string": "2020-05-16T17:00:00.000Z", + "key": 1589648400000, + "doc_count": 12790 + } + ] + } + } +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/es7_count_logs_by_interval_400.json b/pkg/simple/client/logging/elasticsearch/testdata/es7_count_logs_by_interval_400.json new file mode 100644 index 000000000..a430ad038 --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/es7_count_logs_by_interval_400.json @@ -0,0 +1,47 @@ +{ + "error": { + "root_cause": [ + { + "type": "illegal_argument_exception", + "reason": "Unable to parse interval [30m0s]" + }, + { + "type": "illegal_argument_exception", + "reason": "Unable to parse interval [30m0s]" + } + ], + "type": "search_phase_execution_exception", + "reason": "all shards failed", + "phase": "query", + "grouped": true, + "failed_shards": [ + { + "shard": 0, + "index": "ks-logstash-log-2020.05.16", + "node": "Zr2OFlfeSJmK_W3Re4UBlg", + "reason": { + "type": "illegal_argument_exception", + "reason": "Unable to parse interval [30m0s]" + } + }, + { + "shard": 0, + "index": "ks-logstash-log-2020.05.20", + "node": "pbGNYbV3QUuV5yJAgxbp3g", + "reason": { + "type": "illegal_argument_exception", + "reason": "Unable to parse interval [30m0s]" + } + } + ], + "caused_by": { + "type": "illegal_argument_exception", + "reason": "Unable to parse interval [30m0s]", + "caused_by": { + "type": "illegal_argument_exception", + "reason": "Unable to parse interval [30m0s]" + } + } + }, + "status": 400 +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/es7_count_logs_by_interval_404.json b/pkg/simple/client/logging/elasticsearch/testdata/es7_count_logs_by_interval_404.json new file mode 100644 index 000000000..4d5275003 --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/es7_count_logs_by_interval_404.json @@ -0,0 +1,21 @@ +{ + "error": { + "root_cause": [ + { + "type": "index_not_found_exception", + "reason": "no such index [ks-logstash-log-20]", + "resource.type": "index_or_alias", + "resource.id": "ks-logstash-log-20", + "index_uuid": "_na_", + "index": "ks-logstash-log-20" + } + ], + "type": "index_not_found_exception", + "reason": "no such index [ks-logstash-log-20]", + "resource.type": "index_or_alias", + "resource.id": "ks-logstash-log-20", + "index_uuid": "_na_", + "index": "ks-logstash-log-20" + }, + "status": 404 +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/es7_detect_version_major_200.json b/pkg/simple/client/logging/elasticsearch/testdata/es7_detect_version_major_200.json new file mode 100644 index 000000000..b2fc43429 --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/es7_detect_version_major_200.json @@ -0,0 +1,17 @@ +{ + "name" : "elasticsearch-master-2", + "cluster_name" : "elasticsearch", + "cluster_uuid" : "_A-3shR0R0i-2M9CzOWP8g", + "version" : { + "number" : "7.7.0", + "build_flavor" : "default", + "build_type" : "docker", + "build_hash" : "81a1e9eda8e6183f5237786246f6dced26a10eaf", + "build_date" : "2020-05-12T02:01:37.602180Z", + "build_snapshot" : false, + "lucene_version" : "8.5.1", + "minimum_wire_compatibility_version" : "6.8.0", + "minimum_index_compatibility_version" : "6.0.0-beta1" + }, + "tagline" : "You Know, for Search" +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/es7_get_current_stats_200.json b/pkg/simple/client/logging/elasticsearch/testdata/es7_get_current_stats_200.json new file mode 100644 index 000000000..b4b55c731 --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/es7_get_current_stats_200.json @@ -0,0 +1,214 @@ +{ + "took": 1455, + "timed_out": false, + "_shards": { + "total": 2, + "successful": 2, + "skipped": 0, + "failed": 0 + }, + "hits": { + "total": { + "value": 9726, + "relation": "eq" + }, + "max_score": 1.0, + "hits": [ + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "tRt2MXIBlcWZ594bqIUO", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:42.608Z", + "log": "10.233.30.76 redis-ha-announce-0.kubesphere-system.svc.cluster.local\n", + "time": "2020-05-16T16:00:42.608962452Z", + "kubernetes": { + "pod_name": "redis-ha-haproxy-ffb8d889d-8x9kj", + "namespace_name": "kubesphere-system", + "host": "master0", + "container_name": "config-init", + "docker_id": "a673327e5e3dfefca3e773273e69eca64baaa4499fdc04e6eb9d621ad8688ad0", + "container_hash": "cd4b3d4d27ae5931dc96b9632188590b7a6880469bcf07f478a3280dd0955336" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "tht2MXIBlcWZ594bqIUO", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:42.670Z", + "log": "10.233.30.204 redis-ha-announce-1.kubesphere-system.svc.cluster.local\n", + "time": "2020-05-16T16:00:42.670430525Z", + "kubernetes": { + "pod_name": "redis-ha-haproxy-ffb8d889d-8x9kj", + "namespace_name": "kubesphere-system", + "host": "master0", + "container_name": "config-init", + "docker_id": "a673327e5e3dfefca3e773273e69eca64baaa4499fdc04e6eb9d621ad8688ad0", + "container_hash": "cd4b3d4d27ae5931dc96b9632188590b7a6880469bcf07f478a3280dd0955336" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "txt2MXIBlcWZ594bqIUO", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:42.731Z", + "log": "10.233.56.100 redis-ha-announce-2.kubesphere-system.svc.cluster.local\n", + "time": "2020-05-16T16:00:42.731865428Z", + "kubernetes": { + "pod_name": "redis-ha-haproxy-ffb8d889d-8x9kj", + "namespace_name": "kubesphere-system", + "host": "master0", + "container_name": "config-init", + "docker_id": "a673327e5e3dfefca3e773273e69eca64baaa4499fdc04e6eb9d621ad8688ad0", + "container_hash": "cd4b3d4d27ae5931dc96b9632188590b7a6880469bcf07f478a3280dd0955336" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "jxt2MXIBlcWZ594bpIVN", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:07.648Z", + "log": "ls: cannot access '/calico-secrets': No such file or directory\n", + "time": "2020-05-16T16:00:07.64848716Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "kBt2MXIBlcWZ594bpIV0", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:08.164Z", + "log": "Wrote Calico CNI binaries to /host/opt/cni/bin\n", + "time": "2020-05-16T16:00:08.164003996Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "kRt2MXIBlcWZ594bpIV0", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:08.350Z", + "log": "CNI plugin version: v3.7.3\n", + "time": "2020-05-16T16:00:08.350585959Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "kht2MXIBlcWZ594bpIV0", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:08.350Z", + "log": "/host/secondary-bin-dir is non-writeable, skipping\n", + "time": "2020-05-16T16:00:08.350625112Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "kxt2MXIBlcWZ594bpIV0", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:08.350Z", + "log": "Using CNI config template from /host/etc/cni/net.d/calico.conflist.template.\n", + "time": "2020-05-16T16:00:08.350692011Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "lBt2MXIBlcWZ594bpIV0", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:08.454Z", + "log": "CNI config: {\n", + "time": "2020-05-16T16:00:08.454417144Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "lRt2MXIBlcWZ594bpIV0", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:08.454Z", + "log": " \"name\": \"cni0\",\n", + "time": "2020-05-16T16:00:08.454452649Z", + "kubernetes": { + "pod_name": "calico-node-gc7pp", + "namespace_name": "kube-system", + "host": "master0", + "container_name": "install-cni", + "docker_id": "c00abd0a7fe3d37c1328be560480239bb314fe78d31f7785e260ccdc0260cd7a", + "container_hash": "258a0cb3c25022e44ebda3606112c40865adb67b8fb7be3d119f960957301ad6" + } + } + } + ] + }, + "aggregations": { + "container_count": { + "value": 48 + } + } +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/es7_get_current_stats_404.json b/pkg/simple/client/logging/elasticsearch/testdata/es7_get_current_stats_404.json new file mode 100644 index 000000000..df509db55 --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/es7_get_current_stats_404.json @@ -0,0 +1,21 @@ +{ + "error": { + "root_cause": [ + { + "type": "index_not_found_exception", + "reason": "no such index [ks-logstash-log-2020.05.2]", + "resource.type": "index_or_alias", + "resource.id": "ks-logstash-log-2020.05.2", + "index_uuid": "_na_", + "index": "ks-logstash-log-2020.05.2" + } + ], + "type": "index_not_found_exception", + "reason": "no such index [ks-logstash-log-2020.05.2]", + "resource.type": "index_or_alias", + "resource.id": "ks-logstash-log-2020.05.2", + "index_uuid": "_na_", + "index": "ks-logstash-log-2020.05.2" + }, + "status": 404 +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/es7_search_logs_200.json b/pkg/simple/client/logging/elasticsearch/testdata/es7_search_logs_200.json new file mode 100644 index 000000000..62806771c --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/es7_search_logs_200.json @@ -0,0 +1,76 @@ +{ + "took": 772, + "timed_out": false, + "_shards": { + "total": 2, + "successful": 2, + "skipped": 0, + "failed": 0 + }, + "hits": { + "total": { + "value": 10000, + "relation": "gte" + }, + "max_score": 1.0, + "hits": [ + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "tRt2MXIBlcWZ594bqIUO", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:42.608Z", + "log": "10.233.30.76 redis-ha-announce-0.kubesphere-system.svc.cluster.local\n", + "time": "2020-05-16T16:00:42.608962452Z", + "kubernetes": { + "pod_name": "redis-ha-haproxy-ffb8d889d-8x9kj", + "namespace_name": "kubesphere-system", + "host": "master0", + "container_name": "config-init", + "docker_id": "a673327e5e3dfefca3e773273e69eca64baaa4499fdc04e6eb9d621ad8688ad0", + "container_hash": "cd4b3d4d27ae5931dc96b9632188590b7a6880469bcf07f478a3280dd0955336" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "tht2MXIBlcWZ594bqIUO", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:42.670Z", + "log": "10.233.30.204 redis-ha-announce-1.kubesphere-system.svc.cluster.local\n", + "time": "2020-05-16T16:00:42.670430525Z", + "kubernetes": { + "pod_name": "redis-ha-haproxy-ffb8d889d-8x9kj", + "namespace_name": "kubesphere-system", + "host": "master0", + "container_name": "config-init", + "docker_id": "a673327e5e3dfefca3e773273e69eca64baaa4499fdc04e6eb9d621ad8688ad0", + "container_hash": "cd4b3d4d27ae5931dc96b9632188590b7a6880469bcf07f478a3280dd0955336" + } + } + }, + { + "_index": "ks-logstash-log-2020.05.16", + "_type": "flb_type", + "_id": "txt2MXIBlcWZ594bqIUO", + "_score": 1.0, + "_source": { + "@timestamp": "2020-05-16T16:00:42.731Z", + "log": "scvg14005: inuse: 16, idle: 42, sys: 58, released: 40, consumed: 17 (MB)\n", + "time": "2020-05-16T16:00:42.731865428Z", + "kubernetes": { + "pod_name": "redis-ha-haproxy-ffb8d889d-8x9kj", + "namespace_name": "istio-system", + "host": "node0", + "container_name": "mixer", + "docker_id": "a673327e5e3dfefca3e773273e69eca64baaa4499fdc04e6eb9d621ad8688ad0", + "container_hash": "cd4b3d4d27ae5931dc96b9632188590b7a6880469bcf07f478a3280dd0955336" + } + } + } + ] + } +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/testdata/es7_search_logs_200_result.json b/pkg/simple/client/logging/elasticsearch/testdata/es7_search_logs_200_result.json new file mode 100644 index 000000000..94313c347 --- /dev/null +++ b/pkg/simple/client/logging/elasticsearch/testdata/es7_search_logs_200_result.json @@ -0,0 +1,29 @@ +{ + "total": 10000, + "records": [ + { + "time": "2020-05-16T16:00:42.608962452Z", + "log": "10.233.30.76 redis-ha-announce-0.kubesphere-system.svc.cluster.local\n", + "namespace": "kubesphere-system", + "pod": "redis-ha-haproxy-ffb8d889d-8x9kj", + "container": "config-init", + "host": "master0" + }, + { + "time": "2020-05-16T16:00:42.670430525Z", + "log": "10.233.30.204 redis-ha-announce-1.kubesphere-system.svc.cluster.local\n", + "namespace": "kubesphere-system", + "pod": "redis-ha-haproxy-ffb8d889d-8x9kj", + "container": "config-init", + "host": "master0" + }, + { + "time": "2020-05-16T16:00:42.731865428Z", + "log": "scvg14005: inuse: 16, idle: 42, sys: 58, released: 40, consumed: 17 (MB)\n", + "namespace": "istio-system", + "pod": "redis-ha-haproxy-ffb8d889d-8x9kj", + "container": "mixer", + "host": "node0" + } + ] +} \ No newline at end of file diff --git a/pkg/simple/client/logging/elasticsearch/versions/v5/v5.go b/pkg/simple/client/logging/elasticsearch/versions/v5/v5.go index e53a0c03c..b3344df9a 100644 --- a/pkg/simple/client/logging/elasticsearch/versions/v5/v5.go +++ b/pkg/simple/client/logging/elasticsearch/versions/v5/v5.go @@ -29,12 +29,17 @@ func New(address string, index string) *Elastic { return &Elastic{client: client, index: index} } -func (e *Elastic) Search(body []byte) ([]byte, error) { - response, err := e.client.Search( +func (e *Elastic) Search(body []byte, scroll bool) ([]byte, error) { + opts := []func(*esapi.SearchRequest){ e.client.Search.WithContext(context.Background()), e.client.Search.WithIndex(fmt.Sprintf("%s*", e.index)), e.client.Search.WithBody(bytes.NewBuffer(body)), - e.client.Search.WithScroll(time.Minute)) + } + if scroll { + opts = append(opts, e.client.Search.WithScroll(time.Minute)) + } + + response, err := e.client.Search(opts...) if err != nil { return nil, err } diff --git a/pkg/simple/client/logging/elasticsearch/versions/v6/v6.go b/pkg/simple/client/logging/elasticsearch/versions/v6/v6.go index 8c584aadb..198acdb7b 100644 --- a/pkg/simple/client/logging/elasticsearch/versions/v6/v6.go +++ b/pkg/simple/client/logging/elasticsearch/versions/v6/v6.go @@ -29,12 +29,17 @@ func New(address string, index string) *Elastic { return &Elastic{Client: client, index: index} } -func (e *Elastic) Search(body []byte) ([]byte, error) { - response, err := e.Client.Search( +func (e *Elastic) Search(body []byte, scroll bool) ([]byte, error) { + opts := []func(*esapi.SearchRequest){ e.Client.Search.WithContext(context.Background()), e.Client.Search.WithIndex(fmt.Sprintf("%s*", e.index)), e.Client.Search.WithBody(bytes.NewBuffer(body)), - e.Client.Search.WithScroll(time.Minute)) + } + if scroll { + opts = append(opts, e.Client.Search.WithScroll(time.Minute)) + } + + response, err := e.Client.Search(opts...) if err != nil { return nil, err } diff --git a/pkg/simple/client/logging/elasticsearch/versions/v7/v7.go b/pkg/simple/client/logging/elasticsearch/versions/v7/v7.go index 1051ffc66..4ff3d1e70 100644 --- a/pkg/simple/client/logging/elasticsearch/versions/v7/v7.go +++ b/pkg/simple/client/logging/elasticsearch/versions/v7/v7.go @@ -29,13 +29,17 @@ func New(address string, index string) *Elastic { return &Elastic{client: client, index: index} } -func (e *Elastic) Search(body []byte) ([]byte, error) { - response, err := e.client.Search( +func (e *Elastic) Search(body []byte, scroll bool) ([]byte, error) { + opts := []func(*esapi.SearchRequest){ e.client.Search.WithContext(context.Background()), e.client.Search.WithIndex(fmt.Sprintf("%s*", e.index)), - e.client.Search.WithTrackTotalHits(true), e.client.Search.WithBody(bytes.NewBuffer(body)), - e.client.Search.WithScroll(time.Minute)) + } + if scroll { + opts = append(opts, e.client.Search.WithScroll(time.Minute)) + } + + response, err := e.client.Search(opts...) if err != nil { return nil, err } diff --git a/pkg/simple/client/logging/interface.go b/pkg/simple/client/logging/interface.go index 69a20909d..0ada45cb0 100644 --- a/pkg/simple/client/logging/interface.go +++ b/pkg/simple/client/logging/interface.go @@ -6,13 +6,9 @@ import ( ) type Interface interface { - // Current stats about log store, eg. total number of logs and containers GetCurrentStats(sf SearchFilter) (Statistics, error) - CountLogsByInterval(sf SearchFilter, interval string) (Histogram, error) - SearchLogs(sf SearchFilter, from, size int64, order string) (Logs, error) - ExportLogs(sf SearchFilter, w io.Writer) error } diff --git a/pkg/test/testing.go b/pkg/test/testing.go index 9775c1632..b90b3b925 100644 --- a/pkg/test/testing.go +++ b/pkg/test/testing.go @@ -1,16 +1,18 @@ -// Copyright 2018 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 2018 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 test diff --git a/pkg/test/yaml.go b/pkg/test/yaml.go index f08984dab..8fbe33389 100644 --- a/pkg/test/yaml.go +++ b/pkg/test/yaml.go @@ -1,3 +1,19 @@ +/* +Copyright 2018 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 test import ( diff --git a/pkg/tools.go b/pkg/tools.go index 83ed03382..931cb76bb 100644 --- a/pkg/tools.go +++ b/pkg/tools.go @@ -1,5 +1,21 @@ // +build tools +/* +Copyright 2019 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 tools import ( diff --git a/pkg/utils/hashutil/MD5.go b/pkg/utils/hashutil/MD5.go index b68f0469d..1aefaca35 100644 --- a/pkg/utils/hashutil/MD5.go +++ b/pkg/utils/hashutil/MD5.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 hashutil import ( diff --git a/pkg/utils/idutils/id_utils.go b/pkg/utils/idutils/id_utils.go index bec44f0ff..3693b9915 100644 --- a/pkg/utils/idutils/id_utils.go +++ b/pkg/utils/idutils/id_utils.go @@ -1,9 +1,12 @@ /* Copyright 2018 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. diff --git a/pkg/utils/idutils/id_utils_test.go b/pkg/utils/idutils/id_utils_test.go index 5cb25562c..80f6b861d 100644 --- a/pkg/utils/idutils/id_utils_test.go +++ b/pkg/utils/idutils/id_utils_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2018 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 idutils import ( diff --git a/pkg/utils/iputil/iputils.go b/pkg/utils/iputil/iputils.go index 201b531be..b7fe9f4e4 100644 --- a/pkg/utils/iputil/iputils.go +++ b/pkg/utils/iputil/iputils.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 iputil import ( diff --git a/pkg/utils/jsonutil/jsonutils.go b/pkg/utils/jsonutil/jsonutils.go index 74af82b9d..0a545579b 100644 --- a/pkg/utils/jsonutil/jsonutils.go +++ b/pkg/utils/jsonutil/jsonutils.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 jsonutil import ( diff --git a/pkg/utils/k8sutil/k8sutil.go b/pkg/utils/k8sutil/k8sutil.go index bff210a54..58d6c1dad 100644 --- a/pkg/utils/k8sutil/k8sutil.go +++ b/pkg/utils/k8sutil/k8sutil.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 k8sutil import ( diff --git a/pkg/utils/net/net.go b/pkg/utils/net/net.go index e8482c412..abe7e5ffd 100644 --- a/pkg/utils/net/net.go +++ b/pkg/utils/net/net.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 net // 0 is considered as a non valid port diff --git a/pkg/utils/pkiutil/pkiutil.go b/pkg/utils/pkiutil/pkiutil.go index 4beb0e4d5..8a2d60a53 100644 --- a/pkg/utils/pkiutil/pkiutil.go +++ b/pkg/utils/pkiutil/pkiutil.go @@ -1,20 +1,18 @@ /* - * - * Copyright 2020 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 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 pkiutil diff --git a/pkg/utils/readerutils/MD5Reader.go b/pkg/utils/readerutils/MD5Reader.go index b16fcee63..281ea13e3 100644 --- a/pkg/utils/readerutils/MD5Reader.go +++ b/pkg/utils/readerutils/MD5Reader.go @@ -1,3 +1,19 @@ +/* +Copyright 2019 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 readerutils import ( diff --git a/pkg/utils/reflectutils/deep.go b/pkg/utils/reflectutils/deep.go index 8f5488af7..b514a0158 100644 --- a/pkg/utils/reflectutils/deep.go +++ b/pkg/utils/reflectutils/deep.go @@ -1,3 +1,19 @@ +/* +Copyright 2018 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 deep provides function deep.Equal which is like reflect.DeepEqual but // returns a list of differences. This is helpful when comparing complex types // like structures and maps. diff --git a/pkg/utils/reflectutils/reflect.go b/pkg/utils/reflectutils/reflect.go index 660fac03e..0695a9f06 100644 --- a/pkg/utils/reflectutils/reflect.go +++ b/pkg/utils/reflectutils/reflect.go @@ -1,9 +1,12 @@ /* Copyright 2018 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. diff --git a/pkg/utils/sliceutil/sliceutils.go b/pkg/utils/sliceutil/sliceutils.go index 0f1270dbc..7c49dd16f 100644 --- a/pkg/utils/sliceutil/sliceutils.go +++ b/pkg/utils/sliceutil/sliceutils.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 sliceutil func RemoveString(slice []string, remove func(item string) bool) []string { diff --git a/pkg/utils/stringutils/string.go b/pkg/utils/stringutils/string.go index acc7fb1ea..a7375f895 100644 --- a/pkg/utils/stringutils/string.go +++ b/pkg/utils/stringutils/string.go @@ -1,9 +1,12 @@ /* Copyright 2018 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. diff --git a/pkg/utils/term/term.go b/pkg/utils/term/term.go index bbe39f21e..f999275b7 100644 --- a/pkg/utils/term/term.go +++ b/pkg/utils/term/term.go @@ -1,3 +1,19 @@ +/* +Copyright 2018 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 term import ( diff --git a/pkg/version/version.go b/pkg/version/version.go index 6df6f0acf..6cf015f65 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -1,19 +1,17 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 version diff --git a/pkg/webhook/webhook.go b/pkg/webhook/webhook.go index 50244b24d..f232744cc 100644 --- a/pkg/webhook/webhook.go +++ b/pkg/webhook/webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The KubeSphere authors. +Copyright 2019 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. diff --git a/tools/cmd/crd-doc-gen/main.go b/tools/cmd/crd-doc-gen/main.go index 2edefe5d7..c3b48ac8b 100644 --- a/tools/cmd/crd-doc-gen/main.go +++ b/tools/cmd/crd-doc-gen/main.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 main import ( diff --git a/tools/cmd/doc-gen/main.go b/tools/cmd/doc-gen/main.go index 0299cc309..b4d7cdb6c 100644 --- a/tools/cmd/doc-gen/main.go +++ b/tools/cmd/doc-gen/main.go @@ -1,20 +1,19 @@ /* +Copyright 2019 The KubeSphere Authors. - Copyright 2019 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 - 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. + 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 main import ( @@ -38,7 +37,6 @@ import ( "kubesphere.io/kubesphere/pkg/informers" devopsv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/devops/v1alpha2" iamv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/iam/v1alpha2" - loggingv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/logging/v1alpha2" monitoringv1alpha3 "kubesphere.io/kubesphere/pkg/kapis/monitoring/v1alpha3" networkv1alpha2 "kubesphere.io/kubesphere/pkg/kapis/network/v1alpha2" openpitrixv1 "kubesphere.io/kubesphere/pkg/kapis/openpitrix/v1" @@ -114,13 +112,12 @@ func generateSwaggerJson() []byte { urlruntime.Must(devopsv1alpha2.AddToContainer(container, informerFactory.KubeSphereSharedInformerFactory(), &fake.Devops{}, nil, clientsets.KubeSphere(), fakes3.NewFakeS3())) urlruntime.Must(iamv1alpha2.AddToContainer(container, im.NewOperator(clientsets.KubeSphere(), informerFactory), am.NewReadOnlyOperator(informerFactory), authoptions.NewAuthenticateOptions())) - urlruntime.Must(loggingv1alpha2.AddToContainer(container, clientsets, nil)) urlruntime.Must(monitoringv1alpha3.AddToContainer(container, clientsets.Kubernetes(), nil, informerFactory, nil)) urlruntime.Must(openpitrixv1.AddToContainer(container, informerFactory, nil)) urlruntime.Must(operationsv1alpha2.AddToContainer(container, clientsets.Kubernetes())) urlruntime.Must(resourcesv1alpha2.AddToContainer(container, clientsets.Kubernetes(), informerFactory)) urlruntime.Must(resourcesv1alpha3.AddToContainer(container, informerFactory)) - urlruntime.Must(tenantv1alpha2.AddToContainer(container, informerFactory, nil, nil, nil)) + urlruntime.Must(tenantv1alpha2.AddToContainer(container, informerFactory, nil, nil, nil, nil)) urlruntime.Must(terminalv1alpha2.AddToContainer(container, clientsets.Kubernetes(), nil)) urlruntime.Must(metricsv1alpha2.AddToContainer(container)) urlruntime.Must(networkv1alpha2.AddToContainer(container, "")) diff --git a/tools/lib/render.go b/tools/lib/render.go index 0d99600db..273d4ed9a 100644 --- a/tools/lib/render.go +++ b/tools/lib/render.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 lib import ( diff --git a/tools/lib/storage.go b/tools/lib/storage.go index 8fd5eeb01..20e3d7743 100644 --- a/tools/lib/storage.go +++ b/tools/lib/storage.go @@ -1,3 +1,19 @@ +/* +Copyright 2020 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 lib import ( diff --git a/tools/tools.go b/tools/tools.go index a6d2bb85d..7eef128a7 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -1,5 +1,21 @@ // +build tools +/* +Copyright 2019 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 tools import (