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

Wire field markers and tags to types.Field #39

Closed
wants to merge 1 commit into from

Conversation

robbie-demuth
Copy link

This allows users to use field markers and tags in their own templates

This allows users to use field markers and tags in their own templates
@cla-checker-service
Copy link

❌ Author of the following commits did not sign a Contributor Agreement:
14e470a

Please, read and sign the above mentioned agreement if you want to contribute to this project

@@ -318,6 +318,8 @@ func (p *processor) processStructFields(parentType *types.Type, pkg *loader.Pack
Name: f.Name,
Doc: f.Doc,
Embedded: f.Name == "",
Markers: f.Markers,
Copy link
Author

Choose a reason for hiding this comment

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

This doesn't seem to be working properly. When I go to access markers in my own templates, the markers don't seem to be there. I'm still familiarizing myself w/ https://pkg.go.dev/sigs.k8s.io/controller-tools/pkg/markers, but maybe this has something to do w/ how the Collector or Registry are setup?

Copy link
Author

Choose a reason for hiding this comment

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

It seems like markers have to defined before parsing. That's obviously problematic given I wanted to wire all markers without knowing what they are ahead of time

@tenstad
Copy link
Contributor

tenstad commented Aug 8, 2023

@robbie-demuth I've added support for markers in #49
It is correct that they need to be defined ahead of time.

@tenstad
Copy link
Contributor

tenstad commented Oct 9, 2023

@robbie-demuth #55 now adds all CRD markers. So we can maybe close this one?

@thbkrkr
Copy link
Contributor

thbkrkr commented Oct 13, 2023

@robbie-demuth Thanks for your interest on this.
As @tenstad said, we are going to add support for parsing markers in #55, hence closing.

@thbkrkr thbkrkr closed this Oct 13, 2023
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