Skip to content

Commit

Permalink
v1.29.x (merge request !2102)
Browse files Browse the repository at this point in the history
Squash merge branch 'v1.29.x' into 'v1.29.x'
feat: 更新cluster-reporter代码
  • Loading branch information
jonathantan authored and evanxinli committed Nov 5, 2024
1 parent 1ea5a25 commit f669932
Show file tree
Hide file tree
Showing 118 changed files with 10,798 additions and 3,853 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bcs-component:kube-sche apiserver-proxy \
bcs-network:ingress-controller

bcs-services:bkcmdb-synchronizer gateway \
storage user-manager cluster-manager cluster-reporter tools k8s-watch kube-agent data-manager \
storage user-manager cluster-manager cluster-reporter nodeagent tools k8s-watch kube-agent data-manager \
helm-manager project-manager nodegroup-manager

bcs-scenarios: kourse gitops
Expand Down Expand Up @@ -258,7 +258,12 @@ cluster-manager:pre
cluster-reporter:
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-cluster-reporter
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-cluster-reporter/* ${PACKAGEPATH}/bcs-services/bcs-cluster-reporter/
cd ${BCS_SERVICES_PATH}/bcs-cluster-reporter && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-cluster-reporter/bcs-cluster-reporter ./main.go
cd ${BCS_SERVICES_PATH}/bcs-cluster-reporter/cmd/reporter && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-cluster-reporter/bcs-cluster-reporter ./main.go

nodeagent:
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-nodeagent
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-nodeagent/* ${PACKAGEPATH}/bcs-services/bcs-nodeagent/
cd ${BCS_SERVICES_PATH}/bcs-cluster-reporter/cmd/nodeagent && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-nodeagent/bcs-nodeagent ./main.go

project-manager:pre
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-project-manager/swagger
Expand Down Expand Up @@ -364,4 +369,4 @@ gamestatefulset:
make gamestatefulset -f bcs-scenarios/kourse/Makefile

hook-operator:
make hook-operator -f bcs-scenarios/kourse/Makefile
make hook-operator -f bcs-scenarios/kourse/Makefile
105 changes: 58 additions & 47 deletions bcs-services/bcs-client/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,57 @@
# Code generated by scripts/gen-lint. DO NOT EDIT.

run:
timeout: 10m

skip-dirs:
- bcs-services/bcs-upgrader
- bcs-services/bcs-service-prometheus
- bcs-network
- bcs-runtime/bcs-mesos
- bcs-runtime/bcs-k8s/bcs-component/bcs-cc-agent
- bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device
- .*/third_party/*
- api/*
- internal/cloudprovider/component/*
- internal/cloudprovider/qcloud/api/common_*
skip-files:
- .*\.docs\.go$
- .*\.gen\.go$
- .*\.pb\.go$
- .*\.pb.gw\.go$
- .*\.pb.micro\.go$
- .*\.pb.validate\.go$
- .*\_test\.go$
- internal/cloudprovider/qcloud/tasks/createNodeGroup.go
- internal/cloudprovider/qcloud/tasks/createNodeGroup.go
- internal/cloudprovider/qcloud/tasks/createClusterTask.go
- internal/remote/resource/tresource/resource.go
issues:
# 显示所有 issue
max-issues-per-linter: 0
max-same-issues: 0
exclude-use-default: false

linters:
disable-all: true
enable:
# enable by default
- errcheck
- gosimple
- govet
- ineffassign
# - errcheck
# - gosimple
# - govet
# - ineffassign
- staticcheck
- unused

# custom
- funlen
- gci
- goconst
- gocritic
- gocyclo
- gofmt
- goheader
- goimports
- gosec
- lll
- misspell
- nakedret
- revive
- unconvert
- unparam

# - unused
# - funlen
# - gci
# - goconst
# - gocritic
# - gocyclo
# - gofmt
# - goheader
# - goimports
# - gosec
# - lll
# - misspell
# - nakedret
# - revive
# - unconvert
# - unparam
linters-settings:
# 只开启特定的规则
errcheck:
exclude-functions:
- (*os.File).Close
Expand All @@ -48,39 +61,39 @@ linters-settings:
- io.Copy
- os.RemoveAll
lll:
line-length: 120 # widely used and popular community recommended length
line-length: 120
funlen:
lines: 90 # 函数长度 default * 1.5
statements: -1 # 不限制语句数量, 通过圈复杂度处理
lines: 90
statements: -1
gocyclo:
min-complexity: 30 # 函数圈复杂度
min-complexity: 30
govet:
check-shadowing: true
goimports:
local-prefixes: github.com/Tencent/bk-bcs/bcs-services/bcs-client
local-prefixes: github.com/Tencent/bk-bcs/bcs-services/bcs-cluster-manager
gci:
sections:
- standard
- default
- prefix(github.com/Tencent/bk-bcs/bcs-services/bcs-client)
- prefix(github.com/Tencent/bk-bcs/bcs-services/bcs-cluster-manager)
gocritic:
settings:
ifElseChain:
minThreshold: 3
gosec:
includes:
- G201 # SQL query construction using format string
- G202 # SQL query construction using string concatenation
- G101 # Look for hard coded credentials
- G401 # Detect the usage of DES, RC4, MD5 or SHA1
- G402 # Look for bad TLS connection settings
- G403 # Ensure minimum RSA key length of 2048 bits
- G404 # Insecure random number source (rand)
- G504 # Import blocklist: net/http/cgi
- G201
- G202
- G101
- G401
- G402
- G403
- G404
- G504
goheader:
values:
regexp:
YEAR: 20\d\d # 头部时间变量, 如: 2019等, 新增的为当前年份即可
YEAR: 20\d\d
template: |-
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) {{ YEAR }} THL A29 Limited, a Tencent company. All rights reserved.
Expand Down Expand Up @@ -112,6 +125,4 @@ linters-settings:
- name: range
- name: receiver-naming
- name: time-naming
# - name: unexported-return
- name: var-declaration
# - name: var-naming
2 changes: 2 additions & 0 deletions bcs-services/bcs-cluster-reporter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone
WORKDIR /
COPY ./$SRV_NAME .
COPY ./TencentSans-W7.ttf .
COPY ./TencentSans-W3.ttf .
#COPY ./conf ./conf
ENTRYPOINT ["/bcs-cluster-reporter"]
19 changes: 0 additions & 19 deletions bcs-services/bcs-cluster-reporter/Makefile

This file was deleted.

Binary file not shown.
Binary file not shown.
Loading

0 comments on commit f669932

Please sign in to comment.