Tags logic in Config Context #10354

Closed
opened 2025-12-29 21:30:24 +01:00 by adam · 1 comment
Owner

Originally created by @xcdr on GitHub (Oct 11, 2024).

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.3

Python Version

3.10

Steps to Reproduce

  • Assign tags "foo" to Virtual Machine 1
  • Assign tags "foo" and "bar" to Virtual Machine 2
  • Create Config Context with tags "foo" and "bar"

Expected Behavior

Config Context should be applied only to Virtual Machine 2

Observed Behavior

Config Context is applied to Virtual Machine 1 and Virtual Machine 2.

Other attributes have "AND" logic, while tags have "OR" logic, tested on "self-hosted" and "demo" version.

Originally created by @xcdr on GitHub (Oct 11, 2024). ### Deployment Type Self-hosted ### Triage priority N/A ### NetBox Version v4.1.3 ### Python Version 3.10 ### Steps to Reproduce - Assign tags "foo" to Virtual Machine 1 - Assign tags "foo" and "bar" to Virtual Machine 2 - Create Config Context with tags "foo" and "bar" ### Expected Behavior Config Context should be applied only to Virtual Machine 2 ### Observed Behavior Config Context is applied to Virtual Machine 1 and Virtual Machine 2. Other attributes have "AND" logic, while tags have "OR" logic, tested on "self-hosted" and "demo" version.
adam added the type: bugnetbox labels 2025-12-29 21:30:24 +01:00
adam closed this issue 2025-12-29 21:30:24 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 22, 2024):

Config Context is applied to Virtual Machine 1 and Virtual Machine 2.

This is the correct behavior. The config context will apply to objects with any (not all) of the assigned tags.

Other attributes have "AND" logic, while tags have "OR" logic

This is not accurate: The other types of associations for a config context also apply "or" logic.

@jeremystretch commented on GitHub (Oct 22, 2024): > Config Context is applied to Virtual Machine 1 and Virtual Machine 2. This is the correct behavior. The config context will apply to objects with _any_ (not all) of the assigned tags. > Other attributes have "AND" logic, while tags have "OR" logic This is not accurate: The other types of associations for a config context also apply "or" logic.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10354