Skip to content

Add support for policy groups #490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 8, 2025
Merged

Conversation

tzarski0
Copy link
Collaborator

Adding support for policy group based on configuration group object. Tested in versions 20.12 and 20.15. Few important differences between configuration groups and policy groups are listed below:
gen/definitions/generic/policy_group.yaml:

  • added exclude_test: true to model_name: variables (there is no variable value we can test and "go generate" fails when list_value used for test data).
  • used "policy_versions" parameter instead of "feature_versions" that is used in configuration group
  • added configuration group to test_prerequisites as you cannot assign policy group if configuration group is not deployed

internal/provider/data_source_sdwan_policy_group.go:

  • when configuration-group doesn't exists, api returns error "Invalid config group passed". When policy-group doesn't exists, api returns 200 OK with empty payload. Adjusted condition in line 153 to support that.

internal/provider/model_sdwan_policy_group.go:

  • added condition in line 279 not to read empty variables list if all variables are empty/optional

internal/provider/resource_sdwan_policy_group.go:

  • when configuration-group doesn't exists, api returns error "Invalid config group passed". When policy-group doesn't exists, api returns 200 OK with empty payload. Adjusted condition in line 296 to support that.
  • in read function, change the line 307 to always read associated devices

@tzarski0 tzarski0 requested a review from seconroy July 30, 2025 16:15
@danischm danischm merged commit 9b71805 into CiscoDevNet:main Aug 8, 2025
3 checks passed
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.

2 participants