diff --git a/go.mod b/go.mod index 8410991..dc3ca0b 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.5 require ( github.com/ghodss/yaml v1.0.0 github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 - github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17 + github.com/loft-sh/agentapi/v4 v4.1.0-alpha.19 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 diff --git a/go.sum b/go.sum index 7e4f65b..671fe03 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 h1:aqT1UeosCYB+3DEzfxW0evhcYHxhoBVAEWtkXLXFimI= github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= -github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17 h1:yoTwfLkurXmA7ENb8YWQePIVK42vZVSeV4unngNc8c8= -github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17/go.mod h1:CXweRDab9ZcSzcaitULFagYGgSzW8Q12W3cBdKMjR8k= +github.com/loft-sh/agentapi/v4 v4.1.0-alpha.19 h1:YoSavyYFrGN2diMO3qLLz89ufbeuiKaOADahBPgURGk= +github.com/loft-sh/agentapi/v4 v4.1.0-alpha.19/go.mod h1:CXweRDab9ZcSzcaitULFagYGgSzW8Q12W3cBdKMjR8k= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= diff --git a/pkg/apis/management/install/zz_generated.api.register.go b/pkg/apis/management/install/zz_generated.api.register.go index bbc8be2..6480568 100644 --- a/pkg/apis/management/install/zz_generated.api.register.go +++ b/pkg/apis/management/install/zz_generated.api.register.go @@ -136,6 +136,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &management.VirtualClusterInstance{}, &management.VirtualClusterInstanceList{}, &management.VirtualClusterAccessKey{}, + &management.VirtualClusterExternalDatabase{}, &management.VirtualClusterInstanceKubeConfig{}, &management.VirtualClusterInstanceLog{}, &management.VirtualClusterTemplate{}, diff --git a/pkg/apis/management/v1/virtualclusterinstance_externaldatabase_types.go b/pkg/apis/management/v1/virtualclusterinstance_externaldatabase_types.go new file mode 100644 index 0000000..1fd3701 --- /dev/null +++ b/pkg/apis/management/v1/virtualclusterinstance_externaldatabase_types.go @@ -0,0 +1,34 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VirtualClusterExternalDatabase holds kube config request and response data for virtual clusters +// +subresource-request +type VirtualClusterExternalDatabase struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VirtualClusterExternalDatabaseSpec `json:"spec,omitempty"` + Status VirtualClusterExternalDatabaseStatus `json:"status,omitempty"` +} + +type VirtualClusterExternalDatabaseSpec struct { + // Connector specifies the secret that should be used to connect to an external database server. The connection is + // used to manage a user and database for the vCluster. A data source endpoint constructed from the created user and + // database is returned on status. The secret specified by connector should contain the following fields: + // endpoint - the endpoint where the database server can be accessed + // user - the database username + // password - the password for the database username + // port - the port to be used in conjunction with the endpoint to connect to the databse server. This is commonly + // 3306 + // +optional + Connector string `json:"connector,omitempty"` +} + +type VirtualClusterExternalDatabaseStatus struct { + // DataSource holds a datasource endpoint constructed from the vCluster's designated user and database. The user and + // database are created from the given connector. + DataSource string `json:"dataSource,omitempty"` +} diff --git a/pkg/apis/management/v1/virtualclusterinstance_types.go b/pkg/apis/management/v1/virtualclusterinstance_types.go index 3dc28a2..c0b87f1 100644 --- a/pkg/apis/management/v1/virtualclusterinstance_types.go +++ b/pkg/apis/management/v1/virtualclusterinstance_types.go @@ -11,6 +11,7 @@ import ( // +genclient:noStatus // +genclient:method=GetKubeConfig,verb=create,subresource=kubeconfig,input=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig // +genclient:method=GetAccessKey,verb=get,subresource=accesskey,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterAccessKey +// +genclient:method=GetExternalDatabase,verb=create,subresource=externaldatabase,input=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // VirtualClusterInstance holds the VirtualClusterInstance information @@ -19,6 +20,7 @@ import ( // +subresource:request=VirtualClusterInstanceLog,path=log,kind=VirtualClusterInstanceLog,rest=VirtualClusterInstanceLogREST // +subresource:request=VirtualClusterInstanceKubeConfig,path=kubeconfig,kind=VirtualClusterInstanceKubeConfig,rest=VirtualClusterInstanceKubeConfigREST // +subresource:request=VirtualClusterAccessKey,path=accesskey,kind=VirtualClusterAccessKey,rest=VirtualClusterAccessKeyREST +// +subresource:request=VirtualClusterExternalDatabase,path=externaldatabase,kind=VirtualClusterExternalDatabase,rest=VirtualClusterExternalDatabaseREST type VirtualClusterInstance struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/management/v1/zz_generated.api.register.go b/pkg/apis/management/v1/zz_generated.api.register.go index 631c4d1..de25538 100644 --- a/pkg/apis/management/v1/zz_generated.api.register.go +++ b/pkg/apis/management/v1/zz_generated.api.register.go @@ -127,6 +127,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &VirtualClusterInstance{}, &VirtualClusterInstanceList{}, &VirtualClusterAccessKey{}, + &VirtualClusterExternalDatabase{}, &VirtualClusterInstanceKubeConfig{}, &VirtualClusterInstanceLog{}, &VirtualClusterTemplate{}, @@ -371,6 +372,11 @@ var ( func() runtime.Object { return &VirtualClusterAccessKey{} }, // Register versioned resource nil, management.NewVirtualClusterAccessKeyREST), + builders.NewApiResourceWithStorage( + management.InternalVirtualClusterExternalDatabaseREST, + func() runtime.Object { return &VirtualClusterExternalDatabase{} }, // Register versioned resource + nil, + management.NewVirtualClusterExternalDatabaseREST), builders.NewApiResourceWithStorage( management.InternalVirtualClusterInstanceKubeConfigREST, func() runtime.Object { return &VirtualClusterInstanceKubeConfig{} }, // Register versioned resource @@ -1015,6 +1021,14 @@ type VirtualClusterAccessKeyList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type VirtualClusterExternalDatabaseList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualClusterExternalDatabase `json:"items"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type VirtualClusterInstanceKubeConfigList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/management/v1/zz_generated.conversion.go b/pkg/apis/management/v1/zz_generated.conversion.go index 2812850..2677282 100644 --- a/pkg/apis/management/v1/zz_generated.conversion.go +++ b/pkg/apis/management/v1/zz_generated.conversion.go @@ -2659,6 +2659,46 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*VirtualClusterExternalDatabase)(nil), (*management.VirtualClusterExternalDatabase)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase(a.(*VirtualClusterExternalDatabase), b.(*management.VirtualClusterExternalDatabase), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.VirtualClusterExternalDatabase)(nil), (*VirtualClusterExternalDatabase)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase(a.(*management.VirtualClusterExternalDatabase), b.(*VirtualClusterExternalDatabase), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualClusterExternalDatabaseList)(nil), (*management.VirtualClusterExternalDatabaseList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList(a.(*VirtualClusterExternalDatabaseList), b.(*management.VirtualClusterExternalDatabaseList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.VirtualClusterExternalDatabaseList)(nil), (*VirtualClusterExternalDatabaseList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList(a.(*management.VirtualClusterExternalDatabaseList), b.(*VirtualClusterExternalDatabaseList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualClusterExternalDatabaseSpec)(nil), (*management.VirtualClusterExternalDatabaseSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(a.(*VirtualClusterExternalDatabaseSpec), b.(*management.VirtualClusterExternalDatabaseSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.VirtualClusterExternalDatabaseSpec)(nil), (*VirtualClusterExternalDatabaseSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(a.(*management.VirtualClusterExternalDatabaseSpec), b.(*VirtualClusterExternalDatabaseSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualClusterExternalDatabaseStatus)(nil), (*management.VirtualClusterExternalDatabaseStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(a.(*VirtualClusterExternalDatabaseStatus), b.(*management.VirtualClusterExternalDatabaseStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.VirtualClusterExternalDatabaseStatus)(nil), (*VirtualClusterExternalDatabaseStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(a.(*management.VirtualClusterExternalDatabaseStatus), b.(*VirtualClusterExternalDatabaseStatus), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*VirtualClusterInstance)(nil), (*management.VirtualClusterInstance)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_VirtualClusterInstance_To_management_VirtualClusterInstance(a.(*VirtualClusterInstance), b.(*management.VirtualClusterInstance), scope) }); err != nil { @@ -9532,6 +9572,100 @@ func Convert_management_VirtualClusterAccessKeyList_To_v1_VirtualClusterAccessKe return autoConvert_management_VirtualClusterAccessKeyList_To_v1_VirtualClusterAccessKeyList(in, out, s) } +func autoConvert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase(in *VirtualClusterExternalDatabase, out *management.VirtualClusterExternalDatabase, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase is an autogenerated conversion function. +func Convert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase(in *VirtualClusterExternalDatabase, out *management.VirtualClusterExternalDatabase, s conversion.Scope) error { + return autoConvert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase(in, out, s) +} + +func autoConvert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase(in *management.VirtualClusterExternalDatabase, out *VirtualClusterExternalDatabase, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase is an autogenerated conversion function. +func Convert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase(in *management.VirtualClusterExternalDatabase, out *VirtualClusterExternalDatabase, s conversion.Scope) error { + return autoConvert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase(in, out, s) +} + +func autoConvert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList(in *VirtualClusterExternalDatabaseList, out *management.VirtualClusterExternalDatabaseList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]management.VirtualClusterExternalDatabase)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList is an autogenerated conversion function. +func Convert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList(in *VirtualClusterExternalDatabaseList, out *management.VirtualClusterExternalDatabaseList, s conversion.Scope) error { + return autoConvert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList(in, out, s) +} + +func autoConvert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList(in *management.VirtualClusterExternalDatabaseList, out *VirtualClusterExternalDatabaseList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]VirtualClusterExternalDatabase)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList is an autogenerated conversion function. +func Convert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList(in *management.VirtualClusterExternalDatabaseList, out *VirtualClusterExternalDatabaseList, s conversion.Scope) error { + return autoConvert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList(in, out, s) +} + +func autoConvert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(in *VirtualClusterExternalDatabaseSpec, out *management.VirtualClusterExternalDatabaseSpec, s conversion.Scope) error { + out.Connector = in.Connector + return nil +} + +// Convert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec is an autogenerated conversion function. +func Convert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(in *VirtualClusterExternalDatabaseSpec, out *management.VirtualClusterExternalDatabaseSpec, s conversion.Scope) error { + return autoConvert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(in, out, s) +} + +func autoConvert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(in *management.VirtualClusterExternalDatabaseSpec, out *VirtualClusterExternalDatabaseSpec, s conversion.Scope) error { + out.Connector = in.Connector + return nil +} + +// Convert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec is an autogenerated conversion function. +func Convert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(in *management.VirtualClusterExternalDatabaseSpec, out *VirtualClusterExternalDatabaseSpec, s conversion.Scope) error { + return autoConvert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(in, out, s) +} + +func autoConvert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(in *VirtualClusterExternalDatabaseStatus, out *management.VirtualClusterExternalDatabaseStatus, s conversion.Scope) error { + out.DataSource = in.DataSource + return nil +} + +// Convert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus is an autogenerated conversion function. +func Convert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(in *VirtualClusterExternalDatabaseStatus, out *management.VirtualClusterExternalDatabaseStatus, s conversion.Scope) error { + return autoConvert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(in, out, s) +} + +func autoConvert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(in *management.VirtualClusterExternalDatabaseStatus, out *VirtualClusterExternalDatabaseStatus, s conversion.Scope) error { + out.DataSource = in.DataSource + return nil +} + +// Convert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus is an autogenerated conversion function. +func Convert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(in *management.VirtualClusterExternalDatabaseStatus, out *VirtualClusterExternalDatabaseStatus, s conversion.Scope) error { + return autoConvert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(in, out, s) +} + func autoConvert_v1_VirtualClusterInstance_To_management_VirtualClusterInstance(in *VirtualClusterInstance, out *management.VirtualClusterInstance, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1_VirtualClusterInstanceSpec_To_management_VirtualClusterInstanceSpec(&in.Spec, &out.Spec, s); err != nil { diff --git a/pkg/apis/management/v1/zz_generated.deepcopy.go b/pkg/apis/management/v1/zz_generated.deepcopy.go index 0dbb4fb..d1b05f3 100644 --- a/pkg/apis/management/v1/zz_generated.deepcopy.go +++ b/pkg/apis/management/v1/zz_generated.deepcopy.go @@ -7106,6 +7106,99 @@ func (in *VirtualClusterAccessKeyList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabase) DeepCopyInto(out *VirtualClusterExternalDatabase) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabase. +func (in *VirtualClusterExternalDatabase) DeepCopy() *VirtualClusterExternalDatabase { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabase) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualClusterExternalDatabase) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseList) DeepCopyInto(out *VirtualClusterExternalDatabaseList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualClusterExternalDatabase, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseList. +func (in *VirtualClusterExternalDatabaseList) DeepCopy() *VirtualClusterExternalDatabaseList { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualClusterExternalDatabaseList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseSpec) DeepCopyInto(out *VirtualClusterExternalDatabaseSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseSpec. +func (in *VirtualClusterExternalDatabaseSpec) DeepCopy() *VirtualClusterExternalDatabaseSpec { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseStatus) DeepCopyInto(out *VirtualClusterExternalDatabaseStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseStatus. +func (in *VirtualClusterExternalDatabaseStatus) DeepCopy() *VirtualClusterExternalDatabaseStatus { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualClusterInstance) DeepCopyInto(out *VirtualClusterInstance) { *out = *in diff --git a/pkg/apis/management/zz_generated.api.register.go b/pkg/apis/management/zz_generated.api.register.go index 15c51fd..4c757f5 100644 --- a/pkg/apis/management/zz_generated.api.register.go +++ b/pkg/apis/management/zz_generated.api.register.go @@ -1194,7 +1194,15 @@ var ( NewVirtualClusterAccessKeyREST = func(getter generic.RESTOptionsGetter) rest.Storage { return NewVirtualClusterAccessKeyRESTFunc(Factory) } - NewVirtualClusterAccessKeyRESTFunc NewRESTFunc + NewVirtualClusterAccessKeyRESTFunc NewRESTFunc + InternalVirtualClusterExternalDatabaseREST = builders.NewInternalSubresource( + "virtualclusterinstances", "VirtualClusterExternalDatabase", "externaldatabase", + func() runtime.Object { return &VirtualClusterExternalDatabase{} }, + ) + NewVirtualClusterExternalDatabaseREST = func(getter generic.RESTOptionsGetter) rest.Storage { + return NewVirtualClusterExternalDatabaseRESTFunc(Factory) + } + NewVirtualClusterExternalDatabaseRESTFunc NewRESTFunc InternalVirtualClusterInstanceKubeConfigREST = builders.NewInternalSubresource( "virtualclusterinstances", "VirtualClusterInstanceKubeConfig", "kubeconfig", func() runtime.Object { return &VirtualClusterInstanceKubeConfig{} }, @@ -1339,6 +1347,7 @@ var ( InternalVirtualClusterInstance, InternalVirtualClusterInstanceStatus, InternalVirtualClusterAccessKeyREST, + InternalVirtualClusterExternalDatabaseREST, InternalVirtualClusterInstanceKubeConfigREST, InternalVirtualClusterInstanceLogREST, InternalVirtualClusterTemplate, @@ -2729,6 +2738,23 @@ type VirtualClusterAccessKey struct { AccessKey string `json:"accessKey,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type VirtualClusterExternalDatabase struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec VirtualClusterExternalDatabaseSpec `json:"spec,omitempty"` + Status VirtualClusterExternalDatabaseStatus `json:"status,omitempty"` +} + +type VirtualClusterExternalDatabaseSpec struct { + Connector string `json:"connector,omitempty"` +} + +type VirtualClusterExternalDatabaseStatus struct { + DataSource string `json:"dataSource,omitempty"` +} + // +genclient // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -7628,6 +7654,14 @@ type VirtualClusterAccessKeyList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type VirtualClusterExternalDatabaseList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualClusterExternalDatabase `json:"items"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type VirtualClusterInstanceKubeConfigList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/management/zz_generated.deepcopy.go b/pkg/apis/management/zz_generated.deepcopy.go index a6d83fc..2dd0f50 100644 --- a/pkg/apis/management/zz_generated.deepcopy.go +++ b/pkg/apis/management/zz_generated.deepcopy.go @@ -7049,6 +7049,99 @@ func (in *VirtualClusterAccessKeyList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabase) DeepCopyInto(out *VirtualClusterExternalDatabase) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabase. +func (in *VirtualClusterExternalDatabase) DeepCopy() *VirtualClusterExternalDatabase { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabase) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualClusterExternalDatabase) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseList) DeepCopyInto(out *VirtualClusterExternalDatabaseList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualClusterExternalDatabase, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseList. +func (in *VirtualClusterExternalDatabaseList) DeepCopy() *VirtualClusterExternalDatabaseList { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualClusterExternalDatabaseList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseSpec) DeepCopyInto(out *VirtualClusterExternalDatabaseSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseSpec. +func (in *VirtualClusterExternalDatabaseSpec) DeepCopy() *VirtualClusterExternalDatabaseSpec { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseStatus) DeepCopyInto(out *VirtualClusterExternalDatabaseStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseStatus. +func (in *VirtualClusterExternalDatabaseStatus) DeepCopy() *VirtualClusterExternalDatabaseStatus { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualClusterInstance) DeepCopyInto(out *VirtualClusterInstance) { *out = *in diff --git a/pkg/apis/ui/v1/ui_types.go b/pkg/apis/ui/v1/ui_types.go index b5cd94b..91c2f8b 100644 --- a/pkg/apis/ui/v1/ui_types.go +++ b/pkg/apis/ui/v1/ui_types.go @@ -34,11 +34,16 @@ type UISettingsSpec struct { // +optional Offline bool `json:"offline,omitempty"` - // HasHelmRelease indicates whether loft has been installed via Helm + // HasHelmRelease indicates whether the vCluster Platform instance + // has been installed via Helm HasHelmRelease bool `json:"hasHelmRelease,omitempty"` // DefaultVClusterVersion is the default version of vClusters DefaultVClusterVersion string `json:"defaultVClusterVersion,omitempty"` + + // LoftHosted indicates whether the vCluster Platform instance + // is hosted and operated by Loft Labs Inc. + LoftHosted bool `json:"loftHosted,omitempty"` } type UISettingsConfig struct { diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go index 56239ae..f2b5c3e 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go @@ -140,3 +140,15 @@ func (c *FakeVirtualClusterInstances) GetAccessKey(ctx context.Context, virtualC } return obj.(*v1.VirtualClusterAccessKey), err } + +// GetExternalDatabase takes the representation of a virtualClusterExternalDatabase and creates it. Returns the server's representation of the virtualClusterExternalDatabase, and an error, if there is any. +func (c *FakeVirtualClusterInstances) GetExternalDatabase(ctx context.Context, virtualClusterInstanceName string, virtualClusterExternalDatabase *v1.VirtualClusterExternalDatabase, opts metav1.CreateOptions) (result *v1.VirtualClusterExternalDatabase, err error) { + emptyResult := &v1.VirtualClusterExternalDatabase{} + obj, err := c.Fake. + Invokes(testing.NewCreateSubresourceActionWithOptions(virtualclusterinstancesResource, virtualClusterInstanceName, "externaldatabase", c.ns, virtualClusterExternalDatabase, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1.VirtualClusterExternalDatabase), err +} diff --git a/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go b/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go index e8fef8a..cc7cf23 100644 --- a/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go @@ -31,6 +31,7 @@ type VirtualClusterInstanceInterface interface { Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualClusterInstance, err error) GetKubeConfig(ctx context.Context, virtualClusterInstanceName string, virtualClusterInstanceKubeConfig *v1.VirtualClusterInstanceKubeConfig, opts metav1.CreateOptions) (*v1.VirtualClusterInstanceKubeConfig, error) GetAccessKey(ctx context.Context, virtualClusterInstanceName string, options metav1.GetOptions) (*v1.VirtualClusterAccessKey, error) + GetExternalDatabase(ctx context.Context, virtualClusterInstanceName string, virtualClusterExternalDatabase *v1.VirtualClusterExternalDatabase, opts metav1.CreateOptions) (*v1.VirtualClusterExternalDatabase, error) VirtualClusterInstanceExpansion } @@ -81,3 +82,18 @@ func (c *virtualClusterInstances) GetAccessKey(ctx context.Context, virtualClust Into(result) return } + +// GetExternalDatabase takes the representation of a virtualClusterExternalDatabase and creates it. Returns the server's representation of the virtualClusterExternalDatabase, and an error, if there is any. +func (c *virtualClusterInstances) GetExternalDatabase(ctx context.Context, virtualClusterInstanceName string, virtualClusterExternalDatabase *v1.VirtualClusterExternalDatabase, opts metav1.CreateOptions) (result *v1.VirtualClusterExternalDatabase, err error) { + result = &v1.VirtualClusterExternalDatabase{} + err = c.GetClient().Post(). + Namespace(c.GetNamespace()). + Resource("virtualclusterinstances"). + Name(virtualClusterInstanceName). + SubResource("externaldatabase"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualClusterExternalDatabase). + Do(ctx). + Into(result) + return +} diff --git a/pkg/openapi/zz_generated.openapi.go b/pkg/openapi/zz_generated.openapi.go index a60f689..2530d09 100644 --- a/pkg/openapi/zz_generated.openapi.go +++ b/pkg/openapi/zz_generated.openapi.go @@ -342,6 +342,10 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.UserVirtualClustersOptions": schema_pkg_apis_management_v1_UserVirtualClustersOptions(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterAccessKey": schema_pkg_apis_management_v1_VirtualClusterAccessKey(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterAccessKeyList": schema_pkg_apis_management_v1_VirtualClusterAccessKeyList(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase": schema_pkg_apis_management_v1_VirtualClusterExternalDatabase(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseList": schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseList(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseSpec": schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseSpec(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseStatus": schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstance": schema_pkg_apis_management_v1_VirtualClusterInstance(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig": schema_pkg_apis_management_v1_VirtualClusterInstanceKubeConfig(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfigList": schema_pkg_apis_management_v1_VirtualClusterInstanceKubeConfigList(ref), @@ -17712,6 +17716,139 @@ func schema_pkg_apis_management_v1_VirtualClusterAccessKeyList(ref common.Refere } } +func schema_pkg_apis_management_v1_VirtualClusterExternalDatabase(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VirtualClusterExternalDatabase holds kube config request and response data for virtual clusters", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "connector": { + SchemaProps: spec.SchemaProps{ + Description: "Connector specifies the secret that should be used to connect to an external database server. The connection is used to manage a user and database for the vCluster. A data source endpoint constructed from the created user and database is returned on status. The secret specified by connector should contain the following fields: endpoint - the endpoint where the database server can be accessed user - the database username password - the password for the database username port - the port to be used in conjunction with the endpoint to connect to the databse server. This is commonly 3306", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "dataSource": { + SchemaProps: spec.SchemaProps{ + Description: "DataSource holds a datasource endpoint constructed from the vCluster's designated user and database. The user and database are created from the given connector.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_pkg_apis_management_v1_VirtualClusterInstance(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -28483,7 +28620,7 @@ func schema_pkg_apis_ui_v1_UISettingsSpec(ref common.ReferenceCallback) common.O }, "hasHelmRelease": { SchemaProps: spec.SchemaProps{ - Description: "HasHelmRelease indicates whether loft has been installed via Helm", + Description: "HasHelmRelease indicates whether the vCluster Platform instance has been installed via Helm", Type: []string{"boolean"}, Format: "", }, @@ -28495,6 +28632,13 @@ func schema_pkg_apis_ui_v1_UISettingsSpec(ref common.ReferenceCallback) common.O Format: "", }, }, + "loftHosted": { + SchemaProps: spec.SchemaProps{ + Description: "LoftHosted indicates whether the vCluster Platform instance is hosted and operated by Loft Labs Inc.", + Type: []string{"boolean"}, + Format: "", + }, + }, }, }, }, @@ -29239,10 +29383,9 @@ func schema_k8sio_api_admissionregistration_v1_NamedRuleWithOperations(ref commo }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", Type: []string{"string"}, Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -29404,10 +29547,9 @@ func schema_k8sio_api_admissionregistration_v1_Rule(ref common.ReferenceCallback }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", Type: []string{"string"}, Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -29506,10 +29648,9 @@ func schema_k8sio_api_admissionregistration_v1_RuleWithOperations(ref common.Ref }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", Type: []string{"string"}, Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -30907,10 +31048,9 @@ func schema_k8sio_api_admissionregistration_v1beta1_NamedRuleWithOperations(ref }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", Type: []string{"string"}, Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, },