-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error when creating Knative Service: Admission webhook denied request due to metadata.name change validation #15607
Comments
Hi @helloxjade, the Knative version referenced is not supported by the community any more. Could you try with some later version? I am not sure I understand the steps to reproduce this, could you clarify this? Btw the error above usually happens when you want to update a knative service that has a user defined name as follows and then you update it but you forget to update the
If I update the above eg. add a new label
The reason is that in the BYO mode revision names are left to the user to be managed (no auto-generation). |
Here is the error log I'm encountering:
|
The issue seems to be related to the logic in the applyDefault function in the revision_defaults.go file. Here’s what happens in the code:
|
Description: I encountered an issue when trying to create a new Knative Service. Even though the service is newly created, I receive an error related to the validation of the metadata.name in spec.template. The error suggests that the service is attempting a change without a corresponding name update, which is unexpected for a newly created resource.
Error Message:
Expected Behavior: As this is a new service creation, there should be no conflict or validation errors on metadata.name in spec.template.
Steps to Reproduce:
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
if _, err := controllerutil.CreateOrUpdate(ctx, ksb.KnativeClient, knservice, ksb.MutateKnServiceFn(knservice, sapp)); err != nil {
// 如果不是资源版本冲突错误,记录事件和日志
if !apierrors.IsConflict(err) {
ksb.EventRecorder.RecordEventf(sapp, corev1.EventTypeWarning, util.EventReasonFailedCreateKsvc, util.FailedCreateKsvcMsg, err.Error())
klog.Errorf("Failed to create or update knservice for app: %s, error: %v", sapp.Name, err)
}
// 返回错误,触发重试机制
return err
}
If applicable, mention whether CreateOrUpdate with mutate functions was used and if the mutation involved changes to metadata.
Environment:
Knative version: v1.11.4
Kubernetes version: Kubernetes v1.25.14
Client tools or libraries:
Any insight into this validation behavior or recommended configurations to avoid this error would be helpful. Thanks!
The text was updated successfully, but these errors were encountered: