grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1/deepcopy.go

64 lines
1.4 KiB
Go

package v2alpha1
import "reflect"
// TODO: these should be automatically generated by the SDK.
func (in *Dashboard) DeepCopyInto(out *Dashboard) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
}
func (in *Dashboard) DeepCopy() *Dashboard {
if in == nil {
return nil
}
out := new(Dashboard)
in.DeepCopyInto(out)
return out
}
func (in *DashboardList) DeepCopyInto(out *DashboardList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Dashboard, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
func (in *DashboardList) DeepCopy() *DashboardList {
if in == nil {
return nil
}
out := new(DashboardList)
in.DeepCopyInto(out)
return out
}
// TODO: we currently don't generate these methods for spec / status types.
// We probably should do that in the SDK.
func (in *DashboardSpec) DeepCopyInto(out *DashboardSpec) {
// TODO (@radiohead): since we don't generate this,
// I've added a manual reflection-based implementation for now.
val := reflect.ValueOf(in).Elem()
cpy := reflect.New(val.Type())
cpy.Elem().Set(val)
}
func (in *DashboardSpec) DeepCopy() *DashboardSpec {
if in == nil {
return nil
}
out := new(DashboardSpec)
in.DeepCopyInto(out)
return out
}