@@ -171,13 +171,13 @@ var _ = Describe("Test policy automation", func() {
171
171
spec := ansiblejobList .Items [0 ].Object ["spec" ]
172
172
extraVars := spec .(map [string ]interface {})["extra_vars" ].(map [string ]interface {})
173
173
Expect (extraVars ["policy_name" ]).To (Equal ("case5-test-policy" ))
174
- Expect (extraVars ["namespace " ]).To (Equal (testNamespace ))
174
+ Expect (extraVars ["policy_namespace " ]).To (Equal (testNamespace ))
175
175
Expect (extraVars ["hub_cluster" ]).To (Equal ("millienium-falcon.tatooine.local" ))
176
176
Expect (len (extraVars ["target_clusters" ].([]interface {}))).To (Equal (1 ))
177
177
Expect (extraVars ["target_clusters" ].([]interface {})[0 ]).To (Equal ("managed1" ))
178
- Expect (len (extraVars ["policy_set " ].([]interface {}))).To (Equal (1 ))
179
- Expect (extraVars ["policy_set " ].([]interface {})[0 ]).To (Equal ("case5-test-policyset" ))
180
- managed1 := extraVars ["policy_violation_context " ].(map [string ]interface {})["managed1" ]
178
+ Expect (len (extraVars ["policy_sets " ].([]interface {}))).To (Equal (1 ))
179
+ Expect (extraVars ["policy_sets " ].([]interface {})[0 ]).To (Equal ("case5-test-policyset" ))
180
+ managed1 := extraVars ["policy_violations " ].(map [string ]interface {})["managed1" ]
181
181
compliant := managed1 .(map [string ]interface {})["compliant" ]
182
182
Expect (compliant ).To (Equal (string (policiesv1 .NonCompliant )))
183
183
violationMessage := managed1 .(map [string ]interface {})["violation_message" ]
@@ -807,15 +807,15 @@ var _ = Describe("Test policy automation", func() {
807
807
spec := ansiblejobList .Items [0 ].Object ["spec" ]
808
808
extraVars := spec .(map [string ]interface {})["extra_vars" ].(map [string ]interface {})
809
809
Expect (extraVars ["policy_name" ]).To (Equal ("case5-test-policy" ))
810
- Expect (extraVars ["namespace " ]).To (Equal (testNamespace ))
810
+ Expect (extraVars ["policy_namespace " ]).To (Equal (testNamespace ))
811
811
Expect (extraVars ["hub_cluster" ]).To (Equal ("millienium-falcon.tatooine.local" ))
812
812
Expect (len (extraVars ["target_clusters" ].([]interface {}))).To (Equal (2 ))
813
- Expect (len (extraVars ["policy_set " ].([]interface {}))).To (Equal (1 ))
814
- Expect (extraVars ["policy_set " ].([]interface {})[0 ]).To (Equal ("case5-test-policyset" ))
815
- managed1 := extraVars ["policy_violation_context " ].(map [string ]interface {})["managed1" ]
813
+ Expect (len (extraVars ["policy_sets " ].([]interface {}))).To (Equal (1 ))
814
+ Expect (extraVars ["policy_sets " ].([]interface {})[0 ]).To (Equal ("case5-test-policyset" ))
815
+ managed1 := extraVars ["policy_violations " ].(map [string ]interface {})["managed1" ]
816
816
compliant := managed1 .(map [string ]interface {})["compliant" ]
817
817
Expect (compliant ).To (Equal (string (policiesv1 .NonCompliant )))
818
- managed2 := extraVars ["policy_violation_context " ].(map [string ]interface {})["managed2" ]
818
+ managed2 := extraVars ["policy_violations " ].(map [string ]interface {})["managed2" ]
819
819
compliant = managed2 .(map [string ]interface {})["compliant" ]
820
820
Expect (compliant ).To (Equal (string (policiesv1 .NonCompliant )))
821
821
@@ -866,7 +866,7 @@ var _ = Describe("Test policy automation", func() {
866
866
return len (ansiblejobList .Items )
867
867
}, 30 , 1 ).Should (Equal (2 ))
868
868
869
- By ("Check the policy_violation_context is mostly empty for the compliant manual run case" )
869
+ By ("Check policy_violations is mostly empty for the compliant manual run case" )
870
870
ansiblejobList , err = clientHubDynamic .Resource (gvrAnsibleJob ).Namespace (testNamespace ).List (
871
871
context .TODO (), metav1.ListOptions {},
872
872
)
@@ -880,12 +880,12 @@ var _ = Describe("Test policy automation", func() {
880
880
881
881
extraVars = spec .(map [string ]interface {})["extra_vars" ].(map [string ]interface {})
882
882
Expect (extraVars ["policy_name" ]).To (Equal ("case5-test-policy" ))
883
- Expect (extraVars ["namespace " ]).To (Equal (testNamespace ))
883
+ Expect (extraVars ["policy_namespace " ]).To (Equal (testNamespace ))
884
884
Expect (extraVars ["hub_cluster" ]).To (Equal ("millienium-falcon.tatooine.local" ))
885
885
Expect (len (extraVars ["target_clusters" ].([]interface {}))).To (Equal (0 ))
886
- Expect (len (extraVars ["policy_set " ].([]interface {}))).To (Equal (1 ))
887
- Expect (extraVars ["policy_set " ].([]interface {})[0 ]).To (Equal ("case5-test-policyset" ))
888
- Expect (extraVars ["policy_violation_context " ]).To (BeNil ())
886
+ Expect (len (extraVars ["policy_sets " ].([]interface {}))).To (Equal (1 ))
887
+ Expect (extraVars ["policy_sets " ].([]interface {})[0 ]).To (Equal ("case5-test-policyset" ))
888
+ Expect (extraVars ["policy_violations " ]).To (BeNil ())
889
889
})
890
890
})
891
891
Describe ("Clean up" , func () {
0 commit comments