tokers commented on a change in pull request #386:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/386#discussion_r616289960



##########
File path: pkg/ingress/apisix_tls.go
##########
@@ -117,6 +128,8 @@ func (c *apisixTlsController) sync(ctx context.Context, ev 
*types.Event) error {
                        zap.Error(err),
                        zap.Any("ApisixTls", tls),
                )
+               message := fmt.Sprintf(_messageResourceSyncAborted, 
_tlsController, err.Error())

Review comment:
       Why not processing these in `c.handleSyncErr`.

##########
File path: pkg/ingress/apisix_route.go
##########
@@ -198,14 +212,50 @@ func (c *apisixRouteController) sync(ctx context.Context, 
ev *types.Event) error
 }
 
 func (c *apisixRouteController) handleSyncErr(obj interface{}, err error) {
+       event := obj.(*types.Event)
+       route := event.Object.(kube.ApisixRouteEvent).OldObject

Review comment:
       Not all events have `OldObject` field, it's set only in UPDATE event.

##########
File path: pkg/kube/apisix/apis/config/v2alpha1/types.go
##########
@@ -61,11 +62,18 @@ const (
 )
 
 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+// +kubebuilder:subresource:status
 // ApisixRoute is used to define the route rules and upstreams for Apache 
APISIX.
 type ApisixRoute struct {
        metav1.TypeMeta   `json:",inline" yaml:",inline"`
        metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
        Spec              *ApisixRouteSpec `json:"spec,omitempty" 
yaml:"spec,omitempty"`
+       Status            ApisixStatus     `json:"status,omitempty" 
yaml:"status,omitempty"`
+}

Review comment:
       OK.

##########
File path: pkg/ingress/apisix_upstream.go
##########
@@ -122,6 +133,8 @@ func (c *apisixUpstreamController) sync(ctx 
context.Context, ev *types.Event) er
        svc, err := c.controller.svcLister.Services(namespace).Get(name)
        if err != nil {
                log.Errorf("failed to get service %s: %s", key, err)
+               message := fmt.Sprintf(_messageResourceSyncAborted, 
_upstreamController, err.Error())

Review comment:
       Ditto for ApisixUpstream.

##########
File path: pkg/ingress/secret.go
##########
@@ -184,9 +184,9 @@ func (c *secretController) onAdd(obj interface{}) {
                return
        }
 
-       log.Debugw("secret add event arrived",
-               zap.Any("object", obj),
-       )
+       //log.Debugw("secret add event arrived",
+       //      zap.Any("object", obj),

Review comment:
       It seems that `zap.Any` outputs the `cert` and `pkey` in `[]bytes` and 
it's not human-friendly. I think we can just print the `name` and `namespace` 
of this secret, and do not print the body.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to