Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[E2E] Invalid argument "null" for "--revision" flag: strconv.ParseInt: parsing "null": invalid syntax #736

Closed
kravciak opened this issue May 10, 2024 · 4 comments · Fixed by #740
Assignees
Labels
Milestone

Comments

@kravciak
Copy link
Contributor

kravciak commented May 10, 2024

Nightly job failed with Invalid argument "null" for "--revision" flag: strconv.ParseInt: parsing "null": invalid syntax
https://github.com/kubewarden/kubewarden-controller/actions/runs/9025232028/job/24800634936

I tried to run it locally, I found out that if I use latest controller image I get this error:

~ k get clusteradmissionpolicies privileged-pods -o yaml
    message: The policy webhook has not been created
    reason: PolicyActive
    status: "False"

~ k logs -n kubewarden kubewarden-controller-7b69b8b588-lfcs7
{
  "level": "error",
  "ts": "2024-05-10T08:50:30Z",
  "msg": "Reconciler error",
  "controller": "clusteradmissionpolicy",
  "controllerGroup": "policies.kubewarden.io",
  "controllerKind": "ClusterAdmissionPolicy",
  "ClusterAdmissionPolicy": {
    "name": "privileged-pods"
  },
  "namespace": "",
  "name": "privileged-pods",
  "reconcileID": "91bf247e-32df-4e16-936d-194ca44f3262",
  "error": "error reconciling validating webhook\ncannot reconcile validating webhook: validatingwebhookconfigurations.admissionregistration.k8s.io \"clusterwide-privileged-pods\" is forbidden: User \"system:serviceaccount:kubewarden:kubewarden-controller\" cannot update resource \"validatingwebhookconfigurations\" in API group \"admissionregistration.k8s.io\" at the cluster scope",
  "stacktrace": "sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.1/pkg/internal/controller/controller.go:324\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.1/pkg/internal/controller/controller.go:261\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.1/pkg/internal/controller/controller.go:222"
}

I am not sure if those 2 errors are related or not.

@flavio flavio added this to the 1.13 milestone May 10, 2024
@jvanz jvanz self-assigned this May 16, 2024
@jvanz
Copy link
Member

jvanz commented May 20, 2024

Reading the error message we can see that controller does not have the permissions to update the webhooks resources. Which makes sense, because if we take a look in the kubebuilder directive, it has permissions to patch the resources only. That's explains why we are seeing this error. Because in a recent change to use the controller-runtime helper functions we start to use CreateOrUpdate to update the resources. We should use CreateOrPatch. I'll update the code to use the later helper function.

@flavio
Copy link
Member

flavio commented May 21, 2024

The fix is merged in main. We will soon tag RC1 including this fix

@flavio
Copy link
Member

flavio commented May 24, 2024

reopening, @jvanz saw it again, but @kravciak might have fixed it in the meantime.

@kravciak
Copy link
Contributor Author

Closing in favor of #745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants