update operator to latest master (#792)
this is to remove logsearchapi dependency on audit.Entry structure from MinIO server.
This commit is contained in:
@@ -248,10 +248,7 @@ func setGroupStatus(ctx context.Context, client MinioAdmin, group, status string
|
||||
default:
|
||||
return errors.New(500, "status not valid")
|
||||
}
|
||||
if err := client.setGroupStatus(ctx, group, setStatus); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return client.setGroupStatus(ctx, group, setStatus)
|
||||
}
|
||||
|
||||
// getUpdateGroupResponse updates a group by adding or removing it's members depending on the request,
|
||||
|
||||
@@ -328,10 +328,7 @@ func setPolicy(ctx context.Context, client MinioAdmin, name, entityName string,
|
||||
if entityType == models.PolicyEntityGroup {
|
||||
isGroup = true
|
||||
}
|
||||
if err := client.setPolicy(ctx, name, entityName, isGroup); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return client.setPolicy(ctx, name, entityName, isGroup)
|
||||
}
|
||||
|
||||
// getSetPolicyResponse() performs setPolicy() and serializes it to the handler's output
|
||||
|
||||
@@ -1408,7 +1408,7 @@ func getTenantPodsResponse(session *models.Principal, params admin_api.GetTenant
|
||||
}
|
||||
retval := []*models.TenantPod{}
|
||||
for _, pod := range pods.Items {
|
||||
var restarts int64 = 0
|
||||
var restarts int64
|
||||
if len(pod.Status.ContainerStatuses) > 0 {
|
||||
restarts = int64(pod.Status.ContainerStatuses[0].RestartCount)
|
||||
}
|
||||
|
||||
@@ -206,10 +206,7 @@ func getUserAddResponse(session *models.Principal, params admin_api.AddUserParam
|
||||
|
||||
//removeUser invokes removing an user on `MinioAdmin`, then we return the response from API
|
||||
func removeUser(ctx context.Context, client MinioAdmin, accessKey string) error {
|
||||
if err := client.removeUser(ctx, accessKey); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return client.removeUser(ctx, accessKey)
|
||||
}
|
||||
|
||||
func getRemoveUserResponse(session *models.Principal, params admin_api.RemoveUserParams) *models.Error {
|
||||
@@ -393,10 +390,7 @@ func setUserStatus(ctx context.Context, client MinioAdmin, user string, status s
|
||||
return errors.New(500, "status not valid")
|
||||
}
|
||||
|
||||
if err := client.setUserStatus(ctx, user, setStatus); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return client.setUserStatus(ctx, user, setStatus)
|
||||
}
|
||||
|
||||
func getUpdateUserResponse(session *models.Principal, params admin_api.UpdateUserInfoParams) (*models.User, *models.Error) {
|
||||
@@ -595,10 +589,7 @@ func listUsersWithAccessToBucket(ctx context.Context, adminClient MinioAdmin, bu
|
||||
|
||||
// changeUserPassword changes password of selectedUser to newSecretKey
|
||||
func changeUserPassword(ctx context.Context, client MinioAdmin, selectedUser string, newSecretKey string) error {
|
||||
if err := client.changePassword(ctx, selectedUser, newSecretKey); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return client.changePassword(ctx, selectedUser, newSecretKey)
|
||||
}
|
||||
|
||||
// getChangeUserPasswordResponse will change the password of selctedUser to newSecretKey
|
||||
|
||||
@@ -57,10 +57,7 @@ func registerAccountHandlers(api *operations.ConsoleAPI) {
|
||||
|
||||
// changePassword validate current current user password and if it's correct set the new password
|
||||
func changePassword(ctx context.Context, client MinioAdmin, session *models.Principal, newSecretKey string) error {
|
||||
if err := client.changePassword(ctx, session.AccountAccessKey, newSecretKey); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return client.changePassword(ctx, session.AccountAccessKey, newSecretKey)
|
||||
}
|
||||
|
||||
// getChangePasswordResponse will validate user knows what is the current password (avoid account hijacking), update user account password
|
||||
|
||||
@@ -308,10 +308,7 @@ func getListBucketsResponse(session *models.Principal) (*models.ListBucketsRespo
|
||||
// makeBucket creates a bucket for an specific minio client
|
||||
func makeBucket(ctx context.Context, client MinioClient, bucketName string, objectLocking bool) error {
|
||||
// creates a new bucket with bucketName with a context to control cancellations and timeouts.
|
||||
if err := client.makeBucketWithContext(ctx, bucketName, "us-east-1", objectLocking); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return client.makeBucketWithContext(ctx, bucketName, "", objectLocking)
|
||||
}
|
||||
|
||||
// getMakeBucketResponse performs makeBucket() to create a bucket with its access policy
|
||||
|
||||
Reference in New Issue
Block a user