Commit Graph

69 Commits

Author SHA1 Message Date
Luke Kingland 92d20b07d5
feat: func run support all build options (#1693)
* feat: func run build options and host runs

- Refactors the run command to include all options from build, in the same
  manner as deploy.
- Adds the --container flag (currently defaults to true) which will, when
  disabled, invoke the localhost-based runner which, in this commit, is not
  yet active.
- Updates help text to match the other command format, and lays the verbal
  groundwork for the difference between containerized (currently default)
  and non-containerized runs.

* fix e2e

* Update cmd/deploy.go

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

* Update pkg/functions/client.go

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

* Update cmd/run.go

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

---------

Co-authored-by: Lance Ball <lball@redhat.com>
2023-05-02 12:11:55 +00:00
Luke Kingland bcadf234d6
src: Envs type (#1701)
* feat: Envs type

Creates a type for []Env with a String and Slice method for presenting
a set of environment variables in common formats.

* fix: Envs tests
2023-04-28 16:45:51 +00:00
Luke Kingland 5dc18a1cd6
extract splitTemplateName from Templates.Get (#1700) 2023-04-25 14:01:45 +00:00
Luke Kingland 55a6e2846f
move template struct to templates.go (#1698) 2023-04-25 14:00:45 +00:00
Luke Kingland 135dba049d
rename Instance to InstanceRefs (#1694)
In order to not conflict with (and be confused with) the actual Instance
struct name which is introduced in the scaffolding func runtimes
middleware, the Instance struct herein is renamed InstanceRefs to more
accurately reflect its usage as a manager of references to instances.
2023-04-25 13:58:45 +00:00
Matej Vasek fd82412701
fix: increase connection timeouts (#1679)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-04-17 01:05:53 +00:00
Lumír 'Frenzy' Balhar 36d7b23b66
Add Python templates for gunicorn and uwsgi + Flask (#1655)
* Add Python templates for gunicorn and uwsgi + Flask

These templates represents the most common and simple ways
how to implement FAAS in Python either directly via gunicorn
or using Flask and uwsgi.

* feat: runtime envvar definition in templates

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

* fixup: use APP_MODULE not app.sh

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

* fixup: update docs

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

* test: better diffing in tests

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

* fixup: update tests

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

* fixup: style

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
Co-authored-by: Matej Vasek <mvasek@redhat.com>
2023-04-10 19:03:48 +00:00
Adam Boczek 2502819b61
feat: add pvc-size flag to deploy command (#851) (#1598)
* feat: add pvc-size flag to deploy command (#851)

* feat: move pvc-size from deploy to build func configuration section (#851)

* feat: add setting default value for pvc-size in func.yaml (#851)

* feat: change pvc-size to camel case (#851)

* feat: add omitempty to pvcSize (#851)

* feat: regenerate func yaml schema (#851)

* feat: update docs for deploy command (#851)

* feat: update usage help for the pvc-size flag (#851)
2023-04-05 11:54:39 +00:00
Manoel Marques 1ce5d2b7c3
Replace path with function struct in client api (#1640) 2023-03-31 00:45:00 +00:00
Manoel Marques c8f22e735b
Minimal initial func.yaml (#1630) 2023-03-27 06:55:57 +00:00
Zbynek Roubalik 3dc61c8979
feat: implement `func config git remove` (#1626)
* feat: implement `func config git remove`

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

* add test

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

---------

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-03-17 12:09:36 +00:00
Matej Vasek 9aac5eba68
fix: build stamp computation (#1608)
About the same time that buildStamp was computed .gitignore was modified.
This caused non-deterministic results, because sometimes the
modification was taken into account and sometimed it was not.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-03-08 23:06:20 +00:00
Zbynek Roubalik e3b318adff
feat: Pipelines as Code - initial support (pack) (#1594)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-03-07 15:41:20 +00:00
Luke Kingland 91c95a711e
fix: repo add skips root (#1577) 2023-02-21 20:40:27 +00:00
Zbynek Roubalik 726b566f83
fix: deploy annotations & labels correctly (#1574)
* fix: deploy annotations & labels correctly

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

* increase timeout

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

---------

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-02-21 15:24:26 +00:00
Luke Kingland 03c5df4337
fix: missing map initializations (#1575)
The helper Function constructor which uses a passed function as defaults
was missing map initializations.  This could lead to nil pointer
exceptions as it is used by client.Init.
2023-02-21 10:11:26 +00:00
Lance Ball ab194d421d
feat(templates): remove liveness and readiness from defaults (#1555)
* feat(templates): remove liveness and readiness from defaults

The liveness and readiness URLs are defined in code as defaulting to
`/health/liveness` and `/health/readiness` respectively. The deploy
command handles these defaults without requiring them to exist in the
`func.yaml` file. Existing tests for defaults and overrides already
exist, so this change does not require additional tests to be included.

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

* fixup: remove default endpoints from repository.go

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

---------

Signed-off-by: Lance Ball <lball@redhat.com>
2023-02-16 08:23:51 +00:00
Lance Ball 44bb13f803
feat: adds refspec support for `func repo add` (#1558)
* add option 'branch' to command 'repository add'

* Format go code (#1407)

Signed-off-by: Knative Automation <automation@knative.team>

* chore: refactor repository layout (#1554)

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

* fixup: removes --branch tag from repo commands

Removes the currently in-flight work on the `--branch` tag, simply
supporting a `refspec` on the repository URI. For example,
https://github.com/knative-sandbox/func-tastic#metacontroller will pull
the `func-tastic` repo, and set the currently active HEAD to the
`metacontroller` branch. Adds support for displaying this with the
command `func repo list -v`.

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

* fixup: add example to `func repo add` documentation

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

* fixup: adjust test output expectations

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

---------

Signed-off-by: Knative Automation <automation@knative.team>
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
Signed-off-by: Lance Ball <lball@redhat.com>
Co-authored-by: Yingchun Guo <yingchun.guo@intel.com>
Co-authored-by: knative-automation <automation@knative.team>
Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-02-16 04:05:51 +00:00
Zbynek Roubalik 5a4803bf95
chore: refactor repository layout (#1554)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-02-15 08:46:52 +00:00