kubernetes: Failure cluster [331a0ece...] [sig-api-machinery] ValidatingAdmissionPolicy [Privileged:ClusterAdmin] should type check a CRD [Conformance]

image

Failure cluster 331a0ece01ddf18fbdc5

Error text:
[FAILED] Expected
    <[]v1.ExpressionWarning | len:0, cap:0>: nil
to have length 2
In [It] at: k8s.io/kubernetes/test/e2e/apimachinery/validatingadmissionpolicy.go:365 @ 03/08/24 10:00:06.477

Recent failures:

3/8/2024, 4:40:41 PM ci-kubernetes-e2e-kubeadm-kinder-kubelet-1-29-on-latest 3/8/2024, 4:12:52 PM ci-kubernetes-e2e-kubeadm-kinder-rootless-latest 3/8/2024, 4:12:48 PM ci-kubernetes-e2e-kubeadm-kinder-learner-mode-latest 3/8/2024, 4:01:43 PM ci-kubernetes-e2e-kubeadm-kinder-kubelet-1-27-on-latest 3/8/2024, 3:45:39 PM ci-kubernetes-e2e-kubeadm-kinder-upgrade-1-29-latest

/kind failing-test

/sig api-machinery

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 30 (30 by maintainers)

Most upvoted comments

/assign @jiahuif the type checking code owner

@jiahuif, the API field doc indicates a non-nil value means type checking is complete:

	// The results of type checking for each expression.
	// Presence of this field indicates the completion of the type checking.
	// +optional
	TypeChecking *TypeChecking `json:"typeChecking,omitempty" protobuf:"bytes,2,opt,name=typeChecking"`

It doesn’t look like the type checker has any way to signal that it was lacking some information needed to complete type checking, and will record an empty set of warnings if it is:

https://github.com/kubernetes/kubernetes/blob/b3926d137cd2964cd3a04088ded30845910547b1/pkg/controller/validatingadmissionpolicystatus/controller.go#L148-L160

are there any scenarios where a laggy REST mapper or informer can make the controller think it completed type checking but be missing some info that makes it produce an empty list of warnings?

I think our options are:

  1. change the test to wait for non-empty warnings in the status (not just non-nil typeChecking)
  2. change the controller to not write an empty typeChecking stanza if it fails to type check in some way

option 2 seems better for observers, but I don’t know how invasive that is