update CREDITS and enable builds for go1.19 (#2227)
This commit is contained in:
56
.github/workflows/jobs.yaml
vendored
56
.github/workflows/jobs.yaml
vendored
@@ -29,7 +29,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -98,7 +98,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -168,7 +168,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
@@ -210,7 +210,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -234,7 +234,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -281,7 +281,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -341,7 +341,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -379,7 +379,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -458,7 +458,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -537,7 +537,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -618,7 +618,7 @@ jobs:
|
|||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -687,7 +687,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -756,7 +756,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -825,7 +825,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -894,7 +894,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -963,7 +963,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -1042,7 +1042,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -1116,7 +1116,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -1154,7 +1154,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -1192,7 +1192,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -1230,7 +1230,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -1268,7 +1268,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -1306,7 +1306,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -1344,7 +1344,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -1382,7 +1382,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -1428,7 +1428,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -1475,7 +1475,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -1587,7 +1587,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.18.x ]
|
go-version: [ 1.18.x, 1.19.x ]
|
||||||
os: [ ubuntu-latest ]
|
os: [ ubuntu-latest ]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ linters-settings:
|
|||||||
|
|
||||||
misspell:
|
misspell:
|
||||||
locale: US
|
locale: US
|
||||||
|
|
||||||
|
goheader:
|
||||||
|
values:
|
||||||
|
regexp:
|
||||||
|
copyright-holder: Copyright \(c\) (20\d\d\-20\d\d)|2021|({{year}})
|
||||||
|
template-path: .license.tmpl
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
disable-all: true
|
disable-all: true
|
||||||
@@ -28,13 +34,6 @@ linters:
|
|||||||
- tenv
|
- tenv
|
||||||
- durationcheck
|
- durationcheck
|
||||||
|
|
||||||
linters-settings:
|
|
||||||
goheader:
|
|
||||||
values:
|
|
||||||
regexp:
|
|
||||||
copyright-holder: Copyright \(c\) (20\d\d\-20\d\d)|2021|({{year}})
|
|
||||||
template-path: .license.tmpl
|
|
||||||
|
|
||||||
service:
|
service:
|
||||||
golangci-lint-version: 1.43.0 # use the fixed version to not introduce new linters unexpectedly
|
golangci-lint-version: 1.43.0 # use the fixed version to not introduce new linters unexpectedly
|
||||||
|
|
||||||
@@ -52,3 +51,4 @@ run:
|
|||||||
skip-dirs:
|
skip-dirs:
|
||||||
- pkg/clientgen
|
- pkg/clientgen
|
||||||
- pkg/apis/networking.gke.io
|
- pkg/apis/networking.gke.io
|
||||||
|
- restapi/operations
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -21,7 +21,7 @@ k8sdev:
|
|||||||
|
|
||||||
getdeps:
|
getdeps:
|
||||||
@mkdir -p ${GOPATH}/bin
|
@mkdir -p ${GOPATH}/bin
|
||||||
@echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.45.2
|
@echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin
|
||||||
|
|
||||||
verifiers: getdeps fmt lint
|
verifiers: getdeps fmt lint
|
||||||
|
|
||||||
|
|||||||
@@ -180,8 +180,9 @@ const (
|
|||||||
// or data key provided as plaintext.
|
// or data key provided as plaintext.
|
||||||
//
|
//
|
||||||
// The returned ciphertext data consists of:
|
// The returned ciphertext data consists of:
|
||||||
// AEAD ID | iv | nonce | encrypted data
|
//
|
||||||
// 1 16 12 ~ len(data)
|
// AEAD ID | iv | nonce | encrypted data
|
||||||
|
// 1 16 12 ~ len(data)
|
||||||
func encrypt(plaintext, associatedData []byte) ([]byte, error) {
|
func encrypt(plaintext, associatedData []byte) ([]byte, error) {
|
||||||
iv, err := sioutil.Random(16) // 16 bytes IV
|
iv, err := sioutil.Random(16) // 16 bytes IV
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import (
|
|||||||
|
|
||||||
// Target is the entity that we will receive
|
// Target is the entity that we will receive
|
||||||
// a single log entry and Send it to the log target
|
// a single log entry and Send it to the log target
|
||||||
// e.g. Send the log to a http server
|
// e.g. Send the log to a http server
|
||||||
type Target interface {
|
type Target interface {
|
||||||
String() string
|
String() string
|
||||||
Endpoint() string
|
Endpoint() string
|
||||||
|
|||||||
@@ -280,8 +280,8 @@ func setGroupStatus(ctx context.Context, client MinioAdmin, group, status string
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getUpdateGroupResponse updates a group by adding or removing it's members depending on the request,
|
// getUpdateGroupResponse updates a group by adding or removing it's members depending on the request,
|
||||||
// also sets the group's status if status in the request is different than the current one.
|
// also sets the group's status if status in the request is different than the current one.
|
||||||
// Then serializes the output to be used by the handler.
|
// Then serializes the output to be used by the handler.
|
||||||
func getUpdateGroupResponse(session *models.Principal, params groupApi.UpdateGroupParams) (*models.Group, *models.Error) {
|
func getUpdateGroupResponse(session *models.Principal, params groupApi.UpdateGroupParams) (*models.Group, *models.Error) {
|
||||||
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
|
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@@ -320,8 +320,8 @@ func getUpdateGroupResponse(session *models.Principal, params groupApi.UpdateGro
|
|||||||
}
|
}
|
||||||
|
|
||||||
// groupUpdate updates a group given the expected parameters, compares the expected parameters against the current ones
|
// groupUpdate updates a group given the expected parameters, compares the expected parameters against the current ones
|
||||||
// and updates them accordingly, status is only updated if the expected status is different than the current one.
|
// and updates them accordingly, status is only updated if the expected status is different than the current one.
|
||||||
// Then fetches the group again to return the object updated.
|
// Then fetches the group again to return the object updated.
|
||||||
func groupUpdate(ctx context.Context, client MinioAdmin, groupName string, expectedGroup *models.UpdateGroupRequest) (*madmin.GroupDesc, error) {
|
func groupUpdate(ctx context.Context, client MinioAdmin, groupName string, expectedGroup *models.UpdateGroupRequest) (*madmin.GroupDesc, error) {
|
||||||
expectedMembers := expectedGroup.Members
|
expectedMembers := expectedGroup.Members
|
||||||
expectedStatus := *expectedGroup.Status
|
expectedStatus := *expectedGroup.Status
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ func startTraceInfo(ctx context.Context, conn WSConn, client MinioAdmin, opts Tr
|
|||||||
}
|
}
|
||||||
|
|
||||||
// shortTrace creates a shorter Trace Info message.
|
// shortTrace creates a shorter Trace Info message.
|
||||||
// Same implementation as github/minio/mc/cmd/admin-trace.go
|
// Same implementation as github/minio/mc/cmd/admin-trace.go
|
||||||
func shortTrace(info *madmin.ServiceTraceInfo) shortTraceMsg {
|
func shortTrace(info *madmin.ServiceTraceInfo) shortTraceMsg {
|
||||||
t := info.Trace
|
t := info.Trace
|
||||||
s := shortTraceMsg{}
|
s := shortTraceMsg{}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ func Test_getSubPath(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
os.Setenv(SubPath, tt.args.envValue)
|
t.Setenv(SubPath, tt.args.envValue)
|
||||||
defer os.Unsetenv(SubPath)
|
defer os.Unsetenv(SubPath)
|
||||||
subPathOnce = sync.Once{}
|
subPathOnce = sync.Once{}
|
||||||
assert.Equalf(t, tt.want, getSubPath(), "getSubPath()")
|
assert.Equalf(t, tt.want, getSubPath(), "getSubPath()")
|
||||||
|
|||||||
@@ -547,7 +547,7 @@ func setBucketAccessPolicy(ctx context.Context, client MinioClient, bucketName s
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getBucketSetPolicyResponse calls setBucketAccessPolicy() to set a access policy to a bucket
|
// getBucketSetPolicyResponse calls setBucketAccessPolicy() to set a access policy to a bucket
|
||||||
// and returns the serialized output.
|
// and returns the serialized output.
|
||||||
func getBucketSetPolicyResponse(session *models.Principal, params bucketApi.BucketSetPolicyParams) (*models.Bucket, *models.Error) {
|
func getBucketSetPolicyResponse(session *models.Principal, params bucketApi.BucketSetPolicyParams) (*models.Bucket, *models.Error) {
|
||||||
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
|
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ func (mc minioClientMock) getBucketNotification(ctx context.Context, bucketName
|
|||||||
return minioGetBucketNotificationMock(ctx, bucketName)
|
return minioGetBucketNotificationMock(ctx, bucketName)
|
||||||
}
|
}
|
||||||
|
|
||||||
//// Mock mc S3Client functions ////
|
// // Mock mc S3Client functions ////
|
||||||
var (
|
var (
|
||||||
mcAddNotificationConfigMock func(ctx context.Context, arn string, events []string, prefix, suffix string, ignoreExisting bool) *probe.Error
|
mcAddNotificationConfigMock func(ctx context.Context, arn string, events []string, prefix, suffix string, ignoreExisting bool) *probe.Error
|
||||||
mcRemoveNotificationConfigMock func(ctx context.Context, arn string, event string, prefix string, suffix string) *probe.Error
|
mcRemoveNotificationConfigMock func(ctx context.Context, arn string, event string, prefix string, suffix string) *probe.Error
|
||||||
|
|||||||
@@ -288,8 +288,9 @@ type httpRange struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Example:
|
// Example:
|
||||||
// "Content-Range": "bytes 100-200/1000"
|
//
|
||||||
// "Content-Range": "bytes 100-200/*"
|
// "Content-Range": "bytes 100-200/1000"
|
||||||
|
// "Content-Range": "bytes 100-200/*"
|
||||||
func getRange(start, end, total int64) string {
|
func getRange(start, end, total int64) string {
|
||||||
// unknown total: -1
|
// unknown total: -1
|
||||||
if total == -1 {
|
if total == -1 {
|
||||||
@@ -300,10 +301,11 @@ func getRange(start, end, total int64) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Example:
|
// Example:
|
||||||
// "Range": "bytes=100-200"
|
//
|
||||||
// "Range": "bytes=-50"
|
// "Range": "bytes=100-200"
|
||||||
// "Range": "bytes=150-"
|
// "Range": "bytes=-50"
|
||||||
// "Range": "bytes=0-0,-1"
|
// "Range": "bytes=150-"
|
||||||
|
// "Range": "bytes=0-0,-1"
|
||||||
func parseRange(s string, size int64) ([]httpRange, error) {
|
func parseRange(s string, size int64) ([]httpRange, error) {
|
||||||
if s == "" {
|
if s == "" {
|
||||||
return nil, nil // header not present
|
return nil, nil // header not present
|
||||||
@@ -669,8 +671,9 @@ func deleteObjects(ctx context.Context, client MCClient, bucket string, path str
|
|||||||
}
|
}
|
||||||
|
|
||||||
// deleteMultipleObjects uses listing before removal, it can list recursively or not,
|
// deleteMultipleObjects uses listing before removal, it can list recursively or not,
|
||||||
// Use cases:
|
//
|
||||||
// * Remove objects recursively
|
// Use cases:
|
||||||
|
// * Remove objects recursively
|
||||||
func deleteMultipleObjects(ctx context.Context, client MCClient, recursive bool, allVersions bool) error {
|
func deleteMultipleObjects(ctx context.Context, client MCClient, recursive bool, allVersions bool) error {
|
||||||
isBypass := false
|
isBypass := false
|
||||||
isIncomplete := false
|
isIncomplete := false
|
||||||
|
|||||||
@@ -161,8 +161,8 @@ func createServiceAccountCreds(ctx context.Context, userClient MinioAdmin, polic
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getCreateServiceAccountResponse creates a service account with the defined policy for the user that
|
// getCreateServiceAccountResponse creates a service account with the defined policy for the user that
|
||||||
// is requestingit ,it first gets the credentials of the user and creates a client which is going to
|
// is requesting, it first gets the credentials of the user and creates a client which is going to
|
||||||
// make the call to create the Service Account
|
// make the call to create the Service Account
|
||||||
func getCreateServiceAccountResponse(session *models.Principal, params saApi.CreateServiceAccountParams) (*models.ServiceAccountCreds, *models.Error) {
|
func getCreateServiceAccountResponse(session *models.Principal, params saApi.CreateServiceAccountParams) (*models.ServiceAccountCreds, *models.Error) {
|
||||||
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
|
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@@ -222,8 +222,8 @@ func createAUserServiceAccountCreds(ctx context.Context, userClient MinioAdmin,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getCreateServiceAccountResponse creates a service account with the defined policy for the user that
|
// getCreateServiceAccountResponse creates a service account with the defined policy for the user that
|
||||||
// is requesting it ,it first gets the credentials of the user and creates a client which is going to
|
// is requesting it ,it first gets the credentials of the user and creates a client which is going to
|
||||||
// make the call to create the Service Account
|
// make the call to create the Service Account
|
||||||
func getCreateAUserServiceAccountResponse(session *models.Principal, params userApi.CreateAUserServiceAccountParams) (*models.ServiceAccountCreds, *models.Error) {
|
func getCreateAUserServiceAccountResponse(session *models.Principal, params userApi.CreateAUserServiceAccountParams) (*models.ServiceAccountCreds, *models.Error) {
|
||||||
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
|
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
@@ -247,7 +247,7 @@ func getCreateAUserServiceAccountResponse(session *models.Principal, params user
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getCreateServiceAccountCredsResponse creates a service account with the defined policy for the user that
|
// getCreateServiceAccountCredsResponse creates a service account with the defined policy for the user that
|
||||||
// is requesting it, and with the credentials provided
|
// is requesting it, and with the credentials provided
|
||||||
func getCreateAUserServiceAccountCredsResponse(session *models.Principal, params userApi.CreateServiceAccountCredentialsParams) (*models.ServiceAccountCreds, *models.Error) {
|
func getCreateAUserServiceAccountCredsResponse(session *models.Principal, params userApi.CreateServiceAccountCredentialsParams) (*models.ServiceAccountCreds, *models.Error) {
|
||||||
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
|
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|||||||
Reference in New Issue
Block a user