Skip to content

⭐ Add BGP, MLAG, ACL resources and extend existing Arista EOS resources#6559

Merged
tas50 merged 1 commit intomainfrom
tas50/more_arista
Mar 12, 2026
Merged

⭐ Add BGP, MLAG, ACL resources and extend existing Arista EOS resources#6559
tas50 merged 1 commit intomainfrom
tas50/more_arista

Conversation

@tas50
Copy link
Copy Markdown
Member

@tas50 tas50 commented Feb 4, 2026

Summary

New resources

arista.eos.bgp — BGP configuration and peers

  • enabled (bool): whether BGP is enabled
  • asNumber (string): BGP Autonomous System Number
  • routerId (string): BGP Router ID
  • vrfs ([]arista.eos.bgp.vrf): BGP VRFs

arista.eos.bgp.vrf — per-VRF BGP state

  • name (string): VRF name
  • routerId (string): BGP Router ID for this VRF
  • asNumber (string): BGP AS number for this VRF
  • peers ([]arista.eos.bgp.peer): BGP peers in this VRF

arista.eos.bgp.peer — BGP neighbor details

  • vrfName (string): VRF name
  • peerAddress (string): peer IP address
  • remoteAs (string): remote AS number
  • state (string): peer state (Established, Idle, Active, etc.)
  • uptime (int): uptime in seconds
  • prefixesReceived (int): prefixes received from peer
  • prefixesAccepted (int): prefixes accepted after inbound filtering
  • inboundRouteMap (string): inbound route map
  • outboundRouteMap (string): outbound route map
  • description (string): peer description

arista.eos.mlag — MLAG high-availability configuration

  • domainId (string): MLAG domain ID
  • localInterface (string): local interface for MLAG communication
  • peerAddress (string): IP address of the MLAG peer switch
  • peerLink (string): peer-link interface (typically a Port-Channel)
  • shutdown (bool): whether MLAG is administratively shutdown
  • interfaces ([]arista.eos.mlag.interface): Port-Channel interfaces with MLAG IDs

arista.eos.mlag.interface — Port-Channel with MLAG ID

  • name (string): Port-Channel interface name
  • mlagId (string): MLAG ID assigned to this Port-Channel

arista.eos.acl — standard IP access control list

  • name (string): ACL name
  • type (string): ACL type
  • entries ([]arista.eos.acl.entry): ACL rules

arista.eos.acl.entry — ACL rule

  • aclName (string): ACL name this entry belongs to
  • sequenceNumber (int): sequence number (evaluation order)
  • action (string): "permit" or "deny"
  • srcAddress (string): source IP address
  • srcPrefixLen (int): source prefix length
  • log (bool): whether logging is enabled

New fields on existing resources

  • arista.eos.user: locked (bool)
  • arista.eos.interface: enabled (bool), duplex (string), autoNegotiate (bool)
  • arista.eos.vlan: dynamic (bool), interfaces ([]string)
  • arista.eos.route: active (bool)

Implementation notes

BGP and MLAG fields use lazy-loaded computed methods with Internal struct caching to avoid "cannot convert primitive with NO type information" errors when the resource is accessed directly rather than through the parent accessor.

Test plan

  • mql run arista -c "arista.eos.bgp{*}" returns BGP config fields
  • mql run arista -c "arista.eos.bgp.vrfs{*}" lists VRFs with peers
  • mql run arista -c "arista.eos.mlag{*}" returns MLAG config
  • mql run arista -c "arista.eos.acls{*}" lists ACLs with entries
  • mql run arista -c "arista.eos.interfaces { enabled duplex }" returns new fields
  • mql run arista -c "arista.eos.vlans { dynamic interfaces }" returns new fields
  • Unit tests pass: go test ./providers/arista/...

🤖 Generated with Claude Code

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

Test Results

5 441 tests  +17   5 437 ✅ +17   2m 4s ⏱️ -35s
  412 suites ± 0       4 💤 ± 0 
   31 files   ± 0       0 ❌ ± 0 

Results for commit 8ffc1c8. ± Comparison against base commit 2116076.

♻️ This comment has been updated with latest results.

@tas50 tas50 force-pushed the tas50/more_arista branch from effaac0 to 7431aad Compare February 4, 2026 06:10
@tas50 tas50 changed the title WIP: Add BGP + MLAG + ACL resources + more fields WIP: Add BGP + MLAG + ACL resources + more fields to Arista Feb 4, 2026
@tas50 tas50 force-pushed the tas50/more_arista branch 6 times, most recently from 54a3b85 to 1211e04 Compare February 14, 2026 01:34
@tas50 tas50 force-pushed the tas50/more_arista branch from 1211e04 to e853a0c Compare February 25, 2026 17:16
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resource leak in BGP API methods — handle not closed on error paths

@tas50 tas50 force-pushed the tas50/more_arista branch from e853a0c to 61c9dbd Compare February 28, 2026 13:38
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three correctness/reliability bugs in the new resource implementations; the rest of the code is well-structured.

@tas50 tas50 added the pending-testing Waiting on manual testing label Feb 28, 2026
@tas50 tas50 force-pushed the tas50/more_arista branch from 61c9dbd to 43c730d Compare March 11, 2026 19:33
@tas50 tas50 changed the title WIP: Add BGP + MLAG + ACL resources + more fields to Arista Add BGP + MLAG + ACL resources + more fields to Arista Mar 11, 2026
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New Arista BGP, MLAG, and ACL resources missing version tracking entries will break code generation.

@tas50 tas50 changed the title Add BGP + MLAG + ACL resources + more fields to Arista ⭐ Add BGP + MLAG + ACL resources + more fields to Arista Mar 11, 2026
@tas50 tas50 force-pushed the tas50/more_arista branch from 43c730d to 159566b Compare March 11, 2026 19:38
@mondoo-code-review mondoo-code-review bot dismissed their stale review March 11, 2026 19:38

Superseded by new review

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New Arista BGP, MLAG, and ACL resources with additional fields are correctly defined and consistently generated.

@tas50 tas50 force-pushed the tas50/more_arista branch 2 times, most recently from 74eaaa3 to 54317c6 Compare March 12, 2026 21:38
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds BGP, MLAG, and ACL query resources for Arista EOS switches with new computed fields on existing resources.

@tas50 tas50 changed the title ⭐ Add BGP + MLAG + ACL resources + more fields to Arista ⭐ Add BGP, MLAG, ACL resources and extend existing Arista EOS resources Mar 12, 2026
New resources:
- arista.eos.bgp: BGP configuration with enabled, asNumber, routerId
- arista.eos.bgp.vrf: per-VRF BGP state with peers
- arista.eos.bgp.peer: BGP neighbor details (state, uptime, prefixes, route maps)
- arista.eos.mlag: MLAG configuration (domainId, localInterface, peerAddress, peerLink, shutdown)
- arista.eos.mlag.interface: Port-Channel to MLAG ID mappings
- arista.eos.acl: standard IP access control lists
- arista.eos.acl.entry: ACL rules (sequenceNumber, action, srcAddress, log)

New fields on existing resources:
- arista.eos.user: locked
- arista.eos.interface: enabled, duplex, autoNegotiate
- arista.eos.vlan: dynamic, interfaces
- arista.eos.route: active

BGP and MLAG fields use lazy-loaded computed methods with Internal struct
caching to avoid "cannot convert primitive with NO type information" errors
when the resource is accessed directly rather than through the parent accessor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tas50 tas50 force-pushed the tas50/more_arista branch from 54317c6 to 8ffc1c8 Compare March 12, 2026 21:40
@tas50 tas50 merged commit 7844a28 into main Mar 12, 2026
22 checks passed
@tas50 tas50 deleted the tas50/more_arista branch March 12, 2026 21:47
@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

pending-testing Waiting on manual testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant