Shared code and example implementations
API objects are found at the following locations:
pkg/apis/metrics
- Metrics APIpkg/apis/traffcispec
- TrafficSpec APIpkg/apis/trafficsplit
- TrafficSplit API
Client code for the API CRDs is autogenerated and can be found at the following location:
pkg/gen/trafficspec
pkg/gen/trafficsplit
In addition to generating client code at the above locations the generator will
also generate zz_generated.deepcopy.go
inside the API object folder.
To regenerate the client code, follow these steps:
- Install the code-generator tool:
go get k8s.io/code-generator
- Ensure the group name does not contain any hypen characters (see note below)
- Run
hack/update-codegen.sh
The code-generator does not support groupNames with hyphen characters.
Therefore, before running the code generator, you must rename all instances of
"smi-spec.io" in the project to "smispec.io". The update-codegen.sh
script
will rename these back to "smi-spec.io" after code generation is complete.