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

npx [email protected] crd command outputs .ts files that must be edited before use #374

Closed
2 tasks
btlghrants opened this issue Sep 6, 2024 · 3 comments · Fixed by #388
Closed
2 tasks
Assignees
Labels
enhancement New feature or request released

Comments

@btlghrants
Copy link
Contributor

btlghrants commented Sep 6, 2024

Environment

Device and OS: Ubuntu 24.04
App version: v3.0.2
Kubernetes distro being used: n/a

Definition of Done

  • e2e test (in Kubernetes Fluent Client)
  • No manual intervention

Potential look at the e2e test around PolicyReports

Steps to reproduce

  1. Run this command:
    npx [email protected] crd https://github.com/kubernetes-sigs/wg-policy-prototypes/raw/master /policy-report/crd/v1alpha2/wgpolicyk8s.io_clusterpolicyreports.yaml $(pwd)
    
  2. Open the generated files with a TS-aware IDE.

Expected result

An error-free .ts file should be generated.

Actual Result

The requested .ts file is generated but it has TS errors.

Visual Proof (screenshots, videos, text, etc)

image

Severity/Priority

Annoying

Additional Context

Problem can be worked around by manually editing the generated files, but... that's annoying to have to do.

@btlghrants btlghrants added the possible-bug Something may not be working label Sep 6, 2024
@mjnagel
Copy link

mjnagel commented Sep 6, 2024

In my case I'm also seeing some weirdness around spec for my generated CRD. Typically we resolve this by deleting the apiVersion, kind, metadata, and changing spec to spec?.

Screenshot 2024-09-06 at 10 36 36 AM

Example to reproduce:

npx kubernetes-fluent-client crd https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.76.1/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml <some file path to put CRD type>

@btlghrants btlghrants added enhancement New feature or request and removed possible-bug Something may not be working labels Sep 16, 2024
@btlghrants
Copy link
Contributor Author

Found a link to the "fix" I was using during Dash Days PolicyReport excellent example.

https://github.com/defenseunicorns/pepr-excellent-examples/blob/ade93b0142086dce50eae6df180618b8d9f9261e/_helpers/dev/cli.mts#L164

This was built into the dev CLI (as a hack) but could probably be used as a starting point for polishing / moving into Pepr.

@schaeferka schaeferka self-assigned this Sep 17, 2024
@schaeferka schaeferka linked a pull request Sep 25, 2024 that will close this issue
5 tasks
cmwylie19 added a commit that referenced this issue Sep 30, 2024
## Description
The kfc crd command generates files that need to be manually edited.
This is annoying. Need to fix so that generated files do not need manual
editing.
...

## Related Issue

Fixes #374 

<!-- or -->

Relates to #

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [ ] [Contributor Guide
Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request)
followed

---------

Co-authored-by: Case Wylie <[email protected]>
Copy link

🎉 This issue has been resolved in version 3.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants