mirror of https://github.com/k3s-io/k3s
![]() Automatic merge from submit-queue (batch tested with PRs 49498, 49192) Unify genclient tags and add more fine control on verbs generated This will change the syntax of the existing `genclient` tags be like this: ``` // +genclient // +genclient:noStatus // +genclient:noVerbs // +genclient:nonNamespaced // +genclient:readonly ``` The first one indicates the client will be generated from the struct below and the other tags are basically options to the genclient (which justify why they should be prefixed with `genclient:`) This also changes the `// +genclientstatus=false` to `// +genclient:noStatus` to follow the pattern and also changes the `// +noMethods=true` to `// +genclient:noVerbs` as we call the REST operations verbs so it will make it consistent with terminology. In addition to existing options this patch also add two more to allow more fine-grained control on which verbs are going to be generated. This is extra useful for third-party projects (like OpenShift) where some resources does not implement full CRUD, but for example just "create" verb or "create" and "delete"... To support that, you can use this syntax: ``` // +genclient:onlyVerbs=create,delete // +genclient:skipVerbs=patch ``` The first one will generate only create and delete functions and second one will generate full CRUD without "patch" actions. This somehow overlaps with the existing "readonly" tag, but I want to keep that tag in place as it reads better in some cases ;-) |
||
---|---|---|
.. | ||
endpoints | ||
errors | ||
events | ||
helper | ||
install | ||
meta | ||
persistentvolume | ||
pod | ||
ref | ||
resource | ||
service | ||
testapi | ||
testing | ||
unversioned | ||
util | ||
v1 | ||
validation | ||
BUILD | ||
OWNERS | ||
annotation_key_constants.go | ||
conversion_test.go | ||
copy_test.go | ||
deep_copy_test.go | ||
defaulting_test.go | ||
doc.go | ||
field_constants.go | ||
json.go | ||
meta_test.go | ||
node_example.json | ||
objectreference.go | ||
register.go | ||
replication_controller_example.json | ||
resource.go | ||
serialization_proto_test.go | ||
serialization_test.go | ||
taint.go | ||
taint_test.go | ||
toleration.go | ||
types.go | ||
unstructured_test.go | ||
zz_generated.deepcopy.go |