-
Notifications
You must be signed in to change notification settings - Fork 107
Changed volume encryption to enabled by default. #2139
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
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR changes the default encryption setting for Linode volumes from disabled to enabled, improving security by default for users who don't explicitly specify the encryption parameter.
Key Changes:
- Updated the default value for volume encryption from "disabled" to "enabled" in the resource schema
- Added test coverage for the new default behavior and explicit encryption disabled scenario
- Added unit tests to verify the encryption attribute schema configuration
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
linode/volume/framework_schema_resource.go |
Changed the default encryption value from "disabled" to "enabled" |
linode/volume/datasource_test.go |
Added integration tests for default encryption enabled and explicit encryption disabled scenarios |
linode/volume/tmpl/template.go |
Added helper function for encryption disabled test template |
linode/volume/tmpl/data_with_block_storage_encryption_disabled.gotf |
New template file for testing explicitly disabled encryption |
linode/volume/framework_schema_resource_unit_test.go |
New unit test to guard encryption attribute schema properties |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b7ccef8 to
1b0a4b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@zliang-akamai Thanks for adding the breaking change tag! It's also worth noting that this change corresponds to a change in the API. I do wonder what the behavior would be for a volume created without a user-specified Would we want to suppress the diff unless the user has explicitly specified the field? |
…Storage Encryption” are created with encryption="enabled". New volumes in other regions follow the API default. Existing volumes are unaffected unless the user explicitly changes encryption
6a430ed to
d57a022
Compare
I made the following commit (d57a022) to avoid unexpected destroy-and-recreate on provider upgrade caused by changing the default for a RequiresReplace field (volume.encryption). Users who omitted encryption would otherwise see a replacement proposed after upgrade. I removed the schema default for encryption; added UseStateForUnknown so omitted config preserves existing state; kept RequiresReplace and validators. When encryption is omitted: New volumes in regions supporting “Block Storage Encryption” are created with encryption="enabled". New volumes in other regions follow the API default. Existing volumes are unaffected unless the user explicitly changes encryption. User impact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Default encryption to "enabled" when omitted on create; remove region capability checks - Add DefaultEnabledOnCreate plan modifier so plans show encryption="enabled" for new resources - Keep Optional+Computed + UseStateForUnknown so omission on existing resources preserves state (no diff) - Keep RequiresReplace so explicit encryption changes force replacement - Unit: assert presence of DefaultEnabledOnCreate in volume schema
📝 Description
Summary
Default volume encryption to enabled on create when omitted.
Show encryption="enabled" in the plan for new resources when omitted.
Keep existing volumes unchanged when encryption is omitted in config.
Changing encryption forces replacement.
Behavior Details
Create: if encryption is not set, we set it to enabled (no region capability checks).
Update: encryption is Optional+Computed with UseStateForUnknown, so omission preserves the current state (no diff).
Change: explicit encryption changes continue to RequireReplace.
Implementation Details
Added DefaultEnabledOnCreate plan modifier to set planned value to enabled on create when omitted.
Simplified Create logic to always default encryption to enabled when omitted.
Schema retains UseStateForUnknown and RequiresReplace for encryption.
Unit tests updated to assert presence of DefaultEnabledOnCreate.
Acceptance tests updated to validate default/explicit/replace behavior.
✔️ How to Test
Running against Linode API:
Acceptance tests added