grafana/pkg/aggregator/generated/applyconfiguration/utils.go

39 lines
1.6 KiB
Go
Raw Normal View History

2024-08-13 14:28:17 -05:00
// SPDX-License-Identifier: AGPL-3.0-only
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package applyconfiguration
import (
v0alpha1 "github.com/grafana/grafana/pkg/aggregator/apis/aggregation/v0alpha1"
aggregationv0alpha1 "github.com/grafana/grafana/pkg/aggregator/generated/applyconfiguration/aggregation/v0alpha1"
2024-08-14 00:17:05 -05:00
internal "github.com/grafana/grafana/pkg/aggregator/generated/applyconfiguration/internal"
runtime "k8s.io/apimachinery/pkg/runtime"
2024-08-13 14:28:17 -05:00
schema "k8s.io/apimachinery/pkg/runtime/schema"
2024-08-14 00:17:05 -05:00
testing "k8s.io/client-go/testing"
2024-08-13 14:28:17 -05:00
)
// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no
// apply configuration type exists for the given GroupVersionKind.
func ForKind(kind schema.GroupVersionKind) interface{} {
switch kind {
// Group=aggregation.grafana.app, Version=v0alpha1
case v0alpha1.SchemeGroupVersion.WithKind("DataPlaneService"):
return &aggregationv0alpha1.DataPlaneServiceApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("DataPlaneServiceCondition"):
return &aggregationv0alpha1.DataPlaneServiceConditionApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("DataPlaneServiceSpec"):
return &aggregationv0alpha1.DataPlaneServiceSpecApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("DataPlaneServiceStatus"):
return &aggregationv0alpha1.DataPlaneServiceStatusApplyConfiguration{}
case v0alpha1.SchemeGroupVersion.WithKind("Service"):
return &aggregationv0alpha1.ServiceApplyConfiguration{}
}
return nil
}
2024-08-14 00:17:05 -05:00
func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter {
return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()}
}