mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 13:31:52 +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.
|
// TODO(#123829) Remove once the schema watcher is merged.
|
||||||
// If the warnings are empty, touch the policy to retry type checking
|
// If the warnings are empty, touch the policy to retry type checking
|
||||||
if len(policy.Status.TypeChecking.ExpressionWarnings) == 0 {
|
if len(policy.Status.TypeChecking.ExpressionWarnings) == 0 {
|
||||||
applyConfig := applyadmissionregistrationv1.ValidatingAdmissionPolicy(policy.Name).WithLabels(map[string]string{
|
randomValue := fmt.Sprintf(`"%d"`, rand.Int())
|
||||||
"touched": fmt.Sprintf("a%d", time.Now().UnixMilli()),
|
// Use a fixed key and change only the value
|
||||||
"random": fmt.Sprintf("a%d", rand.Int()),
|
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"})
|
_, err := client.AdmissionregistrationV1().ValidatingAdmissionPolicies().Apply(ctx, applyConfig, metav1.ApplyOptions{FieldManager: "validatingadmissionpolicy-e2e"})
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user