mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
conversion-gen: add --skip-unsafe flag
We should expose the SkipUnsafe option, for legacy compatability, so that conversion-go can be used in other projects, and for platforms where unsafe is not available. Make unsafe code generation the default though, and have the help text hint that the resulting code is sub-optimal.
This commit is contained in:
parent
702c33a564
commit
dd351db799
@ -64,6 +64,8 @@ func main() {
|
||||
}
|
||||
pflag.CommandLine.StringSliceVar(&customArgs.ExtraPeerDirs, "extra-peer-dirs", customArgs.ExtraPeerDirs,
|
||||
"Comma-separated list of import paths which are considered, after tag-specified peers, for conversions.")
|
||||
pflag.CommandLine.BoolVar(&customArgs.SkipUnsafe, "skip-unsafe", customArgs.SkipUnsafe,
|
||||
"If true, will not generate code using unsafe pointer conversions; resulting code may be slower.")
|
||||
arguments.CustomArgs = customArgs
|
||||
|
||||
// Run it.
|
||||
|
@ -561,6 +561,7 @@ since-time
|
||||
skip-generated-rewrite
|
||||
skip-munges
|
||||
skip-preflight-checks
|
||||
skip-unsafe
|
||||
sort-by
|
||||
source-file
|
||||
ssh-env
|
||||
|
Loading…
Reference in New Issue
Block a user