sxllwx commented on code in PR #745:
URL: https://github.com/apache/dubbo-go-pixiu/pull/745#discussion_r2434374112


##########
pixiu-ingress-controller/api/v1alpha1/gatewayproxy_types.go:
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package v1alpha1
+
+import (
+       metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// GatewayProxySpec defines the desired state of GatewayProxy
+type GatewayProxySpec struct{}

Review Comment:
   Doesn't our spec need to be clearly defined?



##########
pixiu-ingress-controller/cmd/pixiuctl/main.go:
##########
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+       "pixiu-ingress-controller/cmd"
+)
+
+func main() {
+       rootCmd := cmd.GetRootCmd()
+       if err := rootCmd.Execute(); err != nil {
+               getExitCode(err)

Review Comment:
   It seems that output similar to (fmt.Println) should be done here to help 
users locate the cause of the problem



##########
pixiu-ingress-controller/cmd/root.go:
##########
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package cmd
+
+import (
+       "os"
+)
+
+import (
+       "github.com/go-logr/zapr"
+
+       "github.com/spf13/cobra"
+
+       "go.uber.org/zap"
+       "go.uber.org/zap/zapcore"
+
+       "pixiu-ingress-controller/internal/controller/config"
+
+       "pixiu-ingress-controller/internal/manager"
+
+       ctrl "sigs.k8s.io/controller-runtime"
+)
+
+func GetRootCmd() *cobra.Command {
+       root := newPIXIUIngressController()
+       return root

Review Comment:
   nit:
   
   ```go
   return newPIXUIngressController()
   ```



##########
pixiu-ingress-controller/config/network-policy/allow-metrics-traffic.yaml:
##########
@@ -0,0 +1,27 @@
+# This NetworkPolicy allows ingress traffic
+# with Pods running on namespaces labeled with 'metrics: enabled'. Only Pods 
on those
+# namespaces are able to gather data from the metrics endpoint.
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+  labels:
+    app.kubernetes.io/name: pixiu-ingress-controller

Review Comment:
   For label management, we can consider using kustomize



##########
pixiu-ingress-controller/hack/boilerplate.go.txt:
##########
@@ -0,0 +1,15 @@
+/*
+Copyright 2025 mfordjody.

Review Comment:
   Maybe we should use the community license



##########
pixiu-ingress-controller/internal/controller/config/config.go:
##########
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package config
+
+import (
+       "encoding/json"
+       "fmt"
+       "time"
+)
+
+var (
+       ControllerConfig = NewDefaultConfig()
+)
+
+const (
+       DefaultLeaderElectionID = "pixiu-ingress-gateway-leader"
+       DefaultControllerName   = "pixiu.apache.org/pixiu-ingress-controller"
+       DefaultLogLevel         = "info"
+       DefaultMetricsAddr      = ":8080"
+       DefaultProbeAddr        = ":8081"
+)
+
+type Config struct {
+       LogLevel         string          `json:"log_level" yaml:"log_level"`
+       ControllerName   string          `json:"controller_name" 
yaml:"controller_name"`
+       LeaderElectionID string          `json:"leader_election_id" 
yaml:"leader_election_id"`
+       MetricsAddr      string          `json:"metrics_addr" 
yaml:"metrics_addr"`
+       EnableHTTP2      bool            `json:"enable_http2" 
yaml:"enable_http2"`
+       ProbeAddr        string          `json:"probe_addr" yaml:"probe_addr"`
+       SecureMetrics    bool            `json:"secure_metrics" 
yaml:"secure_metrics"`
+       LeaderElection   *LeaderElection `json:"leader_election" 
yaml:"leader_election"`

Review Comment:
   Consider using 
https://github.com/kubernetes/component-base/blob/v0.32.9/config/v1alpha1/types.go#L27



##########
pixiu-ingress-controller/api/v1alpha1/gatewayproxy_types.go:
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package v1alpha1
+
+import (
+       metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// GatewayProxySpec defines the desired state of GatewayProxy
+type GatewayProxySpec struct{}
+
+// +kubebuilder:object:root=true
+// GatewayProxy defines configuration for the gateway proxy instances used to 
route traffic to services.
+type GatewayProxy struct {
+       metav1.TypeMeta   `json:",inline"`
+       metav1.ObjectMeta `json:"metadata,omitempty"`
+
+       // GatewayProxySpec defines configuration of gateway proxy instances,
+       // including networking settings, global plugins, and plugin metadata.
+       Spec GatewayProxySpec `json:"spec,omitempty"`

Review Comment:
   Doesn't our Proxy Status need to be clearly defined?



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

To unsubscribe, e-mail: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to