Provisioning: Hide HistoricJobs from OpenAPI spec (#109454)

histtoric jobs
This commit is contained in:
Ryan McKinley
2025-08-11 10:47:33 +00:00
committed by GitHub
parent f80627f228
commit 439d4d383c
4 changed files with 17 additions and 835 deletions
+9 -1
View File
@@ -775,8 +775,16 @@ func (b *APIBuilder) PostProcessOpenAPI(oas *spec3.OpenAPI) (*spec3.OpenAPI, err
oas.Info.Description = "Provisioning"
root := "/apis/" + b.GetGroupVersion().String() + "/"
repoprefix := root + "namespaces/{namespace}/repositories/{name}"
// Hide the internal historic jobs endpoint from the OpenAPI spec.
historicjobs := root + "namespaces/{namespace}/historicjobs"
for path := range oas.Paths.Paths {
if strings.HasPrefix(path, historicjobs) {
delete(oas.Paths.Paths, path)
}
}
repoprefix := root + "namespaces/{namespace}/repositories/{name}"
defs := b.GetOpenAPIDefinitions()(func(path string) spec.Ref { return spec.Ref{} })
defsBase := "github.com/grafana/grafana/apps/provisioning/pkg/apis/provisioning/v0alpha1."
refsBase := "com.github.grafana.grafana.pkg.apis.provisioning.v0alpha1."