* 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>
* 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>
* 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>
* 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>
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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
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.