K8s: Fix hack/update-codegen (#91867)

This commit is contained in:
Todd Treece
2024-08-14 01:17:05 -04:00
committed by GitHub
parent e90b272299
commit dacf11b048
36 changed files with 296 additions and 670 deletions

View File

@ -7,7 +7,10 @@ package applyconfiguration
import (
v0alpha1 "github.com/grafana/grafana/pkg/aggregator/apis/aggregation/v0alpha1"
aggregationv0alpha1 "github.com/grafana/grafana/pkg/aggregator/generated/applyconfiguration/aggregation/v0alpha1"
internal "github.com/grafana/grafana/pkg/aggregator/generated/applyconfiguration/internal"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
testing "k8s.io/client-go/testing"
)
// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no
@ -29,3 +32,7 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
}
return nil
}
func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter {
return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()}
}