squakez commented on issue #5752:
URL: https://github.com/apache/camel-k/issues/5752#issuecomment-2302062720
I think what the server side apply patch does is something like
`--server-side --force-conflicts --field-manager=camel-k-operator`.
I think I managed to reproduce the same error also from CLI even without
server side apply. Take a KnativeService as it comes from Camel K, and try to
include the `ownerReferences`:
```
ownerReferences:
- apiVersion: camel.apache.org/v1
blockOwnerDeletion: true
controller: true
kind: Integration
name: platform-http-server
uid: 54329db5-d01c-436e-960d-fc52026899f9
# - apiVersion: v1
# blockOwnerDeletion: true
# controller: true
# kind: ConfigMap
# name: my-profile
# uid: 2d3b37d8-afca-4fcf-b8d1-d716c4119bcb
```
Removing them or setting a ConfigMap would create the KSVC normally.
However, when using an Integration resource as reference, it fails with the
following webhook log:
```
knative-serving webhook-5fdbb849fc-5pj4f webhook
{"severity":"ERROR","timestamp":"2024-08-21T13:17:21.99502267Z","logger":"webhook","caller":"validation/validation_admit.go:183","message":"Failed
the resource specific
validation","commit":"f1bd929","knative.dev/pod":"webhook-5fdbb849fc-5pj4f","knative.dev/kind":"serving.knative.dev/v1,
Kind=Service","knative.dev/namespace":"default","knative.dev/name":"platform-http-server","knative.dev/operation":"CREATE","knative.dev/resource":"serving.knative.dev/v1,
Resource=services","knative.dev/subresource":"","knative.dev/userinfo":"system:serviceaccount:camel-k:camel-k-operator","stacktrace":"knative.dev/pkg/webhook/resourcesemantics/validation.validate\n\tknative.dev/[email protected]/webhook/resourcesemantics/validation/validation_admit.go:183\nknative.dev/pkg/webhook/resourcesemantics/validation.(*reconciler).Admit\n\tknative.dev/[email protected]/webhook/resourcesemantics/validation/validation
_admit.go:79\nknative.dev/pkg/webhook.New.admissionHandler.func4\n\tknative.dev/[email protected]/webhook/admission.go:123\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2136\nnet/http.(*ServeMux).ServeHTTP\n\tnet/http/server.go:2514\nknative.dev/pkg/webhook.(*Webhook).ServeHTTP\n\tknative.dev/[email protected]/webhook/webhook.go:328\nknative.dev/pkg/network/handlers.(*Drainer).ServeHTTP\n\tknative.dev/[email protected]/network/handlers/drain.go:113\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:2938\nnet/http.(*conn).serve\n\tnet/http/server.go:2009"}
knative-serving webhook-5fdbb849fc-5pj4f webhook
{"severity":"INFO","timestamp":"2024-08-21T13:17:21.995083472Z","logger":"webhook","caller":"webhook/admission.go:151","message":"remote
admission controller audit
annotations=map[string]string(nil)","commit":"f1bd929","knative.dev/pod":"webhook-5fdbb849fc-5pj4f","knative.dev/kind":"serving.knative.dev/v1,
Kind=Service","knative.dev/namespace":"default","knative.dev/name":"platform-http-server","knative.dev/operation":"CREATE","knative.dev/resource":"serving.knative.dev/v1,
Resource=services","knative.dev/subresource":"","knative.dev/userinfo":"system:serviceaccount:camel-k:camel-k-operator","admissionreview/uid":"6bccda2d-73a6-461d-9c15-ffefe2d1e798","admissionreview/allowed":false,"admissionreview/result":"&Status{ListMeta:ListMeta{SelfLink:,ResourceVersion:,Continue:,RemainingItemCount:nil,},Status:Failure,Message:validation
failed: expected exactly one, got neither:
spec.template.spec.volumes[2].configMap, spec.template.spec.vol
umes[2].emptyDir, spec.template.spec.volumes[2].projected,
spec.template.spec.volumes[2].secret,Reason:BadRequest,Details:nil,Code:400,}"}
```
They are exactly the same traces coming when running an Integration from
Camel K. I honestly have no clue why this is happening when using an
Integration and only on server side apply from the operator. I have a vague
feeling it could be the service account which is running the Integration,
because, as you can see in the log trace, it is mentioned. Not sure if or why
the object reference SA is used by the webhook, but maybe it's a useful hint
for Knative team.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]