Commit Graph

650 Commits

Author SHA1 Message Date
Lance Ball ece9ac3645
fix: use paketo base image for springboot (#792)
The build actually seems to require `base` vs `tiny.

Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-27 09:26:47 -08:00
Lance Ball 6097b8d790
fix: use domain qualified registry for springboot (#789)
* fix: use domain qualified registry for springboot

The builder image name should include the registry name. Also it seems
that the tiny builder doesn't actually work. We need base.

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

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

* fixup: regenerate pkged.go with go 1.17

Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-26 11:28:45 -08:00
Matej Vasek 6c282e77c2
fix: error type-check condition (#786)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-01-26 09:44:45 -08:00
knative-automation 7fe39cae18
Update community files (#785)
Signed-off-by: Knative Automation <automation@knative.team>
2022-01-26 05:27:45 -08:00
salaboy 61bf5b9da2
Adding git add before commit and push (#781) 2022-01-25 08:27:48 -08:00
Roland Huß 627a88ac3e
Update OWNERS (#783)
Switch to the aliases defined in OWNER_ALIASES.
2022-01-25 08:26:49 -08:00
Lance Ball c58fcb7a9f
chore: skip integration tests for now (#780)
Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-25 07:16:49 -08:00
Zbynek Roubalik d478f555cc
feat: delete pipeline and resources with `func delete` (#763)
* feat: delete pipeline and resources with `func delete`

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* fix test and prompt

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2022-01-24 12:39:29 -08:00
Luke Kingland 6649a71f4d
fix: local cluster name collision (#779) 2022-01-24 10:30:30 -08:00
Matej Vasek 650f99f936
test: fix URL (#777)
On CI machines the image registry is present and reachable.
That causes the actual registry, not mock server, is accessed by the test.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-01-24 03:50:29 -08:00
knative-automation cd11b90a8f
Update community files (#772)
Signed-off-by: Knative Automation <automation@knative.team>
2022-01-24 03:39:29 -08:00
Matej Vasek 153e486bc6
fix: auth check (#773)
* fix: auth check

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

* fix: auth check

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-01-21 12:45:04 -08:00
Luke Kingland e918f74b9e
feat!: invoke (#705)
* feat!: rename 'emit' to 'invoke' and default to local

This commit renames 'func emit' command to 'func invoke' and makes the
default behavior to send an event to localhost. The special '--sink'
value 'local' is changed to 'cluster' to indicate that the function
should be invoked on the cluster instead of locally. All other behavior
has remained the same.

BREAKING CHANGE

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

* fixup: update commands.md doc

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

* squash: change Emitter interface to Invoker

Changes Emit() to Send() in the (now named) Invoker interface, and changes
Emit() to Invoke() in the client.

BREAKING CHANGE

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

* squash: use a common Invoker interface for HTTP and events

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

* checkpoint

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

* fixup: change Emitter to EventInvoker

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

* Invoke v2 Draft

* feat: client invoke function

* static invoke defaults and methods

* remove assimilated invoker package

* includes an ignored .func directory on create

* Instances manager with local and remote defaults

Funciton Info is now Instance, representing a Function in a given
environment.

Describing a Function instance is now Instances().Get(f, environment)

Moves Runner to be async with a Stop method to enable returning runtime pid
and port for persisting.

Instances now have a place for primary Route in addition to all routes slice

Running Functions write PID and Port to .func

* cascading targets: local vs remote vs ad-hoc endpoint

* runner start signals and cancel cleanup

* return run on context done or err on channel

* async runner

Refactors the image runner to start the container asynchronously,
reporting back the port on which it started.  Errors are communicated
back via a provided channel and stop is signaled using context
cancelation.

* pid neither required nor available

* add withTransport option

Incorporates addition of custom transport of the emitter into the
renamed version invoker. Flag and help text cleanup.  Re-additionof the
Info accessor.

* schema now includes invocation data

* loop build msg

* run jobs

Externally exposed port is now chosen based on availability, with 8080
preferred and falling back to an os-chosen open port.
The Client Run method is now async, returning the port assigned to the
running Function, a stop/cleanup function and a runtime errors channel.
The Runner is internally divided into the runner and its started Jobs.

* job metadata

Extracts job metadata tracking to a Job object in the core,
Handles multiple instances of the same Function by creating a single
file for each instances in .func/instances/<port>

* remove superfluous error types and flag bindings

* feat: enable invoke target remote

* feat: preferentially invoke local, remote if running

* feat: read --file for invoke

* feat: invoke confirm prompts

* fixup cli tests

- Updates to handle asynchronous Runner
- Standardize on the naming convention for selective running

* docker runner tests and lint errors

* test refactor

* feat: invoke format override

* comments, spelling and other cleanup

* invoke command doc

* feat: invoke format interactive option

* rename runjob.go to job.go

* e2e test flag update

* test naming homoginization

* silence build activity messages when verbose

* test debugging

* code review updates

- return Job from Client.Run rather than constituent members
- Treat .gitignore as contentious, punting on feature to mutate if
  extant.
- docs wording changes
- add invocation format to pertinent manifest.yaml files

* help text spelling etc.

Co-authored-by: Lance Ball <lball@redhat.com>
2022-01-21 12:04:05 -08:00
Matej Vasek 8ceb325142
Enable custom CA for specified server names (#770)
* src: refactor

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

* src: Allow usage of custom CA for

Allows TLS verify against custom CA for chosen server names.

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

* fixup: style

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

* fixup: lint

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

* fixup: cleanup

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-01-21 06:50:04 -08:00
Luke Kingland ce938122d8
src: remove need for hosts entry for local clusters (#742) 2022-01-18 12:58:33 -08:00
Lance Ball 74158dc63d
fixup: document minimum podman version (#766)
Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-18 11:12:33 -08:00
Lance Ball 2d37be5536
chore: bump lifecycle version to 0.13.2 (#764)
* chore: bump lifecycle version to 0.13.0

And add docker.io/paketobuildpacks as another trusted builder prefix.

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

* fixup: bump to 0.13.2

Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-17 14:52:31 -08:00
Fabian Lopez 7de4dc1667
ensure build flag binds for run command (#758)
Signed-off-by: Fabian Lopez <lfabian@vmware.com>
2022-01-17 01:41:29 -08:00
Matej Vasek 1dded12796
Support git scp url format (#761)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-01-13 11:24:12 -08:00
Zbynek Roubalik bddac30621
feat: add `function.knative.dev/name: functionName` label to every resouce created for a Function (#757)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2022-01-13 10:19:11 -08:00
Zbynek Roubalik 3d7c351544
fix: use correct --build flag value for `func-deploy` Tekton Task (#760)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2022-01-13 09:48:12 -08:00
Zbynek Roubalik f06fd97759
src: simplyfing Knative Deployer RoleBinding (#759)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2022-01-13 08:21:12 -08:00
knative-automation 21d857877b
Update actions (#749)
Signed-off-by: Knative Automation <automation@knative.team>
2022-01-13 04:10:12 -08:00
Matej Vasek 15d617f99d
src: use common functionality for docker cred retrieval (#756)
* Use common functionality for docker cred retrieval

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

* fixup: docker auth secret for tekton pipeline

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

* fixup: style

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-01-13 03:52:12 -08:00
Zbynek Roubalik cb719ff564
feat!: support on cluster build from git repo with Tekton (#743)
* feat: support on cluster build from git repo with Tekton

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* incorporate feedback

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* incorporate feedback 2

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* fixup-licence

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

* fix deploy with --build=disabled

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* incorporate feedback

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* incorporate feedback

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

Co-authored-by: Matej Vasek <mvasek@redhat.com>
2022-01-12 11:58:51 -08:00
Zbynek Roubalik b8d248a00b
feat: add definition for `func-deploy` Tekton Task (#740)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2022-01-12 11:57:50 -08:00
Zbynek Roubalik 9117940e14
doc: on cluster build documentation (#744)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2022-01-12 11:55:51 -08:00
Lance Ball a5793916a0
chore: release 0.21.0 (#737) 2022-01-12 10:56:51 -08:00
Lance Ball 963659bd0b
chore: add knative infra release scripts (#729)
* chore: add knative infra release scripts

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

* fixup: add newlines at EOF

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

* fixup: whitespace

Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-12 06:49:51 -08:00
knative-automation 47c82c0375
Update community files (#747)
Signed-off-by: Knative Automation <automation@knative.team>
2022-01-11 07:40:14 -08:00
Luke Kingland 4504b21369
src: simplify go templates (#741) 2022-01-10 13:59:12 -08:00
Zbynek Roubalik 64ba17b4fb
feat: add possibility to disable pushing of image in `deploy` command (#739)
* feat: add possibility to disable pushing of image in `deploy` command

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* remove commented code

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* incorporate feedback

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2022-01-07 06:40:26 -08:00
Zbynek Roubalik 2282cf899d
Revert "feat: add possibility to disable pushing of image in `deploy` command (#736)" (#738)
This reverts commit 4e5a5e8307.
2022-01-06 08:03:02 -08:00
Zbynek Roubalik 4e5a5e8307
feat: add possibility to disable pushing of image in `deploy` command (#736)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2022-01-06 07:22:01 -08:00
Zbynek Roubalik 0b130dd769
Add `ko` to produce image with `func` command in CI (#735)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2022-01-06 06:39:02 -08:00
salaboy 7d22e20092
adding ko to produce image with func command (#692) 2022-01-06 06:37:02 -08:00
jrangelramos 3177287571
chore: Adding support to ssh-agent on Windows using named pipes (#733) 2022-01-05 10:38:33 -08:00
knative-automation e0b5adcaf4
Update actions (#730)
Signed-off-by: Knative Automation <automation@knative.team>
2022-01-05 09:50:33 -08:00
knative-automation f5147fe1ea
Update community files (#734)
Signed-off-by: Knative Automation <automation@knative.team>
2022-01-05 04:47:32 -08:00
knative-automation 7cf2b470f4
Update community files (#731)
Signed-off-by: Knative Automation <automation@knative.team>
2021-12-22 07:47:18 -08:00
Lance Ball f20a238ecc
chore: release 0.20.0 (#667) 2021-12-20 16:16:16 -08:00
Matej Vasek 8d51393181
feat: allow push to cluster internal registries (#718)
* feat: allow push to cluster internal registries

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

* fix: NewRoundTripper consults http.DefaultTransport

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

* src: move credential code to sub-package

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

* src: refactor

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

* src: share RoundTripper

avoid creating expensive RoundTripper twice

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

* test: added test for pusher

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

* src: disable parallel layer upload

it's more reliable

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

* fixup: lint

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

* fixup: lint

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

* fixup: doc, rm commented code

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-12-20 14:28:17 -08:00
Zbynek Roubalik feaf8f9109
feat!: use `function.knative.dev` for Functions related labels (#717)
* chore: fix typo in deploy command output (#501)

* feat!: use `function.knative.dev` for function related labels

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

Co-authored-by: Lance Ball <lball@redhat.com>
2021-12-20 08:07:19 -08:00
knative-automation a77bdf0e76
Update community files (#727)
Signed-off-by: Knative Automation <automation@knative.team>
2021-12-17 07:08:18 -08:00
Luke Kingland 96aa41707c
Format pkged.go (#726)
Fixes the missing build stanza from pkged.go by running gofmt
(necessary beuntil such time as pkger does this itself)
2021-12-16 05:38:17 -08:00
Fabian Lopez 866728dbc0
mitigate log4j dependency vulnerability (#723)
* mitigate log4j dependency vulnerability

* bump log4j version to 2.16.0

* update pkged.go

* manually fix pkged.go annotation

* Revert "manually fix pkged.go annotation"

This reverts commit dc67a48185.

* fix pkged.go

* podman test trigger

* e2e test trigger
2021-12-16 03:32:17 -08:00
knative-automation 56b23251f8
Format go code (#724)
Signed-off-by: Knative Automation <automation@knative.team>
2021-12-15 09:07:30 -08:00
Lance Ball d7cfe6ead7
feat: add telemetry to Node.js and TypeScript function templates (#719)
* feat: add telemetry to Node.js and TypeScript function templates

This commit pulls in the latest version of faas-js-runtime which supports
metrics exposed at /metrics. Also, concidentally, adds CloudEvent batch
support, so Node.js and TypeScript functions may be invoked with a set of
more than one event simultaneously.

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

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

* fixup: regenerate and commit pkged.go

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

* fixup: remove stray go.sum and update pkged.go file

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

* fixup: try to make knative code style happy

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

* Revert "fixup: try to make knative code style happy"

This reverts commit 91d625be7b.

* fixup: update package-lock.json files

Signed-off-by: Lance Ball <lball@redhat.com>
2021-12-15 03:00:29 -08:00
knative-automation 82316f5672
Update community files (#714)
Signed-off-by: Knative Automation <automation@knative.team>
2021-12-14 10:34:51 -08:00
Fabian Lopez b190b52754
feat: allow build to be triggered from run when fn.Image is missing (#644)
* allow build to be triggered from run when fn.Image is missing

* add build check when run by the run command

* added unit test for run command

* remove log output

* rename run test

* change build trigger to be managed by a flag and not a prompt

* tlet users know about the --build flag in the error message

* fix code check issue

* add some debug info to the run_test

* Update cmd/run.go

Co-authored-by: Luke Kingland <58986931+lkingland@users.noreply.github.com>

* add build field to runConfig

* fix issue with cmd args for testing

* refactor run tests to use mocks

* update imageless function run error message

* add check for build error test case

* run unit test cleanup

* empty commit

Co-authored-by: Luke Kingland <58986931+lkingland@users.noreply.github.com>
2021-12-13 09:25:22 -08:00