Finished
This commit is contained in:
parent
093ba23e9a
commit
09b59faff7
1 changed files with 17 additions and 7 deletions
|
@ -81,11 +81,13 @@ func main() {
|
|||
for _, page := range scans {
|
||||
go func(page string) {
|
||||
defer wg.Done()
|
||||
if !strings.HasPrefix(page, "events.") && !strings.HasPrefix(page, "customresourcedefinitions.a") {
|
||||
create(true, page, outputDir)
|
||||
fmt.Println("scaned " + page)
|
||||
if !strings.HasPrefix(page, "events.events.k8s.io") {
|
||||
if strings.HasPrefix(page, "customresourcedefinitions.a") {
|
||||
create(true, page, outputDir)
|
||||
fmt.Println("scaned " + page)
|
||||
}
|
||||
} else {
|
||||
fmt.Println("skipped " + page)
|
||||
fmt.Println("warning, skipped " + page)
|
||||
}
|
||||
}(page)
|
||||
}
|
||||
|
@ -224,16 +226,20 @@ func create(pages bool, page string, dir string) {
|
|||
func getSpec(level int, specName string) spec {
|
||||
spec := spec{}
|
||||
|
||||
if strings.HasPrefix(specName, "customresourcedefinitions.apiextensions.k8s.io.spec.versions.schema.openAPIV3Schema") {
|
||||
fmt.Println("warning, skipping " + specName)
|
||||
return spec
|
||||
}
|
||||
|
||||
out, err := lib.ExecNotFatal(`#!/bin/bash
|
||||
kubectl explain "${SPEC}"
|
||||
`, []string{"SPEC=" + specName})
|
||||
|
||||
if err != nil {
|
||||
if specName == "events.events.k8s.io" {
|
||||
fmt.Println("debug: skipped " + specName + " intentionally, seems duplicate of events")
|
||||
return spec
|
||||
} else {
|
||||
log.Fatal("warning, cant lookup "+specName+": ", err)
|
||||
log.Fatal("cant lookup "+specName+": ", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -450,7 +456,11 @@ func printFields(level int, fields []field, baseUuidLength int, baseName string,
|
|||
linked = ", <a href=\"index_" + fields[i].uuid + "." + fields[i].name + ".html\">link</a>"
|
||||
}
|
||||
}
|
||||
writeFile(out, fill+" "+fields[i].name+", "+fields[i].kind+", "+fmt.Sprint(fields[i].required)+", enums["+fields[i].enums+"]"+linked)
|
||||
if fields[i].uuid+"."+fields[i].name == "customresourcedefinitions.apiextensions.k8s.io.spec.versions.schema.openAPIV3Schema" {
|
||||
writeFile(out, fill+" "+fields[i].name+", "+fields[i].kind+", "+fmt.Sprint(fields[i].required)+", enums["+fields[i].enums+"]"+linked+" broken")
|
||||
} else {
|
||||
writeFile(out, fill+" "+fields[i].name+", "+fields[i].kind+", "+fmt.Sprint(fields[i].required)+", enums["+fields[i].enums+"]"+linked)
|
||||
}
|
||||
if len(fields[i].uuid) > baseUuidLength && len(fields[i].uuid[baseUuidLength+1:]) > 0 {
|
||||
writeFile(out, fill+" "+baseName+"."+fields[i].uuid[baseUuidLength+1:])
|
||||
} else if len(fields[i].uuid) == baseUuidLength {
|
||||
|
|
Loading…
Reference in a new issue