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