From 7707313c6869cc50c20d2ec786cfc8992038e0f9 Mon Sep 17 00:00:00 2001 From: Georgi Chulkov Date: Thu, 11 Apr 2024 08:03:08 +0200 Subject: [PATCH] Fix applyconfiguration (#310) --- api/ipam/v1alpha1/ipaddr_types.go | 8 ++++++++ clientgo/applyconfiguration/internal/internal.go | 12 +----------- clientgo/openapi/zz_generated.openapi.go | 4 +++- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/api/ipam/v1alpha1/ipaddr_types.go b/api/ipam/v1alpha1/ipaddr_types.go index 27cc429..642d6ff 100644 --- a/api/ipam/v1alpha1/ipaddr_types.go +++ b/api/ipam/v1alpha1/ipaddr_types.go @@ -65,3 +65,11 @@ func (in *IPAddr) DeepCopyInto(out *IPAddr) { out.Net = in.Net } } + +// OpenAPISchemaType is used by the kube-openapi generator when constructing +// the OpenAPI spec of this type. +func (_ IPAddr) OpenAPISchemaType() []string { return []string{"string"} } + +// OpenAPISchemaFormat is used by the kube-openapi generator when constructing +// the OpenAPI spec of this type. +func (_ IPAddr) OpenAPISchemaFormat() string { return "" } diff --git a/clientgo/applyconfiguration/internal/internal.go b/clientgo/applyconfiguration/internal/internal.go index e3913a0..3e7f286 100644 --- a/clientgo/applyconfiguration/internal/internal.go +++ b/clientgo/applyconfiguration/internal/internal.go @@ -60,17 +60,7 @@ var schemaYAML = typed.YAMLObject(`types: namedType: com.github.ironcore-dev.ipam.api.ipam.v1alpha1.IPStatus default: {} - name: com.github.ironcore-dev.ipam.api.ipam.v1alpha1.IPAddr - map: - elementType: - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_deduced_ - elementRelationship: separable + scalar: string - name: com.github.ironcore-dev.ipam.api.ipam.v1alpha1.IPSpec map: fields: diff --git a/clientgo/openapi/zz_generated.openapi.go b/clientgo/openapi/zz_generated.openapi.go index e414b2c..f69c52b 100644 --- a/clientgo/openapi/zz_generated.openapi.go +++ b/clientgo/openapi/zz_generated.openapi.go @@ -11,6 +11,7 @@ package openapi import ( + v1alpha1 "github.com/ironcore-dev/ipam/api/ipam/v1alpha1" resource "k8s.io/apimachinery/pkg/api/resource" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" common "k8s.io/kube-openapi/pkg/common" @@ -380,7 +381,8 @@ func schema_ipam_api_ipam_v1alpha1_IPAddr(ref common.ReferenceCallback) common.O return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Type: v1alpha1.IPAddr{}.OpenAPISchemaType(), + Format: v1alpha1.IPAddr{}.OpenAPISchemaFormat(), }, }, }