Skip to content

feat: add cuelang input type #1322

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

Merged
merged 12 commits into from
Jun 21, 2025
Merged

Conversation

lorenzofelletti
Copy link
Contributor

@lorenzofelletti lorenzofelletti commented Jun 11, 2025

Fixes #257

Proposed Changes

  • Adding CUE-lang input. Allow to compile CUE modules and injecting values from Kapitan parameters.

Docs and Tests

  • Tests added
  • Updated documentation

@ademariag
Copy link
Contributor

I've been meaning to do it for months! Thank you Lorenzo!

@lorenzofelletti
Copy link
Contributor Author

This is an MVP of compiling CUE modules with Kapitan. It pretty much follows the Kustomize InputType implementation.

I've tested it locally by building the Docker image and testing it against a minimal project obtained by:

  • creating a new folder and running kapitan init in it
  • creating a folder templates/cue and running cue mod init com.cue.example from within that folder
  • adding file templates/cue/main.cue with content below
  • editing inventory/classes/my_component.yml and adding the content from below
  • running kapitan compile (with kapitan aliased to the use the built image).
parameters:
  your_component:
    some_parameter: true
  kapitan:
    compile:
    - output_path: cute
      input_type: cuelang
      input_paths:
      - templates/cue
      input:
        some_input: true

main.cue:

package main

hello: "world"

@ademariag
Copy link
Contributor

this is great @lorenzofelletti. Would you mind adding a little bit of documentation to the documentation site, and some tests?

Then I think we are ready to ship

@lorenzofelletti
Copy link
Contributor Author

Yes, you're right! I'll add them!

@ademariag ademariag enabled auto-merge (squash) June 18, 2025 07:38
@lorenzofelletti lorenzofelletti changed the title feat: mvp cuelang implementation feat: add cuelang input type Jun 18, 2025
@lorenzofelletti
Copy link
Contributor Author

tests fails because cue is not installed on the runner...
I see Jsonnet is installed via Python bindings, helm is installed ad-hoc, while I don't get how kustomize is installed.
Which is the best way to go for cue?

@ademariag
Copy link
Contributor

tests fails because cue is not installed on the runner... I see Jsonnet is installed via Python bindings, helm is installed ad-hoc, while I don't get how kustomize is installed. Which is the best way to go for cue?

feel free to install cue whichever way you prefer, I will clean it up later

auto-merge was automatically disabled June 20, 2025 08:56

Head branch was pushed to by a user without write access

@ademariag ademariag enabled auto-merge (squash) June 20, 2025 14:18
@ademariag ademariag disabled auto-merge June 21, 2025 10:23
@ademariag ademariag merged commit f1b2101 into kapicorp:master Jun 21, 2025
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support to CUE
2 participants