mirror of https://github.com/minio/minio.git
relax retention date validation on replication target (#15752)
This commit is contained in:
parent
b04c0697e1
commit
5fd5ddea23
|
@ -25,10 +25,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/textproto"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/beevik/ntp"
|
"github.com/beevik/ntp"
|
||||||
|
xhttp "github.com/minio/minio/internal/http"
|
||||||
|
|
||||||
"github.com/minio/minio/internal/logger"
|
"github.com/minio/minio/internal/logger"
|
||||||
"github.com/minio/pkg/env"
|
"github.com/minio/pkg/env"
|
||||||
)
|
)
|
||||||
|
@ -411,6 +414,7 @@ func ParseObjectLockRetentionHeaders(h http.Header) (rmode RetMode, r RetentionD
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return rmode, r, ErrInvalidRetentionDate
|
return rmode, r, ErrInvalidRetentionDate
|
||||||
}
|
}
|
||||||
|
_, replReq := h[textproto.CanonicalMIMEHeaderKey(xhttp.MinIOSourceReplicationRequest)]
|
||||||
|
|
||||||
t, err := UTCNowNTP()
|
t, err := UTCNowNTP()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -418,7 +422,7 @@ func ParseObjectLockRetentionHeaders(h http.Header) (rmode RetMode, r RetentionD
|
||||||
return rmode, r, ErrPastObjectLockRetainDate
|
return rmode, r, ErrPastObjectLockRetainDate
|
||||||
}
|
}
|
||||||
|
|
||||||
if retDate.Before(t) {
|
if retDate.Before(t) && !replReq {
|
||||||
return rmode, r, ErrPastObjectLockRetainDate
|
return rmode, r, ErrPastObjectLockRetainDate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue