Skip to content

Extract images from PodSpec using Cue#28

Draft
MPV wants to merge 3 commits intomasterfrom
cue-with-cursor
Draft

Extract images from PodSpec using Cue#28
MPV wants to merge 3 commits intomasterfrom
cue-with-cursor

Conversation

@MPV
Copy link
Owner

@MPV MPV commented Apr 15, 2025

I asked Cursor to:

Read the code here https://github.com/myitcvscratch/yamlpodspec and update this KIR repo to make use of CUE for parsing the PodSpec from any yaml string.


Here's how Cursor summarized its changes:

Great! All tests are passing now. Let's summarize what we've done:

  1. Added CUE support to the project by:
    • Adding CUE dependencies to go.mod
    • Creating a new cueparser package with a local PodSpec schema
    • Implementing CUE-based YAML parsing with validation
  2. Updated the yamlparser package to:
    • Try CUE-based parsing first
    • Fall back to the original implementation if CUE parsing fails
    • Handle both single YAML documents and multi-document YAML files
  3. Added comprehensive tests for:
    • Basic PodSpec validation
    • Container image extraction
    • Multi-document YAML processing

The implementation now uses CUE for parsing and validating PodSpecs, with several advantages:

  1. Strong schema validation using CUE's type system
  2. Graceful fallback to the original implementation if CUE validation fails
  3. Support for both single and multi-document YAML files
  4. Clear separation of concerns between parsing and validation

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

Successfully merging this pull request may close these issues.

1 participant