mirror of https://github.com/minio/minio.git
				
				
				
			Avoid unnecessary logging for policy not found errors (#6104)
This commit is contained in:
		
							parent
							
								
									f53d511798
								
							
						
					
					
						commit
						92a6676a2f
					
				|  | @ -1131,7 +1131,6 @@ func (a *azureObjects) GetBucketPolicy(ctx context.Context, bucket string) (*pol | |||
| 	} | ||||
| 
 | ||||
| 	if perm.AccessType == storage.ContainerAccessTypePrivate { | ||||
| 		logger.LogIf(ctx, minio.BucketPolicyNotFound{Bucket: bucket}) | ||||
| 		return nil, minio.BucketPolicyNotFound{Bucket: bucket} | ||||
| 	} else if perm.AccessType != storage.ContainerAccessTypeContainer { | ||||
| 		logger.LogIf(ctx, minio.NotImplemented{}) | ||||
|  |  | |||
|  | @ -772,7 +772,6 @@ func (l *b2Objects) GetBucketPolicy(ctx context.Context, bucket string) (*policy | |||
| 	// just return back as policy not found for all cases.
 | ||||
| 	// CreateBucket always sets the value to allPrivate by default.
 | ||||
| 	if bkt.Type != bucketTypeReadOnly { | ||||
| 		logger.LogIf(ctx, minio.BucketPolicyNotFound{Bucket: bucket}) | ||||
| 		return nil, minio.BucketPolicyNotFound{Bucket: bucket} | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
|  | @ -1136,7 +1136,6 @@ func (l *gcsGateway) CompleteMultipartUpload(ctx context.Context, bucket string, | |||
| func (l *gcsGateway) SetBucketPolicy(ctx context.Context, bucket string, bucketPolicy *policy.Policy) error { | ||||
| 	policyInfo, err := minio.PolicyToBucketAccessPolicy(bucketPolicy) | ||||
| 	if err != nil { | ||||
| 		// This should not happen.
 | ||||
| 		logger.LogIf(ctx, err) | ||||
| 		return gcsToObjectError(err, bucket) | ||||
| 	} | ||||
|  | @ -1192,7 +1191,6 @@ func (l *gcsGateway) SetBucketPolicy(ctx context.Context, bucket string, bucketP | |||
| func (l *gcsGateway) GetBucketPolicy(ctx context.Context, bucket string) (*policy.Policy, error) { | ||||
| 	rules, err := l.client.Bucket(bucket).ACL().List(l.ctx) | ||||
| 	if err != nil { | ||||
| 		logger.LogIf(ctx, err) | ||||
| 		return nil, gcsToObjectError(err, bucket) | ||||
| 	} | ||||
| 
 | ||||
|  | @ -1227,7 +1225,6 @@ func (l *gcsGateway) GetBucketPolicy(ctx context.Context, bucket string) (*polic | |||
| 
 | ||||
| 	// Return NoSuchBucketPolicy error, when policy is not set
 | ||||
| 	if len(actionSet) == 0 { | ||||
| 		logger.LogIf(ctx, minio.BucketPolicyNotFound{}) | ||||
| 		return nil, gcsToObjectError(minio.BucketPolicyNotFound{}, bucket) | ||||
| 	} | ||||
| 
 | ||||
|  | @ -1252,7 +1249,6 @@ func (l *gcsGateway) GetBucketPolicy(ctx context.Context, bucket string) (*polic | |||
| func (l *gcsGateway) DeleteBucketPolicy(ctx context.Context, bucket string) error { | ||||
| 	// This only removes the storage.AllUsers policies
 | ||||
| 	if err := l.client.Bucket(bucket).ACL().Delete(l.ctx, storage.AllUsers); err != nil { | ||||
| 		logger.LogIf(ctx, err) | ||||
| 		return gcsToObjectError(err, bucket) | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
|  | @ -1018,7 +1018,6 @@ func (l *ossObjects) GetBucketPolicy(ctx context.Context, bucket string) (*polic | |||
| 	switch result.ACL { | ||||
| 	case string(oss.ACLPrivate): | ||||
| 		// By default, all buckets starts with a "private" policy.
 | ||||
| 		logger.LogIf(ctx, minio.BucketPolicyNotFound{}) | ||||
| 		return nil, ossToObjectError(minio.BucketPolicyNotFound{}, bucket) | ||||
| 	case string(oss.ACLPublicRead): | ||||
| 		readOnly = true | ||||
|  |  | |||
|  | @ -464,7 +464,6 @@ func (l *s3Objects) SetBucketPolicy(ctx context.Context, bucket string, bucketPo | |||
| func (l *s3Objects) GetBucketPolicy(ctx context.Context, bucket string) (*policy.Policy, error) { | ||||
| 	data, err := l.Client.GetBucketPolicy(bucket) | ||||
| 	if err != nil { | ||||
| 		logger.LogIf(ctx, err) | ||||
| 		return nil, minio.ErrorRespToObjectError(err, bucket) | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue