Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetK8sObjType ¶
GetK8sObjType returns the type (not the pointer type) of a kubernetes object.
func GroupVersionResourceToString ¶
func GroupVersionResourceToString(gvr metav1.GroupVersionResource) string
GroupVersionResourceToString returns a string representation. It differs from the original stringer of the object itself.
func ToAdmissionErrorResponse ¶
func ToAdmissionErrorResponse(uid types.UID, err error, logger log.Logger) *admissionv1beta1.AdmissionResponse
ToAdmissionErrorResponse transforms an error into a admission response with error.
Types ¶
type ObjectCreator ¶ added in v0.10.0
ObjectCreator knows how to create objects from Raw JSON data into specific types.
func NewDynamicObjectCreator ¶ added in v0.10.0
func NewDynamicObjectCreator() ObjectCreator
NewDynamicObjectCreator returns a object creator that knows how to return objects from raw JSON data without the need of knowing the type.
To be able to infer the types the types need to be registered on the global client Scheme. Normally when a user tries casting the metav1.Object to a specific type, the object is already registered. In case the type is not registered and the object can't be created it will fallback to an Unstructured type.
Useful to make dynamic webhooks that expect multiple or unknown types.
func NewStaticObjectCreator ¶ added in v0.10.0
func NewStaticObjectCreator(obj metav1.Object) ObjectCreator
NewStaticObjectCreator doesn't need to infer the type, it will create a new schema and create a new object with the same type from the received object type.