Comments (8)
Git diff shows this fixing the issue! Comments are removed from the generated documentation
from konstraint.
Konstraint treats the @kinds
tag as the end of the header block when parsing the policy description. This was selected when @kinds
was the only tag Konstraint supported, so this may need a refresh.
Since all of the @
tags are optional and can exist in any order, it may be best to add an @end
tag or something similar so Konstraint can easily know when a comment is no longer a part of the header block. What are your thoughts @artis3n @jpreese ?
from konstraint.
Ah, and I don't use the @kind
tag because I'm writing policies beyond just kubernetes - using Konstraint for policy documentation of the rest of what Conftest can test as well as k8s.
I understand Konstraint is primarily a tool to templatize policies between Conftest and Gatekeeper, but to leverage its policy self-documentation utilities - I would prefer Konstraint to use the contiguous block of comments above a package
declaration / at the top of a file and ignore any other comments in the file. Then, the content can exist in that contiguous block in any order, and anything within that contiguous comment block that does not begin with @
should be treated as part of the policy description.
read lines in file, while line begins with #
, treat as part of policy header, break when line no longer begins with #
. But it doesn't look like you maintain the file structure when parsing the Rego, you have all comments in the file and have to work with that. If that is the case, then adding a @end
works. That suggests there should be a @begin
or @start
highlighting the start of where Konstraint should look for policy declaration - if the r.comments
is ordered such that the comment lines appear in the same order that they are written in the file, earlier lines first.
I have used Go, many years ago, and have only interacted with rego for writing policies. So hopefully my comments make sense for the tools we have in the language.
from konstraint.
That sounds good, and it shouldn't be too hard to implement. I'll probably have time to get to this next week.
from konstraint.
@artis3n this was implemented in #104 and it seems to work in my testing. Can you try with your policies and let me know if you run into any issues?
from konstraint.
Will check on Monday
from konstraint.
Is there any particular cadence to Konstraint's release cycle? It would be nice to take advantage of this fix but I don't see that #104 has been released.
from konstraint.
@artis3n We don't have any formal release schedule at the moment, but I think it would be fair to target monthly at a minimum going forward, with a release every 2 weeks being a stretch goal. @jpreese do you have any thoughts?
from konstraint.
Related Issues (20)
- Unexpected match.kinds generated when matching multiple apiGroups HOT 2
- Imports of specific rule from module not supported HOT 2
- Generate descriptions for parameters HOT 2
- Input parameters verification ignores assignment rules HOT 9
- Use OPA Rego rich metadata instead of custom @annotations HOT 3
- Allow defining object parameters HOT 2
- Provide a conversion tool from old annotations to OPA rich metadata annotations
- Legacy parameters warning is generated even for new style parameters HOT 1
- Remove legacy annotations support and refactor
- Migrate to PSS HOT 1
- Flag to generate templates to v1 from v1beta1 HOT 2
- Allow skipping creation of ConstraintTemplates entirely HOT 1
- Allow to add metadata like annotations to constraint automatically HOT 3
- Templates and Constraint files are not in CamelCasing after running konstraint create HOT 5
- Build binary for linux/arm64 HOT 1
- Lint examples with regal HOT 1
- containerdenyescalation HOT 2
- No arm64 docker image for konstraint HOT 1
- Documentation unclear
- Add support for annotations on constraint and template HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from konstraint.