Skip to content

Commit 575d8ed

Browse files
committed
Merge remote-tracking branch 'origin/sprint-1.18' into sprint-1.18
# Conflicts: # go.mod # go.sum
2 parents b6ac1fc + 54dc98e commit 575d8ed

File tree

8 files changed

+61
-23
lines changed

8 files changed

+61
-23
lines changed

.github/workflows/build-zbox.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
sudo apt -y install build-essential nghttp2 libnghttp2-dev libssl-dev containerd docker.io
2222
2323
- name: Checkout
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v4
2525

2626
- name: Setup gopath and gocache
2727
run: |
@@ -40,7 +40,7 @@ jobs:
4040
make install
4141
4242
- name: 'Upload Artifact'
43-
uses: actions/upload-artifact@v2
43+
uses: actions/upload-artifact@v3
4444
with:
4545
name: zbox-linux
4646
path: zbox
@@ -79,7 +79,7 @@ jobs:
7979
go env -w "CC=/mingw64/bin/clang.exe"
8080
8181
- name: Checkout
82-
uses: actions/checkout@v2
82+
uses: actions/checkout@v4
8383

8484
- name: Install
8585
run: make install
@@ -93,7 +93,7 @@ jobs:
9393
zip zbox-windows.zip zbox.exe libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll
9494
9595
- name: 'Upload Artifact'
96-
uses: actions/upload-artifact@v2
96+
uses: actions/upload-artifact@v3
9797
with:
9898
name: zbox-windows.zip
9999
path: zbox-windows.zip
@@ -115,13 +115,13 @@ jobs:
115115
go-version: '1.21'
116116

117117
- name: Checkout
118-
uses: actions/checkout@v2
118+
uses: actions/checkout@v4
119119

120120
- name: Install
121121
run: make install
122122

123123
- name: 'Upload Artifact'
124-
uses: actions/upload-artifact@v2
124+
uses: actions/upload-artifact@v3
125125
with:
126126
name: zbox-macos
127127
path: zbox

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
steps:
3636
- name: Checkout repository
37-
uses: actions/checkout@v2
37+
uses: actions/checkout@v4
3838

3939
# Initializes the CodeQL tools for scanning.
4040
- name: Initialize CodeQL

.github/workflows/distribute-zboxcli-apt.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949

5050
steps:
5151
- name: Checkout code
52-
uses: actions/checkout@v2
52+
uses: actions/checkout@v4
5353
with:
5454
path: ${{ env.SRC_DIR }}
5555

@@ -140,7 +140,7 @@ jobs:
140140
DEB_DIR: ${{ github.workspace }}/deb-files
141141
steps:
142142
- name: Checkout code
143-
uses: actions/checkout@v2
143+
uses: actions/checkout@v4
144144
with:
145145
path: ${{ env.SRC_DIR }}
146146

@@ -263,7 +263,7 @@ jobs:
263263

264264
steps:
265265
- name: Checkout code
266-
uses: actions/checkout@v2
266+
uses: actions/checkout@v4
267267
with:
268268
path: ${{ env.SRC_DIR }}
269269

.github/workflows/release-zboxcli.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout code
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v4
2626

2727
- name: Install deps
2828
run: |
@@ -87,7 +87,7 @@ jobs:
8787
tag_schema: semantic
8888

8989
- name: 'Upload Artifact'
90-
uses: actions/upload-artifact@v2
90+
uses: actions/upload-artifact@v3
9191
with:
9292
name: zbox-linux
9393
path: zbox
@@ -126,7 +126,7 @@ jobs:
126126
go env -w "CC=/mingw64/bin/clang.exe"
127127
128128
- name: Checkout
129-
uses: actions/checkout@v2
129+
uses: actions/checkout@v4
130130

131131
- name: Install
132132
run: make install
@@ -140,7 +140,7 @@ jobs:
140140
zip zbox-windows.zip zbox.exe libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll
141141
142142
- name: 'Upload Artifact'
143-
uses: actions/upload-artifact@v2
143+
uses: actions/upload-artifact@v3
144144
with:
145145
name: zbox-windows.zip
146146
path: zbox-windows.zip
@@ -162,7 +162,7 @@ jobs:
162162
go-version: '1.20' # The Go version to download (if necessary) and use.
163163

164164
- name: Checkout
165-
uses: actions/checkout@v2
165+
uses: actions/checkout@v4
166166

167167
- name: Install
168168
run: make install
@@ -171,7 +171,7 @@ jobs:
171171
run: tar -czvf zbox-macos.tar.gz ./zbox
172172

173173
- name: 'Upload Artifact'
174-
uses: actions/upload-artifact@v2
174+
uses: actions/upload-artifact@v3
175175
with:
176176
name: zbox-macos
177177
path: zbox

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
OUTPUT_DIR: ${{ github.workspace }}/output
5252
steps:
5353
- name: Checkout code
54-
uses: actions/checkout@v2
54+
uses: actions/checkout@v4
5555
with:
5656
path: ${{ env.SRC_DIR }}
5757

