Skip to content

Unable to create OpenSearchISMPolicy with allocation #876

@vinodhreddyg

Description

@vinodhreddyg

What is the bug?

Unable to create OpenSearchISMPolicy with allocation and its childs

 - allocation:
      exclude: hot
      include: warm
      require: warm
      waitFor: "false"

Opensearch rest API is expecting it as an object for require but in the CRD it is expecting string

CRD ref https://github.com/opensearch-project/opensearch-k8s-operator/blob/main/charts/opensearch-operator/files/opensearch.opster.io_opensearchismpolicies.yaml#L191

How can one reproduce the bug?

Create OpenSearchISMPolicy CR with allocation and its child

What is the expected behavior?

Create OpenSearchISMPolicy without any errors

Operator logs

{"level":"error","ts":"2024-10-04T20:10:53.651Z","msg":"failed to create ism policy","controller":"opensearchismpolicy","controllerGroup":"opensearch.opster.io","controllerKind":"OpenSearchISMPolicy","OpenSearchISMPolicy":{"name":"default-ism-policy","namespace":"sbospe-vg-os3"},"namespace":"sbospe-vg-os3","name":"default-ism-policy","reconcileID":"018ed4ff-4482-4537-91d5-40718f72b103","reconciler":"ismpolicy","error":"failed to create ism policy: [400 Bad Request] {\"error\":{\"root_cause\":[{\"type\":\"parsing_exception\",\"reason\":\"Failed to parse object: expecting token of type [START_OBJECT] but found [VALUE_STRING]\",\"line\":1,\"col\":579}],\"type\":\"parsing_exception\",\"reason\":\"Failed to parse object: expecting token of type [START_OBJECT] but found [VALUE_STRING]\",\"line\":1,\"col\":579},\"status\":400}","stacktrace":"github.com/Opster/opensearch-k8s-operator/opensearch-operator/pkg/reconcilers.(*IsmPolicyReconciler).Reconcile\n\t/workspace/pkg/reconcilers/ismpolicy.go:209\ngithub.com/Opster/opensearch-k8s-operator/opensearch-operator/controllers.(*OpensearchISMPolicyReconciler).Reconcile\n\t/workspace/controllers/opensearchism_controller.go:53\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:118\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:314\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:265\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:226"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    📦 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions