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

     1  package v1alpha3
     2  
     3  import (
     4  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
     5  	"k8s.io/apimachinery/pkg/runtime"
     6  	"k8s.io/apimachinery/pkg/runtime/schema"
     7  )
     8  
     9  const (
    10  	group   = "infrastructure.giantswarm.io"
    11  	version = "v1alpha3"
    12  )
    13  
    14  // knownTypes is the full list of objects to register with the scheme. It
    15  // should contain pointers of zero values of all custom objects and custom
    16  // object lists in the group version.
    17  var knownTypes = []runtime.Object{
    18  	&AWSCluster{},
    19  	&AWSClusterList{},
    20  	&AWSControlPlane{},
    21  	&AWSControlPlaneList{},
    22  	&AWSMachineDeployment{},
    23  	&AWSMachineDeploymentList{},
    24  	&NetworkPool{},
    25  	&NetworkPoolList{},
    26  	&G8sControlPlane{},
    27  	&G8sControlPlaneList{},
    28  }
    29  
    30  // SchemeGroupVersion is group version used to register these objects
    31  var SchemeGroupVersion = schema.GroupVersion{
    32  	Group:   group,
    33  	Version: version,
    34  }
    35  
    36  var (
    37  	schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
    38  
    39  	// AddToScheme is used by the generated client.
    40  	AddToScheme = schemeBuilder.AddToScheme
    41  )
    42  
    43  // Adds the list of known types to api.Scheme.
    44  func addKnownTypes(scheme *runtime.Scheme) error {
    45  	scheme.AddKnownTypes(SchemeGroupVersion, knownTypes...)
    46  	metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
    47  	return nil
    48  }