* 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>
* 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>
* host builder nonregular files
* disallow links outside root
* add back in correct path support for windows
* code review updates
* host builder file test
* windows-specific absolute link check
* windows-specific test
* refactor
Resolve the link target one level higher such that it can be used
when creating the tar header without repetition.
* validate link header targets
* expand link test
* merge os-specific test cases
* remove os filter and unused arg
* Making updates to Spring boot templates, as suggested by @trisberg
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
* 🤖 We touched the samples, so adding the generated thing
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
* Bump JDK Builder to 21
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
* Some more java 21 setters
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
---------
Signed-off-by: Matthias Wessendorf <mwessend@redhat.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>
* Log if image is referenced by tag
Signed-off-by: AdamKorcz <adam@adalogics.com>
* fixup: do not warn with standard images
Signed-off-by: Matej Vasek <mvasek@redhat.com>
---------
Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Co-authored-by: Matej Vasek <mvasek@redhat.com>
* chore: use smaller s2i nodejs builder
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* test: skip python s2i on cluster build test on GH
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fixup: do check at correct place
Signed-off-by: Matej Vasek <mvasek@redhat.com>
---------
Signed-off-by: Matej Vasek <mvasek@redhat.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>
* fix: docker registry/repository parsing
Use go-containerregistry to do parsing.
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fix: use kebab-case instead of camelCase
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fix: use kebab-case instead of camelCase
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>
* src: better debugging
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fix: wait for both builds
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fixup
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fixup
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fixup
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fix: detection of process liveness on Windows
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fix: make symlink relative
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fixup: cleanup
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>
* adding suppor for funcignore file
Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
* resolving unit test and linting error
Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
* adding unit tests and symlink
Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
* making requested changes in tests
Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
* making requested changes
Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
* changing the comment
Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
* resolving unit test error in windows
Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
---------
Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.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>
This allows setting the service account for the resulting knative
service, which must pre-exist in the namespace to let the deployment
succeed.
Signed-off-by: Sascha Grunert <sgrunert@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>
Plumbs through the platform CLI flag to the individual builders by
creating a client-level BuildOption functional option, and modifying the
builder interface to accept an optional set of requested target
platforms.