Commit Graph

187 Commits

Author SHA1 Message Date
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 d481289397
Remove unnecessary 'go get' commands (#2524)
Signed-off-by: Matej Vašek <matejvasek@gmail.com>
2024-09-30 05:22:38 +00:00
Matej Vašek 075bc9bed4
fix: allow sub-pkgs in Go functions (#2523)
* fix: allow sub-pkgs in Go functions

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

* fixup

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

* fixup

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

* fixup

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

---------

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
2024-09-27 01:02:32 +00:00
Matej Vašek 1702c8e3c4
Update builder.go (#2512) 2024-09-24 09:17:54 +00:00
Matej Vašek 1937499775
Improve socat conn success detection (#2506)
It appears that Go's MatchReader() returns true only if some new lines
are written to the writer after the searched word. It mostly all right
because socat actually writes several more lines to stderr. However this
new implementation is better it should signal immediately when searched
patter is written to the writer.

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
2024-09-20 06:42:26 +00:00
Matej Vašek 42ed4d8096
Fix test failures in OCP prow CI (#2503)
* Fix test failures in OCP prow CI

Ensure that ServeRepo() make copy of repo from ./testdata and serves the
repo from that copy.

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

* fixup: typo

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

---------

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
2024-09-16 06:57:35 +00:00
Jefferson Ramos 84f4caf724
test: preventing dubios ownership repository error on git unit tests (#2499) 2024-09-13 13:33:35 +00:00
David Fridrich 92856e5627
Fix: create whole config path if it doesnt exist yet (#2490)
* fix

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

* fix

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

---------

Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
2024-09-10 14:46:47 +00:00
David Fridrich 8dce9bcaa7
fix: HOME with different permissions (#2361)
* fixed integration tests

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

* docker config.json credentials test when HOME not defined

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

* pack test

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

* simplify

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

* og creds, small fixes

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

* s2i test no home

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

* remove unnecessary stuff

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

* deploy test without home

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

* confict fix after rebase

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

* move test, dont delete

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

* runtime change

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

* node image signals fixed and smaller size for GH actions

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

* return err

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

* clean up comments

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

* creds and test

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

* test return commented code

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

* config warning

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

* cleanup

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

* cleanup

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

* fix

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

* fix

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

* skip test for windows

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

* skip for prow

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

* fix repo on create, move warning up a function

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

* fix print

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-09-09 07:20:04 +00:00
David Fridrich a13056e4ee
migrate client-pkg to client/pkg (#2477)
* migrate

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

* migrate more

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

* sort imports

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

---------

Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
2024-09-04 10:08:32 +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
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 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 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
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
Swastik Gour 40eb0eb304
corrected error msg (#2372)
* corrected error msg

Signed-off-by: swastik959 <Sswastik959@gmail.com>

* lintted

Signed-off-by: swastik959 <Sswastik959@gmail.com>

---------

Signed-off-by: swastik959 <Sswastik959@gmail.com>
2024-06-20 14:10:18 +00:00
Matej Vašek f249714bfe
chore: removed deprecated types (#2378)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-20 06:07:17 +00:00
Matej Vašek 9f7eac80ce
test: better res cleanup (#2349)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-12 16:01:03 +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 a18957db0a
fix: mount of socket from Docker Desktop (#2350)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-12 09:57:40 +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 2aec66735f
chore: ubi9 => ubi8 (#2338)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-06-05 14:13:48 +00:00
David Fridrich aa909bdc44
Run func without HOME defined/ unaccessible .config dir (#2236)
* fixed integration tests

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

* def creds back

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

* docker config.json credentials test when HOME not defined

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

* pack test

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

* simplify

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

* og creds, small fixes

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

* s2i test no home

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

* remove unnecessary stuff

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

* deploy test without home

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

* confict fix after rebase

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

* move test, dont delete

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

* runtime change

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

* node image signals fixed and smaller size for GH actions

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

* return err

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

* cred test

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

* clean up comments

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

---------

Signed-off-by: gauron99 <fridrich.david19@gmail.com>
2024-06-04 00:04:52 +00:00
Matej Vašek d3b8847792
chore: update images ubi8 => ubi9 (#2328)
Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-05-28 16:36:44 +00:00
Matej Vašek 125e4b6665
Use image index not just image (#2284)
* Always try daemon push first

Daemon push is now tried always first withouth using
net.DefaultResolver.LookupHost() to guess if the registry is reachable
from the daemon. If the daemon returns error contaning "no such host"
then use manual push with custom transport.

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

* Rework image pusher tests

Merged daemon push and non-daemon tests to one table driven test.

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

* Use image index not just image

This results in "multi-arch" image with single architecture this may
seems weird but it helps multi-arch clusters to run pods on approprieate
nodes.

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

* fixup: style

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

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-05-28 14:27:17 +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
David Simansky f594551317
fix: Fix Test_deployerNamespace with empty kubeconfig (#2286) 2024-05-06 06:54:25 +00:00
David Simansky e3db53309f
fix: Disable flaky unit test Test_deployerNamespace (#2285) 2024-05-02 10:10:55 +00:00
Matej Vašek 7c87e0c4b8
chore: update node to v20 (#2217)
* chore: update node to v20

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

* fixup: temporarily ingore deletion errors for Node

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

* fixup

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

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-04-30 14:53:54 +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 cf433243cb
chore: update codecov/codecov-action (#2267)
* chore: update codecov/codecov-action

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

* chore: pin paketo builder version

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

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
2024-04-10 11:47:01 +00:00
David Simansky 5a2e58441d
Update Knative deps to latest (#2265) 2024-04-05 09:07:51 +00:00
Luke Kingland e4010db028
src: cleanup setup scripts (#2247)
The current binaries and allocation scrips are very CI-centric, this PR
takes a few steps to make them more friendly to running in a dev
environment; mainly centered around not polluting global scope (keeping
filesystem mutations in a relative local directory).

- binaries (and kind kubeconfig) are installed in ./hack/bin
- adds /hack/bin to .gitignore
- binary paths can be overridden via env vars FUNC_TEST_{name}
- binary fallback is system-installed (when binaries.sh not run)
- Cleanup of the UX, including colors and some shared helpers via
  library.sh
- Removes `yq` as the hack that required it appears to no longer be necessary.
- Adds some notes for Nix users
- Better error messaging when !linux
- Refactors the installers to pipe directly to tar rather than touch
  disk.
- begin to standardize on hyphens in filenames
2024-04-02 08:29:03 +00:00
Calum Murray 701e258acf
fix: func invoke unmarshals json before setting it in the event (#2256)
Signed-off-by: Calum Murray <cmurray@redhat.com>
2024-03-29 09:55:40 +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
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
Dave Protasowski 1d0d7611b2
Introduce a --registry-insecure flag (#2234)
* fix env var casing otherwise flags with hyphens will continue to have hyphens

* Introduce an --registry-insecure flag

* fix build tests

* fix TestList

* fix insecure (http) push
2024-03-16 04:45:20 +00:00
Dave Protasowski 4d73d8d055
func-go v1.21.3 - idiomatic handler signatures (#2227)
* update go-http templates to match new idiomatic handler

* update embedded templates

* bump func-go dependency

* regenerate templates

* update template deps again

* run embed again

* update test fixtures

* use go1.22 in CI

* setup metallb right after creating k8s cluster

* func-go v1.21.2

* revert static http handler signature update

Since the Pack and S2I builders do not yet use the new func-go
middleware, we are not yet able update the static static handler template.

* func-go v0.21.3

* revert static handler template test

* update embedded template fs

* try go 1.21 throughout

---------

Co-authored-by: Luke Kingland <luke@lukekingland.com>
2024-03-14 14:40:36 +00:00