Commit Graph

65 Commits

Author SHA1 Message Date
Matej Vašek 8e0b752edc
Apply linter suggestions (#2786)
* Refactor: if-elif-else => switch

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

* Cleanup: calls to embedded fields

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

* Fix: add missing err checks

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

* Cleanup: fix format of error messages

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

* Cleanup: omit type where possible

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

* Cleanup: apply De Morgan's law

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

* Cleanup: call ReplaceAll where possible

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

* Cleanup: fix format of error messages

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

* Cleanup: fix format of error messages

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

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2025-04-15 09:43:13 +00:00
Matej Vašek f12acd34de
Refactor if-elif-else => switch (#2785)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
2025-04-14 12:02:16 +00:00
Luke Kingland 1d26629b51
feat: remote storage class (#2693)
* feat: remote storage class

* why isn't the schema regenerated on each make
2025-02-19 07:35:47 +00:00
Matej Vašek 9c0c216193
Optimise func-utils image (#2686)
* Use command instad of script in some tkn tasks

The "script" requires /bin/sh present in the image.

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

* Add s2i-generate command to func-util image

The command encompasses some logic previously implemented as shell
script defined in tekton task. This allows us to remove sh/shell from
the func-util image.

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

* Make func-util image "FROM scratch"

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

* Change func-utils image tag latest->v2

Since there are backward incompatible changes we must not change how
'latest' tag work (at least for some time).

For this reason we change tag to v2, so newer versions of func use that
and older use 'latest' that is compatible with them.

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

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2025-02-06 07:02:13 +00:00
Matej Vašek d2aa94d30a
Remove usage of ttl.sh (#2653)
* Remove usage of ttl.sh

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

* Fix detection of host resolution failure

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

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2025-01-21 06:32:09 +00:00
Matej Vašek 70f96bb8ac
Fix some linter errors in integration tests (#2608)
* Fix some linter errors

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

* fixup: set func registry

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

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-12-04 13:36:45 +00:00
Matej Vašek 8815c53e79
Fix missing workspaces decl in the scaffold task (#2587)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-11-28 00:16:13 +00:00
Luke Kingland 2fd4982e05
fix: set DOCKER_CONFIG prior to build (#2580) 2024-11-19 11:59:01 +00:00
Matej Vašek e2621f6637
Fix symlink path separators (#2535)
When running on Windows the path separators in symlink target is
backslash. This must be fixed up when uploading source code into docker
daemon or into cluster volume.

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
2024-10-11 10:39:08 +00:00
Jefferson Ramos f3369409ba
Set default value for REGISTRY param on func-s2i task (#2530) 2024-10-03 12:50:23 +00:00
Jefferson Ramos be3a8a07b6
fix: Remove unnecesary annotations from Pipeline-as-Code template (#2527) 2024-10-01 17:21:21 +00:00
Matej Vašek e937035dae
Incorporate s2i CLI into func-utils image. (#2473)
Signed-off-by: Matej Vašek <matejvasek@gmail.com>
2024-09-03 13:03:21 +00:00
Matej Vašek 2e4d157162
On cluster s2i build for Go (alternative version) (#2471)
* Prepare util image to accomodate multiple cmds

As of now func-util image has only one command of our own -- "deploy".
This commits prepares grounds for one additional command named "scaffolding".
The commands will be implemented in one binary and dispatched over
argv[0] using symlinks. Kinda like busybox does.

Signed-off-by: Matej Vašek <matejvasek@gmail.com>

* Add scaffolding for on-cluster build

Added new build step in tekton pipeline that scaffolds main() for Go
porject when using s2i builder.

Signed-off-by: Matej Vašek <matejvasek@gmail.com>

* Better docker build caching

This will cache dependencies between docker builds.

Signed-off-by: Matej Vašek <matejvasek@gmail.com>

* fixup: perms

Signed-off-by: Matej Vašek <matejvasek@gmail.com>

* fixup: remove broken check

Signed-off-by: Matej Vašek <matejvasek@gmail.com>

* fixup: remove test because of 'no space left on device'

Signed-off-by: Matej Vašek <matejvasek@gmail.com>

* Make func-util rootfull

Signed-off-by: Matej Vašek <matejvasek@gmail.com>

---------

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
2024-09-03 12:33:17 +00:00
Matej Vašek aed23cf9a1
Fix PaC detection for Red Hat's Sandbox cluster (#2429)
The sandbox cluster installs PaC cm into tekton-pipelines NS.

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
2024-07-19 09:37:20 +00:00
Matej Vašek 3eab5fc25d
chore: removed unused constants (#2402)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-27 05:21:29 +00:00
Matej Vašek 3e8dc4ddc1
feat: embed tkn tasks in func binary (#2396)
* feat: embed tkn tasks in func binary

Embed Tekton tasks for direct on cluster build.

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

* feat: embed tkn tasks in func binary

Embed Tekton tasks for PaC build.

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

* feat: added tkn-tasks sub-command

This new command prints tektons tasks in form of multi-document yaml,
these tekton tasks may requird to be installed for some advanced
functionality.

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

* chore: remove unused files

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

* feat: make deployer image settable via linker

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

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-26 17:48:06 +00:00
Matej Vašek bbdd66b0f3
chore: updated tekton api verison (#2383)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-20 18:01:14 +00:00
Matej Vašek d6b1822543
test: increased wait period (#2356)
Increased wait period for Gitlab settings change to kick in.

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-12 11:14:28 +00:00
Matej Vašek 2e7154ca84
Optimized disk usage in GH Action for integration tests (#2355)
* tests: remote unncessary software from GH VM

Previously tests were failing with no space left on device.

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

* fixup: updated generated code

The codegen should have been updated in prior PR but we forget do do it
there.

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

* test: wait for gitlab setting effect

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

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-11 18:47:42 +00:00
Matej Vašek a898fe79e0
fix: PaC build (#2341)
* Fixed detection of PaC controller URL for unprivileged users.
* Use fn.Deploy.Image before fn.Image since the fn.Image may not be
  populated.

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-11 13:38:33 +00:00
Matej Vašek 80d0e21481
fix: error when setting gitlab settings in test (#2342)
* test: fix error when setting gitlab settings

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

* test: replace sleep with active condition check

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

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-07 11:29:37 +00:00
Matej Vašek 059f788061
chore: update tekton,PaC (#2340)
* chore: update tekton

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

* fixup: param introduced in new version of gitlab lib

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

* chore: update tekton,PaC used in test env

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

* fixup: disable affinity assistant for tekton

The affinity assistant is causing troubles in testing KinD cluster.

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

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-06 23:46:43 +00:00
Matej Vašek 7276955847
fix: pipeline run yaml format for newer PaC (#2317)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-05-22 19:03:10 +00:00
Matej Vašek feb06f52b0
Fix PaC build (#2314)
* fix: default NS for PaC

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

* fix: make error non-fatal

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

* fix: pass correct image to PaC

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

* chore: enable gitlab test

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-05-22 15:19:36 +00:00
Luke Kingland b0418f95bb
feat: s2i Go support (#2203) 2024-05-21 13:12:55 +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
Matej Vašek 1aed6e04d3
chore: make tkn taks urls setable via linker flags (#2277)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-04-23 11:15:02 +00:00
Matej Vašek 6b78b7f5c5
Improve utility image (#2246)
* The socat/tar image is now build in GH Actions.
* We use new tiny deploy binary for deployment instead of whole func.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2024-03-26 11:30:56 +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 fcdafd7d1b
unreliable gitlab test skip (#2186)
* unreliable gitlab test skip

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

* comm

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

---------

Signed-off-by: gauron99 <fridrich.david19@gmail.com>
2024-02-27 09:37:48 +00:00
Gunjan Vyas e6c53eb083
func write: write localsettings to .func/local.yaml (#2121) 2024-01-19 08:56:06 +00:00
Matej Vasek 152d00901b
fix: GitLab test (#2112)
* fix: GitLab test

Update to URL used in newer versions of GitLab.

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

* fixup: increase resource limit

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2024-01-10 17:35:43 +00:00
Matej Vasek 00591fd1c9
test: better clean up after test (#2034)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-10-19 11:38:06 +00:00
Matej Vasek 68f357561b
Use our own s2i image (#1971)
Our image is much more recent and it is multiarch.
2023-09-13 17:38:03 +00:00
Matej Vasek 97291a4422
fix: direct upload ppc64le, x390x (#1958)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-09-05 12:29:17 +00:00
Matej Vasek 7a7e4bf24a
chore: update buildah image ref (#1960)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-08-31 17:28:35 +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 67517b738e
feat: tekton task urls in the env sub-cmd output (#1925)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-08-13 15:14:42 +00:00
Matej Vasek efb04bef0f
Use custom jammy paketo builder (#1911)
* chore: use custom jammy paketo builder

Use our own modified jammy builder with additional buildpacks for
GoFunc and Rust. This enables on cluster build for Go and Rust functions.
Where possible (Go, Java) we use "tiny" variant, other runtimes use "base"
variant.

The updated task is new file instead of modifying existing task
this is done for sake of keeping compatiblility.

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

* fixup: remove unnecessary code per review request

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

* fixup

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

* fixup: podman test refers correct tkn task yamls

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-08-10 03:25:35 +00:00
Matej Vasek a2b7d2c932
chore: mark test as integration test (#1920)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-08-09 20:44:34 +00:00
Matej Vasek 45d242633a
fix: report correct error when task doesn't exist (#1915)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-08-09 15:16:35 +00:00
Shashank Sharma 2463202f11
allowing on cluster build for go runtime (#1445)
* allowing on cluster build for go runtime

* warning message added for go and rust builder

* gofmt

* fixups

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-07-28 12:02:10 +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
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
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
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 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