Skip to content

Commit

Permalink
feature: tencent License; issue #115
Browse files Browse the repository at this point in the history
  • Loading branch information
zmberg committed Aug 5, 2019
1 parent 6ee044f commit b7a5e5e
Show file tree
Hide file tree
Showing 26 changed files with 344 additions and 50 deletions.
17 changes: 15 additions & 2 deletions bcs-common/pkg/discovery/application.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 discovery

import (
Expand All @@ -6,9 +19,9 @@ import (
"time"

"bk-bcs/bcs-common/common/blog"
schedypes "bk-bcs/bcs-common/pkg/scheduler/types"
"bk-bcs/bcs-common/pkg/meta"
"bk-bcs/bcs-common/pkg/reflector"
schedypes "bk-bcs/bcs-common/pkg/scheduler/types"
"bk-bcs/bcs-common/pkg/storage"
"bk-bcs/bcs-common/pkg/storage/zookeeper"
"bk-bcs/bcs-common/pkg/watch"
Expand Down Expand Up @@ -71,7 +84,7 @@ func (s *applicationController) GetByName(ns, name string) (*schedypes.Applicati

func NewApplicationController(hosts []string, eventHandler reflector.EventInterface) (ApplicationController, error) {
indexers := k8scache.Indexers{
meta.NamespaceIndex: meta.NamespaceIndexFunc,
meta.NamespaceIndex: meta.NamespaceIndexFunc,
}

ts := k8scache.NewIndexer(ApplicationObjectKeyFn, indexers)
Expand Down
13 changes: 13 additions & 0 deletions bcs-common/pkg/discovery/lister.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 discovery

import (
Expand Down
15 changes: 14 additions & 1 deletion bcs-common/pkg/discovery/node.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 discovery

import (
Expand Down Expand Up @@ -114,4 +127,4 @@ func NodeObjectKeyFn(obj interface{}) (string, error) {
//NodeObjectNewFn create new Node Object
func NodeObjectNewFn() meta.Object {
return new(schedypes.Agent)
}
}
15 changes: 14 additions & 1 deletion bcs-common/pkg/discovery/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 discovery

import (
Expand Down Expand Up @@ -71,7 +84,7 @@ func (s *serviceController) GetByName(ns, name string) (*commtypes.BcsService, e

func NewServiceController(hosts []string, eventHandler reflector.EventInterface) (ServiceController, error) {
indexers := k8scache.Indexers{
meta.NamespaceIndex: meta.NamespaceIndexFunc,
meta.NamespaceIndex: meta.NamespaceIndexFunc,
}

ts := k8scache.NewIndexer(ServiceObjectKeyFn, indexers)
Expand Down
13 changes: 13 additions & 0 deletions bcs-common/pkg/discovery/taskgroup.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 discovery

import (
Expand Down
13 changes: 13 additions & 0 deletions bcs-common/pkg/meta/codec.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 meta

import (
Expand Down
13 changes: 13 additions & 0 deletions bcs-common/pkg/meta/labels.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 meta

import (
Expand Down
13 changes: 13 additions & 0 deletions bcs-common/pkg/meta/meta.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 meta

import (
Expand Down
15 changes: 14 additions & 1 deletion bcs-common/pkg/meta/object.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 meta

import (
Expand Down Expand Up @@ -70,4 +83,4 @@ func ApplicationIndexFunc(obj interface{}) ([]string, error) {
default:
return nil, errNotObject
}
}
}
31 changes: 11 additions & 20 deletions bcs-common/pkg/queue/event.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
/*
Copyright (C) 2019 The BlueKing Authors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 queue

Expand Down
31 changes: 11 additions & 20 deletions bcs-common/pkg/queue/queue.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
/*
Copyright (C) 2019 The BlueKing Authors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 queue

Expand Down
13 changes: 13 additions & 0 deletions bcs-common/pkg/reflector/listerwatcher.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 reflector

import (
Expand Down
13 changes: 13 additions & 0 deletions bcs-common/pkg/reflector/reflector.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 reflector

import (
Expand Down
23 changes: 18 additions & 5 deletions bcs-common/pkg/scheduler/types/application.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 types

import (
Expand Down Expand Up @@ -618,15 +631,15 @@ func (om *Agent) SetClusterName(clusterName string) {
//
}

func (om *Agent) GetAgentIP()string{
if om.AgentInfo==nil||om.AgentInfo.AgentInfo==nil {
func (om *Agent) GetAgentIP() string {
if om.AgentInfo == nil || om.AgentInfo.AgentInfo == nil {
return ""
}
if len(om.AgentInfo.AgentInfo.Attributes)==0 {
if len(om.AgentInfo.AgentInfo.Attributes) == 0 {
return ""
}
for _,attr :=range om.AgentInfo.AgentInfo.Attributes {
if attr.GetName()=="InnerIP" {
for _, attr := range om.AgentInfo.AgentInfo.Attributes {
if attr.GetName() == "InnerIP" {
return attr.GetText().GetValue()
}
}
Expand Down
13 changes: 13 additions & 0 deletions bcs-common/pkg/scheduler/types/message.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 types

import (
Expand Down
13 changes: 13 additions & 0 deletions bcs-common/pkg/storage/etcd/client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 etcd

import (
Expand Down
13 changes: 13 additions & 0 deletions bcs-common/pkg/storage/etcd/util.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT 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 etcd

//util is tools collection for etcd client
Loading

0 comments on commit b7a5e5e

Please sign in to comment.