* 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>
* Fix: Go scaffolding uses correct module name
Using incorrect name works for a functions with flat structure -- no
sub-packages. When sub-packages are used we need to refer the user
module by its true name.
Signed-off-by: Matej Vašek <mvasek@redhat.com>
* fixup tests
Signed-off-by: Matej Vašek <mvasek@redhat.com>
---------
Signed-off-by: Matej Vašek <mvasek@redhat.com>
* Make build binds more similar to runtime binds
Signed-off-by: Matej Vašek <mvasek@redhat.com>
* Added comments on struct
Signed-off-by: Matej Vašek <mvasek@redhat.com>
---------
Signed-off-by: Matej Vašek <mvasek@redhat.com>
* Added tests for s2i build with private Go module
The test is for now skipped since host binds are not yet implemented for s2i.
Signed-off-by: Matej Vašek <mvasek@redhat.com>
* User "host" network mode for s2i build on Linux
Signed-off-by: Matej Vašek <mvasek@redhat.com>
* Implement host binds for local s2i build
Signed-off-by: Matej Vašek <mvasek@redhat.com>
---------
Signed-off-by: Matej Vašek <mvasek@redhat.com>
* refactor python http template
* python http scaffolding
* add python to make update-runtimes
* integrate python scaffolding with func run
* python http template
* reorganize python scaffolding
* cancellation stopgap
* documentation and logging cleanup
* Python Middleware v2 - Scaffolding
* base layer cache
* remove wsgi and flask templates
Inbuilt templates should be limited to a base http and cloudevent
integration, with anything beyond this falling to the officially
supported functions samples repository.
* update python cloudevents runtime in makefile
* python cloudevents middleware
* add python .venvs to gitignore
* clean up venvs on make
* add missing dependencies to python http tempklate
* set python cloudevents manifest
* further cleanup of repository impl
* cleanup
* ignore venv when building runtime container
* set listen address on python container
* remove unnecessary python runtime update from makefile
* remove debug statements and improved comments
* enable scaffolding python funcs in s2i builder
* set listen address on all containers built by s2i
* python s2i integration
* regen fs
* cleanup
* enable host builder
* fix manifest inheritance
* regen fs
* bug fixes
* regen docs
* cleanup and linter error fixes
* conditional python host builder test
* misspellings
* disable python E2E
Until the Python middleware is supported by the Pack builder, the E2E
tests will need to be disabled.
* install python for presubmit tests
* use linux for test builder runs
The target platform for a test needs to be a platform which is available
in all test base images. That's usually linux. Using current OS would
fail, for example, building python containers on MacOS because the
official Python base image has no darwin layer.
* fix ineffasign
* set python ce template to python 3.9
* regen fs
* windows python tests
* python templates README
* Allow host mounts for build pahse.
This is in particular useful for using paket bindings,
e.g. to inject git credentials into build process.
Signed-off-by: Matej Vašek <mvasek@redhat.com>
* Mark test as a integration test
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>
* Use tiny instead of base BP builder.
* Decrease minimal required Go version.
* Make the self-signed certificate CA==true so it works with update-ca-trust utility.
Signed-off-by: Matej Vašek <mvasek@redhat.com>
* gomod
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* create hack/main.go, delegate, init dynamic updatic of version in allocate.sh, bump github version, unify those versions to v68
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* new file, fix, more updates
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* fix
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* bump
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* fix
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* simplify
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* pr exists, check
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* simplify, fix some stuff
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* simplify further
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* fix sed error, more comments
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* return to main, dont exit
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* single execute, dont force push, return Run()
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* fix printing because no 'ready' is at the end
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* misspell
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* context moved to main
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* updt-builder
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* update-knative-components fixes, pagination, simplify using go templates, json file as source of truth
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* fix error check
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* add json, add kind version, comments
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* fix versions json
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* add newline
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* add tests, fix structs, locally generate files
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* fix comment inline
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* redo the structure to use cmd/ instead of big hack/main, separate, add \n to generated .json
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* simplify test, fix linter errors
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* small additions, comments
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* update autogen comment
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* gomod
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* localize const to test
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* suggestions
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* makefile
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* makefile, update builder target
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* prefix target with wf
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
---------
Signed-off-by: David Fridrich <fridrich.david19@gmail.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>
Some tools dislike having questionable symlinks in git repository so we
must create this symlinks dynamically in the test instead of having it
committed into the repository.
Signed-off-by: Matej Vašek <matejvasek@gmail.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>
* 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>
* simplify more
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* fix
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* fix creds test
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* name fix
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* naming
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
---------
Signed-off-by: David Fridrich <fridrich.david19@gmail.com>
* Improve build caching for s2i local build
Use 'RUN --mount=type=cache...' to cache build artifacts,
e.g. the local maven repostory.
Signed-off-by: Matej Vašek <mvasek@redhat.com>
* Update podman version in tests
Signed-off-by: Matej Vašek <mvasek@redhat.com>
* fixup: set buildopt version to buildkit
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>
* 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>
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>
* 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>
* 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>
* 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>