github.com/giantswarm/apiextensions/v6@v6.6.0/pkg/apis/capiexp/v1alpha3/groupversion_info.go (about)

     1  /*
     2  Copyright 2020 The Kubernetes 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  // Package v1alpha3 contains API Schema definitions for the exp v1alpha3 API group
    18  // +kubebuilder:object:generate=true
    19  // +groupName=exp.cluster.x-k8s.io
    20  package v1alpha3
    21  
    22  import (
    23  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    24  	"k8s.io/apimachinery/pkg/runtime"
    25  	"k8s.io/apimachinery/pkg/runtime/schema"
    26  )
    27  
    28  // knownTypes is the full list of objects to register with the scheme. It
    29  // should contain all zero values of custom objects and custom object lists
    30  // in the group version.
    31  var knownTypes = []runtime.Object{
    32  	&MachinePool{},
    33  	&MachinePoolList{},
    34  }
    35  
    36  var (
    37  	// GroupVersion is group version used to register these objects
    38  	GroupVersion = schema.GroupVersion{Group: "exp.cluster.x-k8s.io", Version: "v1alpha3"}
    39  
    40  	schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
    41  
    42  	// AddToScheme is used by the generated client.
    43  	AddToScheme = schemeBuilder.AddToScheme
    44  )
    45  
    46  // SchemeGroupVersion is group version used to register these objects
    47  var SchemeGroupVersion = schema.GroupVersion{
    48  	Group:   GroupVersion.Group,
    49  	Version: GroupVersion.Version,
    50  }
    51  
    52  // Adds the list of known types to api.Scheme.
    53  func addKnownTypes(scheme *runtime.Scheme) error {
    54  	scheme.AddKnownTypes(SchemeGroupVersion, knownTypes...)
    55  	metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
    56  	return nil
    57  }