Skip to content

Commit f0031a9

Browse files
author
Ankita Thomas
committed
gvk check before server-side apply
1 parent db144bd commit f0031a9

File tree

1 file changed

+9
-0
lines changed
  • pkg/controller/registry/reconciler

1 file changed

+9
-0
lines changed

pkg/controller/registry/reconciler/grpc.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
v1 "k8s.io/api/core/v1"
1414
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1515
"k8s.io/apimachinery/pkg/labels"
16+
"k8s.io/apimachinery/pkg/runtime/schema"
1617
"k8s.io/apimachinery/pkg/types"
1718
"k8s.io/apimachinery/pkg/util/intstr"
1819
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -209,6 +210,14 @@ func (c *GrpcRegistryReconciler) ensureUpdatePod(source grpcCatalogSourceDecorat
209210
if err != nil {
210211
return errors.Wrapf(err, "error serializing updated catalog source pod to bytes: %s", source.Pod().GetName())
211212
}
213+
214+
if updatePod.GroupVersionKind().Empty() {
215+
updatePod.SetGroupVersionKind(schema.GroupVersionKind{
216+
Group: "",
217+
Version: "v1",
218+
Kind: "Pod",
219+
})
220+
}
212221
_, err = c.OpClient.KubernetesInterface().CoreV1().Pods(source.GetNamespace()).Patch(context.TODO(), updatePod.Name, types.ApplyPatchType, updatePodBytes, opts)
213222
if err != nil {
214223
return errors.Wrapf(err, "error updating catalog source pod: %s", source.Pod().GetName())

0 commit comments

Comments
 (0)