Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Resource Types
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
libraries
Resource Types
Commits
7b2f5b25
Commit
7b2f5b25
authored
3 years ago
by
L. Ellenbeck
Browse files
Options
Downloads
Patches
Plain Diff
Fix: To long default retention
parent
a7b5a0d2
Branches
Hotfix/xxxx-lock
No related tags found
1 merge request
!3
Fix: To long default retention
Pipeline
#724464
passed
3 years ago
Stage: build
Stage: test
Stage: publish
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ResourceTypes.RdsWorm/RdsS3WormResourceType.cs
+5
-6
5 additions, 6 deletions
src/ResourceTypes.RdsWorm/RdsS3WormResourceType.cs
src/ResourceTypes.Tests/ResourceTypeWaterbutlerRdsWormTests .cs
+6
-0
6 additions, 0 deletions
...sourceTypes.Tests/ResourceTypeWaterbutlerRdsWormTests .cs
with
11 additions
and
6 deletions
src/ResourceTypes.RdsWorm/RdsS3WormResourceType.cs
+
5
−
6
View file @
7b2f5b25
...
...
@@ -182,7 +182,7 @@ namespace Coscine.ResourceTypes.RdsWorm
try
{
//
await _s3client.PutBucketPolicyAsync(putRequest);
await
_s3client
.
PutBucketPolicyAsync
(
putRequest
);
}
#pragma warning disable RCS1075 // Avoid empty catch clause that catches System.Exception.
catch
(
Exception
)
...
...
@@ -203,14 +203,13 @@ namespace Coscine.ResourceTypes.RdsWorm
throw
new
ArgumentNullException
(
nameof
(
quota
));
}
// Retention default for Int64 max value is about 292471208677 years
// Should be enough
var
retention
=
long
.
MaxValue
;
// Approximately 11 years. At least 10.
var
retention
=
60L
*
60L
*
24L
*
365L
*
11L
;
// Set retention to one
day
for our simulator
// Set retention to one
week
for our simulator
if
(
RdsS3WormResourceTypeConfiguration
.
Endpoint
.
Contains
(
"ecs-sim01.itc.rwth-aachen.de"
))
{
retention
=
60
*
60
*
24
;
retention
=
60
L
*
60
L
*
24
L
*
7L
;
}
if
(
options
?.
ContainsKey
(
"retention"
)
==
true
&&
long
.
TryParse
(
options
[
"retention"
],
out
var
retentionResult
))
...
...
This diff is collapsed.
Click to expand it.
src/ResourceTypes.Tests/ResourceTypeWaterbutlerRdsWormTests .cs
+
6
−
0
View file @
7b2f5b25
...
...
@@ -150,6 +150,12 @@ namespace Coscine.ResourceTypes.Tests
var
s3Client
=
GetS3Client
(
_type
,
specificType
);
Assert
.
Throws
<
AggregateException
>(()
=>
s3Client
.
DeleteObjectAsync
(
deleteObjectRequest
).
Wait
());
memoryStream
=
new
MemoryStream
();
memoryStream
.
Write
(
testData
,
0
,
testData
.
Length
);
memoryStream
.
Position
=
0
;
Assert
.
Throws
<
AggregateException
>(()
=>
resourceType
.
StoreEntry
(
_bucketName
,
randomFileName
,
memoryStream
).
Wait
());
bool
objectDeleted
=
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment