Commit Graph

196 Commits

Author SHA1 Message Date
Luke Kingland d7d3f8f052
feat: support external deps for host runs (#1882) 2023-07-25 19:31:40 +00:00
Adam Boczek 025c457955
add defaults for the security context to avoid warnings (#1851) (#1886) 2023-07-25 19:12:39 +00:00
Matej Vasek cb6f33d924
src: Use jobs not plain pods for auxiliary tasks (#1857)
* src: Use jobs not plain pods for auxiliary tasks

Job should have security context set properly automatically.

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

* fixup: remove unused code

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-07-24 21:14:38 +00:00
Matej Vasek 8b46151b92
fix: resolve tkn task spec locally (#1885)
* fix: resolve tkn task spec locally

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

* fixup: remove unused import

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

* fixup: run ./hack/update-deps.sh

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-07-24 18:09:39 +00:00
Luke Kingland 60aafba296
fix: host builder retry error (#1874)
* error message improvement

* src: remove trailing period on error

* fix: clear previous build on rebuild
2023-07-20 16:02:12 +00:00
Matej Vasek 5948cf4a07
Update docker client dependency (#1877)
* chore: update docker client lib

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

* fixup: "host" OCI pusher

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

* fixup: downgrade github.com/containers/image/v5

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

* fixup: platform tests

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-07-20 10:50:12 +00:00
Matej Vasek 410f0757ae
fix: remove path bacause of bug in paring logic (#1875)
* fix: remove path bacause of bug in paring logic

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

* Update pkg/docker/docker_client.go

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-07-18 19:28:10 +00:00
Matej Vasek a9e52815bc
fix: OCI content creation by "host" builder on Win (#1871)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-07-18 17:29:09 +00:00
Luke Kingland 4719a43530
adds ADDRESS env to deployed (#1837)
Requests that deployed functions listen on all interfaces by default by
providing an ADDRESS environment variable.
2023-07-12 20:15:14 +00:00
Zbynek Roubalik 79c36eefdc
use Tekton Resolvers for a standard on cluster build (#1843)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-07-11 17:41:13 +00:00
Nitish Chauhan c15450177a
adding support for .funcignore file (#1815)
* adding suppor for funcignore file

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* resolving unit test and linting error

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* adding unit tests and symlink

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* making requested changes in tests

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* making requested changes

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* changing the comment

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* resolving unit test error in windows

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

---------

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
2023-06-28 20:36:03 +00:00
Matej Vasek 504b40b8eb
Cluster integration tests cleanup (#1829)
* test: better cleanup

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

* test: k8s dialer test improvements

* Use deployment, not pod directly.
* Use gcr.io/knative-samples/helloworld-go instead of nginx.

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

* refactor: dialer ctor accepts k8s config as param

This is in general better design since ctor does not relay on global
state in form of environment variable.
This also allows to run tests in parallel against various clusters.

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

* test: do run tests in a new namespace

Not all cluster users can create a new namesapce.
If we want to run test against non-admin users namespace must be ensured
by test invoker.

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

* test: better deletion policy

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

* test: better random resource names

Related resource have common random suffix.

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-06-27 14:54:52 +00:00
Luke Kingland 19509e5053
feat: scaffolded functions certs (#1823) 2023-06-26 18:57:51 +00:00
Matej Vasek cbd6b04986
fix: choosePort for host-runner (#1825)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-06-26 18:24:51 +00:00
Luke Kingland 8a078cea0c
src: make update-runtimes (#1822)
- Updates func-runtime-go 20 v0.2.3
- Create an 'update-runtimes' make target
- Standardizes plurality of "Cloudevents" throughout
2023-06-22 07:00:35 +00:00
Luke Kingland 264507dc8b
src: speed up tests by building with a test platform (#1820) 2023-06-22 06:58:35 +00:00
Luke Kingland 278ce6b0d8
src: refactor builder concurrency test (#1821) 2023-06-21 11:18:36 +00:00
Nitish Chauhan f93b23290c
adding service account support (#1812)
* adding service account support

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* correcting formatting

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

---------

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Co-authored-by: Matej Vasek <mvasek@redhat.com>
2023-06-21 07:44:35 +00:00
Luke Kingland 8dc5a76d24
feat: enable host-built functions' dependencies (#1790) 2023-06-21 05:50:34 +00:00
Luke Kingland 51cb15b78a
feat: enable host builder via cli (#1748) 2023-06-20 17:33:34 +00:00
Sascha Grunert c1a90f65f2
Add support for `serviceAccountName` on deploy (#1811)
This allows setting the service account for the resulting knative
service, which must pre-exist in the namespace to let the deployment
succeed.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-06-19 16:46:54 +00:00
Matej Vasek 3d1176680d
fix: bad connection handling for in cluster dialer (#1800)
* fix: bad connection handling for in cluster dialer

Connections were closed from wrong end of io.Pipe
which resulted in confusing error logs.

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

* feat: DialContext() better error handling

Now DialContext() returns some errors immediately
instead of deferring it Read/Write operation on the returned connection.

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

* feat: DialContext() more better error handling

Now ContextDial() tries to parse socat's stderr and translate it to Go's net.OpError
instead of just creating error with whole stderr embedded in it.

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

* Apply suggestions from code review

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
Co-authored-by: Lance Ball <lball@redhat.com>
2023-06-19 06:23:53 +00:00
Luke Kingland cabba3f9d3
feat: start timeout for host runs (#1782)
* feat: start timeout for host runs

* refactor timeout function

* hide flag until a valid path
2023-06-16 19:57:49 +00:00
Nitish Chauhan d3a6d6c60c
adding default builders (#1796)
* adding default builders

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* adding yaml format output option

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* fixing typo

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

* making changes in flag

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>

---------

Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
2023-06-14 17:01:46 +00:00
Luke Kingland 25ec89d52c
feat: platform build options (#1780)
Plumbs through the platform CLI flag to the individual builders by
creating a client-level BuildOption functional option, and modifying the
builder interface to accept an optional set of requested target
platforms.
2023-06-12 14:04:03 +00:00
Luke Kingland 0ef55f8036
src: cleanup the run timeout loop and check (#1804)
* src: cleanup the run timeout loop and check

* Update pkg/functions/runner.go

---------

Co-authored-by: Matej Vasek <matejvasek@gmail.com>
2023-06-09 16:52:00 +00:00
Aleksander Slominski 8489a0d08b
Check error before defer body close, include timeout in error message (#1803) 2023-06-09 00:52:58 +00:00
Matej Vasek 6b97fb5a3c
test: integration test for tekton on cluster build (#1789)
* test: integration tests for Tekton builds

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

* fixup: disable s2i integration test for now

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-06-07 21:47:57 +00:00
Matej Vasek 4386689f41
cleanup: run test operations in dedicated ns (#1791)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-06-07 07:21:57 +00:00
Jefferson Ramos 2af040f5b7
chore: default s2i builder as var for ldflags (#1787) 2023-06-06 21:51:26 +00:00
Luke Kingland e5aff92984
feat: enable scaffolding for host builds (#1750)
* feat: enable scaffolding in builder

* fix a few typos

* error text formatting

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

* error text formatting

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

* remove test job stop defer

---------

Co-authored-by: Lance Ball <lball@redhat.com>
2023-06-06 20:37:26 +00:00
Luke Kingland 9632748f19
src: errors cleanup (#1783) 2023-06-06 20:15:26 +00:00
Michal Vinkler 109e6b6be8
Fix appending SHA256 hash to image reference in ImageWithDigest (#1784) 2023-06-06 19:01:26 +00:00
Matej Vasek 75a8b8991d
chore: clean up PaC GitLab test (#1785)
* chore: clean up PaC GitLab test

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

* fixup: missing EOL

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

* fixup: generate random password for GitLab

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-06-06 17:55:26 +00:00
Luke Kingland a7f68f9de9
fix: filename typo (#1772) 2023-06-06 00:24:26 +00:00
Matej Vasek 4e743684e1
Pipeline as Code integration for GitLab (#1769)
* feat: PaC for Gitlab

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

* fixup: different approach to hostname resolution

Resolve '[*.]127.0.0.1.sslip.io' to cluster node IP.

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

* fixup: error handling

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

* fixup: added TODO

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

* fixup: small refactor

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-06-05 19:48:26 +00:00
Luke Kingland d3e33738b9
src: add missing 'omitempty' annotations (#1773) 2023-06-05 18:29:26 +00:00
Luke Kingland 7175a554ff
feat: source-defined buildpacks (#1774)
Allows buildpacks to be updated by updating to a newer version of
func.  Previously, buildpacs were fixed at time of function creation
without a manual edit of func.yaml.  Currently using Go as the reference
implementation in this commit.
2023-06-05 09:49:41 +00:00
Luke Kingland bb599f00f9
fix: PVCSize resets to default (#1771)
Refactors PVCSize to treat the Function member as a custom setting,
and the in-code constant as the default.

- Fixes a bug where the PVCSize would reset to the default on deploy
- Allows the default to be changed by future func version, only pinning
  the value if explicitly requested by the user.
2023-06-05 09:43:41 +00:00
Luke Kingland 4dad8aaf7a
reduce default build platforms (#1765) 2023-05-30 17:04:35 +00:00
Lance Ball dd7c8bdc4e
deps: update tekton to latest versions (#1753)
* deps: update tekton to latest versions

Fixes: https://github.com/knative/func/issues/1716

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

* fixup: rebase

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

* fixup: replace kube-openapi with older version and add shell scripts

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

* fixup: handle deprecations

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

* fixup: revert make check timeout value

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

---------

Signed-off-by: Lance Ball <lball@redhat.com>
2023-05-26 20:04:26 +00:00
Matej Vasek f8e976cb05
Pass image with digest to the deploy task (#1756)
* fix: deploy task explicitly sets --image flag

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

* fix: PaC with `pack` sets image param for deploy task

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

* fixup: unify output of s2i and pack build task

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

* fixup: unify passing of produced image by build tasks

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>
2023-05-25 15:18:27 +00:00
Luke Kingland b82a5a4eac
feat: host-based scaffolded function runner (#1733)
* feat: host runner

* improve error message wording
2023-05-24 21:26:25 +00:00
Jefferson Ramos f155c9c7ae
chore: preparing pipelines as code template for midstream customization (#1735) 2023-05-24 20:31:23 +00:00
Luke Kingland bf01e6426a
feat: oci directory pusher (#1702)
* feat: write instanced and static scaffolding

* feat: add oci pusher
2023-05-18 23:19:13 +00:00
Luke Kingland 530ea4fe53
feat: write instanced and static scaffolding (#1732) 2023-05-18 20:03:14 +00:00
Lance Ball f070ea8c00
chore: improve error messages for most commands (#1745)
This commit adds a new error type `UninitializedError` to minimize
redundancy across commands, and applies it in all of the commands which
need an initialized function to operate.

Fixes: https://github.com/knative/func/issues/1744

Signed-off-by: Lance Ball <lball@redhat.com>
2023-05-17 15:52:12 +00:00
Zbynek Roubalik 702da8a665
chore: improve error msg when PAC is not installed (#1742)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-05-17 15:06:12 +00:00
Luke Kingland 9a790f005f
feat: host oci builder (#1730)
* feat: oci builder for host builds

* do not expose host builder until fully baked
2023-05-17 10:53:11 +00:00
Luke Kingland 94c81d4046
fix: .gitignore stamp interference (#1728)
- The .gitignore file was always relative to process' current working
  directory.  Now correctly uses the function root
- The .gitignore file was always being updated, causing its modification
  timestamp to be updated multiple times throughout the executaion of
  any client commands.
- Adds the ability to override this behavior by commenting out the line
  in the .gitignore.
- Adds the ability to request that stamping create an ongoing journal
  via a build log file with timestamp prefix (for debugging)
2023-05-16 19:41:11 +00:00
Matej Vasek ca0c251bb9
fix: use full builder for Rust (#1737)
Some Rust libraries using system libraries need pkg-config installed and
it is not present in the base builder, only in the full one.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-05-10 20:55:01 +00:00
Luke Kingland f58770d997
feat: function signature detection (#1699)
* feat: function signatures and detector

Adds an enumeration of base accepted method signatures, and implements a
detector for go functions.

* fix lint errors

* Capitalize error text

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

* Capitalize error text

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

* Capitalize error text

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

* Capitalize error text

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

* Add error text punctuation

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

---------

Co-authored-by: Lance Ball <lball@redhat.com>
2023-05-10 16:02:02 +00:00
Luke Kingland 89b599df24
feat: job scaffolding (#1697)
* feat: job scaffolding

- Local jobs use a directory rather than filename
  This sets up for upcoming scaffolding to use as a space for job
  scaffolding code.
- Places all jobs within a 'runs' directory in ./func rather than
  'instances' to further differentiate between an instance and a local
  run task invoked via .Run
- Updates Jobs' stop handler to have an error return.
- Adds tests which ensure creating and stopping a job are reflected in
  the client's .Instances().Local() accessor.
- Adds verbose logging support to the Job implementation.
- Adds a cleanup task which will remove orphaned jobs by, in addition to
  previous logic, checking that there is no longer a process listening
  on the port indicated by the job.

* fix spelling errors

* fix lint errors

* log job stop errors

* use temp dir for tests

* add back docker build tags and wait
2023-05-04 20:53:57 +00:00
Luke Kingland 3c371f79f2
feat: func domain route (#1690)
* feat: func domain route

Adds the --domain flag which, when provided sets the value of the
func.domain label on the deployed knative service.  The cluster can then
use this to choose which route to create for multi-route clusters.
Optional.

* fix whitespace
2023-05-04 19:48:57 +00:00
Luke Kingland 1285176f60
feat: write a build stamp log to .func (#1695)
* feat: build stamp and log

- Adds an explicit "Stamp" step to client builds
- Building always "Stamps" the function, allowing builds to cache
- Commands which alter function in inconsequential ways update the stamp
  as-needed.
- Tests updated to use the API rather than hard-coding func.yaml

* fix misspellings

* temporarily disable Quarkus tests

* stamping also creates necessary run directory

* reenable Quarkus tests

* comments
2023-05-03 21:43:56 +00:00
Zuhair AlSader 6558f9652d
add pvc and emptyDir to function_volumes (#1666)
* add pvc and emptyDir to function_volumes

Signed-off-by: Zuhair AlSader <zuhair@koor.tech>

* add pvc and emptydir to deployer

Signed-off-by: Zuhair AlSader <zuhair@koor.tech>

* add config functions

Signed-off-by: Zuhair AlSader <zuhair@koor.tech>

* update tests

Signed-off-by: Zuhair AlSader <zuhair@koor.tech>

* use random string for emptydir

Signed-off-by: Zuhair AlSader <zuhair@koor.tech>

* include func yaml schema

Signed-off-by: Zuhair AlSader <zuhair@koor.tech>

* fix make schema-generate

it needs to be regenrated every time.

Signed-off-by: Zuhair AlSader <zuhair@koor.tech>

* make function volumes dependency-free

Signed-off-by: Zuhair AlSader <zuhair@koor.tech>

* add prompt for extension flags

Signed-off-by: Zuhair AlSader <zuhair@koor.tech>

* add dependency in func_yaml-schema

Signed-off-by: Zuhair AlSader <zuhair@koor.tech>

---------

Signed-off-by: Zuhair AlSader <zuhair@koor.tech>
2023-05-03 13:57:56 +00:00
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
Matej Vasek f2eb853073
fix: PaC not working with dot git suffixed url (#1713)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-04-28 19:13:51 +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
Will Li cd0dbfd300
feat: specify create time for image built with buildpacks (#1685)
* specify the image created time

* add build-timestamp config

* fix trailing white space
2023-04-28 07:14: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 506cb71e76
test: extend filesystem tests (#1684)
* refactor: extract functions

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

* test: extend filesystem tests

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-04-24 14:02:43 +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
Gunjan Vyas 8f2f290aab
Replace knative.dev/client references to knative.dev/client-pkg (#1671) 2023-04-10 15:59:39 +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
Matej Vasek f877aebdd5
chore: update lifecycle image to v0.16.1 (#1653)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-03-28 17:35:59 +00:00
Manoel Marques c8f22e735b
Minimal initial func.yaml (#1630) 2023-03-27 06:55:57 +00:00
Matej Vasek 73f8773b7d
style: fix lint error (#1648)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-03-23 18:43:54 +00:00
Matej Vasek 0645af7a41
fix: pre-compile mock binaries instead of 'go run' (#1645)
The 'go run' does internally compile and it prolongs perceived run-time.
This may lead to timeout in some tests.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-03-22 18:21:55 +00:00
Zbynek Roubalik 8d4db7546d
feat: PAC - add possibility to specify a Git provider (#1638)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-03-22 13:30:53 +00:00
Zbynek Roubalik c793fd4c88
feat: PAC - dynamically generate Pipeline target branch (#1636)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-03-22 13:15:53 +00:00
Matej Vasek 8eeff81580
fix: s2i build on Windows (#1641)
Make all files executable on Windows s2i build.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-03-21 21:27:52 +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 db1b624988
fix: TCP+TLS docker daemon connection (#1629)
* fix: TCP+TLS docker daemon connection

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

* fixup: skip tls verify if DOCKER_TLS_VERIFY is falsy

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-03-16 16:01:59 +00:00
Zbynek Roubalik b793f8739a
feat: PAC - add support for S2I (#1610)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-03-10 12:14:23 +00:00
Matej Vasek 7b85fa5f84
fix: node s2i build when node_modules present (#1612)
* fix: node s2i build when node_modules present

This is workaround for two bug in another components:
* The s2i CLI/library is not honoring the `--exclude` flag when used with
  the `--as-dockerfile` flag.
* The node s2i image is not working if project contains `node_modules`
  directory with NodeJS modules.

If only one of the bugs above were fixed this commit wouldn't be
necessary.

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

* fix: project root escape link detection

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

* fix: ignore node_modules for s2i on cluster build

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>
2023-03-10 12:09:24 +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 c552aa2e4e
chore: better output for PaC (#1606)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-03-08 17:34:22 +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
Matej Vasek 0a9ed1bc46
refactor: clean up filesystem test (#1584)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-02-27 02:21:32 +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
Luke Kingland 9961c43b35
rm testData (#1576) 2023-02-21 09:15:26 +00:00
David Hadas e6e27d6e66
fix initialization of service.Spec.Template.ObjectMeta.Annotations (#1569)
Signed-off-by: David Hadas <david.hadas@gmail.com>
2023-02-20 18:31:25 +00:00
Matej Vasek 138d1e46c5
fix: ban podman 4.3 for pack build (#1563)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-02-20 17:16:25 +00:00
Matej Vasek 6d4565158b
feat: enabled s2i for python (#1562)
* feat: enable s2i for python

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

* fixup: update zz_filesystem_generated.go

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

* fixup: test

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

* fixup: test

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

* fixup: test

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

* fixup: script

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-02-20 16:45:26 +00:00
Luke Kingland 902eaecd57
global config member accessors (#1559) 2023-02-16 20:07:52 +00:00
Zbynek Roubalik b26a1c29b3
chore: `testData` -> `testdata` (#1560)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-02-16 11:05:51 +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