Terraform search: Integration of TS in vlanrange#500
Open
AnilGadiyarHJ wants to merge 18 commits into
Open
Conversation
…nios into list_record_a
…s into list_record_a
…s into list_record_a
…s into list_record_a
…s into list_record_a
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the provider’s Terraform “search/query” (List Resource) support to IPAM VLAN ranges and aligns the nios_ipam_vlanrange resource with the plugin-framework identity interfaces for identity-based import and query results.
Changes:
- Added
ResourceWithIdentity/IdentitySchemasupport toVlanrangeResourceand persisted identity (ref) in Create/Read/Update flows. - Introduced a new
nios_ipam_vlanrangeList Resource with filtering/extattr filtering, plus acceptance tests. - Registered the new list resource in the provider and added corresponding docs and example query configuration.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/utils/utils.go | Removes ProviderSetup() (currently breaks compilation due to remaining test references). |
| internal/service/ipam/vlanrange_resource.go | Adds identity schema + identity persistence; adjusts diagnostics handling; updates import to accept identity. |
| internal/service/ipam/vlanrange_list.go | New list resource implementation for querying VLAN ranges. |
| internal/service/ipam/vlanrange_list_test.go | Acceptance tests for the VLAN range list resource. |
| internal/provider/provider.go | Registers ipam.NewVlanrangeList in provider list resources. |
| examples/list-resources/nios_ipam_vlanrange/list-resource.tfquery.hcl | Example tfquery usage for the new list resource. |
| docs/list-resources/ipam_vlanrange.md | Generated documentation for the new list resource. |
Comments suppressed due to low confidence (1)
internal/utils/utils.go:889
ProviderSetup()was removed, but it is still referenced by multiple acceptance tests (e.g.internal/service/dhcp/fixedaddress_list_test.go,internal/service/dns/record_a_list_test.go,internal/service/ipam/networkview_list_test.go). This will breakgo testcompilation unless those tests are updated in the same PR.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
138
to
141
| if diags.HasError() { | ||
| resp.Diagnostics.Append(diags...) | ||
| resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Error while create Vlanrange due inherited Extensible attributes, got error: %s", err)) | ||
| return |
Comment on lines
227
to
231
| res.ExtAttrs, data.ExtAttrsAll, diags = RemoveInheritedExtAttrs(ctx, data.ExtAttrs, *res.ExtAttrs) | ||
| if diags.HasError() { | ||
| resp.Diagnostics.Append(diags...) | ||
| resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Error while reading Vlanrange due inherited Extensible attributes, got error: %s", diags)) | ||
| return |
Comment on lines
382
to
386
| res.ExtAttrs, data.ExtAttrsAll, diags = RemoveInheritedExtAttrs(ctx, planExtAttrs, *res.ExtAttrs) | ||
| if diags.HasError() { | ||
| resp.Diagnostics.Append(diags...) | ||
| resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Error while update Vlanrange due inherited Extensible attributes, got error: %s", diags)) | ||
| return |
Comment on lines
+63
to
+65
| resp.Schema = schema.Schema{ | ||
| MarkdownDescription: "Query existing ipam Vlanrange.", | ||
| Attributes: map[string]schema.Attribute{ |
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.
No description provided.