validate service type of target in replication/ilm transition config (#10928)

This commit is contained in:
Poorna Krishnamoorthy
2020-11-19 10:38:50 -08:00
committed by Harshavardhana
parent f60b6eb82e
commit 0fa430c1da
3 changed files with 16 additions and 0 deletions

View File

@@ -154,6 +154,9 @@ func validateTransitionDestination(ctx context.Context, bucket string, targetLab
if err != nil {
return false, "", BucketRemoteTargetNotFound{Bucket: bucket}
}
if arn.Type != madmin.ILMService {
return false, "", BucketRemoteArnTypeInvalid{}
}
clnt := globalBucketTargetSys.GetRemoteTargetClient(ctx, tgt.Arn)
if clnt == nil {
return false, "", BucketRemoteTargetNotFound{Bucket: bucket}