* 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>
* Fixed pod readiness check
Detect also if pod did not exited prematurely.
Signed-off-by: Matej Vašek <mvasek@redhat.com>
* Removed dependency on sh/tar from alpine image
This commit removes depencency on sh and tar binaries by implementing
the logic in our func-util binary.
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>
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>
* 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>
* test: use custom buildah image in tests
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* refactor: rename
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* test: use internal registry in on cluster tests
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* chore: more verbose output
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fix: use fake ctx until fixing termination properly
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>
* Revert "src: Use jobs not plain pods for auxiliary tasks (#1857)"
This reverts commit cb6f33d924.
* refactor: move code from openshift
This is needed to avoid circular package dependencies.
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fix: set pod SC only on non-OpenShift
Signed-off-by: Matej Vasek <mvasek@redhat.com>
---------
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* 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>
* 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>
* 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>