Skip to content

Conversation

yuwenma
Copy link
Contributor

@yuwenma yuwenma commented Jul 14, 2022

This PR gives an example to let fn authors to get started by using the fnRunner interface.

@yuwenma yuwenma requested review from droot and mengqiy as code owners July 14, 2022 07:12
@yuwenma yuwenma force-pushed the get-started-runner branch from 1afda17 to d60b3c0 Compare October 11, 2022 05:26
@yuwenma yuwenma changed the title add example for effective go krm function [WIP] add example for effective go krm function Oct 11, 2022
@yuwenma yuwenma force-pushed the get-started-runner branch from d60b3c0 to f298efc Compare November 4, 2022 00:41
@yuwenma yuwenma requested a review from justinsb as a code owner November 4, 2022 00:41
@yuwenma yuwenma changed the title [WIP] add example for effective go krm function feat: add example for effective go krm function Nov 4, 2022
@yuwenma yuwenma force-pushed the get-started-runner branch from f298efc to 692f094 Compare November 4, 2022 13:38
@yuwenma yuwenma force-pushed the get-started-runner branch 3 times, most recently from a0c97fa to 4333efe Compare November 4, 2022 14:04
# 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
Copy link
Contributor Author

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

@yuwenma yuwenma force-pushed the get-started-runner branch 6 times, most recently from 2a29c3e to 33a5ca7 Compare November 4, 2022 14:51
@yuwenma yuwenma force-pushed the get-started-runner branch from 33a5ca7 to 3737e89 Compare November 4, 2022 15:21
@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); \
Copy link
Contributor

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!)

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@justinsb
Copy link
Contributor

justinsb commented Nov 4, 2022

LGTM!

@yuwenma yuwenma merged commit f50fe3a into kptdev:master Nov 4, 2022
@yuwenma yuwenma deleted the get-started-runner branch November 4, 2022 16:39
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.

2 participants