From 1cc0d7d11135d63d28a8a772710d506cced7052c Mon Sep 17 00:00:00 2001 From: "smile.tan" Date: Thu, 7 Mar 2024 16:07:48 +0800 Subject: [PATCH] some apiserver will check the resourceVersion when update --- pkg/common/utils/k8s/client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/common/utils/k8s/client.go b/pkg/common/utils/k8s/client.go index 613f93b1..420639f2 100644 --- a/pkg/common/utils/k8s/client.go +++ b/pkg/common/utils/k8s/client.go @@ -36,6 +36,8 @@ func ApplyService(ctx context.Context, k8sclient client.Client, svc *corev1.Serv return nil } + //resolve the bug: metadata.resourceversion invalid value '' must be specified for an update + svc.ResourceVersion = esvc.ResourceVersion return UpdateClientObject(ctx, k8sclient, svc) }