add field description for the API

Signed-off-by: zhu733756 <talonzhu@yunify.com>
This commit is contained in:
zhu733756
2021-09-02 09:32:07 +08:00
parent ad02644674
commit 4d19d1a0e4
3 changed files with 6 additions and 2 deletions

View File

@@ -383,13 +383,16 @@ func (h handler) handleGrafanaDashboardImport(req *restful.Request, resp *restfu
return
}
annotation := map[string]string{"kubesphere.io/description": entity.Description}
dashboard := monitoringdashboardv1alpha2.ClusterDashboard{
TypeMeta: v1.TypeMeta{
APIVersion: convertedDashboard.APIVersion,
Kind: convertedDashboard.Kind,
},
ObjectMeta: v1.ObjectMeta{
Name: convertedDashboard.Metadata["name"],
Name: convertedDashboard.Metadata["name"],
Annotations: annotation,
},
Spec: *convertedDashboard.Spec,
}