From 021a6ebbe4621518041f324ee729d915d450cfb9 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sun, 29 Oct 2023 20:43:06 -0700 Subject: [PATCH] Fix registry credentials Signed-off-by: Tamal Saha --- apis/core/v1alpha1/openapi_generated.go | 36 +++++++++++++++-- apis/management/v1alpha1/openapi_generated.go | 36 +++++++++++++++-- apis/meta/v1alpha1/openapi_generated.go | 36 +++++++++++++++-- apis/shared/helm.go | 10 +++-- apis/shared/openapi_generated.go | 36 +++++++++++++++-- apis/shared/zz_generated.deepcopy.go | 40 ++++++++----------- apis/ui/v1alpha1/openapi_generated.go | 36 +++++++++++++++-- 7 files changed, 184 insertions(+), 46 deletions(-) diff --git a/apis/core/v1alpha1/openapi_generated.go b/apis/core/v1alpha1/openapi_generated.go index 37e35f2f2..2eb63ab9f 100644 --- a/apis/core/v1alpha1/openapi_generated.go +++ b/apis/core/v1alpha1/openapi_generated.go @@ -329,6 +329,7 @@ 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), @@ -16374,6 +16375,33 @@ 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{ @@ -16686,18 +16714,18 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_RegistryInfo(ref common.Re Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/resource-metadata/apis/shared.Credentials"), }, }, }, }, }, }, - Required: []string{"credentials"}, }, }, + 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 b0e0140c2..1cff521ba 100644 --- a/apis/management/v1alpha1/openapi_generated.go +++ b/apis/management/v1alpha1/openapi_generated.go @@ -309,6 +309,7 @@ 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), @@ -15125,6 +15126,33 @@ 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{ @@ -15437,18 +15465,18 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_RegistryInfo(ref common.Re Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/resource-metadata/apis/shared.Credentials"), }, }, }, }, }, }, - Required: []string{"credentials"}, }, }, + 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 429a3dc2c..6535d1ac2 100644 --- a/apis/meta/v1alpha1/openapi_generated.go +++ b/apis/meta/v1alpha1/openapi_generated.go @@ -394,6 +394,7 @@ 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), @@ -19094,6 +19095,33 @@ 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{ @@ -19406,18 +19434,18 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_RegistryInfo(ref common.Re Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/resource-metadata/apis/shared.Credentials"), }, }, }, }, }, }, - Required: []string{"credentials"}, }, }, + Dependencies: []string{ + "kmodules.xyz/resource-metadata/apis/shared.Credentials"}, } } diff --git a/apis/shared/helm.go b/apis/shared/helm.go index c594f11d2..6f24a1a29 100644 --- a/apis/shared/helm.go +++ b/apis/shared/helm.go @@ -55,10 +55,14 @@ type RegistryProxies struct { AppsCode string `json:"appscode"` } -type RepositoryCredential map[string]string - type RegistryInfo struct { - Credentials RepositoryCredential `json:"credentials"` + //+optional + Credentials map[string]Credentials `json:"credentials"` +} + +type Credentials struct { + Username string `json:"username"` + Password string `json:"password"` } type HelmInfo struct { diff --git a/apis/shared/openapi_generated.go b/apis/shared/openapi_generated.go index 2f1c8fccd..92edfac90 100644 --- a/apis/shared/openapi_generated.go +++ b/apis/shared/openapi_generated.go @@ -36,6 +36,7 @@ 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), @@ -329,6 +330,33 @@ 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{ @@ -641,18 +669,18 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_RegistryInfo(ref common.Re Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/resource-metadata/apis/shared.Credentials"), }, }, }, }, }, }, - Required: []string{"credentials"}, }, }, + 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 d44bb467d..9427b8a98 100644 --- a/apis/shared/zz_generated.deepcopy.go +++ b/apis/shared/zz_generated.deepcopy.go @@ -165,6 +165,22 @@ 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 @@ -369,7 +385,7 @@ func (in *RegistryInfo) DeepCopyInto(out *RegistryInfo) { *out = *in if in.Credentials != nil { in, out := &in.Credentials, &out.Credentials - *out = make(RepositoryCredential, len(*in)) + *out = make(map[string]Credentials, len(*in)) for key, val := range *in { (*out)[key] = val } @@ -403,28 +419,6 @@ func (in *RegistryProxies) DeepCopy() *RegistryProxies { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in RepositoryCredential) DeepCopyInto(out *RepositoryCredential) { - { - in := &in - *out = make(RepositoryCredential, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - return - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepositoryCredential. -func (in RepositoryCredential) DeepCopy() RepositoryCredential { - if in == nil { - return nil - } - out := new(RepositoryCredential) - in.DeepCopyInto(out) - return *out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceLocator) DeepCopyInto(out *ResourceLocator) { *out = *in diff --git a/apis/ui/v1alpha1/openapi_generated.go b/apis/ui/v1alpha1/openapi_generated.go index 57d24f982..2deb5f89b 100644 --- a/apis/ui/v1alpha1/openapi_generated.go +++ b/apis/ui/v1alpha1/openapi_generated.go @@ -303,6 +303,7 @@ 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), @@ -14885,6 +14886,33 @@ 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{ @@ -15197,18 +15225,18 @@ func schema_kmodulesxyz_resource_metadata_apis_shared_RegistryInfo(ref common.Re Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/resource-metadata/apis/shared.Credentials"), }, }, }, }, }, }, - Required: []string{"credentials"}, }, }, + Dependencies: []string{ + "kmodules.xyz/resource-metadata/apis/shared.Credentials"}, } }