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

Support generating multiple YAML documents from one template #34

Open
ryannedolan opened this issue Jun 22, 2023 · 0 comments
Open

Support generating multiple YAML documents from one template #34

ryannedolan opened this issue Jun 22, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ryannedolan
Copy link
Collaborator

A template like SqlJob.yaml.template can include multiple documents, separated by ---. This is could be useful if one Resource needs to be implemented with multiple Kubernetes objects. For example, a SqlJob could be implemented as a FlinkDeployment and a ConfigMap.

However, the operator currently treats each Resource as a single document, and makes one call to the Kubernetes API for each. Instead, the operator should:

  1. Generate yaml by applying templates, as it does now.
  2. Split the output yaml into separate documents.
  3. Apply each document individually.

It is probably insufficient to just String.split on ---, as this sequence may appear in the template in an escaped string. Instead, the YAML parser should be used to parse the YAML into a list of documents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant