Skip to content

feat: Enable object locking #593

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

Merged
merged 7 commits into from
Apr 22, 2024
Merged

feat: Enable object locking #593

merged 7 commits into from
Apr 22, 2024

Conversation

shemau
Copy link
Contributor

@shemau shemau commented Apr 19, 2024

Description

#592

Initial implementation enables object locking on the bucket and creates a ibm_cos_bucket_object_lock_configuration resource.

A bucket with object_versioning_enabled can now also have object_versioning_enabled. When doing this
exactly one of object_lock_duration_days or object_lock_duration_years must be set.

Release required?

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (X.x.x)
Release notes content

There will be an upgrade in place of COS buckets created.

object_lock will be added to value specified (default false).
object_versioning.enable will be added if it was previously false (default false).

Run the pipeline

If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.

Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:

/run pipeline

Checklist for reviewers

  • If relevant, a test for the change is included or updated with this PR.
  • If relevant, documentation for the change is included or updated with this PR.

For mergers

  • Use a conventional commit message to set the release level. Follow the guidelines.
  • Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
  • Use the Squash and merge option.

@shemau shemau marked this pull request as draft April 19, 2024 14:48
@shemau
Copy link
Contributor Author

shemau commented Apr 19, 2024

/run pipeline

@shemau
Copy link
Contributor Author

shemau commented Apr 22, 2024

An upgrade in place will be seen by all consumers, something like:

TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: Terraform used the selected providers to generate the following execution
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: plan. Resource actions are indicated with the following symbols:
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:   ~ update in-place
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: 
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: Terraform will perform the following actions:
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: 
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:   # module.cos_bucket1.ibm_cos_bucket.cos_bucket[0] will be updated in-place
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:   ~ resource "ibm_cos_bucket" "cos_bucket" {
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:         id                   = "crn:v1:bluemix:public:cloud-object-storage:global:a/abac0df06b644a9cabc6e44f55b3880e:3410fc67-1a93-4f70-b211-b51396ded2dc:bucket:cos-upgrade-zxztq5-bucket-1:meta:rl:us-south:public"
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:       + object_lock          = false
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:         # (13 unchanged attributes hidden)
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: 
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:       + object_versioning {
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:           + enable = false
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:         }
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185: 
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:         # (4 unchanged blocks hidden)
TestRunUpgradeExample 2024-04-22T11:40:00+01:00 command.go:185:     }

Consumers that set object_versioning to true will only see the object_lock being added.
Consumers that set object_versioning to false will see both being added.

@shemau
Copy link
Contributor Author

shemau commented Apr 22, 2024

/run pipeline

@shemau
Copy link
Contributor Author

shemau commented Apr 22, 2024

The full set of upgrade issues is

TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: Terraform used the selected providers to generate the following execution
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: plan. Resource actions are indicated with the following symbols:
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   ~ update in-place
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: Terraform will perform the following actions:
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   # module.cos_bucket1.ibm_cos_bucket.cos_bucket[0] will be updated in-place
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   ~ resource "ibm_cos_bucket" "cos_bucket" {
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         id                   = "crn:v1:bluemix:public:cloud-object-storage:global:a/abac0df06b644a9cabc6e44f55b3880e:39d7f8d0-4654-4966-986c-017492ae4f79:bucket:cos-upgrade-ibk9lj-bucket-1:meta:rl:us-south:public"
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:       + object_lock          = false
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         # (13 unchanged attributes hidden)
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:       + object_versioning {
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:           + enable = false
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         }
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         # (4 unchanged blocks hidden)
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:     }
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   # module.cos_bucket2.ibm_cos_bucket.cos_bucket[0] will be updated in-place
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   ~ resource "ibm_cos_bucket" "cos_bucket" {
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         id                    = "crn:v1:bluemix:public:cloud-object-storage:global:a/abac0df06b644a9cabc6e44f55b3880e:39d7f8d0-4654-4966-986c-017492ae4f79:bucket:cos-upgrade-ibk9lj-bucket-2-gl9x:meta:crl:us:public"
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:       + object_lock           = false
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         # (13 unchanged attributes hidden)
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:       + object_versioning {
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:           + enable = false
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         }
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         # (3 unchanged blocks hidden)
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:     }
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   # module.cos_bucket3.ibm_cos_bucket.cos_bucket1[0] will be updated in-place
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:   ~ resource "ibm_cos_bucket" "cos_bucket1" {
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         id                   = "crn:v1:bluemix:public:cloud-object-storage:global:a/abac0df06b644a9cabc6e44f55b3880e:39d7f8d0-4654-4966-986c-017492ae4f79:bucket:cos-upgrade-ibk9lj-bucket-3-cttf:meta:ssl:ams03:public"
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:       + object_lock          = false
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         # (12 unchanged attributes hidden)
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:       + object_versioning {
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:           + enable = false
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         }
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:         # (3 unchanged blocks hidden)
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185:     }
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: 
TestRunUpgradeExample 2024-04-22T12:04:55Z command.go:185: Plan: 0 to add, 3 to change, 0 to destroy.

This is only the expected changes, so skipping upgrade tests

@shemau
Copy link
Contributor Author

shemau commented Apr 22, 2024

/run pipeline

@shemau shemau marked this pull request as ready for review April 22, 2024 12:58
@shemau
Copy link
Contributor Author

shemau commented Apr 22, 2024

/run pipeline

@vburckhardt vburckhardt merged commit 4146d09 into main Apr 22, 2024
@vburckhardt vburckhardt deleted the locks branch April 22, 2024 15:01
@terraform-ibm-modules-ops
Copy link
Contributor

🎉 This PR is included in version 8.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants