diff --git a/hack/docgen/format/asciidocs/api.go b/hack/docgen/format/asciidocs/api.go index 69f06d49d5..4a69abc112 100644 --- a/hack/docgen/format/asciidocs/api.go +++ b/hack/docgen/format/asciidocs/api.go @@ -133,9 +133,6 @@ func PrintAPIDocs(args []string) { moduleContent += "|===\n" moduleContent += "| Property | Type | Description \n" for _, f := range t.Fields { - if strings.HasPrefix(fmt.Sprint(f.Description()), "OmitFromDoc") { - continue - } moduleContent += fmt.Sprint("|", f.Name(), "|", f.TypeLink(typeSetUnion), "|", f.Description(), "\n\n") } moduleContent += "|===\n" diff --git a/hack/docgen/format/markdown/api.go b/hack/docgen/format/markdown/api.go index 0f1e1f508f..fb1b1ff1d4 100644 --- a/hack/docgen/format/markdown/api.go +++ b/hack/docgen/format/markdown/api.go @@ -104,9 +104,6 @@ func PrintAPIDocs(args []string) { fmt.Println("| Property | Type | Description |") fmt.Println("| -------- | ---- | ----------- |") for _, f := range t.Fields { - if strings.HasPrefix(fmt.Sprint(f.Description()), "OmitFromDoc") { - continue - } fmt.Println("|", f.Name(), "|", f.TypeLink(typeSetUnion), "|", f.Description(), "|") } fmt.Println("") diff --git a/hack/docgen/model/parser.go b/hack/docgen/model/parser.go index 1361d73f7e..db8772a1d7 100644 --- a/hack/docgen/model/parser.go +++ b/hack/docgen/model/parser.go @@ -32,7 +32,7 @@ func Load(path string) (TypeSet, error) { for _, t := range types.Types { structType, ok := t.Decl.Specs[0].(*ast.TypeSpec).Type.(*ast.StructType) - if !ok || hideFromDoc(t.Doc) { + if !ok || omitFromDoc(t.Doc) { continue } @@ -49,7 +49,7 @@ func Load(path string) (TypeSet, error) { for _, currentStruct := range structs { for _, field := range currentStruct.rawFields { field := Field(*field) - if hideFromDoc(field.Doc.Text()) { + if omitFromDoc(field.Doc.Text()) { continue } if field.IsInlined() { @@ -83,9 +83,9 @@ func Load(path string) (TypeSet, error) { return structs, nil } -// hideFromDoc helps filetring out elements that are not intended to be shown in docs. -func hideFromDoc(doc string) bool { - return strings.HasPrefix(doc, "HideFromDoc: ") +// omitFromDoc helps filetring out elements that are not intended to be shown in docs. +func omitFromDoc(doc string) bool { + return strings.HasPrefix(doc, "OmitFromDoc") } func mergeFields(to *StructType, from *StructType, structs TypeSet) { diff --git a/pkg/manifests/types.go b/pkg/manifests/types.go index 41a353a8b9..89c9aa0382 100644 --- a/pkg/manifests/types.go +++ b/pkg/manifests/types.go @@ -117,7 +117,7 @@ type K8sPrometheusAdapter struct { Tolerations []v1.Toleration `json:"tolerations,omitempty"` // Defines a pod's topology spread constraints. TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` - // HideFromDoc: Defines dedicated service monitors. + // OmitFromDoc: Defines dedicated service monitors. DedicatedServiceMonitors *DedicatedServiceMonitors `json:"dedicatedServiceMonitors,omitempty"` } @@ -134,7 +134,7 @@ type MetricsServerConfig struct { TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` } -// HideFromDoc: This is deprecated and will be removed in a future version, setting it has no effect. +// OmitFromDoc: This is deprecated and will be removed in a future version, setting it has no effect. type DedicatedServiceMonitors struct { Enabled bool `json:"enabled,omitempty"` }