本文整理匯總了Golang中github.com/openshift/origin/pkg/api.GetFieldLabelConversionFunc函數的典型用法代碼示例。如果您正苦於以下問題:Golang GetFieldLabelConversionFunc函數的具體用法?Golang GetFieldLabelConversionFunc怎麽用?Golang GetFieldLabelConversionFunc使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetFieldLabelConversionFunc函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: addConversionFuncs
func addConversionFuncs(scheme *runtime.Scheme) {
err := scheme.AddConversionFuncs(
Convert_v1_NamedTagEventListArray_to_api_TagEventListArray,
Convert_api_TagEventListArray_to_v1_NamedTagEventListArray,
Convert_v1_TagReferenceArray_to_api_TagReferenceMap,
Convert_api_TagReferenceMap_to_v1_TagReferenceArray,
Convert_api_Image_To_v1_Image,
Convert_v1_Image_To_api_Image,
Convert_v1_ImageStreamSpec_To_api_ImageStreamSpec,
Convert_api_ImageStreamSpec_To_v1_ImageStreamSpec,
Convert_v1_ImageStreamStatus_To_api_ImageStreamStatus,
Convert_api_ImageStreamStatus_To_v1_ImageStreamStatus,
Convert_api_ImageStreamMapping_To_v1_ImageStreamMapping,
Convert_v1_ImageStreamMapping_To_api_ImageStreamMapping,
)
if err != nil {
// If one of the conversion functions is malformed, detect it immediately.
panic(err)
}
if err := scheme.AddFieldLabelConversionFunc("v1", "Image",
oapi.GetFieldLabelConversionFunc(newer.ImageToSelectableFields(&newer.Image{}), nil),
); err != nil {
panic(err)
}
if err := scheme.AddFieldLabelConversionFunc("v1", "ImageStream",
oapi.GetFieldLabelConversionFunc(newer.ImageStreamToSelectableFields(&newer.ImageStream{}), map[string]string{"name": "metadata.name"}),
); err != nil {
panic(err)
}
}
示例2: init
func init() {
err := kapi.Scheme.AddDefaultingFuncs(
func(strategy *BuildStrategy) {
if (strategy != nil) && (strategy.Type == DockerBuildStrategyType) {
// initialize DockerStrategy to a default state if it's not set.
if strategy.DockerStrategy == nil {
strategy.DockerStrategy = &DockerBuildStrategy{}
}
}
},
func(obj *SourceBuildStrategy) {
if len(obj.From.Kind) == 0 {
obj.From.Kind = "ImageStreamTag"
}
},
func(obj *DockerBuildStrategy) {
if obj.From != nil && len(obj.From.Kind) == 0 {
obj.From.Kind = "ImageStreamTag"
}
},
func(obj *CustomBuildStrategy) {
if len(obj.From.Kind) == 0 {
obj.From.Kind = "ImageStreamTag"
}
},
func(obj *BuildTriggerPolicy) {
if obj.Type == ImageChangeBuildTriggerType && obj.ImageChange == nil {
obj.ImageChange = &ImageChangeTrigger{}
}
},
)
if err != nil {
panic(err)
}
kapi.Scheme.AddConversionFuncs(
convert_v1_SourceBuildStrategy_To_api_SourceBuildStrategy,
convert_api_SourceBuildStrategy_To_v1_SourceBuildStrategy,
convert_v1_DockerBuildStrategy_To_api_DockerBuildStrategy,
convert_api_DockerBuildStrategy_To_v1_DockerBuildStrategy,
convert_v1_CustomBuildStrategy_To_api_CustomBuildStrategy,
convert_api_CustomBuildStrategy_To_v1_CustomBuildStrategy,
convert_v1_BuildOutput_To_api_BuildOutput,
convert_api_BuildOutput_To_v1_BuildOutput,
convert_v1_BuildTriggerPolicy_To_api_BuildTriggerPolicy,
convert_api_BuildTriggerPolicy_To_v1_BuildTriggerPolicy,
)
if err := kapi.Scheme.AddFieldLabelConversionFunc("v1", "Build",
oapi.GetFieldLabelConversionFunc(newer.BuildToSelectableFields(&newer.Build{}), map[string]string{"name": "metadata.name"}),
); err != nil {
panic(err)
}
if err := kapi.Scheme.AddFieldLabelConversionFunc("v1", "BuildConfig",
oapi.GetFieldLabelConversionFunc(newer.BuildConfigToSelectableFields(&newer.BuildConfig{}), map[string]string{"name": "metadata.name"}),
); err != nil {
panic(err)
}
}
示例3: addConversionFuncs
func addConversionFuncs(scheme *runtime.Scheme) {
scheme.AddConversionFuncs(
Convert_v1_BuildConfig_To_api_BuildConfig,
Convert_api_BuildConfig_To_v1_BuildConfig,
Convert_v1_SourceBuildStrategy_To_api_SourceBuildStrategy,
Convert_api_SourceBuildStrategy_To_v1_SourceBuildStrategy,
Convert_v1_DockerBuildStrategy_To_api_DockerBuildStrategy,
Convert_api_DockerBuildStrategy_To_v1_DockerBuildStrategy,
Convert_v1_CustomBuildStrategy_To_api_CustomBuildStrategy,
Convert_api_CustomBuildStrategy_To_v1_CustomBuildStrategy,
Convert_v1_BuildOutput_To_api_BuildOutput,
Convert_api_BuildOutput_To_v1_BuildOutput,
Convert_v1_BuildTriggerPolicy_To_api_BuildTriggerPolicy,
Convert_api_BuildTriggerPolicy_To_v1_BuildTriggerPolicy,
Convert_v1_SourceRevision_To_api_SourceRevision,
Convert_api_SourceRevision_To_v1_SourceRevision,
Convert_v1_BuildSource_To_api_BuildSource,
Convert_api_BuildSource_To_v1_BuildSource,
Convert_v1_BuildStrategy_To_api_BuildStrategy,
Convert_api_BuildStrategy_To_v1_BuildStrategy,
)
if err := scheme.AddFieldLabelConversionFunc("v1", "Build",
oapi.GetFieldLabelConversionFunc(newer.BuildToSelectableFields(&newer.Build{}), map[string]string{"name": "metadata.name"}),
); err != nil {
panic(err)
}
if err := scheme.AddFieldLabelConversionFunc("v1", "BuildConfig",
oapi.GetFieldLabelConversionFunc(newer.BuildConfigToSelectableFields(&newer.BuildConfig{}), map[string]string{"name": "metadata.name"}),
); err != nil {
panic(err)
}
}
示例4: addConversionFuncs
func addConversionFuncs(scheme *runtime.Scheme) error {
if err := scheme.AddFieldLabelConversionFunc("v1", "OAuthAccessToken",
oapi.GetFieldLabelConversionFunc(api.OAuthAccessTokenToSelectableFields(&api.OAuthAccessToken{}), nil),
); err != nil {
return err
}
if err := scheme.AddFieldLabelConversionFunc("v1", "OAuthAuthorizeToken",
oapi.GetFieldLabelConversionFunc(api.OAuthAuthorizeTokenToSelectableFields(&api.OAuthAuthorizeToken{}), nil),
); err != nil {
return err
}
if err := scheme.AddFieldLabelConversionFunc("v1", "OAuthClient",
oapi.GetFieldLabelConversionFunc(api.OAuthClientToSelectableFields(&api.OAuthClient{}), nil),
); err != nil {
return err
}
if err := scheme.AddFieldLabelConversionFunc("v1", "OAuthClientAuthorization",
oapi.GetFieldLabelConversionFunc(api.OAuthClientAuthorizationToSelectableFields(&api.OAuthClientAuthorization{}), nil),
); err != nil {
return err
}
return nil
}
示例5: init
func init() {
if err := kapi.Scheme.AddFieldLabelConversionFunc("v1", "OAuthAccessToken",
oapi.GetFieldLabelConversionFunc(api.OAuthAccessTokenToSelectableFields(&api.OAuthAccessToken{}), nil),
); err != nil {
panic(err)
}
if err := kapi.Scheme.AddFieldLabelConversionFunc("v1", "OAuthAuthorizeToken",
oapi.GetFieldLabelConversionFunc(api.OAuthAuthorizeTokenToSelectableFields(&api.OAuthAuthorizeToken{}), nil),
); err != nil {
panic(err)
}
if err := kapi.Scheme.AddFieldLabelConversionFunc("v1", "OAuthClient",
oapi.GetFieldLabelConversionFunc(api.OAuthClientToSelectableFields(&api.OAuthClient{}), nil),
); err != nil {
panic(err)
}
if err := kapi.Scheme.AddFieldLabelConversionFunc("v1", "OAuthClientAuthorization",
oapi.GetFieldLabelConversionFunc(api.OAuthClientAuthorizationToSelectableFields(&api.OAuthClientAuthorization{}), nil),
); err != nil {
panic(err)
}
}
示例6: addConversionFuncs
func addConversionFuncs(scheme *runtime.Scheme) {
if err := scheme.AddFieldLabelConversionFunc("v1", "ClusterNetwork",
oapi.GetFieldLabelConversionFunc(api.ClusterNetworkToSelectableFields(&api.ClusterNetwork{}), nil),
); err != nil {
panic(err)
}
if err := scheme.AddFieldLabelConversionFunc("v1", "HostSubnet",
oapi.GetFieldLabelConversionFunc(api.HostSubnetToSelectableFields(&api.HostSubnet{}), nil),
); err != nil {
panic(err)
}
if err := scheme.AddFieldLabelConversionFunc("v1", "NetNamespace",
oapi.GetFieldLabelConversionFunc(api.NetNamespaceToSelectableFields(&api.NetNamespace{}), nil),
); err != nil {
panic(err)
}
if err := scheme.AddFieldLabelConversionFunc("v1", "EgressNetworkPolicy",
oapi.GetFieldLabelConversionFunc(api.EgressNetworkPolicyToSelectableFields(&api.EgressNetworkPolicy{}), nil),
); err != nil {
panic(err)
}
}
示例7: init
func init() {
if err := kapi.Scheme.AddFieldLabelConversionFunc("v1", "Project",
oapi.GetFieldLabelConversionFunc(namespace.NamespaceToSelectableFields(&kapi.Namespace{}), nil),
); err != nil {
panic(err)
}
}
示例8: addConversionFuncs
func addConversionFuncs(scheme *runtime.Scheme) {
if err := scheme.AddFieldLabelConversionFunc("v1", "Project",
oapi.GetFieldLabelConversionFunc(namespace.NamespaceToSelectableFields(&kapi.Namespace{}), nil),
); err != nil {
panic(err)
}
}
示例9: addConversionFuncs
func addConversionFuncs(scheme *runtime.Scheme) {
if err := scheme.AddFieldLabelConversionFunc("v1", "Application",
oapi.GetFieldLabelConversionFunc(api.ApplicationToSelectableFields(&api.Application{}), nil),
); err != nil {
panic(err)
}
}
示例10: addConversionFuncs
func addConversionFuncs(scheme *runtime.Scheme) {
if err := scheme.AddFieldLabelConversionFunc("v1", "BackingServiceInstance",
oapi.GetFieldLabelConversionFunc(backingserviceinstanceapi.BackingServiceInstanceToSelectableFields(&backingserviceinstanceapi.BackingServiceInstance{}), nil),
); err != nil {
panic(err)
}
}
示例11: addConversionFuncs
func addConversionFuncs(scheme *runtime.Scheme) {
if err := scheme.AddFieldLabelConversionFunc("v1", "Template",
oapi.GetFieldLabelConversionFunc(api.TemplateToSelectableFields(&api.Template{}), nil),
); err != nil {
panic(err)
}
}
示例12: init
func init() {
err := api.Scheme.AddDefaultingFuncs(
func(obj *RouteSpec) {
obj.To.Kind = "Service"
},
func(obj *TLSConfig) {
if len(obj.Termination) == 0 && len(obj.DestinationCACertificate) == 0 {
obj.Termination = TLSTerminationEdge
}
switch obj.Termination {
case TLSTerminationType("Reencrypt"):
obj.Termination = TLSTerminationReencrypt
case TLSTerminationType("Edge"):
obj.Termination = TLSTerminationEdge
case TLSTerminationType("Passthrough"):
obj.Termination = TLSTerminationPassthrough
}
},
)
if err != nil {
panic(err)
}
err = api.Scheme.AddConversionFuncs()
if err != nil {
panic(err)
}
if err := api.Scheme.AddFieldLabelConversionFunc("v1", "Route",
oapi.GetFieldLabelConversionFunc(routeapi.RouteToSelectableFields(&routeapi.Route{}), nil),
); err != nil {
panic(err)
}
}
示例13: addConversionFuncs
func addConversionFuncs(scheme *runtime.Scheme) {
err := scheme.AddDefaultingFuncs(
func(obj *ImageImportSpec) {
if obj.To == nil {
if ref, err := newer.ParseDockerImageReference(obj.From.Name); err == nil {
if len(ref.Tag) > 0 {
obj.To = &v1.LocalObjectReference{Name: ref.Tag}
}
}
}
})
if err != nil {
// If one of the default functions is malformed, detect it immediately.
panic(err)
}
err = scheme.AddConversionFuncs(
Convert_v1_NamedTagEventListArray_to_api_TagEventListArray,
Convert_api_TagEventListArray_to_v1_NamedTagEventListArray,
Convert_v1_TagReferenceArray_to_api_TagReferenceMap,
Convert_api_TagReferenceMap_to_v1_TagReferenceArray,
Convert_api_Image_To_v1_Image,
Convert_v1_Image_To_api_Image,
Convert_v1_ImageStreamSpec_To_api_ImageStreamSpec,
Convert_api_ImageStreamSpec_To_v1_ImageStreamSpec,
Convert_v1_ImageStreamStatus_To_api_ImageStreamStatus,
Convert_api_ImageStreamStatus_To_v1_ImageStreamStatus,
Convert_api_ImageStreamMapping_To_v1_ImageStreamMapping,
Convert_v1_ImageStreamMapping_To_api_ImageStreamMapping,
)
if err != nil {
// If one of the conversion functions is malformed, detect it immediately.
panic(err)
}
if err := scheme.AddFieldLabelConversionFunc("v1", "Image",
oapi.GetFieldLabelConversionFunc(newer.ImageToSelectableFields(&newer.Image{}), nil),
); err != nil {
panic(err)
}
if err := scheme.AddFieldLabelConversionFunc("v1", "ImageStream",
oapi.GetFieldLabelConversionFunc(newer.ImageStreamToSelectableFields(&newer.ImageStream{}), map[string]string{"name": "metadata.name"}),
); err != nil {
panic(err)
}
}
示例14: addConversionFuncs
func addConversionFuncs(scheme *runtime.Scheme) {
if err := scheme.AddFieldLabelConversionFunc("v1", "ServiceBroker",
oapi.GetFieldLabelConversionFunc(api.ServiceBrokerToSelectableFields(&api.ServiceBroker{}), nil),
); err != nil {
panic(err)
}
}
示例15: init
func init() {
if err := kapi.Scheme.AddFieldLabelConversionFunc("v1", "Group",
oapi.GetFieldLabelConversionFunc(api.GroupToSelectableFields(&api.Group{}), nil),
); err != nil {
panic(err)
}
if err := kapi.Scheme.AddFieldLabelConversionFunc("v1", "Identity",
oapi.GetFieldLabelConversionFunc(api.IdentityToSelectableFields(&api.Identity{}), nil),
); err != nil {
panic(err)
}
if err := kapi.Scheme.AddFieldLabelConversionFunc("v1", "User",
oapi.GetFieldLabelConversionFunc(api.UserToSelectableFields(&api.User{}), nil),
); err != nil {
panic(err)
}
}