Commit Graph

736 Commits

Author SHA1 Message Date
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
Matej Vasek fa17dc9e4b
Update wrt switch from pkger to custom ZIP pkging (#889)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-09 17:39:46 -08:00
Matej Vasek ff06ed426a
Update developer documentation. (#888)
* Update developer documentation.

Update documentation for template generation.

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

* Apply suggestions from code review

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

Co-authored-by: Lance Ball <lball@redhat.com>
2022-03-09 12:25:50 -08:00
Matej Vasek fe6d9f7d70
Improve cleanup recipes in Makefile (#887)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-09 12:17:49 -08:00
Matej Vasek f29805ad27
Fix formatting for template zip generator (#886)
* Fix formatting for template zip generator

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

* fixup: style

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-09 07:32:50 -08:00
Luke Kingland 25524a1f84
fix: bind verbose flag to root (#884) 2022-03-08 11:02:06 -08:00
Matej Vasek 917a8efdb2
Hint to user when ssh server key is not known (#885)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-08 10:08:05 -08:00
Matej Vasek 2d23c9cd1f
Fixup writer Write() return value (#882)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-07 06:22:35 -08:00
Matej Vasek cc049952bb
Generate templates zip unconditionally (#879)
* Improve formant performance in template generation

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

* Improve memory footprint of template generation

Use streamlined generation which is limiting need for in memory buffers.
Might be imprtant if we had big files in templates.

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

* Generate templates unconditionally

Rationale:
The way we create prerequisites (the find command) we cannot detect deleted files.
The generation is fast (around 500ms) so we can afford that.

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

* Test embbeded templates content on push to main

This has to run prior to `make test` because the `test` recipe
enforces generation of the templates zip.
This would prevent test from being run against git commited templates
zip.

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

* Optimization don't use unnecessary io.Pipe

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-06 14:28:35 -08:00
Lance Ball 6d7ab83aed
Make `func invoke` print any response it receives. (#881)
* Make `func invoke` print any response it receives.

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

* fixup: improve test

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

* fixup: check Write() return value

Signed-off-by: Lance Ball <lball@redhat.com>
2022-03-06 14:25:35 -08:00
Luke Kingland 5a122c31e6
src: promote verbosity to constructor arg (#869)
* update root and version structure and help text

* fix: limit openshift int test with tag

* src: verbosity to constructor param

* fix misspelling

* fix merge error
2022-03-04 11:19:36 -08:00
Matej Vasek 1e4d52be33
Relax permission check only to owner exec perm (#878)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-03 05:54:06 -08:00
knative-automation d672afc19f
Update community files (#877)
Signed-off-by: Knative Automation <automation@knative.team>
2022-03-02 14:45:07 -08:00
Luke Kingland 043a00d12b
src: update root and version structure and help text (#865)
* update root and version structure and help text

* test root command help output

* fix trailing whitespace
2022-03-02 11:58:44 -08:00
Matej Vasek c4a7e095de
Use custom zip embedding not pkger (#835)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-02 06:41:43 -08:00
Luke Kingland 2bd5254f19
feat: command help text template preprocessing (#875) 2022-03-02 03:56:43 -08:00
Luke Kingland 3f30c91116
fix: use full root name for cmd help prefixes (#873) 2022-03-02 02:18:42 -08:00
knative-automation 02fa79e8e9
Update actions (#871)
Signed-off-by: Knative Automation <automation@knative.team>
2022-03-01 18:01:42 -08:00
Matej Vasek 8dd90bff19
Fix OpenShift credential loader (#876)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-01 17:59:42 -08:00