...

Source file src/github.com/emissary-ingress/emissary/v3/pkg/api/getambassador.io/v1/handwritten.conversion.go

Documentation: github.com/emissary-ingress/emissary/v3/pkg/api/getambassador.io/v1

     1  // This file is ultimately authored by a human, you can ask the build system to generate the
     2  // necessary signatures for you by running (in the project root)
     3  //
     4  //    make $PWD/pkg/api/getambassador.io/v1/handwritten.conversion.scaffold.go
     5  //
     6  // You can then diff `handwritten.conversion.go` and `handwritten.conversion.scaffold.go` to make
     7  // sure you have all of the functions that conversion-gen thinks you need.
     8  
     9  package v1
    10  
    11  import (
    12  	k8sRuntime "k8s.io/apimachinery/pkg/runtime"
    13  	k8sRuntimeUtil "k8s.io/apimachinery/pkg/util/runtime"
    14  
    15  	"github.com/emissary-ingress/emissary/v3/pkg/api/getambassador.io/v2"
    16  	"github.com/emissary-ingress/emissary/v3/pkg/api/getambassador.io/v3alpha1"
    17  )
    18  
    19  // These first few functions are written of our own human initiative.
    20  
    21  var (
    22  	conversionScheme = func() *k8sRuntime.Scheme {
    23  		scheme := k8sRuntime.NewScheme()
    24  		k8sRuntimeUtil.Must(AddToScheme(scheme))
    25  		k8sRuntimeUtil.Must(v2.AddToScheme(scheme))
    26  		k8sRuntimeUtil.Must(v3alpha1.AddToScheme(scheme))
    27  		return scheme
    28  	}
    29  	conversionIntermediates = []k8sRuntime.GroupVersioner{
    30  		// v1 (spoke)
    31  		v2.GroupVersion,
    32  		// v3alpha1 (hub)
    33  	}
    34  )
    35  
    36  ////////////////////////////////////////////////////////////////////////////////////////////////////
    37  // The remaining functions are all filled out from `handwritten.conversion.scaffold.go` (see the
    38  // comment at the top of the file).  I like to leave in the "WARNING" and "INFO" comments that
    39  // `handwritten.conversion.scaffold.go` has, so that I can (1) compare the comments and the code,
    40  // and make sure the code does everything the comments mention, and (2) compare this file against
    41  // `handwritten.conversion.scaffold.go` to make sure all the comments are there.
    42  

View as plain text