From 783c2e28e36e4837751a19d4fb4d90f97dc6951f Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sun, 29 Oct 2023 21:28:24 -0700 Subject: [PATCH] Update reg credentails schema Signed-off-by: Tamal Saha --- apis/core/v1alpha1/openapi_generated.go | 43 +++++-------------- apis/management/v1alpha1/openapi_generated.go | 43 +++++-------------- apis/meta/v1alpha1/openapi_generated.go | 43 +++++-------------- apis/shared/helm.go | 7 +-- apis/shared/openapi_generated.go | 43 +++++-------------- apis/shared/zz_generated.deepcopy.go | 26 ++++------- apis/ui/v1alpha1/openapi_generated.go | 43 +++++-------------- 7 files changed, 64 insertions(+), 184 deletions(-) diff --git a/apis/core/v1alpha1/openapi_generated.go b/apis/core/v1alpha1/openapi_generated.go index 9f9d368e9..53024c318 100644 --- a/apis/core/v1alpha1/openapi_generated.go +++ b/apis/core/v1alpha1/openapi_generated.go @@ -329,7 +329,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/shared.ActionTemplate": schema_kmodulesxyz_resource_metadata_apis_shared_ActionTemplate(ref), "kmodules.xyz/resource-metadata/apis/shared.ActionTemplateGroup": schema_kmodulesxyz_resource_metadata_apis_shared_ActionTemplateGroup(ref), "kmodules.xyz/resource-metadata/apis/shared.BootstrapPresets": schema_kmodulesxyz_resource_metadata_apis_shared_BootstrapPresets(ref), - "kmodules.xyz/resource-metadata/apis/shared.Credentials": schema_kmodulesxyz_resource_metadata_apis_shared_Credentials(ref), "kmodules.xyz/resource-metadata/apis/shared.Dashboard": schema_kmodulesxyz_resource_metadata_apis_shared_Dashboard(ref), "kmodules.xyz/resource-metadata/apis/shared.DashboardVar": schema_kmodulesxyz_resource_metadata_apis_shared_DashboardVar(ref), "kmodules.xyz/resource-metadata/apis/shared.DeploymentParameters": schema_kmodulesxyz_resource_metadata_apis_shared_DeploymentParameters(ref), @@ -16375,33 +16374,6 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_BootstrapPresets(ref commo } } -func schema_kmodulesxyz_resource_metadata_apis_shared_Credentials(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "username": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "password": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"username", "password"}, - }, - }, - } -} - func schema_kmodulesxyz_resource_metadata_apis_shared_Dashboard(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -16709,15 +16681,22 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_RegistryInfo(ref common.Re Properties: map[string]spec.Schema{ "credentials": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/resource-metadata/apis/shared.Credentials"), + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, }, }, }, }, }, - Dependencies: []string{ - "kmodules.xyz/resource-metadata/apis/shared.Credentials"}, } } diff --git a/apis/management/v1alpha1/openapi_generated.go b/apis/management/v1alpha1/openapi_generated.go index 443ece9b1..77b6e1f46 100644 --- a/apis/management/v1alpha1/openapi_generated.go +++ b/apis/management/v1alpha1/openapi_generated.go @@ -309,7 +309,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/shared.ActionTemplate": schema_kmodulesxyz_resource_metadata_apis_shared_ActionTemplate(ref), "kmodules.xyz/resource-metadata/apis/shared.ActionTemplateGroup": schema_kmodulesxyz_resource_metadata_apis_shared_ActionTemplateGroup(ref), "kmodules.xyz/resource-metadata/apis/shared.BootstrapPresets": schema_kmodulesxyz_resource_metadata_apis_shared_BootstrapPresets(ref), - "kmodules.xyz/resource-metadata/apis/shared.Credentials": schema_kmodulesxyz_resource_metadata_apis_shared_Credentials(ref), "kmodules.xyz/resource-metadata/apis/shared.Dashboard": schema_kmodulesxyz_resource_metadata_apis_shared_Dashboard(ref), "kmodules.xyz/resource-metadata/apis/shared.DashboardVar": schema_kmodulesxyz_resource_metadata_apis_shared_DashboardVar(ref), "kmodules.xyz/resource-metadata/apis/shared.DeploymentParameters": schema_kmodulesxyz_resource_metadata_apis_shared_DeploymentParameters(ref), @@ -15126,33 +15125,6 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_BootstrapPresets(ref commo } } -func schema_kmodulesxyz_resource_metadata_apis_shared_Credentials(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "username": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "password": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"username", "password"}, - }, - }, - } -} - func schema_kmodulesxyz_resource_metadata_apis_shared_Dashboard(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -15460,15 +15432,22 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_RegistryInfo(ref common.Re Properties: map[string]spec.Schema{ "credentials": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/resource-metadata/apis/shared.Credentials"), + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, }, }, }, }, }, - Dependencies: []string{ - "kmodules.xyz/resource-metadata/apis/shared.Credentials"}, } } diff --git a/apis/meta/v1alpha1/openapi_generated.go b/apis/meta/v1alpha1/openapi_generated.go index b8a37d598..39e81689a 100644 --- a/apis/meta/v1alpha1/openapi_generated.go +++ b/apis/meta/v1alpha1/openapi_generated.go @@ -394,7 +394,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/shared.ActionTemplate": schema_kmodulesxyz_resource_metadata_apis_shared_ActionTemplate(ref), "kmodules.xyz/resource-metadata/apis/shared.ActionTemplateGroup": schema_kmodulesxyz_resource_metadata_apis_shared_ActionTemplateGroup(ref), "kmodules.xyz/resource-metadata/apis/shared.BootstrapPresets": schema_kmodulesxyz_resource_metadata_apis_shared_BootstrapPresets(ref), - "kmodules.xyz/resource-metadata/apis/shared.Credentials": schema_kmodulesxyz_resource_metadata_apis_shared_Credentials(ref), "kmodules.xyz/resource-metadata/apis/shared.Dashboard": schema_kmodulesxyz_resource_metadata_apis_shared_Dashboard(ref), "kmodules.xyz/resource-metadata/apis/shared.DashboardVar": schema_kmodulesxyz_resource_metadata_apis_shared_DashboardVar(ref), "kmodules.xyz/resource-metadata/apis/shared.DeploymentParameters": schema_kmodulesxyz_resource_metadata_apis_shared_DeploymentParameters(ref), @@ -19095,33 +19094,6 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_BootstrapPresets(ref commo } } -func schema_kmodulesxyz_resource_metadata_apis_shared_Credentials(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "username": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "password": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"username", "password"}, - }, - }, - } -} - func schema_kmodulesxyz_resource_metadata_apis_shared_Dashboard(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -19429,15 +19401,22 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_RegistryInfo(ref common.Re Properties: map[string]spec.Schema{ "credentials": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/resource-metadata/apis/shared.Credentials"), + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, }, }, }, }, }, - Dependencies: []string{ - "kmodules.xyz/resource-metadata/apis/shared.Credentials"}, } } diff --git a/apis/shared/helm.go b/apis/shared/helm.go index b94a22e61..eec83f543 100644 --- a/apis/shared/helm.go +++ b/apis/shared/helm.go @@ -57,12 +57,7 @@ type RegistryProxies struct { type RegistryInfo struct { //+optional - Credentials Credentials `json:"credentials"` -} - -type Credentials struct { - Username string `json:"username"` - Password string `json:"password"` + Credentials map[string]string `json:"credentials"` } type HelmInfo struct { diff --git a/apis/shared/openapi_generated.go b/apis/shared/openapi_generated.go index 9b5b02120..ad6f44c8f 100644 --- a/apis/shared/openapi_generated.go +++ b/apis/shared/openapi_generated.go @@ -36,7 +36,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/shared.ActionTemplate": schema_kmodulesxyz_resource_metadata_apis_shared_ActionTemplate(ref), "kmodules.xyz/resource-metadata/apis/shared.ActionTemplateGroup": schema_kmodulesxyz_resource_metadata_apis_shared_ActionTemplateGroup(ref), "kmodules.xyz/resource-metadata/apis/shared.BootstrapPresets": schema_kmodulesxyz_resource_metadata_apis_shared_BootstrapPresets(ref), - "kmodules.xyz/resource-metadata/apis/shared.Credentials": schema_kmodulesxyz_resource_metadata_apis_shared_Credentials(ref), "kmodules.xyz/resource-metadata/apis/shared.Dashboard": schema_kmodulesxyz_resource_metadata_apis_shared_Dashboard(ref), "kmodules.xyz/resource-metadata/apis/shared.DashboardVar": schema_kmodulesxyz_resource_metadata_apis_shared_DashboardVar(ref), "kmodules.xyz/resource-metadata/apis/shared.DeploymentParameters": schema_kmodulesxyz_resource_metadata_apis_shared_DeploymentParameters(ref), @@ -330,33 +329,6 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_BootstrapPresets(ref commo } } -func schema_kmodulesxyz_resource_metadata_apis_shared_Credentials(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "username": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "password": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"username", "password"}, - }, - }, - } -} - func schema_kmodulesxyz_resource_metadata_apis_shared_Dashboard(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -664,15 +636,22 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_RegistryInfo(ref common.Re Properties: map[string]spec.Schema{ "credentials": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/resource-metadata/apis/shared.Credentials"), + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, }, }, }, }, }, - Dependencies: []string{ - "kmodules.xyz/resource-metadata/apis/shared.Credentials"}, } } diff --git a/apis/shared/zz_generated.deepcopy.go b/apis/shared/zz_generated.deepcopy.go index 8e42d5a99..39939a078 100644 --- a/apis/shared/zz_generated.deepcopy.go +++ b/apis/shared/zz_generated.deepcopy.go @@ -150,7 +150,7 @@ func (in *ActionTemplateGroup) DeepCopy() *ActionTemplateGroup { func (in *BootstrapPresets) DeepCopyInto(out *BootstrapPresets) { *out = *in out.Image = in.Image - out.Registry = in.Registry + in.Registry.DeepCopyInto(&out.Registry) in.Helm.DeepCopyInto(&out.Helm) return } @@ -165,22 +165,6 @@ func (in *BootstrapPresets) DeepCopy() *BootstrapPresets { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Credentials) DeepCopyInto(out *Credentials) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Credentials. -func (in *Credentials) DeepCopy() *Credentials { - if in == nil { - return nil - } - out := new(Credentials) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Dashboard) DeepCopyInto(out *Dashboard) { *out = *in @@ -383,7 +367,13 @@ func (in *ImageRegistrySpec) DeepCopy() *ImageRegistrySpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RegistryInfo) DeepCopyInto(out *RegistryInfo) { *out = *in - out.Credentials = in.Credentials + if in.Credentials != nil { + in, out := &in.Credentials, &out.Credentials + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } return } diff --git a/apis/ui/v1alpha1/openapi_generated.go b/apis/ui/v1alpha1/openapi_generated.go index 9935252ce..8b2f975f4 100644 --- a/apis/ui/v1alpha1/openapi_generated.go +++ b/apis/ui/v1alpha1/openapi_generated.go @@ -303,7 +303,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/resource-metadata/apis/shared.ActionTemplate": schema_kmodulesxyz_resource_metadata_apis_shared_ActionTemplate(ref), "kmodules.xyz/resource-metadata/apis/shared.ActionTemplateGroup": schema_kmodulesxyz_resource_metadata_apis_shared_ActionTemplateGroup(ref), "kmodules.xyz/resource-metadata/apis/shared.BootstrapPresets": schema_kmodulesxyz_resource_metadata_apis_shared_BootstrapPresets(ref), - "kmodules.xyz/resource-metadata/apis/shared.Credentials": schema_kmodulesxyz_resource_metadata_apis_shared_Credentials(ref), "kmodules.xyz/resource-metadata/apis/shared.Dashboard": schema_kmodulesxyz_resource_metadata_apis_shared_Dashboard(ref), "kmodules.xyz/resource-metadata/apis/shared.DashboardVar": schema_kmodulesxyz_resource_metadata_apis_shared_DashboardVar(ref), "kmodules.xyz/resource-metadata/apis/shared.DeploymentParameters": schema_kmodulesxyz_resource_metadata_apis_shared_DeploymentParameters(ref), @@ -14886,33 +14885,6 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_BootstrapPresets(ref commo } } -func schema_kmodulesxyz_resource_metadata_apis_shared_Credentials(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "username": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "password": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"username", "password"}, - }, - }, - } -} - func schema_kmodulesxyz_resource_metadata_apis_shared_Dashboard(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -15220,15 +15192,22 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_RegistryInfo(ref common.Re Properties: map[string]spec.Schema{ "credentials": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("kmodules.xyz/resource-metadata/apis/shared.Credentials"), + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, }, }, }, }, }, - Dependencies: []string{ - "kmodules.xyz/resource-metadata/apis/shared.Credentials"}, } }