Skip to content

Terraform search: Integration of TS in vlanrange#500

Open
AnilGadiyarHJ wants to merge 18 commits into
infobloxopen:mainfrom
AnilGadiyarHJ:ts_vlanrange
Open

Terraform search: Integration of TS in vlanrange#500
AnilGadiyarHJ wants to merge 18 commits into
infobloxopen:mainfrom
AnilGadiyarHJ:ts_vlanrange

Conversation

@AnilGadiyarHJ

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 / IdentitySchema support to VlanrangeResource and persisted identity (ref) in Create/Read/Update flows.
  • Introduced a new nios_ipam_vlanrange List 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 break go test compilation 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{
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.

3 participants