AlexStocks commented on code in PR #1314:
URL: https://github.com/apache/dubbo-admin/pull/1314#discussion_r2296971673
##########
pkg/core/resource/apis/mesh/v1alpha1/conditionroute_types.go:
##########
@@ -83,12 +84,31 @@ func (r *ConditionRouteResource) ResourceMeta()
metav1.ObjectMeta {
func (r *ConditionRouteResource) ResourceSpec() coremodel.ResourceSpec {
return r.Spec
}
+func (r *ConditionRouteResource) DeepCopyObject() k8sruntime.Object {
+ if r == nil {
+ return nil
+ }
+
+ out := &ConditionRouteResource{
+ 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.ConditionRoute)
+ }
+
+ return out
+}
-func NewConditionRouteResource(name string, mesh string, apiVersion string)
*ConditionRouteResource {
+func NewConditionRouteResourceWithAttributes(name string, mesh string,
apiVersion string) *ConditionRouteResource {
return &ConditionRouteResource{
TypeMeta: metav1.TypeMeta{
Kind: string(ConditionRouteKind),
- APIVersion: apiVersion,
+ APIVersion: "v1alpha1",
Review Comment:
这里为何要改?如果写死,参数 apiVersion 这个没啥用了吧
--
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]