Commit Graph

854 Commits

Author SHA1 Message Date
Matej Vasek 34cb893545
Refactor: templates (#961)
* Refactor: use fs.WalkDir to copy from FS

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: rename and added doc comment

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: clean up templates

Make `fn.Template` interface not struct.

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Clean up: mask manifest.yaml from template FS

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: receiver is not pointer

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: use const instead of string literal

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: TemplatesPath defaulting at correct place

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: mask manifest.yaml in template code

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: remove unnecessary else

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: put docstring on interface

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: test calls better API

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: check return value

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-04-14 11:29:10 +00:00
Lance Ball 4ffb1f9cba
chore: update allocate script with latest knative (#965)
Use the latest Knative release in the hack/allocate.sh script.
In addition, there is a small change to how the munged yaml files
are piped through `yq`, adding a final pass through `yq` itself
essentially sanitizing the data.

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-14 10:53:10 +00:00
David Simansky baac9e9cf2
Add unicode control chars exclude (#972)
* Add unicode control chars exclude

* Update .unicode-control-characters.config.py

Co-authored-by: Chris Suszynski <krzysztof.suszynski@gmail.com>

* Update .unicode-control-characters.config.py

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>

Co-authored-by: Chris Suszynski <krzysztof.suszynski@gmail.com>
Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
2022-04-14 10:50:11 +00:00
Luke Kingland 3be1a77388
feat: s2i builder typescript support (#957) 2022-04-14 10:48:10 +00:00
Jefferson Ramos f92db575e9
Update Springboot and quarkus e2e tests (#959) 2022-04-12 13:30:09 +00:00
Lance Ball 23d1188319
chore: add version.txt to .gitattributes for style (#966)
* chore: add version.txt to .gitattributes for style

The Knative style check uses linguist to determine if a given file is a
generated file. If so, it excludes that file from the check. This change
should prevent Knative's style check from complaining about no newline on
version.txt

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: also add zz_filessytem_generated.go

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-11 21:52:07 +00:00
knative-automation 7121e1f2d9
Update community files (#962)
Signed-off-by: Knative Automation <automation@knative.team>
2022-04-11 14:42:08 +00:00
Lance Ball 76c647a1c7
docs: add a language pack "contract" document (#918)
* docs: restructure & add a language pack "contract"

The docs/guides/langugage-packs.md document does a good job of describing
what's required of a language pack in terms of directory structure and the
options for the `manifest.yaml` file. But it does a pretty crappy job of
describing the whole thing in context. I've tried to do that here.

Also some fixes to links and reorganization of the docs to make things a
little easier to find.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: inline language pack referenc into contract

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: minor wording tweak

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: whitespace

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-11 13:30:07 +00:00
knative-automation bc3a418e07
Update community files (#956)
Signed-off-by: Knative Automation <automation@knative.team>
2022-04-11 02:27:19 +00:00
Lance Ball 13d4222461
feat: make templates consistent across runtimes (#948)
* fix: make templates consistent across runtimes

Fixes: https://github.com/knative-sandbox/kn-plugin-func/issues/572

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: review feedback

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: fix embedded fs

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: fix whitespace

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-08 11:28:46 +00:00
knative-automation 4e1d9b61e4
Update community files (#953)
Signed-off-by: Knative Automation <automation@knative.team>
2022-04-07 17:35:45 +00:00
Lance Ball 4e369a013a
chore: add release process and func_darwin_arm64 to the release artifacts (#945)
* fix: add func_darwin_arm64 to the release artifacts

Signed-off-by: Lance Ball <lball@redhat.com>

* chore: add ARM64 release target/propose process

I noticed in the most recent release, that a MacOS M1 binary was not
produced. This commit adds that target to `hack/release.sh`. Additionally
the CHANGELOG.md files and version.txt files have been updated to accurately
reflect the current status. Finally, I've proposed a release process in
the new file `docs/RELEASING.md`.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: remove trailing whitespace

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-07 15:22:46 +00:00
knative-automation 48d081be65
Update community files (#950)
Signed-off-by: Knative Automation <automation@knative.team>
2022-04-07 07:01:45 +00:00
knative-automation f0f5a080e5
Update actions (#946)
Signed-off-by: Knative Automation <automation@knative.team>
2022-04-07 07:00:45 +00:00
Matej Vasek 94dd53d009
Template generation improvements (#949)
* Improve test error output

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Template ZIP generator close file after use

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-04-06 21:59:44 +00:00
Matej Vasek 1ee9fa163b
Update spring-boot in templates (#947)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-04-06 18:11:45 +00:00
Luke Kingland c3c1456ede
feat: invoke verbose metadata (#944)
* invoke verbose prints metadata

* review updattes
2022-04-06 14:19:47 +00:00
Zbynek Roubalik 36cfef726f
Print logs if Pipeline Run fails (#943)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2022-04-05 16:07:44 +00:00
Luke Kingland a91bcc5fcf
feat: s2i builder with preliminary node support (#923)
* fix: stuck build ticker

* feat: s2i builder prototype

* default builders

* use s2i fork with updated docker

* in-code builder defaults

* s2i builder verbosity constructor arg

* typed errors

* typed error tests

* remove unneeded env code

* s2i build e2e test

* e2e tests

* update licenses

* cleanup

* codegen debug

* update licenses

* Revert "Update actions (#921)"

This reverts commit 8312b5c560.

* update licenses

* e2e test updates

* use GetDefaultDockerConfig for s2i config

* docker.NewClient docs
2022-04-05 13:08:44 +00:00
Zbynek Roubalik e9251f518c
feat: on cluster build doens't require privileged cluster permissions (#934)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2022-04-05 12:52:43 +00:00
knative-automation 6e5a2ae193
Update actions (#940)
Signed-off-by: Knative Automation <automation@knative.team>
2022-04-05 07:54:43 +00:00
knative-automation a807b042a4
Update community files (#924)
Signed-off-by: Knative Automation <automation@knative.team>
2022-04-05 07:53:44 +00:00
Matej Vasek d7314f3c4a
Use "openshift" uname for OpenShift image registry (#938)
The user name from the config is invalid sometimes.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-04-04 20:37:43 +00:00
Lance Ball 4a4cebb1ea
fix: apply updated spring-boot-function dependency (#936)
This commit updates the spring-boot-function dependency explicitly as there
is not yet a CVE fix for spring-cloud 2021.0.1.

```
❯ ./mvnw clean install dependency:tree | grep spring-cloud-function
[INFO] |  +- org.springframework.cloud:spring-cloud-function-web:jar:3.2.2:compile
[INFO] +- org.springframework.cloud:spring-cloud-function-context:jar:3.2.3:compile (optional)
[INFO] |  +- org.springframework.cloud:spring-cloud-function-core:jar:3.2.2:compile (optional)
```

Fixes: https://github.com/knative-sandbox/kn-plugin-func/issues/929
Fixes: https://spring.io/blog/2022/03/29/cve-report-published-for-spring-cloud-function

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-04 16:52:43 +00:00
Lance Ball 00d5a82722
chore: add Apple M1 build in cross-platform target (#932)
* chore: add Apple M1 build in cross-platform target

Might fix: https://github.com/knative-sandbox/kn-plugin-func/issues/377

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: review feedback/better names

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: adjust release workflow

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: remove duplicate

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-01 14:47:45 +00:00
knative-automation 1d29100027
Update actions (#933)
Signed-off-by: Knative Automation <automation@knative.team>
2022-04-01 14:45:45 +00:00
David Simansky 739cded50f
Update to latest Tekton release (#935)
* Update to latest Tekton release

* Update vendor dir

* Fix misspelled comment
2022-04-01 14:44:45 +00:00
David Simansky df67900d8b
Update buildpacks/pack to v0.24.0 (#926)
* Update buildpacks/pack to v0.24.0

* Update vendor dir
2022-04-01 11:24:46 +00:00
Luke Kingland 06fe5c048f
Revert "Update actions (#921)" (#927)
This reverts commit 8312b5c560.
2022-03-31 14:27:44 +00:00
David Simansky bf68b221a6
Update Knative dependencies to v1.1 (#925)
* Update Knative dependencies to v1.1 (0.28)

* Update vendor dir

* Update lincenses

* Fix docker push test

* Refactor docker client interface
2022-03-31 13:45:45 +00:00
knative-automation 8312b5c560
Update actions (#921)
Signed-off-by: Knative Automation <automation@knative.team>
2022-03-30 19:31:49 +00:00
Luke Kingland 9a0335de7d
src: exported client constructor with options (#883)
* update root and version structure and help text

* fix: limit openshift int test with tag

* refactor: commands to use simplifed, unified constructor

* fix ineffectual assignment lint error

* cleanup

* add repository to run command

* callout for forthcoming s2i builder impl

* lint errors

* re-add the deferred client factory

* remove setNamespaceFlag now that it is persistent

* avoid side-effect of global-mutating deploy tests

* reduce line-by-line difference for PR ease

* simplificaiton of tests and comment lines for further PR ease purposes

* reduce inconsequential differences for ease of PR

* tests to RootCommandConfig

* review comment updates

* fix lint errors

* replace stdlib Setenv in tests

Using t.Setenv will require an update to go1.17, which is out of scope
for this PR.

* pass ClientFactory throughout

* explicitly empty test command args

See https://github.com/spf13/cobra/pull/155

Errors can still be encountered when, for example, using precomiled
tests.  Explicitly setting constructed command args to the empty slice
ensures we avoid hitting any futher edge cases.
2022-03-30 00:58:46 +00:00
Thomas Risberg 9a6aaa5474
Support using 'func invoke' for springboot templates (#920)
* Support using 'func invoke' for springboot templates

- add README notes for using 'func invoke' to springboot templates
- update ce-type used for cloudevents template tests

* Re-generate zz_filesystem_generated.go after rebase
2022-03-23 09:31:18 -07:00
Matej Vasek c766e75a77
Improve template ZIP generation (#917)
* Improve template ZIP generation

Use only 755 and 644 mod permission.
The exec bit is really the only one that we care about.

Also other bits may be set differently on developer machines depending
on its configuration, this would affect generation reproducibility.

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Add explanatory comment

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-23 07:47:26 -07:00
knative-automation ccadf1bb0a
Update community files (#919)
Signed-off-by: Knative Automation <automation@knative.team>
2022-03-23 06:01:17 -07:00
Matej Vasek 669329f02f
Improve error handling (#916)
* replaced plain `==` by `error.Is()`
* wrapping some more errors using `fmt.Errorf()`

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-22 17:18:17 -07:00
Thomas Risberg 03e53287d1
Update springboot http template (#914)
- http should match cloudevents template
- update Spring Boot version
- update README for cloudevents template
2022-03-22 08:31:12 -07:00
Matej Vasek 3a7f388035
Improve error messages (#913)
* Improve error messages

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* incorporate review suggestion

Co-authored-by: Lance Ball <lball@redhat.com>

Co-authored-by: Lance Ball <lball@redhat.com>
2022-03-21 08:24:47 -07:00
Roland Huß 56d93cfd9c
Adding code of conduct to reference knative/community's CoC (#911) 2022-03-21 07:22:46 -07:00
knative-automation 51a4011ad8
Update community files (#910)
Signed-off-by: Knative Automation <automation@knative.team>
2022-03-18 10:54:19 -07:00
Matej Vasek cad0a04276
Enabled previously disabled git tests for Window (#909)
* Recreate git repo from scratch

Recreated the repo by `git init --bare` and commited template there all
over again.

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Enable previously disabled tests for Windows

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Use git HTTP protocol not file protocol in tests

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: cleanup

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-17 03:20:48 -07:00
Lance Ball 7b001a198a
doc: add documentation for using podman remotely (#907)
* doc: add documentation for using podman remotely

This commit adds more documentation for using podman, specifically in this
case, connecting to and using a remote podman service from a Mac computer.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup

Signed-off-by: Lance Ball <lball@redhat.com>
2022-03-16 14:46:47 -07:00
Luke Kingland 9dec4c20ee
differentiate repository and repositories (#900) 2022-03-16 14:01:59 -07:00
Luke Kingland 564a34b3f5
fix: full clone of template repos on add (#904)
* full clone remote repos on write

* use filepath to parse path
2022-03-16 11:40:00 -07:00
Zbynek Roubalik c60079d792
🐛 allow adding environment variables without a cluster connection (#893)
* allow adding environment variables without a cluster connection

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>

* add tests

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>

* use k8s clientcmd

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2022-03-16 07:20:00 -07:00
Lance Ball 166313b541
improve template comments for Node.js and TypeScript (#902)
* improve template comments for Node.js and TypeScript

See: https://github.com/knative-sandbox/kn-plugin-func/issues/572

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: add zz_ file

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: whitespace

Signed-off-by: Lance Ball <lball@redhat.com>
2022-03-15 15:36:59 -07:00
Zbynek Roubalik 5de9e193b8
parameter `-P` is not needed in grep in pre-commit hook (#895)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2022-03-14 06:33:18 -07:00
knative-automation 265786dfc2
Update community files (#892)
Signed-off-by: Knative Automation <automation@knative.team>
2022-03-14 02:24:17 -07:00
salaboy 57909f71fe
Updating to latest spring cloud release and refactoring code (#838)
* updating to latest spring cloud release and refactoring code

* new health endpoints

* implementing simplified echo function in template

* adding banner

* adding NL at EOF

* updating native to release

* fixing trailing whitespace

* adding invocation back

* adding Newline

* whitespaces

* fix lint and regenerate

* regenerate zz filesystem after rebase
2022-03-11 07:22:32 -08:00
knative-automation e5039891eb
Update community files (#890)
Signed-off-by: Knative Automation <automation@knative.team>
2022-03-10 22:13:32 -08:00