mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #128263 from ShazaAldawamneh/typecheck-retry-generation
CRD type check test fix
This commit is contained in:
		@@ -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
 | 
			
		||||
					}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user