Skip to content

Commit 62803cd

Browse files
committed
chore: update Docker and ORAS versions, modify upgrade functionality
- Update the version of `github.com/docker/docker` from `v25.0.0+incompatible` to `v25.0.1+incompatible` in the `go.mod` file - Update the version of `github.com/docker/cli` from `v25.0.0+incompatible` to `v25.0.1+incompatible` in the `go.mod` file - Update the version of `github.com/oras.land/oras-go` from `v1.2.4` to `v1.2.5` in the `go.mod` file - Modify the code in `pkg/qucheng/upgrade/upgrade.go` to change the value of `newValue` based on selected items and products - Add a log statement to display the product, old version, and new version in `pkg/qucheng/upgrade/upgrade.go` Signed-off-by: ysicing <[email protected]>
1 parent 543f2bd commit 62803cd

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

go.mod

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/cheggaaa/pb/v3 v3.1.5
1010
github.com/cockroachdb/errors v1.11.1
1111
github.com/containerd/continuity v0.4.3
12-
github.com/docker/docker v25.0.0+incompatible
12+
github.com/docker/docker v25.0.1+incompatible
1313
github.com/easysoft/quickon-api v0.7.4
1414
github.com/emirpasic/gods v1.18.1
1515
github.com/ergoapi/util v0.6.4
@@ -90,12 +90,11 @@ require (
9090
github.com/daviddengcn/go-colortext v1.0.0 // indirect
9191
github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa // indirect
9292
github.com/distribution/reference v0.5.0 // indirect
93-
github.com/docker/cli v25.0.0+incompatible // indirect
93+
github.com/docker/cli v25.0.1+incompatible // indirect
9494
github.com/docker/distribution v2.8.3+incompatible // indirect
9595
github.com/docker/docker-credential-helpers v0.8.1 // indirect
9696
github.com/docker/go-connections v0.5.0 // indirect
9797
github.com/docker/go-metrics v0.0.1 // indirect
98-
github.com/docker/go-units v0.5.0 // indirect
9998
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
10099
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
101100
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
@@ -226,7 +225,7 @@ require (
226225
k8s.io/component-helpers v0.29.0 // indirect
227226
k8s.io/klog/v2 v2.120.1 // indirect
228227
k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15 // indirect
229-
oras.land/oras-go v1.2.4 // indirect
228+
oras.land/oras-go v1.2.5 // indirect
230229
rsc.io/goversion v1.2.0 // indirect
231230
sigs.k8s.io/controller-runtime v0.16.2 // indirect
232231
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect

go.sum

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2 h1:aB
108108
github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI=
109109
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
110110
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
111-
github.com/docker/cli v25.0.0+incompatible h1:zaimaQdnX7fYWFqzN88exE9LDEvRslexpFowZBX6GoQ=
112-
github.com/docker/cli v25.0.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
111+
github.com/docker/cli v25.0.1+incompatible h1:mFpqnrS6Hsm3v1k7Wa/BO23oz0k121MTbTO1lpcGSkU=
112+
github.com/docker/cli v25.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
113113
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
114114
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
115-
github.com/docker/docker v25.0.0+incompatible h1:g9b6wZTblhMgzOT2tspESstfw6ySZ9kdm94BLDKaZac=
116-
github.com/docker/docker v25.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
115+
github.com/docker/docker v25.0.1+incompatible h1:k5TYd5rIVQRSqcTwCID+cyVA0yRg86+Pcrz1ls0/frA=
116+
github.com/docker/docker v25.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
117117
github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo=
118118
github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
119119
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
@@ -122,8 +122,6 @@ github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ
122122
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA=
123123
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
124124
github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=
125-
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
126-
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
127125
github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1 h1:ZClxb8laGDf5arXfYcAtECDFgAgHklGI8CxgjHnXKJ4=
128126
github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
129127
github.com/easysoft/quickon-api v0.7.4 h1:8P288Iinjf1HY85AXgEdDxpKhTjqt1p980x8rKPV5vw=
@@ -773,8 +771,8 @@ k8s.io/system-validators v1.7.0 h1:tYD3hojdYc58CKtiEsh7BWW6Pg0x6xbclUiwjaIiiYo=
773771
k8s.io/system-validators v1.7.0/go.mod h1:gP1Ky+R9wtrSiFbrpEPwWMeYz9yqyy1S/KOh0Vci7WI=
774772
k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ=
775773
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
776-
oras.land/oras-go v1.2.4 h1:djpBY2/2Cs1PV87GSJlxv4voajVOMZxqqtq9AB8YNvY=
777-
oras.land/oras-go v1.2.4/go.mod h1:DYcGfb3YF1nKjcezfX2SNlDAeQFKSXmf+qrFmrh4324=
774+
oras.land/oras-go v1.2.5 h1:XpYuAwAb0DfQsunIyMfeET92emK8km3W4yEzZvUbsTo=
775+
oras.land/oras-go v1.2.5/go.mod h1:PuAwRShRZCsZb7g8Ar3jKKQR/2A/qN+pkYxIOd/FAoo=
778776
rsc.io/goversion v1.2.0 h1:SPn+NLTiAG7w30IRK/DKp1BjvpWabYgxlLp/+kx5J8w=
779777
rsc.io/goversion v1.2.0/go.mod h1:Eih9y/uIBS3ulggl7KNJ09xGSLcuNaLgmvvqa07sgfo=
780778
sigs.k8s.io/controller-runtime v0.16.2 h1:mwXAVuEk3EQf478PQwQ48zGOXvW27UJc8NHktQVuIPU=

pkg/qucheng/upgrade/upgrade.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,17 @@ func Upgrade(flagVersion string, testmode bool, log log.Logger) error {
133133
Size: 5,
134134
}
135135
it, _, _ := selectApp.Run()
136-
appnewVersion := fmt.Sprintf("%s%s.k8s", selectItems[it].Key.String(), common.GetVersion(true, selectItems[it].Key.String(), ""))
137-
log.Debugf("devops mode, product: %v, oldversion: %v, newversion: %v", product, appoldVersion, appnewVersion)
138-
defaultValue["deploy"].(map[string]interface{})["versions"].(map[string]interface{})[product.(string)] = appnewVersion
139-
defaultValue["deploy"].(map[string]interface{})["product"] = selectItems[it].Key.String()
140-
if selectItems[it].Key != common.ZenTaoOSSType && selectItems[it].Key.String() != product.(string) {
141-
log.Warnf("切换版本升级(如开源版升级到企业版), 可能导致因版本授权问题无法正常使用, 如有问题请联系技术支持!")
136+
newProduct := selectItems[it].Key.String()
137+
defaultValue["deploy"].(map[string]interface{})["product"] = newProduct
138+
appnewVersion := common.GetVersion(true, newProduct, "")
139+
if selectItems[it].Key != common.ZenTaoOSSType {
140+
appnewVersion = fmt.Sprintf("%s%s.k8s", newProduct, common.GetVersion(true, newProduct, ""))
141+
if newProduct != product.(string) {
142+
log.Warnf("切换版本升级(如开源版升级到企业版), 可能导致因版本授权问题无法正常使用, 如有问题请联系技术支持!")
143+
}
142144
}
145+
defaultValue["deploy"].(map[string]interface{})["versions"].(map[string]interface{})[product.(string)] = appnewVersion
146+
log.Infof("devops mode, product: %v, oldversion: %v, newversion: %v", product, appoldVersion, appnewVersion)
143147
msg := fmt.Sprintf("Are you sure to upgrade from %v(%v) to %v(%v)", product, appoldVersion, selectItems[it].Key.String(), appnewVersion)
144148
status, _ := confirm.Confirm(msg)
145149
if !status {

0 commit comments

Comments
 (0)