mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
K8s/Folders: Warn against using full path in metadata (#94829)
This commit is contained in:
parent
4e93b0f467
commit
8b9bb2acf6
@ -106,9 +106,16 @@ type GrafanaMetaAccessor interface {
|
|||||||
// NOTE the type must match the existing value, or an error will be thrown
|
// NOTE the type must match the existing value, or an error will be thrown
|
||||||
SetStatus(any) error
|
SetStatus(any) error
|
||||||
|
|
||||||
|
// Deprecated: this is a temporary hack for folders, it will be removed without notice soon
|
||||||
GetFullPath() string
|
GetFullPath() string
|
||||||
|
|
||||||
|
// Deprecated: this is a temporary hack for folders, it will be removed without notice soon
|
||||||
SetFullPath(path string)
|
SetFullPath(path string)
|
||||||
|
|
||||||
|
// Deprecated: this is a temporary hack for folders, it will be removed without notice soon
|
||||||
GetFullPathUIDs() string
|
GetFullPathUIDs() string
|
||||||
|
|
||||||
|
// Deprecated: this is a temporary hack for folders, it will be removed without notice soon
|
||||||
SetFullPathUIDs(path string)
|
SetFullPathUIDs(path string)
|
||||||
|
|
||||||
// Find a title in the object
|
// Find a title in the object
|
||||||
|
@ -86,11 +86,19 @@ func UnstructuredToLegacyFolder(item unstructured.Unstructured, orgID int64) *fo
|
|||||||
// #TODO add created by field if necessary
|
// #TODO add created by field if necessary
|
||||||
// CreatedBy: meta.GetCreatedBy(),
|
// CreatedBy: meta.GetCreatedBy(),
|
||||||
// UpdatedBy: meta.GetCreatedBy(),
|
// UpdatedBy: meta.GetCreatedBy(),
|
||||||
URL: getURL(meta, title),
|
URL: getURL(meta, title),
|
||||||
Created: createdTime,
|
Created: createdTime,
|
||||||
Updated: createdTime,
|
Updated: createdTime,
|
||||||
OrgID: orgID,
|
OrgID: orgID,
|
||||||
Fullpath: meta.GetFullPath(),
|
|
||||||
|
// This will need to be restructured so the full path is looked up when saving
|
||||||
|
// it can't be saved in the resource metadata because then everything must cascade
|
||||||
|
// nolint:staticcheck
|
||||||
|
Fullpath: meta.GetFullPath(),
|
||||||
|
|
||||||
|
// This will need to be restructured so the full path is looked up when saving
|
||||||
|
// it can't be saved in the resource metadata because then everything must cascade
|
||||||
|
// nolint:staticcheck
|
||||||
FullpathUIDs: meta.GetFullPathUIDs(),
|
FullpathUIDs: meta.GetFullPathUIDs(),
|
||||||
}
|
}
|
||||||
return f
|
return f
|
||||||
@ -187,9 +195,11 @@ func convertToK8sResource(v *folder.Folder, namespacer request.NamespaceMapper)
|
|||||||
meta.SetFolder(v.ParentUID)
|
meta.SetFolder(v.ParentUID)
|
||||||
}
|
}
|
||||||
if v.Fullpath != "" {
|
if v.Fullpath != "" {
|
||||||
|
// nolint:staticcheck
|
||||||
meta.SetFullPath(v.Fullpath)
|
meta.SetFullPath(v.Fullpath)
|
||||||
}
|
}
|
||||||
if v.FullpathUIDs != "" {
|
if v.FullpathUIDs != "" {
|
||||||
|
// nolint:staticcheck
|
||||||
meta.SetFullPathUIDs(v.FullpathUIDs)
|
meta.SetFullPathUIDs(v.FullpathUIDs)
|
||||||
}
|
}
|
||||||
f.UID = gapiutil.CalculateClusterWideUID(f)
|
f.UID = gapiutil.CalculateClusterWideUID(f)
|
||||||
|
Loading…
Reference in New Issue
Block a user