Skip to content

Conversation

@saswatamcode
Copy link
Member

This commit adds a jsonnet lib to perses operator, so that the CRDs and definitions can be imported by downstream stacks like kube-prometheus

Signed-off-by: Saswata Mukherjee <[email protected]>
@saswatamcode
Copy link
Member Author

cc: @simonpasquier

@saswatamcode saswatamcode marked this pull request as draft May 14, 2025 10:50
Copy link

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we convert the perses*-crd.json from config/crd/bases using gojsontoyaml?

Signed-off-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
@saswatamcode
Copy link
Member Author

@simonpasquier ok I kind of tried a trick here. I basically converted all the kubebuilder generated YAML to json in jsonnet dir, then import and modify those.

So any future edits of the original kubebuilder YAML would reflect into the jsonnet lib.

Let me know if this seems reasonable, cc: @jgbernalp

Copy link

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we highlight generated files more prominently? Either .json files go to jsonnet/enerated/ or we add some header to the json files?
Also I'm not sure that we need to keep the manifests generated from jsonnet in the repository since they kinda overlap with the manifest files.
One last thing: it would be good to run jsonnetfmt on the json/jsonnet files.

@saswatamcode
Copy link
Member Author

@simonpasquier I added fmt and linting for jsonnet.
I'm also storing all the generated json in a generated dir.

As for the manifests generated by jsonnet, I would still like to keep them, as you can test those manifests on a cluster and validate that things work as expected.

@saswatamcode saswatamcode marked this pull request as ready for review May 15, 2025 07:46
Signed-off-by: Saswata Mukherjee <[email protected]>
Copy link

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jgbernalp jgbernalp merged commit 6855a84 into perses:main May 15, 2025
5 checks passed
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.

3 participants