import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) func AddMyCRDToScheme(scheme *runtime.Scheme) error { // create a new MyCRD instance crd := &MyCRD{} // add the MyCRD GroupVersion to the scheme gv := schema.GroupVersion{Group: "mydomain.com", Version: "v1"} scheme.AddKnownTypes(gv, crd, &crdList{}, &metav1.ListOptions{}, &metav1.DeleteOptions{}, ) // Add the MyCRD to the core v1 API resources metav1.AddToGroupVersion(scheme, gv, &crd) return nil }This creates the necessary `schema.GroupVersion` object and adds the `MyCRD` and related types to the scheme. It also adds the newly created `schema.GroupVersion` to the core v1 API resources. Overall, `Scheme.AddKnownTypes` is used to add custom resources and their relevant types to the Kubernetes API server, allowing them to be serialized and deserialized properly.