TPT-4427: add locks field to various resources#942
Open
zliang-akamai wants to merge 2 commits intolinode:mainfrom
Open
TPT-4427: add locks field to various resources#942zliang-akamai wants to merge 2 commits intolinode:mainfrom
zliang-akamai wants to merge 2 commits intolinode:mainfrom
Conversation
c47e477 to
8ea6cc1
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the SDK’s resource models (and corresponding unit-test fixtures/assertions) to surface the API’s locks attribute on additional resource types, allowing clients to inspect deletion-protection locks returned by the API (notably under v4beta).
Changes:
- Added
Locks []LockTypetoVolume,LKECluster, andLKENodePoolstructs. - Updated unit tests to assert
locksdeserialization for volumes, LKE clusters, and LKE node pools. - Updated unit-test JSON fixtures to include the new
locksfield.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| volumes.go | Adds Locks field to Volume model for API response decoding. |
| lke_clusters.go | Adds Locks field to LKECluster model for API response decoding. |
| lke_node_pools.go | Adds Locks field to LKENodePool model for API response decoding. |
| instances.go | Clarifies comment describing which lock types apply to Instances. |
| test/unit/volume_test.go | Adds assertions verifying Volume.Locks is decoded from fixtures. |
| test/unit/lke_clusters_test.go | Adds assertions verifying LKECluster.Locks is decoded from fixtures. |
| test/unit/lke_node_pools_test.go | Adds assertions verifying LKENodePool.Locks is decoded from fixtures. |
| test/unit/fixtures/volumes_list.json | Adds locks to volumes list fixture. |
| test/unit/fixtures/volume_get.json | Adds locks to volume get fixture. |
| test/unit/fixtures/lke_node_pool_list.json | Adds locks to LKE node pool list fixture (including empty array case). |
| test/unit/fixtures/lke_node_pool_get.json | Adds locks to LKE node pool get fixture. |
| test/unit/fixtures/lke_cluster_list.json | Adds locks to LKE cluster list fixture (including empty array case). |
| test/unit/fixtures/lke_cluster_get.json | Adds locks to LKE cluster get fixture. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Add locks attribute to many supported resources.
✔️ How to Test