Skip to content

Commit

Permalink
fix: objects get from lister must be treated as read-only (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
nic-6443 committed Feb 20, 2022
1 parent 6b0c139 commit 32a096c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/ingress/status.go
Expand Up @@ -29,6 +29,7 @@ import (
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/cache"
gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"

Expand Down Expand Up @@ -70,6 +71,10 @@ func (c *Controller) recordStatus(at interface{}, reason string, err error, stat
client := c.kubeClient.APISIXClient
kubeClient := c.kubeClient.Client

if kubeObj, ok := at.(runtime.Object); ok {
at = kubeObj.DeepCopyObject()
}

switch v := at.(type) {
case *configv2beta3.ApisixTls:
// set to status
Expand Down

0 comments on commit 32a096c

Please sign in to comment.