generate: parse CSV annotations with controller-tools/pkg/markers#2792
generate: parse CSV annotations with controller-tools/pkg/markers#2792estroz merged 4 commits intooperator-framework:masterfrom
controller-tools/pkg/markers#2792Conversation
88cd734 to
a53c74a
Compare
|
What is the possibility of introducing the new format while simultaneously keeping the old format, so that we can deprecate without immediately breaking and give folks time to transition? |
|
@joelanford that may prove difficult but let me see how easy it is first. Edit: the dot-in-path (ex.
While method 2 does provide a true deprecation path, it will require some extra work to parse the new marker format. |
a53c74a to
c5d0103
Compare
c5d0103 to
9446856
Compare
|
Two more options:
|
Can we do both of these and also deprecate the old gengo code/format for legacy projects? So the result would be:
This way we have a path to fully removing the old gengo-based parsing. |
9446856 to
7cd3e7a
Compare
a7ed23d to
064aeda
Compare
|
@joelanford done adding back old behavior, take a look. Will write a migration script and docs. |
c50ef88 to
d0f4666
Compare
1480b36 to
6095653
Compare
6095653 to
84b26eb
Compare
There was a problem hiding this comment.
I tested it with a personal project and could not find any issue. So, all shows fine when has not the PROJECT file.
After, just add the project file I started to face :
$ operator-sdk generate csv --csv-version 0.0.2 --update-crds FATA[0000] version format must match ^(v)?([1-9][0-9]*)(-alpha|-beta)?$
Also, could you please clarify better in the first comment what are the breaking changes? Are we changing the markers?
I am not sure about what changes with this PR, would be nice have this info in the first comment for we know what exactly we need test and verify. Also, the motivation here just makes it runs faster?
84b26eb to
d4b5758
Compare
|
Closes #2983 |
| - description: The desired number of member Pods for the deployment. | ||
| displayName: Size | ||
| path: podStatuses.size | ||
| - displayName: Size |
There was a problem hiding this comment.
The description is a required property of both specDescriptors and statusDescriptors. We may need to add the default data for description field instead of omitting it.
There was a problem hiding this comment.
Just checked the struct again and notice in fact only the path is the required property. So no concerns on the examples as well.
There was a problem hiding this comment.
I almost regret immediately after posting my previous comments. :(
Although "technically" only path is the required property, an empty description leads to an empty tooltip on the UI:
Empty tooltip - without description:

Can we at least include some simple text for the description field in the example (UI will be adding better handling for the empty description case)? Thanks!
There was a problem hiding this comment.
This is something I'd like to leave up to the OperatorHubValidator, since it is perfectly valid to have a CSV without these descriptions.
joelanford
left a comment
There was a problem hiding this comment.
LGTM. Just a few nits/questions.
| if kbutil.HasProjectFile() || areAnnotationsMigrated(b.APIsDir) { | ||
| err = updateDefinitions(base, b.APIsDir, b.GVKs) | ||
| } else { | ||
| err = updateDescriptionsForGVKs(base, b.APIsDir, b.GVKs) | ||
| } |
There was a problem hiding this comment.
There was a problem hiding this comment.
Shouldn't that requirement check be centralized in IsOperatorGo()?
hack/generate/migrate-markers.sh: annotation -> marker migration script internal/generate/olm-catalog: use legacy descriptor parsing if neither PROJECT nor the new markers format exists
d4b5758 to
bb31df0
Compare
bb31df0 to
598997b
Compare
jmrodri
left a comment
There was a problem hiding this comment.
/lgtm
I didn't see any red flags. Good job.
| local old_marker_pattern_1="${OLD_MARKER_BASE}"'\.resources="([^\,]+)\,([^\,]+)\,\\"([^\\]+)\\""' | ||
| local old_marker_pattern_2="${OLD_MARKER_BASE}"'\.resources="([^\,]+)\,([^\,]+)\,"' | ||
| local new_marker_pattern_1="${NEW_MARKER_BASE}"':resources={\1,\2,"\3"}' | ||
| local new_marker_pattern_2="${NEW_MARKER_BASE}"':resources={\1,\2,}' | ||
|
|
There was a problem hiding this comment.
Impressive! regex always impresses me :)
|
New changes are detected. LGTM label has been removed. |
controller-tools/pkg/markerscontroller-tools/pkg/markers

Description of the change: use
sigs.k8s.io/controller-tools/pkg/markersto re-write the CSV annotations (now known as markers) machinery.Motivation for the change: speedup of ~20x based on unit test runtime:
TODO: