Fix some leftover issues from PR 18936 (#18946)

This commit is contained in:
Frank Wessels 2024-02-01 19:42:56 -08:00 committed by GitHub
parent 6fd63e920a
commit 31743789dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 56 deletions

View file

@ -415,11 +415,8 @@ func (client *peerRESTClient) LoadBucketMetadata(bucket string) error {
_, err := loadBucketMetadataHandler.Call(context.Background(), conn, grid.NewMSSWith(map[string]string{
peerRESTBucket: bucket,
}))
if err != nil {
return err
}
return nil
}
// DeleteBucketMetadata - Delete bucket metadata
func (client *peerRESTClient) DeleteBucketMetadata(bucket string) error {
@ -430,11 +427,8 @@ func (client *peerRESTClient) DeleteBucketMetadata(bucket string) error {
_, err := deleteBucketMetadataHandler.Call(context.Background(), conn, grid.NewMSSWith(map[string]string{
peerRESTBucket: bucket,
}))
if err != nil {
return err
}
return nil
}
// DeletePolicy - delete a specific canned policy.
func (client *peerRESTClient) DeletePolicy(policyName string) (err error) {
@ -446,11 +440,8 @@ func (client *peerRESTClient) DeletePolicy(policyName string) (err error) {
_, err = deletePolicyHandler.Call(context.Background(), conn, grid.NewMSSWith(map[string]string{
peerRESTPolicy: policyName,
}))
if err != nil {
return err
}
return nil
}
// LoadPolicy - reload a specific canned policy.
func (client *peerRESTClient) LoadPolicy(policyName string) (err error) {
@ -462,11 +453,8 @@ func (client *peerRESTClient) LoadPolicy(policyName string) (err error) {
_, err = loadPolicyHandler.Call(context.Background(), conn, grid.NewMSSWith(map[string]string{
peerRESTPolicy: policyName,
}))
if err != nil {
return err
}
return nil
}
// LoadPolicyMapping - reload a specific policy mapping
func (client *peerRESTClient) LoadPolicyMapping(userOrGroup string, userType IAMUserType, isGroup bool) error {
@ -480,11 +468,8 @@ func (client *peerRESTClient) LoadPolicyMapping(userOrGroup string, userType IAM
peerRESTUserType: strconv.Itoa(int(userType)),
peerRESTIsGroup: strconv.FormatBool(isGroup),
}))
if err != nil {
return err
}
return nil
}
// DeleteUser - delete a specific user.
func (client *peerRESTClient) DeleteUser(accessKey string) (err error) {
@ -496,11 +481,8 @@ func (client *peerRESTClient) DeleteUser(accessKey string) (err error) {
_, err = deleteUserHandler.Call(context.Background(), conn, grid.NewMSSWith(map[string]string{
peerRESTUser: accessKey,
}))
if err != nil {
return err
}
return nil
}
// DeleteServiceAccount - delete a specific service account.
func (client *peerRESTClient) DeleteServiceAccount(accessKey string) (err error) {
@ -512,11 +494,8 @@ func (client *peerRESTClient) DeleteServiceAccount(accessKey string) (err error)
_, err = deleteSvcActHandler.Call(context.Background(), conn, grid.NewMSSWith(map[string]string{
peerRESTUser: accessKey,
}))
if err != nil {
return err
}
return nil
}
// LoadUser - reload a specific user.
func (client *peerRESTClient) LoadUser(accessKey string, temp bool) (err error) {
@ -529,11 +508,8 @@ func (client *peerRESTClient) LoadUser(accessKey string, temp bool) (err error)
peerRESTUser: accessKey,
peerRESTUserTemp: strconv.FormatBool(temp),
}))
if err != nil {
return err
}
return nil
}
// LoadServiceAccount - reload a specific service account.
func (client *peerRESTClient) LoadServiceAccount(accessKey string) (err error) {
@ -545,11 +521,8 @@ func (client *peerRESTClient) LoadServiceAccount(accessKey string) (err error) {
_, err = loadSvcActHandler.Call(context.Background(), conn, grid.NewMSSWith(map[string]string{
peerRESTUser: accessKey,
}))
if err != nil {
return err
}
return nil
}
// LoadGroup - send load group command to peers.
func (client *peerRESTClient) LoadGroup(group string) error {
@ -561,11 +534,8 @@ func (client *peerRESTClient) LoadGroup(group string) error {
_, err := loadGroupHandler.Call(context.Background(), conn, grid.NewMSSWith(map[string]string{
peerRESTGroup: group,
}))
if err != nil {
return err
}
return nil
}
// VerifyBinary - sends verify binary message to remote peers.
func (client *peerRESTClient) VerifyBinary(ctx context.Context, u *url.URL, sha256Sum []byte, releaseInfo string, reader io.Reader) error {
@ -678,11 +648,8 @@ func (client *peerRESTClient) ReloadPoolMeta(ctx context.Context) error {
return nil
}
_, err := reloadPoolMetaHandler.Call(ctx, conn, grid.NewMSSWith(map[string]string{}))
if err != nil {
return err
}
return nil
}
func (client *peerRESTClient) StopRebalance(ctx context.Context) error {
conn := client.gridConn()
@ -690,11 +657,8 @@ func (client *peerRESTClient) StopRebalance(ctx context.Context) error {
return nil
}
_, err := stopRebalanceHandler.Call(ctx, conn, grid.NewMSSWith(map[string]string{}))
if err != nil {
return err
}
return nil
}
func (client *peerRESTClient) LoadRebalanceMeta(ctx context.Context, startRebalance bool) error {
conn := client.gridConn()
@ -704,11 +668,8 @@ func (client *peerRESTClient) LoadRebalanceMeta(ctx context.Context, startRebala
_, err := loadRebalanceMetaHandler.Call(ctx, conn, grid.NewMSSWith(map[string]string{
peerRESTStartRebalance: strconv.FormatBool(startRebalance),
}))
if err != nil {
return err
}
return nil
}
func (client *peerRESTClient) LoadTransitionTierConfig(ctx context.Context) error {
conn := client.gridConn()
@ -716,11 +677,8 @@ func (client *peerRESTClient) LoadTransitionTierConfig(ctx context.Context) erro
return nil
}
_, err := loadTransitionTierConfigHandler.Call(ctx, conn, grid.NewMSSWith(map[string]string{}))
if err != nil {
return err
}
return nil
}
func (client *peerRESTClient) doTrace(ctx context.Context, traceCh chan<- []byte, traceOpts madmin.ServiceTraceOpts) {
gridConn := client.gridConn()

View file

@ -228,6 +228,10 @@ func (s *peerRESTServer) LoadGroupHandler(mss *grid.MSS) (np grid.NoPayload, ner
}
group := mss.Get(peerRESTGroup)
if group == "" {
return np, grid.NewRemoteErr(errors.New("group is missing"))
}
err := globalIAMSys.LoadGroup(context.Background(), objAPI, group)
if err != nil {
return np, grid.NewRemoteErr(err)