-
Notifications
You must be signed in to change notification settings - Fork 38
feat: add example for effective go krm function #602
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
Conversation
1afda17
to
d60b3c0
Compare
d60b3c0
to
f298efc
Compare
f298efc
to
692f094
Compare
a0c97fa
to
4333efe
Compare
go/hack/update-license.sh
Outdated
# and will add them to the theme which is a submodule (bad) | ||
command -v addlicense || go install github.com/google/[email protected] | ||
find . -print0 | xargs "$GOBIN"/addlicense -y 2022 -l apache | ||
find . -print0 | xargs "$GOBIN"/addlicense -y 2022 -l apache -ignore **/*.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skip adding licenses to the .yaml files to avoid the conflict where addlicense
adds license to the golden test _expected.yaml
while the golden tests fail due to the unexpected diff in _expected.yaml
2a29c3e
to
33a5ca7
Compare
33a5ca7
to
3737e89
Compare
@for f in $(^D); do \ | ||
(cd $$f; echo "Checking golangci-lint $$f"; \ | ||
(which $(GOPATH)/bin/golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.2); \ | ||
(which $(GOPATH)/bin/golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I really like using go run
where it works - it seems plenty fast enough now. It also works really nicely with go generate.
(No need to fix, just one for the future!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Yeah, go run
is more proper in this case in a follow-up PR.
|
||
// TODO: Change to your functionConfig "Kind" name. | ||
type YourFunction struct { | ||
FnConfigBool bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Do we need json
annotations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to.
LGTM! |
This PR gives an example to let fn authors to get started by using the fnRunner interface.
kfn
feat: Addkfn
as function editor CLI #639 (Eventually I want thekfn
to generate the scaffolding code as kubebuilder does)