kubernetesk8s.io/kubernetes/cmd/libs/go2idl/defaulter-gen

defaulter-gen command

defaulter-gen is a tool for auto-generating Defaulter functions.

Given a list of input directories, it will scan for top level types and generate efficient defaulters for an entire object from the sum of the SetDefault_* methods contained in the object tree.

Generation is governed by comment tags in the source. Any package may request defaulter generation by including one or more comment tags at the package comment level:

// +k8s:defaulter-gen=<field-name-to-flag>

which will create defaulters for any type that contains the provided field name (if the type has defaulters). Any type may request explicit defaulting by providing the comment tag:

// +k8s:defaulter-gen=true|false

An existing defaulter method (`SetDefaults_TYPE`) can provide the comment tag:

// +k8s:defaulter-gen=covers

to indicate that the defaulter does not or should not call any nested defaulters.

Version
v1.6.9
Published
Aug 23, 2017
Platform
js/wasm
Imports
5 packages
Last checked
8 minutes ago

Tools for package owners.