未验证 提交 dda1bfee 编写于 作者: K KubeSphere CI Bot 提交者: GitHub

Merge pull request #2252 from wansir/federatedworkspaces

fix: federatedworkspace clusterSelector zero value
......@@ -69,8 +69,8 @@ type Template struct {
}
type Placement struct {
Clusters []Cluster `json:"clusters,omitempty"`
ClusterSelector ClusterSelector `json:"clusterSelector,omitempty"`
Clusters []Cluster `json:"clusters,omitempty"`
ClusterSelector *ClusterSelector `json:"clusterSelector,omitempty"`
}
type ClusterSelector struct {
......
......@@ -125,7 +125,11 @@ func (in *Placement) DeepCopyInto(out *Placement) {
*out = make([]Cluster, len(*in))
copy(*out, *in)
}
in.ClusterSelector.DeepCopyInto(&out.ClusterSelector)
if in.ClusterSelector != nil {
in, out := &in.ClusterSelector, &out.ClusterSelector
*out = new(ClusterSelector)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Placement.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册