Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow yaml instead of json body #57

Open
an-tex opened this issue May 10, 2023 · 1 comment
Open

allow yaml instead of json body #57

an-tex opened this issue May 10, 2023 · 1 comment

Comments

@an-tex
Copy link
Contributor

an-tex commented May 10, 2023

currently to e.g. create a snapshot repository you'd write

apiVersion: es.eck.github.com/v1alpha1
kind: SnapshotRepository
metadata:
  name: snapshotrepository-sample
spec:
  targetInstance:
    name: elasticsearch-quickstart
  body: |
    {
      "type": "fs",
      "settings": {
        "location": "/tmp/"
      }
    }

meaning the actual configuration is written in json. the downside of this approach is that you can't use tools like kustomize to e.g. define a base snapshot repository with it's settings and then override it only partially in an overlay. to overcome this limitation one could allow (untyped) yaml and just transform it to the same json.

then you could define sth like:

apiVersion: es.eck.github.com/v1alpha1
kind: SnapshotRepository
metadata:
  name: snapshotrepository-sample
spec:
  targetInstance:
    name: elasticsearch-quickstart
  settings: # or some better name?
    type: fs
    settings:
      location: "/tmp"
@xco-sk
Copy link
Owner

xco-sk commented May 10, 2023

Hello, thanks for the idea, and yeah, it's a valid point for the yaml. The original idea behind the json was the simplicity of creating the resources - just taking the json from the ES/Kibana REST API and pasting it into the yaml but, well it does have its limits.
I will check what's possible in terms of schema definition and backward compatibility (this one shouldn't be that bad, as you mention, we can easily translate between json and yaml, but again I need to find out what's possible with schema definition).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants