Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/qj kubeserver auto purge logs #365

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
48448a8
fix(kubeserver): show more error details when adding helm repo
zexi Sep 25, 2023
b6ca337
Merge pull request #332 from zexi/automated-cherry-pick-of-#331-upstr…
zexi Sep 25, 2023
dbc41f3
fix(kubeserver): raise error when get client from imported kubeconfig
zexi Oct 11, 2023
17cbca0
Merge pull request #335 from zexi/automated-cherry-pick-of-#334-upstr…
zexi Oct 11, 2023
e27e419
fix(kubeserver): can't import empty api_server cluster
zexi Oct 12, 2023
e9575fb
Merge pull request #339 from zexi/automated-cherry-pick-of-#337-upstr…
zexi Oct 12, 2023
0112b0c
fix(kubeserver): update grafana version to 7.5.17
zexi Nov 8, 2023
52430cf
Merge pull request #342 from zexi/automated-cherry-pick-of-#341-upstr…
zexi Nov 8, 2023
f905207
fix(kubeserver): skip HPA syncing
zexi Nov 14, 2023
b6d5b5e
Merge pull request #347 from zexi/automated-cherry-pick-of-#345-upstr…
zexi Nov 14, 2023
dc42cb2
fix(kubeserver): can't deploy k8s v1.22.9
zexi Jan 9, 2024
890484b
fix(kubeserver): retry 5 mins to wait kube-apiserver running
zexi Jan 9, 2024
5a461cc
Merge pull request #349 from zexi/automated-cherry-pick-of-#348-upstr…
zexi Jan 9, 2024
3ec48c0
feat(kubeserver): update vendor to release/3.11
zexi Feb 5, 2024
a91df18
Merge pull request #351 from zexi/update-vendor-20240205.0
zexi Feb 5, 2024
4162e2e
fix(kubeserver): repo url filter
zexi Feb 5, 2024
22c597a
Merge pull request #353 from zexi/repo-url-filter
zexi Feb 5, 2024
372730d
fix(kubeserver): registry repository name filter
zexi Feb 5, 2024
67ce983
Merge pull request #356 from zexi/registry-repo-filter
zexi Feb 5, 2024
a497e88
fix(kubeserver): url filter for container_registry models
zexi Feb 19, 2024
2349b53
Merge pull request #358 from zexi/ctr-reg-url-filter
zexi Feb 19, 2024
2e22e26
fix: update vendor 20240305
Mar 5, 2024
6a6eae1
Merge pull request #362 from swordqiu/automated-cherry-pick-of-#361-u…
swordqiu Mar 5, 2024
eeda51c
fix: compability issues and add github test flow
Mar 5, 2024
7fed76f
Merge pull request #364 from swordqiu/automated-cherry-pick-of-#363-u…
swordqiu Mar 5, 2024
4d96685
fix: kubeserver automatically purge spitable logs
Mar 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 32 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and test
on:
pull_request:
types:
- assigned
- opened
- synchronize
- reopened

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 8
- uses: actions/setup-go@v2
with:
go-version: '1.18'
- name: test
shell: bash
run: |
set -o xtrace
workdir="$HOME/go/src/yunion.io/x"
mkdir -p "$workdir"
mv "$HOME/work/pkg/kubecomps" "$workdir/"

export GOPATH="$HOME/go"
export GO111MODULE=off
cd "$workdir/kubecomps"
make test
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ LDFLAGS := "-w \

export GO111MODULE:=on
export GOPROXY:=direct
RELEASE_BRANCH:=master
RELEASE_BRANCH:=release/3.11
GO_BUILD := go build -mod vendor -buildvcs=false -ldflags $(LDFLAGS)

CMDS := $(shell find $(ROOT_DIR)/cmd -mindepth 1 -maxdepth 1 -type d)
Expand All @@ -52,7 +52,7 @@ prepare_dir:

mod:
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go get yunion.io/x/onecloud@$(RELEASE_BRANCH)
GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go get $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p' | grep -v '/onecloud$$'))
#GOPROXY=$(GOPROXY) GONOSUMDB=yunion.io/x go get $(patsubst %,%@master,$(shell GO111MODULE=on go mod edit -print | sed -n -e 's|.*\(yunion.io/x/[a-z].*\) v.*|\1|p' | grep -v '/onecloud$$'))
go mod tidy
go mod vendor -v

Expand Down Expand Up @@ -111,7 +111,11 @@ fmt-check: fmt
echo "$@: working tree modified (possibly by gofmt)" >&2 ; \
false ; \
fi
.PHONY: fmt fmt-check

test:
@go test $(GO_BUILD_FLAGS) $(shell go list ./...)

.PHONY: fmt fmt-check test

%:
@:
14 changes: 8 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ require (
sigs.k8s.io/controller-runtime v0.6.4
sigs.k8s.io/yaml v1.2.0
yunion.io/x/code-generator v0.0.0-20230130032150-a6851cfe4737
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361
yunion.io/x/onecloud v0.0.0-20230718094204-288bb6d900db
yunion.io/x/pkg v1.0.1-0.20230711090507-0aafe0f0c9db
yunion.io/x/sqlchemy v1.1.2-0.20230712025503-b1892bc5944c
yunion.io/x/onecloud v0.0.0-20240305022950-ed2dd1f548c2
yunion.io/x/pkg v1.10.1-0.20240303050651-73685b15a96e
yunion.io/x/sqlchemy v1.1.3-0.20240304110946-16faa82225e6
)

require (
cloud.google.com/go v0.99.0 // indirect
gitee.com/chunanyong/dm v1.8.14 // indirect
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.1 // indirect
Expand Down Expand Up @@ -119,6 +120,7 @@ require (
github.com/golang-plus/uuid v1.0.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
Expand Down Expand Up @@ -237,10 +239,10 @@ require (
rsc.io/letsencrypt v0.0.3 // indirect
sigs.k8s.io/kustomize v2.0.3+incompatible // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.0.1 // indirect
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230714020436-02f1bfcc8e8e // indirect
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240304114831-feebc346e513 // indirect
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 // indirect
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e // indirect
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6 // indirect
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c // indirect
)

replace (
Expand Down
31 changes: 17 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gitee.com/chunanyong/dm v1.8.14 h1:1S9+aD0fY/HXkcm8dKh2HjYsDlcdXNG+4IOX9JtrSjA=
gitee.com/chunanyong/dm v1.8.14/go.mod h1:EPRJnuPFgbyOFgJ0TRYCTGzhq+ZT4wdyaj/GW/LLcNg=
github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v43.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=
Expand Down Expand Up @@ -528,6 +530,7 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho=
github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995/go.mod h1:lJgMEyOkYFkPcDKwRXegd+iM6E7matEszMG5HhwytU8=
Expand Down Expand Up @@ -710,7 +713,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand Down Expand Up @@ -855,6 +857,7 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
Expand Down Expand Up @@ -1633,8 +1636,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
Expand Down Expand Up @@ -1762,30 +1765,30 @@ sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230714020436-02f1bfcc8e8e h1:5X432B4i7RMiA76FAFwQueyIvyw3t0LgjyrS+a37wfA=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230714020436-02f1bfcc8e8e/go.mod h1:2sgCN7nRPQL3woLfdgqLDd92vwAHqtlz3KKiHxC5BAw=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240304114831-feebc346e513 h1:p6TyojYdVP5S3jTTgOOj/Pm5uRRAv6sLRj8xLxADRe4=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240304114831-feebc346e513/go.mod h1:dsUESXIbXJ+/ywbNClhldOrbPOiBi2udrgOnB/ffoWk=
yunion.io/x/code-generator v0.0.0-20230130032150-a6851cfe4737 h1:+wbsJEsGDbuMZWeflXb+sQwuqrUOa4QSa/MFmgicD3w=
yunion.io/x/code-generator v0.0.0-20230130032150-a6851cfe4737/go.mod h1:kUCyyjSbaDW0A+ZXuUg3avTpaS1LUw3LxYkHZymjgz8=
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug=
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19 h1:mZh6vuo7oOiOtE5HF4667+XBNnn7uYpmGN5eIgCVMLk=
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19/go.mod h1:VK4Z93dgiKgAijcSqbMKmGaBMJuHulR16Hz4K015ZPo=
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401 h1:4l6ELFSQ0MBVInscZ8/yOtSWF0cwH5BT1ATN6dCtAqc=
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401/go.mod h1:VK4Z93dgiKgAijcSqbMKmGaBMJuHulR16Hz4K015ZPo=
yunion.io/x/log v0.0.0-20190514041436-04ce53b17c6b/go.mod h1:+gauLs73omeJAPlsXcevLsJLKixV+sR/E7WSYTSx1fE=
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
yunion.io/x/log v0.0.0-20200313080802-57a4ce5966b3/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361 h1:c5LyNdhbvBe/92pXs9jgXOU/S+RgYh/DHe538LpT/Mo=
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361/go.mod h1:LC6f/4FozL0iaAbnFt2eDX9jlsyo3WiOUPm03d7+U4U=
yunion.io/x/onecloud v0.0.0-20230718094204-288bb6d900db h1:dGGl4xqqY2EXDMsK5Mpv1g72h5vr/n2mmN7EZSB7XkQ=
yunion.io/x/onecloud v0.0.0-20230718094204-288bb6d900db/go.mod h1:TVk1N2tHQ1jIEIfYm5f2615PbDzXXnuAjcsQ+nXGG3Y=
yunion.io/x/onecloud v0.0.0-20240305022950-ed2dd1f548c2 h1:a//bOiPceVRMdBV7ziolAoxFS8mQSKZU1kv8Oe26Muc=
yunion.io/x/onecloud v0.0.0-20240305022950-ed2dd1f548c2/go.mod h1:MoJDV5/Sc1+dA8r7F1upUOQy/D0BWDh2JAk+iTmUC/A=
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v0.0.0-20200416145704-22c189971435/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
yunion.io/x/pkg v1.0.1-0.20230711090507-0aafe0f0c9db h1:GyBvo/gYl2MY5Q0SZ6Nso8WJHPonmngOtcpVfyCE0yA=
yunion.io/x/pkg v1.0.1-0.20230711090507-0aafe0f0c9db/go.mod h1:ksCJVQ+DwKrJ5QBEoU8pzrDFfDaZVAFH/iJ6yQCYxJk=
yunion.io/x/pkg v1.10.1-0.20240303050651-73685b15a96e h1:NuYu+z0dOT93aoNjg3W3PkLidy3E3cdNFZqz2Aua6UE=
yunion.io/x/pkg v1.10.1-0.20240303050651-73685b15a96e/go.mod h1:ksCJVQ+DwKrJ5QBEoU8pzrDFfDaZVAFH/iJ6yQCYxJk=
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
yunion.io/x/sqlchemy v1.1.2-0.20230712025503-b1892bc5944c h1:jlJkjiL1jv6mpdV3Z0RdeEWB5U3qEwUnSjioGZmki70=
yunion.io/x/sqlchemy v1.1.2-0.20230712025503-b1892bc5944c/go.mod h1:uuPVZEyEq3sWd5vf9VjGSy6lZzof22X87OEHw9sddJQ=
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6 h1:WuWXhY3DvhdRTzWCJ/kwt3Ss6KIq7+KqJwb+esvNGwU=
yunion.io/x/structarg v0.0.0-20220312084958-9c6c79c7d1c6/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
yunion.io/x/sqlchemy v1.1.3-0.20240304110946-16faa82225e6 h1:3R34JW8CxuweUn4mCrFMSTwU5Njwh5aCB5x9x6l5GBA=
yunion.io/x/sqlchemy v1.1.3-0.20240304110946-16faa82225e6/go.mod h1:5W8ghvJ4TNt/r2yDjjD3i4QsZgIiJX45dhRQBGWPHsQ=
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c h1:QuLab2kSRECZRxo4Lo2KcYn6XjQFDGaZ1+x0pYDVVwQ=
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
3 changes: 2 additions & 1 deletion pkg/calico-node-agent/serve/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
kapiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"

Expand Down Expand Up @@ -235,7 +236,7 @@ func (s *server) syncIPPools(ctx context.Context) error {
}
// delete remote pool
if err := s.deleteIPPool(ctx, rp); err != nil {
return errors.Wrapf(err, "delete remote IPPool %s")
return errors.Wrapf(err, "delete remote IPPool %s", jsonutils.Marshal(rp))
}
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/kubeserver/api/container_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type ContainerRegistryListInput struct {
apis.StatusInfrasResourceBaseListInput

Type string `json:"type"`
Url string `json:"url"`
}

type ContainerRegistryConfigCommon struct {
Expand Down Expand Up @@ -72,5 +73,6 @@ type ContainerRegistryDownloadImageInput struct {
}

type ContainerRegistryListImagesInput struct {
Details bool `json:"details"`
Details bool `json:"details"`
RepositoryName string `json:"repository_name"`
}
1 change: 1 addition & 0 deletions pkg/kubeserver/api/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type RepoListInput struct {
apis.StatusInfrasResourceBaseListInput

Type string `json:"type"`
Url string `json:"url"`
}

type RepoDetail struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubeserver/app/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func InitHandlers(app *appsrv.Application) {
apiPrefix := "/api"
taskman.AddTaskHandler(apiPrefix, app)
usages.AddUsageHandler(apiPrefix, app)
appsrv.AddPProfHandler(apiPrefix, app)
app.EnableProfiling()

for _, man := range []db.IModelManager{
taskman.TaskManager,
Expand Down
26 changes: 13 additions & 13 deletions pkg/kubeserver/client/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package api

import (
apps "k8s.io/api/apps/v1"
autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
// autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
// extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
Expand Down Expand Up @@ -73,17 +73,17 @@ var KindToResourceMap = map[string]ResourceMap{
Namespaced: true,
},

api.ResourceNameHorizontalPodAutoscaler: {
GroupVersionResourceKind: GroupVersionResourceKind{
GroupVersionResource: schema.GroupVersionResource{
Group: autoscalingv2beta2.GroupName,
Version: autoscalingv2beta2.SchemeGroupVersion.Version,
Resource: api.ResourceNameHorizontalPodAutoscaler,
},
Kind: api.KindNameHorizontalPodAutoscaler,
},
Namespaced: true,
},
// api.ResourceNameHorizontalPodAutoscaler: {
// GroupVersionResourceKind: GroupVersionResourceKind{
// GroupVersionResource: schema.GroupVersionResource{
// Group: autoscalingv2beta2.GroupName,
// Version: autoscalingv2beta2.SchemeGroupVersion.Version,
// Resource: api.ResourceNameHorizontalPodAutoscaler,
// },
// Kind: api.KindNameHorizontalPodAutoscaler,
// },
// Namespaced: true,
// },
// api.ResourceNameIngress: {
// GroupVersionResourceKind: GroupVersionResourceKind{
// GroupVersionResource: schema.GroupVersionResource{
Expand Down Expand Up @@ -319,7 +319,7 @@ var KindToResourceMap = map[string]ResourceMap{
}

var KindHandledByDynamic = []string{
api.KindNameIngress, api.KindNameCronJob,
api.KindNameIngress, api.KindNameCronJob, // api.KindNameHorizontalPodAutoscaler,
}

func GetResourceKinds() sets.String {
Expand Down
5 changes: 4 additions & 1 deletion pkg/kubeserver/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func GetManager(cluster string) (*ClusterManager, error) {
func BuildClientConfig(master string, kubeconfig string) (*rest.Config, *clientcmdapi.Config, error) {
configInternal, err := clientcmd.Load([]byte(kubeconfig))
if err != nil {
return nil, nil, err
return nil, nil, errors.Wrapf(err, "Load kubeconfig")
}
curCtxName := configInternal.CurrentContext
curCtx, ok := configInternal.Contexts[curCtxName]
Expand All @@ -140,6 +140,9 @@ func BuildClientConfig(master string, kubeconfig string) (*rest.Config, *clientc
if !ok {
return nil, nil, errors.Errorf("Not found cluster %q", ctxClsName)
}
if master == "" {
master = cls.Server
}
cls.Server = master
configInternal.Clusters[ctxClsName] = cls

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ func (d *ExternalOpenshift) ValidateCreateData(ctx context.Context, userCred mcc
return errors.Wrap(err, "new openshift client")
}
var clusterOperator *configv1.ClusterOperator
clusterOperator, serverErr := ocCli.ClusterOperators().Get(context.Background(), "openshift-apiserver", metav1.GetOptions{})
clusterOperator, serverErr := ocCli.ClusterOperators().Get(ctx, "openshift-apiserver", metav1.GetOptions{})
if serverErr != nil {
switch {
case kerrors.IsForbidden(serverErr), kerrors.IsNotFound(serverErr):
return errors.Wrapf(err, "OpenShift Version not found (must be logged in to cluster as admin): %v")
return errors.Wrapf(err, "OpenShift Version not found (must be logged in to cluster as admin): %v", config)
}
return errors.Wrap(err, "get openshift apiserver")
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/kubeserver/drivers/clusters/imported_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ func (d *sImportBaseDriver) ValidateCreateData(ctx context.Context, userCred mcc
apiServer := importData.ApiServer
kubeconfig := importData.Kubeconfig
newKubeconfig, restConfig, cli, err := d.getKubeClientByConfig(apiServer, kubeconfig)
if err != nil {
return httperrors.NewNotSupportedError("get kubernetes client by config: %v", err)
}
importData.Kubeconfig = string(newKubeconfig)
importData.ApiServer = restConfig.Host
version, err := cli.Discovery().ServerVersion()
Expand Down
17 changes: 10 additions & 7 deletions pkg/kubeserver/drivers/clusters/selfbuild/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,23 @@ func (s *sAwsDriver) GetAddonsManifest(cluster *models.SCluster, conf *api.Clust
commonConf.IngressControllerYunionConfig = nil
commonConf.CSIYunionConfig = nil
commonConf.MetricsPluginConfig = nil
commonConf.CSIRancherLocalPathConfig.Image = "registry.cn-beijing.aliyuncs.com/yunionio/local-path-provisioner:v0.0.24"
// commonConf.CSIRancherLocalPathConfig.Image = "registry.cn-beijing.aliyuncs.com/yunionio/local-path-provisioner:v0.0.24"
commonConf.CSIRancherLocalPathConfig.Image = "rancher/local-path-provisioner:v0.0.24"
commonConf.CSIRancherLocalPathConfig.HelperImage = "busybox:latest"

reg, err := cluster.GetImageRepository()
if err != nil {
return "", errors.Wrap(err, "get cluster image_repository")
}
// reg, err := cluster.GetImageRepository()
// if err != nil {
// return "", errors.Wrap(err, "get cluster image_repository")
// }

cniVersion := "v1.13.3"
cniUrl := "registry.us-west-1.aliyuncs.com/yunion-dev"

pluginConf := &addons.AwsVMPluginsConfig{
YunionCommonPluginsConfig: commonConf,
AwsVPCCNIConfig: &addons.AwsVPCCNIConfig{
Image: registry.MirrorImage(reg.Url, "amazon-k8s-cni", cniVersion, ""),
InitImage: registry.MirrorImage(reg.Url, "amazon-k8s-cni-init", cniVersion, ""),
Image: registry.MirrorImage(cniUrl, "amazon-k8s-cni", cniVersion, ""),
InitImage: registry.MirrorImage(cniUrl, "amazon-k8s-cni-init", cniVersion, ""),
},
CloudProviderAwsConfig: &addons.CloudProviderAwsConfig{},
}
Expand Down
12 changes: 11 additions & 1 deletion pkg/kubeserver/drivers/container_registries/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,17 @@ func (c client) ListImages(ctx context.Context, input *api.ContainerRegistryList
newRepos = result.Repositories
}
}
result.Repositories = newRepos
if input.RepositoryName != "" {
filterRepos := []string{}
for _, name := range newRepos {
if strings.Contains(name, input.RepositoryName) {
filterRepos = append(filterRepos, name)
}
}
result.Repositories = filterRepos
} else {
result.Repositories = newRepos
}
if input.Details {
result.Details = make([]*ImageTagResult, 0)
var errgrp errgroup.Group
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubeserver/drivers/container_registries/harbor.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ func (h harborImpl) PreparePushImage(ctx context.Context, url string, conf *api.
Public: &trueObj,
}
ret, err := cs.V2().Project.CreateProject(ctx, params)
log.Infof("create project %q, ret: %#v, error: %v", ret, err)
log.Infof("create project %q, ret: %#v, error: %v", projectName, ret, err)
return nil
}
Loading
Loading