mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 05:21:58 +00:00
CRD type check test fix
Co-authored-by: Ben Luddy <bluddy@redhat.com>
This commit is contained in:
parent
d891934352
commit
4b545779c2
@ -366,10 +366,15 @@ var _ = SIGDescribe("ValidatingAdmissionPolicy [Privileged:ClusterAdmin]", func(
|
||||
// TODO(#123829) Remove once the schema watcher is merged.
|
||||
// If the warnings are empty, touch the policy to retry type checking
|
||||
if len(policy.Status.TypeChecking.ExpressionWarnings) == 0 {
|
||||
applyConfig := applyadmissionregistrationv1.ValidatingAdmissionPolicy(policy.Name).WithLabels(map[string]string{
|
||||
"touched": fmt.Sprintf("a%d", time.Now().UnixMilli()),
|
||||
"random": fmt.Sprintf("a%d", rand.Int()),
|
||||
})
|
||||
randomValue := fmt.Sprintf(`"%d"`, rand.Int())
|
||||
// Use a fixed key and change only the value
|
||||
applyConfig := applyadmissionregistrationv1.ValidatingAdmissionPolicy(policy.Name).
|
||||
WithSpec(applyadmissionregistrationv1.ValidatingAdmissionPolicySpec().
|
||||
WithAuditAnnotations(applyadmissionregistrationv1.AuditAnnotation().
|
||||
WithKey("key").
|
||||
WithValueExpression(randomValue),
|
||||
),
|
||||
)
|
||||
_, err := client.AdmissionregistrationV1().ValidatingAdmissionPolicies().Apply(ctx, applyConfig, metav1.ApplyOptions{FieldManager: "validatingadmissionpolicy-e2e"})
|
||||
return false, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user