gxthrj commented on a change in pull request #572:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/572#discussion_r664415858



##########
File path: samples/deploy/crd/v1beta1/ApisixRoute.yaml
##########
@@ -44,7 +44,11 @@ spec:
     - name: v1
       served: true
       storage: false
+      deprecated: true
     - name: v2alpha1
+      served: true
+      storage: false

Review comment:
       OK

##########
File path: pkg/kube/apisix/apis/config/v2beta1/types.go
##########
@@ -0,0 +1,227 @@
+// 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 v2beta1
+
+import (
+       "encoding/json"
+
+       metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+       "k8s.io/apimachinery/pkg/util/intstr"
+)
+
+// +genclient
+// +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"`

Review comment:
       I just copy the other fields from v2alpha1, Perhaps we can change these 
fields,  do not use pointer since v2beta1.

##########
File path: pkg/kube/apisix/apis/config/v2beta1/types.go
##########
@@ -0,0 +1,227 @@
+// 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 v2beta1
+
+import (
+       "encoding/json"
+
+       metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+       "k8s.io/apimachinery/pkg/util/intstr"
+)
+
+// +genclient
+// +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"`

Review comment:
       Ditto

##########
File path: pkg/kube/apisix/apis/config/v2beta1/types.go
##########
@@ -0,0 +1,227 @@
+// 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 v2beta1
+
+import (
+       "encoding/json"
+
+       metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+       "k8s.io/apimachinery/pkg/util/intstr"
+)
+
+// +genclient
+// +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"`
+}
+
+// ApisixStatus is the status report for Apisix ingress Resources
+type ApisixStatus struct {
+       Conditions *[]metav1.Condition `json:"conditions,omitempty" 
yaml:"conditions,omitempty"`

Review comment:
       Ditto

##########
File path: samples/deploy/crd/v1beta1/ApisixRoute.yaml
##########
@@ -262,3 +267,43 @@ spec:
                     required:
                       - serviceName
                       - servicePort
+            stream:
+              type: array
+              minItems: 1
+              items:
+                type: object
+                required: [ "name", "match", "backend", "protocol" ]
+                properties:
+                  "protocol":
+                    type: string
+                    enum: [ "TCP", "UDP" ]
+                  name:
+                    type: string
+                    minLength: 1
+                  match:
+                    type: object
+                    properties:
+                      ingressPort:
+                        type: integer
+                        minimum: 1
+                        maximum: 65535
+                    required:
+                      - ingressPort
+                  backend:
+                    type: object
+                    properties:
+                      serviceName:
+                        type: string
+                        minLength: 1
+                      servicePort:
+                        type: integer
+                        minimum: 1
+                        maximum: 65535
+                      resolveGranualrity:
+                        type: string
+                        enum: [ "endpoint", "service" ]
+                      subset:
+                        type: string
+                    required:
+                      - serviceName
+                      - servicePort

Review comment:
       Done

##########
File path: pkg/kube/apisix_route.go
##########
@@ -28,6 +29,8 @@ const (
        ApisixRouteV1 = "apisix.apache.org/v1"
        // ApisixRouteV2alpha1 represents the APisixRoute in 
apisix.apache.org/v2alpha1 group version
        ApisixRouteV2alpha1 = "apisix.apache.org/v2alpha1"
+       // ApisixRouteV2beta1 represents the APisixRoute in 
apisix.apache.org/v2beta1 group version

Review comment:
       done




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


Reply via email to