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

This commit is contained in:
Todd Treece
2024-08-14 08:17:05 +03:00
committed by GitHub
parent e90b272299
commit dacf11b048
36 changed files with 296 additions and 670 deletions
@@ -8,8 +8,11 @@ import (
v0alpha1 "github.com/grafana/grafana/pkg/apis/alerting_notifications/v0alpha1"
servicev0alpha1 "github.com/grafana/grafana/pkg/apis/service/v0alpha1"
alertingnotificationsv0alpha1 "github.com/grafana/grafana/pkg/generated/applyconfiguration/alerting_notifications/v0alpha1"
internal "github.com/grafana/grafana/pkg/generated/applyconfiguration/internal"
applyconfigurationservicev0alpha1 "github.com/grafana/grafana/pkg/generated/applyconfiguration/service/v0alpha1"
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
@@ -41,3 +44,7 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
}
return nil
}
func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter {
return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()}
}