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
@@ -10,7 +10,7 @@ import (
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// DataPlaneServiceApplyConfiguration represents an declarative configuration of the DataPlaneService type for use
// DataPlaneServiceApplyConfiguration represents a declarative configuration of the DataPlaneService type for use
// with apply.
type DataPlaneServiceApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
@@ -19,7 +19,7 @@ type DataPlaneServiceApplyConfiguration struct {
Status *DataPlaneServiceStatusApplyConfiguration `json:"status,omitempty"`
}
// DataPlaneService constructs an declarative configuration of the DataPlaneService type for use with
// DataPlaneService constructs a declarative configuration of the DataPlaneService type for use with
// apply.
func DataPlaneService(name string) *DataPlaneServiceApplyConfiguration {
b := &DataPlaneServiceApplyConfiguration{}
@@ -202,3 +202,9 @@ func (b *DataPlaneServiceApplyConfiguration) WithStatus(value *DataPlaneServiceS
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *DataPlaneServiceApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.Name
}
@@ -9,7 +9,7 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// DataPlaneServiceConditionApplyConfiguration represents an declarative configuration of the DataPlaneServiceCondition type for use
// DataPlaneServiceConditionApplyConfiguration represents a declarative configuration of the DataPlaneServiceCondition type for use
// with apply.
type DataPlaneServiceConditionApplyConfiguration struct {
Type *v0alpha1.DataPlaneServiceConditionType `json:"type,omitempty"`
@@ -19,7 +19,7 @@ type DataPlaneServiceConditionApplyConfiguration struct {
Message *string `json:"message,omitempty"`
}
// DataPlaneServiceConditionApplyConfiguration constructs an declarative configuration of the DataPlaneServiceCondition type for use with
// DataPlaneServiceConditionApplyConfiguration constructs a declarative configuration of the DataPlaneServiceCondition type for use with
// apply.
func DataPlaneServiceCondition() *DataPlaneServiceConditionApplyConfiguration {
return &DataPlaneServiceConditionApplyConfiguration{}
@@ -8,7 +8,7 @@ import (
v0alpha1 "github.com/grafana/grafana/pkg/aggregator/apis/aggregation/v0alpha1"
)
// DataPlaneServiceSpecApplyConfiguration represents an declarative configuration of the DataPlaneServiceSpec type for use
// DataPlaneServiceSpecApplyConfiguration represents a declarative configuration of the DataPlaneServiceSpec type for use
// with apply.
type DataPlaneServiceSpecApplyConfiguration struct {
PluginID *string `json:"pluginID,omitempty"`
@@ -18,7 +18,7 @@ type DataPlaneServiceSpecApplyConfiguration struct {
Services []ServiceApplyConfiguration `json:"services,omitempty"`
}
// DataPlaneServiceSpecApplyConfiguration constructs an declarative configuration of the DataPlaneServiceSpec type for use with
// DataPlaneServiceSpecApplyConfiguration constructs a declarative configuration of the DataPlaneServiceSpec type for use with
// apply.
func DataPlaneServiceSpec() *DataPlaneServiceSpecApplyConfiguration {
return &DataPlaneServiceSpecApplyConfiguration{}
@@ -4,13 +4,13 @@
package v0alpha1
// DataPlaneServiceStatusApplyConfiguration represents an declarative configuration of the DataPlaneServiceStatus type for use
// DataPlaneServiceStatusApplyConfiguration represents a declarative configuration of the DataPlaneServiceStatus type for use
// with apply.
type DataPlaneServiceStatusApplyConfiguration struct {
Conditions []DataPlaneServiceConditionApplyConfiguration `json:"conditions,omitempty"`
}
// DataPlaneServiceStatusApplyConfiguration constructs an declarative configuration of the DataPlaneServiceStatus type for use with
// DataPlaneServiceStatusApplyConfiguration constructs a declarative configuration of the DataPlaneServiceStatus type for use with
// apply.
func DataPlaneServiceStatus() *DataPlaneServiceStatusApplyConfiguration {
return &DataPlaneServiceStatusApplyConfiguration{}
@@ -8,7 +8,7 @@ import (
v0alpha1 "github.com/grafana/grafana/pkg/aggregator/apis/aggregation/v0alpha1"
)
// ServiceApplyConfiguration represents an declarative configuration of the Service type for use
// ServiceApplyConfiguration represents a declarative configuration of the Service type for use
// with apply.
type ServiceApplyConfiguration struct {
Type *v0alpha1.ServiceType `json:"type,omitempty"`
@@ -16,7 +16,7 @@ type ServiceApplyConfiguration struct {
Path *string `json:"path,omitempty"`
}
// ServiceApplyConfiguration constructs an declarative configuration of the Service type for use with
// ServiceApplyConfiguration constructs a declarative configuration of the Service type for use with
// apply.
func Service() *ServiceApplyConfiguration {
return &ServiceApplyConfiguration{}
@@ -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()}
}