@@ -154,7 +154,7 @@ jobs:
154154
OUTPUT_DIR: ${{ github.workspace }}/output
155155
steps:
156156
- name: Checkout code
157-
uses: actions/checkout@v2
157+
uses: actions/checkout@v4
158158
with:
159159
path: ${{ env.SRC_DIR }}
160160

@@ -230,7 +230,7 @@ jobs:
230230
OUTPUT_DIR: ${{ github.workspace }}\output
231231
steps:
232232
- name: Checkout code
233-
uses: actions/checkout@v2
233+
uses: actions/checkout@v4
234234
with:
235235
path: ${{ env.SRC_DIR }}
236236

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
go-version: '1.21'
2020

2121
- name: Clone Zbox
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
2323

2424
- name: Install Packages
2525
run: |
@@ -40,7 +40,7 @@ jobs:
4040
go-version: '1.21'
4141

4242
- name: Clone 0Box
43-
uses: actions/checkout@v2
43+
uses: actions/checkout@v4
4444

4545
- name: check software
4646
run: |
@@ -52,7 +52,7 @@ jobs:
5252
run: make install
5353

5454
- name: 'Upload Artifact'
55-
uses: actions/upload-artifact@v2
55+
uses: actions/upload-artifact@v3
5656
with:
5757
name: zbox-linux
5858
path: zbox

cmd/newallocation.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ var newallocationCmd = &cobra.Command{
237237
fileOptionParams.ForbidRename.Value = forbidRename
238238
}
239239

240+
var storageVersion int64
241+
if flags.Changed("storage_version") {
242+
storageVersion, err = flags.GetInt64("storage_version")
243+
if err != nil {
244+
log.Fatal("invalid forbid_upload: ", err)
245+
}
246+
}
247+
240248
var allocationID string
241249
if len(owner) == 0 {
242250
options := sdk.CreateAllocationOptions{
@@ -258,6 +266,7 @@ var newallocationCmd = &cobra.Command{
258266
ThirdPartyExtendable: thirdPartyExtendable,
259267
Force: force,
260268
IsEnterprise: isEnterprise,
269+
StorageVersion: int(storageVersion),
261270
}
262271
allocationID, _, _, err = sdk.CreateAllocationWith(options)
263272
if err != nil {
@@ -355,6 +364,8 @@ func init() {
355364
newallocationCmd.Flags().Bool("forbid_move", false, "(default false) specify if the users cannot move objects from this allocation")
356365
newallocationCmd.Flags().Bool("forbid_copy", false, "(default false) specify if the users cannot copy object from this allocation")
357366
newallocationCmd.Flags().Bool("forbid_rename", false, "(default false) specify if the users cannot rename objects in this allocation")
367+
368+
newallocationCmd.Flags().Int64("storage_version", 0, "storaage version of allocation")
358369
}
359370

360371
func storeAllocation(allocationID string) {

cmd/storage.go

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,22 @@ var blobberUpdateCmd = &cobra.Command{
188188
updateBlobber.Capacity = &changedCapacity
189189
}
190190

191+
var delegateWallet string
192+
if flags.Changed("delegate_wallet") {
193+
if delegateWallet, err = flags.GetString("delegate_wallet"); err != nil {
194+
log.Fatal(err)
195+
}
196+
updateBlobber.DelegateWallet = &delegateWallet
197+
}
198+
199+
var storageVersion int
200+
if flags.Changed("storage_version") {
201+
if storageVersion, err = flags.GetInt("storage_version"); err != nil {
202+
log.Fatal(err)
203+
}
204+
updateBlobber.StorageVersion = &storageVersion
205+
}
206+
191207
terms := &sdk.UpdateTerms{}
192208
var termsChanged bool
193209
if flags.Changed("read_price") {
@@ -235,6 +251,15 @@ var blobberUpdateCmd = &cobra.Command{
235251
stakePoolSettingChanged = true
236252
}
237253

254+
if flags.Changed("delegate_Wallet") {
255+
var dw string
256+
if dw, err = flags.GetString("delegate_wallet"); err != nil {
257+
log.Fatal(err)
258+
}
259+
stakePoolSettings.DelegateWallet = &dw
260+
stakePoolSettingChanged = true
261+
}
262+
238263
if flags.Changed("service_charge") {
239264
var sc float64
240265
if sc, err = flags.GetFloat64("service_charge"); err != nil {
@@ -379,7 +404,9 @@ func init() {
379404

380405
buf := blobberUpdateCmd.Flags()
381406
buf.String("blobber_id", "", "blobber ID, required")
382-
buf.Int64("capacity", 0, " update blobber capacity bid, optional")
407+
buf.String("delegate_wallet", "", "delegate wallet, optional")
408+
buf.Int64("storage_version", 0, "update storage version, optional")
409+
buf.Int64("capacity", 0, "update blobber capacity bid, optional")
383410
buf.Float64("read_price", 0.0, "update read_price, optional")
384411
buf.Float64("write_price", 0.0, "update write_price, optional")
385412
buf.Duration("max_offer_duration", 0*time.Second, "update max_offer_duration, optional")

0 commit comments

Comments
 (0)