Skip to content

Commit e73f8f6

Browse files
Fix es client generation from kubedb/ui-server
Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
1 parent 7b20b24 commit e73f8f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

elasticsearch/kubedb_client_builder.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import (
4545
osapiv2 "github.com/opensearch-project/opensearch-go/v2/opensearchapi"
4646
"github.com/pkg/errors"
4747
core "k8s.io/api/core/v1"
48+
"k8s.io/apimachinery/pkg/runtime/schema"
4849
"k8s.io/klog/v2"
4950
"sigs.k8s.io/controller-runtime/pkg/client"
5051
)
@@ -91,6 +92,11 @@ func (o *KubeDBClientBuilder) GetElasticClient() (*Client, error) {
9192
}
9293

9394
var esVersion catalog.ElasticsearchVersion
95+
esVersion.SetGroupVersionKind(schema.GroupVersionKind{
96+
Group: catalog.SchemeGroupVersion.Group,
97+
Version: catalog.SchemeGroupVersion.Version,
98+
Kind: catalog.ResourceKindElasticsearchVersion,
99+
})
94100
err := o.kc.Get(o.ctx, client.ObjectKey{Namespace: o.db.Namespace, Name: o.db.Spec.Version}, &esVersion)
95101
if err != nil {
96102
return nil, errors.Errorf("Failed to get elasticsearchVersion with %s", err)

0 commit comments

Comments
 (0)