Skip to content

Commit 84ee5b1

Browse files
committed
[bug_fix] Fixed an issue with aci_contract_subject_filter when using "none" in the directives attribute.
1 parent a1c2b14 commit 84ee5b1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

aci/resource_aci_vzrssubjfiltatt.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ func setSubjectFilterAttributes(vzRsSubjFiltAtt *models.SubjectFilter, d *schema
103103
for _, val := range strings.Split(vzRsSubjFiltAttMap["directives"], ",") {
104104
directivesGet = append(directivesGet, strings.Trim(val, " "))
105105
}
106+
// The "none" value in directives does not get returned by APIC.
107+
// Add "none" if the user has defined the value in the directives attributes.
108+
if userDirectives, ok := d.GetOk("directives"); ok {
109+
for _, val := range userDirectives.([]interface{}) {
110+
if val.(string) == "none" {
111+
directivesGet = append(directivesGet, "none")
112+
break
113+
}
114+
}
115+
}
106116
d.Set("directives", directivesGet)
107117
d.Set("priority_override", vzRsSubjFiltAttMap["priorityOverride"])
108118
d.Set("filter_dn", vzRsSubjFiltAttMap["tDn"])

0 commit comments

Comments
 (0)