Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Feature: @toJson / @toYaml operators for config generation #10

Description

@lukacsi

Problem

Generating ConfigMaps and Secrets with structured content requires building files as @concat strings with manually escaped quotes and \n:

stringData:
  config.yaml:
    "@concat":
      - "server_name: \""
      - "$.Source.spec.name"
      - "\"\n"
      - "database:\n"
      - "  host: \""
      - "$.Source.spec.dbHost"
      - "\"\n"

This is error-prone, unreadable, and unmaintainable. Any operator managing applications needs config generation, and @concat doesn't scale for it.

Proposal

@toJson and @toYaml operators that serialize a structured object (with embedded expressions) to a string:

stringData:
  config.yaml:
    "@toYaml":
      server_name: "$.Source.spec.name"
      database:
        host: "$.Source.spec.dbHost"
        port: "$.Source.spec.dbPort"
  • Recursively evaluate expressions, then serialize
  • Nested operators (@concat, @cond, @definedOr) work inside
  • Output is a string for ConfigMap/Secret values

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions