From 2369238f6dc443d674a3cea121b835bdb3bd92ec Mon Sep 17 00:00:00 2001 From: "Md. Istiak" Date: Wed, 1 Jul 2026 16:00:30 +0600 Subject: [PATCH] Add QdrantBinding Signed-off-by: Md. Istiak --- api/catalog/v1alpha1/crds.go | 4 + api/catalog/v1alpha1/generic_types.go | 9 + api/catalog/v1alpha1/openapi_generated.go | 98 ++++++ api/catalog/v1alpha1/qdrantbinding_types.go | 77 +++++ api/catalog/v1alpha1/zz_generated.deepcopy.go | 59 ++++ crds/catalog.appscode.com_qdrantbindings.yaml | 301 ++++++++++++++++++ 6 files changed, 548 insertions(+) create mode 100644 api/catalog/v1alpha1/qdrantbinding_types.go create mode 100644 crds/catalog.appscode.com_qdrantbindings.yaml diff --git a/api/catalog/v1alpha1/crds.go b/api/catalog/v1alpha1/crds.go index 2e940da6..a4526982 100644 --- a/api/catalog/v1alpha1/crds.go +++ b/api/catalog/v1alpha1/crds.go @@ -94,6 +94,10 @@ func (ProxySQLBinding) CustomResourceDefinition() *apiextensions.CustomResourceD return crds.MustCustomResourceDefinition(GroupVersion.WithResource(ResourceProxySQLBindings)) } +func (QdrantBinding) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { + return crds.MustCustomResourceDefinition(GroupVersion.WithResource(ResourceQdrantBindings)) +} + func (RabbitMQBinding) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(GroupVersion.WithResource(ResourceRabbitMQBindings)) } diff --git a/api/catalog/v1alpha1/generic_types.go b/api/catalog/v1alpha1/generic_types.go index 24ce469c..97476175 100644 --- a/api/catalog/v1alpha1/generic_types.go +++ b/api/catalog/v1alpha1/generic_types.go @@ -232,6 +232,15 @@ func (dst *GenericBinding) Duckify(srcRaw runtime.Object) error { dst.Spec.SourceRef = src.Spec.SourceRef dst.Status = src.Status return nil + case *QdrantBinding: + dst.TypeMeta = metav1.TypeMeta{ + APIVersion: GroupVersion.String(), + Kind: ResourceKindQdrantBinding, + } + dst.ObjectMeta = src.ObjectMeta + dst.Spec.SourceRef = src.Spec.SourceRef + dst.Status = src.Status + return nil case *RabbitMQBinding: dst.TypeMeta = metav1.TypeMeta{ APIVersion: GroupVersion.String(), diff --git a/api/catalog/v1alpha1/openapi_generated.go b/api/catalog/v1alpha1/openapi_generated.go index 2f153cf3..f8cf4456 100644 --- a/api/catalog/v1alpha1/openapi_generated.go +++ b/api/catalog/v1alpha1/openapi_generated.go @@ -75,6 +75,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "go.bytebuilders.dev/catalog/api/catalog/v1alpha1.PostgresBindingList": schema_catalog_api_catalog_v1alpha1_PostgresBindingList(ref), "go.bytebuilders.dev/catalog/api/catalog/v1alpha1.ProxySQLBinding": schema_catalog_api_catalog_v1alpha1_ProxySQLBinding(ref), "go.bytebuilders.dev/catalog/api/catalog/v1alpha1.ProxySQLBindingList": schema_catalog_api_catalog_v1alpha1_ProxySQLBindingList(ref), + "go.bytebuilders.dev/catalog/api/catalog/v1alpha1.QdrantBinding": schema_catalog_api_catalog_v1alpha1_QdrantBinding(ref), + "go.bytebuilders.dev/catalog/api/catalog/v1alpha1.QdrantBindingList": schema_catalog_api_catalog_v1alpha1_QdrantBindingList(ref), "go.bytebuilders.dev/catalog/api/catalog/v1alpha1.RabbitMQBinding": schema_catalog_api_catalog_v1alpha1_RabbitMQBinding(ref), "go.bytebuilders.dev/catalog/api/catalog/v1alpha1.RabbitMQBindingList": schema_catalog_api_catalog_v1alpha1_RabbitMQBindingList(ref), "go.bytebuilders.dev/catalog/api/catalog/v1alpha1.RedisBinding": schema_catalog_api_catalog_v1alpha1_RedisBinding(ref), @@ -2345,6 +2347,102 @@ func schema_catalog_api_catalog_v1alpha1_ProxySQLBindingList(ref common.Referenc } } +func schema_catalog_api_catalog_v1alpha1_QdrantBinding(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "QdrantBinding is the Schema for the qdrantbindings API", + 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("go.bytebuilders.dev/catalog/api/catalog/v1alpha1.BindingSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("go.bytebuilders.dev/catalog/api/catalog/v1alpha1.BindingStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "go.bytebuilders.dev/catalog/api/catalog/v1alpha1.BindingSpec", "go.bytebuilders.dev/catalog/api/catalog/v1alpha1.BindingStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_catalog_api_catalog_v1alpha1_QdrantBindingList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "QdrantBindingList contains a list of QdrantBinding", + 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("go.bytebuilders.dev/catalog/api/catalog/v1alpha1.QdrantBinding"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "go.bytebuilders.dev/catalog/api/catalog/v1alpha1.QdrantBinding", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + func schema_catalog_api_catalog_v1alpha1_RabbitMQBinding(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/api/catalog/v1alpha1/qdrantbinding_types.go b/api/catalog/v1alpha1/qdrantbinding_types.go new file mode 100644 index 00000000..709d1ae0 --- /dev/null +++ b/api/catalog/v1alpha1/qdrantbinding_types.go @@ -0,0 +1,77 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + kmapi "kmodules.xyz/client-go/api/v1" +) + +const ( + ResourceKindQdrantBinding = "QdrantBinding" + ResourceQdrantBinding = "qdrantbinding" + ResourceQdrantBindings = "qdrantbindings" +) + +// +kubebuilder:object:root=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:subresource:status +// +kubebuilder:resource:shortName=qdbinding,categories={binding,kubedb,appscode} +// +kubebuilder:printcolumn:name="Src_NS",type="string",JSONPath=".spec.sourceRef.namespace" +// +kubebuilder:printcolumn:name="Src_Name",type="string",JSONPath=".spec.sourceRef.name" +// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.phase" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" + +// QdrantBinding is the Schema for the qdrantbindings API +type QdrantBinding struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec BindingSpec `json:"spec,omitempty"` + Status BindingStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// QdrantBindingList contains a list of QdrantBinding +type QdrantBindingList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []QdrantBinding `json:"items"` +} + +func init() { + SchemeBuilder.Register(&QdrantBinding{}, &QdrantBindingList{}) +} + +var _ BindingInterface = &QdrantBinding{} + +func (in *QdrantBinding) GetSourceRef() kmapi.ObjectReference { + return in.Spec.SourceRef +} + +func (in *QdrantBinding) GetStatus() *BindingStatus { + return &in.Status +} + +func (in *QdrantBinding) GetConditions() kmapi.Conditions { + return in.Status.Conditions +} + +func (in *QdrantBinding) SetConditions(conditions kmapi.Conditions) { + in.Status.Conditions = conditions +} diff --git a/api/catalog/v1alpha1/zz_generated.deepcopy.go b/api/catalog/v1alpha1/zz_generated.deepcopy.go index 97cb8dbd..0d5e9937 100644 --- a/api/catalog/v1alpha1/zz_generated.deepcopy.go +++ b/api/catalog/v1alpha1/zz_generated.deepcopy.go @@ -1206,6 +1206,65 @@ func (in *ProxySQLBindingList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QdrantBinding) DeepCopyInto(out *QdrantBinding) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QdrantBinding. +func (in *QdrantBinding) DeepCopy() *QdrantBinding { + if in == nil { + return nil + } + out := new(QdrantBinding) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *QdrantBinding) 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 *QdrantBindingList) DeepCopyInto(out *QdrantBindingList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]QdrantBinding, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QdrantBindingList. +func (in *QdrantBindingList) DeepCopy() *QdrantBindingList { + if in == nil { + return nil + } + out := new(QdrantBindingList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *QdrantBindingList) 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 *RabbitMQBinding) DeepCopyInto(out *RabbitMQBinding) { *out = *in diff --git a/crds/catalog.appscode.com_qdrantbindings.yaml b/crds/catalog.appscode.com_qdrantbindings.yaml new file mode 100644 index 00000000..cc34169e --- /dev/null +++ b/crds/catalog.appscode.com_qdrantbindings.yaml @@ -0,0 +1,301 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + app.kubernetes.io/name: ace + kube-bind.appscode.com/exported: "true" + name: qdrantbindings.catalog.appscode.com +spec: + group: catalog.appscode.com + names: + categories: + - binding + - kubedb + - appscode + kind: QdrantBinding + listKind: QdrantBindingList + plural: qdrantbindings + shortNames: + - qdbinding + singular: qdrantbinding + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.sourceRef.namespace + name: Src_NS + type: string + - jsonPath: .spec.sourceRef.name + name: Src_Name + type: string + - jsonPath: .status.phase + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: QdrantBinding is the Schema for the qdrantbindings API + properties: + apiVersion: + 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 + kind: + 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 + metadata: + type: object + spec: + description: BindingSpec defines the desired state of Binding + properties: + sourceRef: + description: SourceRef refers to the source app instance. + properties: + name: + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + namespace: + description: |- + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + type: string + required: + - name + type: object + uiExposure: + description: UIExposure holds the specification of UI exposer + properties: + disableCostEfficiency: + type: boolean + disableUI: + type: boolean + required: + - disableCostEfficiency + - disableUI + type: object + required: + - sourceRef + type: object + status: + description: BindingStatus defines the observed state of App + properties: + conditions: + items: + description: Condition defines an observation of a object operational + state. + properties: + lastTransitionTime: + description: |- + Last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when + the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + A human-readable message indicating details about the transition. + This field may be empty. + type: string + observedGeneration: + description: |- + If set, this represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: |- + The reason for the condition's last transition in CamelCase. + The specific API may choose whether this field is considered a guaranteed API. + This field may not be empty. + type: string + severity: + description: |- + Severity provides an explicit classification of Reason code, so the users or machines can immediately + understand the current situation and act accordingly. + The Severity field MUST be set only when Status=False. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: |- + Type of condition in CamelCase or in foo.example.com/CamelCase. + Many .condition.type values are consistent across resources like Available, but because arbitrary util + can be useful (see .node.status.util), the ability to deconflict is important. + type: string + required: + - lastTransitionTime + - status + - type + type: object + maxItems: 12 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + gateway: + properties: + hostname: + type: string + ip: + type: string + name: + type: string + namespace: + type: string + services: + description: Services is an optional configuration for services + used to expose database + items: + properties: + alias: + description: Alias represents the identifier of the service. + type: string + ports: + items: + description: GatewayPort contains information on Gateway + service's port. + properties: + backendServicePort: + description: Number of the port to access the backend + service. + format: int32 + type: integer + name: + description: The name of this port within the gateway + service. + type: string + nodePort: + description: |- + The port on each node on which this gateway service is exposed when type is + NodePort or LoadBalancer. + format: int32 + type: integer + port: + description: The port that will be exposed by the + gateway service. + format: int32 + type: integer + required: + - port + type: object + type: array + required: + - alias + - ports + type: object + type: array + ui: + description: UI is an optional list of database web uis + items: + properties: + alias: + description: |- + Alias represents the identifier of the service. + This should match the db ui chart name + type: string + helmRelease: + description: |- + HelmRelease is the name of the helm release used to deploy this ui + The name format is typically - + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + port: + description: GatewayPort contains information on Gateway + service's port. + properties: + backendServicePort: + description: Number of the port to access the backend + service. + format: int32 + type: integer + name: + description: The name of this port within the gateway + service. + type: string + nodePort: + description: |- + The port on each node on which this gateway service is exposed when type is + NodePort or LoadBalancer. + format: int32 + type: integer + port: + description: The port that will be exposed by the gateway + service. + format: int32 + type: integer + required: + - port + type: object + url: + description: URL of the database ui + type: string + required: + - alias + - port + - url + type: object + type: array + required: + - name + - namespace + type: object + phase: + description: Specifies the current phase of the App + enum: + - Pending + - InProgress + - Terminating + - Current + - Failed + - Expired + type: string + secretRef: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + source: + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + type: object + served: true + storage: true + subresources: + status: {}