Skip to content

Commit 003d70a

Browse files
authored
Merge pull request #305 from droot/book/help-for-desc-limit
📖 generate help for maxDecLen commandline parameter
2 parents 7a2cb8e + 370fb97 commit 003d70a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

pkg/crd/gen.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ type Generator struct {
4040
// the CRD's schema.
4141
TrivialVersions bool `marker:",optional"`
4242

43-
// MaxDescLen limits the description length of each field in CRD's OpenAPI schema.
43+
// MaxDescLen specifies the maximum description length for fields in CRD's OpenAPI schema.
4444
//
45-
// nil (default) indicates no limit on description of fields
46-
// 0 indicates drop the description completely
47-
// n means at most n characters
45+
// 0 indicates drop the description for all fields completely.
46+
// n indicates limit the description to at most n characters and truncate the description to
47+
// closest sentence boundary if it exceeds n characters.
4848
MaxDescLen *int `marker:",optional"`
4949
}
5050

pkg/crd/zz_generated.markerhelp.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ func (Generator) Help() *markers.DefinitionHelp {
3636
Summary: "indicates that we should produce a single-version CRD. ",
3737
Details: " Single \"trivial-version\" CRDs are compatible with older (pre 1.13) Kubernetes API servers. The storage version's schema will be used as the CRD's schema.",
3838
},
39+
"MaxDescLen": markers.DetailedHelp{
40+
Summary: "specifies the maximum description length for fields in CRD's OpenAPI schema. ",
41+
Details: " 0 indicates drop the description for all fields completely. n indicates limit the description to at most n characters and truncate the description to closest sentence boundary if it exceeds n characters.",
42+
},
3943
},
4044
}
4145
}

0 commit comments

Comments
 (0)