Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COS: Added support for Noncurrent version expiration, EODM & abort incomplete MPU #3359

Merged
merged 1 commit into from
Nov 26, 2021

Conversation

Priyaranimishra
Copy link
Collaborator

COS Objectversioning ph2 & abort incomplete MPU:----

  • Incomplete multi-part upload cleanup.
  • Object Expiration for Versioned Buckets New Lifecycle Functionality
  • Non-Current Version Expiration Lifecycle
  • Expiration Lifecycle behavior on versioning-enabled buckets
  • Expired Object Delete Marker Lifecycle

@Priyaranimishra
Copy link
Collaborator Author

Here is the test results:-

=== RUN TestAccIBMCosBucket_noncurrentversion
--- PASS: TestAccIBMCosBucket_noncurrentversion (107.00s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 109.462s

=== RUN TestAccIBMCosBucket_AbortIncompeleteMPU
--- PASS: TestAccIBMCosBucket_AbortIncompeleteMPU (105.43s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 108.222s

=== RUN TestAccIBMCosBucket_Expiredays
--- PASS: TestAccIBMCosBucket_Expiredays (163.35s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 165.730s

=== RUN TestAccIBMCosBucket_Expiredate
--- PASS: TestAccIBMCosBucket_Expiredate (126.77s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 130.008s

=== RUN TestAccIBMCosBucket_Expireddeletemarker
--- PASS: TestAccIBMCosBucket_Expireddeletemarker (74.71s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 77.028s

@Priyaranimishra Priyaranimishra force-pushed the cos-mpuversioningph2 branch 2 times, most recently from 5b6e3f4 to 893b184 Compare November 24, 2021 07:33
@hkantare
Copy link
Collaborator

share the test results of old testcases also

@@ -227,7 +260,7 @@ func resourceIBMCOSBucket() *schema.Resource {
"expire_rule": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1000,
MaxItems: 1,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can create multiple expiry rules?
why the number is changed from 1000 to 1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Max item should be 1 only . Once we change to 1000, it failed with below error in testing

resource_ibm_cos_bucket_test.go:92: Step 1/2 error: Error running pre-apply refresh: exit status 1
        2021/11/24 20:46:00 [DEBUG] Using modified User-Agent: Terraform/0.12.28 HashiCorp-terraform-exec/0.14.0

        Error: InternalValidate

        Internal validation of the provider failed! This is always a bug
        with the provider itself, and not a user issue. Please report
        this bug:

        1 error occurred:
        	* resource ibm_cos_bucket: ConflictsWith: expired_object_delete_marker
        configuration block reference (expire_rule.0.date) can only be used with
        TypeList and MaxItems: 1 configuration blocks

Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Description: "Protect objects from accidental deletion or overwrites. Versioning allows you to keep multiple versions of an object protecting from unintentional data loss.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is conflict removed here we can proivide object_versioning along with retention_rule and expire_rule


- `crn` - (String) The CRN of the bucket.
- `cross_region_location` - (String) The location to create a cross-regional bucket.
- `single_site_location` - (String) The location to create a single site bucket.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the order changed they were arranged in alphabetical order


Nested scheme for `expire_rule`:
- `rule_id` - (Optional, Computed, String) Unique ID for the rule. Expire rules allow you to set a specific time frame after which objects are deleted.
- `enable` - (Required, Bool) Specifies expire rule status either `enable` or `disable` for a bucket.
- `days` - (Required, String) Specifies the number of days when the specific rule action takes effect.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arrange the nested structure inner attributes in alphabetical order for all rules

@Priyaranimishra Priyaranimishra force-pushed the cos-mpuversioningph2 branch 3 times, most recently from 0d986cc to fe493e1 Compare November 24, 2021 17:10
@Priyaranimishra
Copy link
Collaborator Author

here is the rest test cases result except TestAccIBMCosBucket_ActivityTracker_Monitor

=== RUN TestAccIBMCosBucket_Archive_Expiration
--- PASS: TestAccIBMCosBucket_Archive_Expiration (134.26s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 136.677s

=== RUN TestAccIBMCosBucket_Archive_Expiration
--- PASS: TestAccIBMCosBucket_Archive_Expiration (140.09s)
=== RUN TestAccIBMCosBucket_Archive
--- PASS: TestAccIBMCosBucket_Archive (133.38s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 276.198s

=== RUN TestAccIBMCosBucket_Retention
--- PASS: TestAccIBMCosBucket_Retention (82.45s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 85.163s
(base) Priyas-MBP:terraform-provider-ibm priyarani$

=== RUN TestAccIBMCosBucket_Object_Versioning
--- PASS: TestAccIBMCosBucket_Object_Versioning (76.08s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 78.983s

=== RUN TestAccIBMCosBucket_Hard_Quota
--- PASS: TestAccIBMCosBucket_Hard_Quota (70.33s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 72.706s

=== RUN TestAccIBMCosBucket_Smart_Type
--- PASS: TestAccIBMCosBucket_Smart_Type (96.37s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 109.880s

=== RUN TestAccIBMCosBucket_import
--- PASS: TestAccIBMCosBucket_import (80.09s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 82.808s\

=== RUN TestAccIBMCosBucket_Expireddeletemarker
--- PASS: TestAccIBMCosBucket_Expireddeletemarker (70.32s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 72.774s

changes for objectv2 & mpu

updated documentation

updated based on the comment

updated based on the comment

updated back with max1

updated maxitem of expiry & added diff function

updated maxitem of expiry & added diff function
@Priyaranimishra
Copy link
Collaborator Author

Test result after making changes with Maxitems to 1000

--- PASS: TestAccIBMCosBucket_Expiredays (149.91s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 152.856s

--- PASS: TestAccIBMCosBucket_Expiredate (272.23s)
PASS
ok github.com/IBM-Cloud/terraform-provider-ibm/ibm 281.453s

@hkantare hkantare merged commit a225052 into IBM-Cloud:master Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants