robocanic commented on code in PR #1314:
URL: https://github.com/apache/dubbo-admin/pull/1314#discussion_r2296886592


##########
pkg/core/resource/apis/mesh/v1alpha1/affinityroute_types.go:
##########
@@ -83,12 +84,31 @@ func (r *AffinityRouteResource) ResourceMeta() 
metav1.ObjectMeta {
 func (r *AffinityRouteResource) ResourceSpec() coremodel.ResourceSpec {
        return r.Spec
 }
+func (r *AffinityRouteResource) DeepCopyObject() k8sruntime.Object {
+       if r == nil {
+               return nil
+       }
+
+       out := &AffinityRouteResource{
+               TypeMeta: r.TypeMeta,
+               Mesh:     r.Mesh,
+               Status:   r.Status,
+       }
+
+       r.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+
+       if r.Spec != nil {
+               out.Spec = proto.Clone(r.Spec).(*meshproto.AffinityRoute)
+       }
+
+       return out
+}
 
-func NewAffinityRouteResource(name string, mesh string, apiVersion string) 
*AffinityRouteResource {
+func NewAffinityRouteResourceWithAttributes(name string, mesh string, 
apiVersion string) *AffinityRouteResource {
        return &AffinityRouteResource{
                TypeMeta: metav1.TypeMeta{
                        Kind:       string(AffinityRouteKind),
-                       APIVersion: apiVersion,
+                       APIVersion: "v1alpha1",

Review Comment:
   The original intention of this change is to keep the apiVersion the same as 
the package name , not as the method parameter



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