kubesphere.io/api@v0.0.0-20231107125330-c9a03957060c/cluster/v1alpha1/register.go (about) 1 /* 2 Copyright 2020 KubeSphere Authors 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 /* 18 19 Licensed under the Apache License, Version 2.0 (the "License"); 20 you may not use this file except in compliance with the License. 21 You may obtain a copy of the License at 22 23 http://www.apache.org/licenses/LICENSE-2.0 24 25 Unless required by applicable law or agreed to in writing, software 26 distributed under the License is distributed on an "AS IS" BASIS, 27 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 28 See the License for the specific language governing permissions and 29 limitations under the License. 30 */ 31 32 // Package v1alpha1 contains API Schema definitions for the tower v1alpha1 API group 33 // +k8s:openapi-gen=true 34 // +kubebuilder:object:generate=true 35 // +k8s:defaulter-gen=TypeMeta 36 // +groupName=cluster.kubesphere.io 37 package v1alpha1 38 39 import ( 40 "k8s.io/apimachinery/pkg/runtime/schema" 41 "sigs.k8s.io/controller-runtime/pkg/scheme" 42 ) 43 44 var ( 45 // GroupVersion is group version used to register these objects 46 SchemeGroupVersion = schema.GroupVersion{Group: "cluster.kubesphere.io", Version: "v1alpha1"} 47 48 // SchemeBuilder is used to add go types to the GroupVersionKind scheme 49 SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} 50 51 // AddToScheme adds the types in this group-version to the given scheme. 52 AddToScheme = SchemeBuilder.AddToScheme 53 ) 54 55 func Resource(resource string) schema.GroupResource { 56 return SchemeGroupVersion.WithResource(resource).GroupResource() 57 }