Commit Graph

25 Commits

Author SHA1 Message Date
David Fridrich ca61712d4b
allow digested images to be 'run' (#2445)
* init fix

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* dont override direct deploy tag, more tests

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* dont validate with tagged image, fix comment

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* init run fix for --image

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* init

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* int test, add valid untdigested images to run

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* check images passed to runner for func run command

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix build/deploy image passing bug add test

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove extra printing

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* merge functions to digested

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* misspell

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* simplify

Signed-off-by: David Fridrich <fridrich.david19@gmail.com>

* quick fix

Signed-off-by: David Fridrich <fridrich.david19@gmail.com>

* remove prints, comment

Signed-off-by: David Fridrich <fridrich.david19@gmail.com>

---------

Signed-off-by: gauron99 <fridrich.david19@gmail.com>
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
2024-08-28 06:13:02 +00:00
Matej Vašek a2a97dbd85
Fix linter issues (#2420)
* chore: fixed typos

Signed-off-by: Matej Vašek <mvasek@redhat.com>

* chore: removed trailing whitespaces

Signed-off-by: Matej Vašek <mvasek@redhat.com>

* chore: added EoLs at EoFs

Signed-off-by: Matej Vašek <mvasek@redhat.com>

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-07-09 13:48:22 +00:00
Luke Kingland e6fa020f78
fix: test and namespace isolation (#2187)
* fix: namespace logic cleanup and test isolation

- Pulls logic for defaulting to active namespace (K8S) moved UP to CLI during
  flag default calculation.
- Pushes logic of deciding between f.Namespace vs f.Deploy.Namespace down into
  implementations.
- Updates some tests which needed to have their environment cleared.
- Refactors Pipelines tests to use client API.
- Removes namespaces as a state variable all structures, instead passing as
  an argument.
- Moves FromTempDirectory to testing package for use outside cmd.

* fix spelling errors

* fix: pipelines remover always returned (empty) error

* update tekton namespace handling

* fix: remove deprecated GitLab config: max_concurrency
2024-05-17 08:25:46 +00:00
Luke Kingland 9beea04064
Basic auth (#2242)
* feat: host builder basic auth

* update tests

* mark oci basic auth flags hidden

* cleanup
- Remove debug statements
- Fix test race
- Update licenses

* spelling and linting errors
2024-03-26 09:17:21 +00:00
Luke Kingland c5fcabab4a
remove unrechable condition (#2239) 2024-03-25 16:16:11 +00:00
David Fridrich 7e95ca2181
Cleanup orphaned func, new image-name calculation (#1962)
* forced namespace change, deletes old func, kind works

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* new .deploy.image field

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* building

* building

* add first iteration of complete functionality with f.Build.Image and f.Deploy.Image that STILL contains a workaround for image digest which is populated on Push instead of Build

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* base tests fixes for compile

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix base tests2 for now, integration test has a possible TODO

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* new generated schema

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix some tests using .Image and create new test

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove nested .func

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* get rid of test

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove my debug test

* fix namespace change test

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix pipeline run to use .Deploy.Image

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix TestDeploy_ConfigApplied and change pipelines image being used

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix some tests

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix actions - return value, configApplied and registry on subsequent deploy different

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* update empty image in tests issue

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix client.Apply tests with passing image value to .Deploy after push

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* openshift override on namespace change forced, remove useless print

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* printing fixes, reviewdog, buildConfig return

* fix pipelines test by feeding image name to .Deploy, comments

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* update more tests

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* new test, comment

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* misspell

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove unnecessary comments

* fix from review

* namespace updated with 2 fields; new error definitions; deploy functionality cleanup

* remove k8s service host var in test

* error definition; fix client tests; cli delete fixup

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* new schema

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* namespace fixes; remover arguments fix

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* delete_test cmd

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* schema, new local remote flag instead of deploy

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix test to have now required namespace

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* add namespace check, test action

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix integration deploy test, comments

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix wrongly removed namespace

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* small changes to remover and ns added to its tests

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* test moving logic to client

* fix deploy bug, remove verbose for better logs

* pipelines, clean remover

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* newline

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* namespace required in remover, and fixed remote deployer - returns ns

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* fix integ test for pipelines.Run

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* cleanup

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* registry update change on deploy, some prints

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* new deploy tests and mock update

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* new tests, ns determination in mocks

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* deploy digested img doesnt populate build

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* comments

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove todo

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

---------

Signed-off-by: gauron99 <fridrich.david19@gmail.com>
2024-02-27 10:44:20 +00:00
David Fridrich ec6ee77f5a
Remove progress package (spinner) (#1922)
* spinner print statements out

* structures out, del file

* fix pipelines_integration_test, return url now

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove unnecessary goroutines

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

* remove goroutine completely

Signed-off-by: gauron99 <fridrich.david19@gmail.com>

---------

Signed-off-by: gauron99 <fridrich.david19@gmail.com>
2023-08-16 15:13:42 +00:00
Matej Vasek 1163a5e5ae
fix: docker registry/repository parsing (#1929)
* fix: docker registry/repository parsing

Use go-containerregistry to do parsing.

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

* fix: use kebab-case instead of camelCase

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

* fix: use kebab-case instead of camelCase

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-08-14 18:17:40 +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
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
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 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
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
Luke Kingland 530ea4fe53
feat: write instanced and static scaffolding (#1732) 2023-05-18 20:03:14 +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
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
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 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
Manoel Marques 1ce5d2b7c3
Replace path with function struct in client api (#1640) 2023-03-31 00:45:00 +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
Zbynek Roubalik 5a4803bf95
chore: refactor repository layout (#1554)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-02-15 08:46:52 +00:00