* 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>
* 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
* 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
* 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>
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.
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.
This commit adds a new error type `UninitializedError` to minimize
redundancy across commands, and applies it in all of the commands which
need an initialized function to operate.
Fixes: https://github.com/knative/func/issues/1744
Signed-off-by: Lance Ball <lball@redhat.com>
* feat: func domain route
Adds the --domain flag which, when provided sets the value of the
func.domain label on the deployed knative service. The cluster can then
use this to choose which route to create for multi-route clusters.
Optional.
* fix whitespace
* feat: build stamp and log
- Adds an explicit "Stamp" step to client builds
- Building always "Stamps" the function, allowing builds to cache
- Commands which alter function in inconsequential ways update the stamp
as-needed.
- Tests updated to use the API rather than hard-coding func.yaml
* fix misspellings
* temporarily disable Quarkus tests
* stamping also creates necessary run directory
* reenable Quarkus tests
* comments
* feat: func run build options and host runs
- Refactors the run command to include all options from build, in the same
manner as deploy.
- Adds the --container flag (currently defaults to true) which will, when
disabled, invoke the localhost-based runner which, in this commit, is not
yet active.
- Updates help text to match the other command format, and lays the verbal
groundwork for the difference between containerized (currently default)
and non-containerized runs.
* fix e2e
* Update cmd/deploy.go
Co-authored-by: Lance Ball <lball@redhat.com>
* Update pkg/functions/client.go
Co-authored-by: Lance Ball <lball@redhat.com>
* Update cmd/run.go
Co-authored-by: Lance Ball <lball@redhat.com>
---------
Co-authored-by: Lance Ball <lball@redhat.com>
Fixes a bug where the image digest was being cleared on a subsequent
deploy, resulting in incorrect metadata and a build stamp which was
always out-of-date (effectively disabling cached builds).
* feat: add pvc-size flag to deploy command (#851)
* feat: move pvc-size from deploy to build func configuration section (#851)
* feat: add setting default value for pvc-size in func.yaml (#851)
* feat: change pvc-size to camel case (#851)
* feat: add omitempty to pvcSize (#851)
* feat: regenerate func yaml schema (#851)
* feat: update docs for deploy command (#851)
* feat: update usage help for the pvc-size flag (#851)
* cli help text and flags cleanup
- verbose flag uses global setting throughout
- confirm flag added using shared visitor throughout
- path flag added using shared visitor throughout
- removes --version flag on root as redundant with subcommand
- splits main help's 'Main Commands' into 'Primary Commands' and 'Development
Commands' groups
- Moves RunE definition into flag struct literals
* remove commented code
* feat: deploy command global config function context
* fix static check errors
* fix test
* fix remote persists test
* env opaque box test
* use keyed fields (govet)
* mock deployer expansion
* ClearEnvs now in shared testing pkg
* effectivePath now uses plfags
* list directly uses config for default namespace
* Improved Namespace calculation and Caching
- Built() now a client package function
- Namespace evaluation delegeate to implementations
This enables the func.yaml to avert dirtiness checks on rebuilds
(caching)
- Build and Deploy update build stamp on completion
Enables dirtiness checks to be unaffects, leading to better caching.
- CLI Namespace checks no longer require k8s env evaluation for default
- Fixed missing condition check in TestDeploy_Namespace
- Fixes some minor linter and spelling errors
- Global config does not directly set namespace - it is corrected to be
deferred evaluation used by implementations.
- Skips writing func.yaml on f.Write if there were no modifications,
which leads to better caching (no timestamp update means Built ==
true)
- HasImage removed in favor of a corrected fn.Built
* linting, misspellings and docs rebuild
* warn user if git settings exist on a non-remote build
* lint error fix
* test flag unsetting persists
* allow unknown flags in preparsing of flags
* pre-submit cleanup
* update cmd to use client.Init
* chore: deploy namespace simplification
Separates namespace redeploy warnings from namespace value derivation
logic. Simplifies derivation by integration more closely with flag init
flow.
* cleanup
* feat: config members and paths
- Adds Builder, Namespace, Registry and Verbose as globally
configurable.
- Fixes problems where file paths were being created or required when
not necessary.
- Relocates environment variable usage to main's use of config
- Adds FUNC_CONFIG_PATH
- Only creates paths on disk when necessary
- Makes non-existent config paths nonfatal
* postpone adding some members
* refactor: attach() and podReady() more general
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* feat: added function for upload to a volume
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* refactor: extract defaultSecurityContext
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fix: added runtime type check
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* feat: allow on-cluster-build without VCS
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fix: reword error message
Co-authored-by: Lance Ball <lball@redhat.com>
* fix: runtime type check
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* test: e2e test for direct upload on-cluster-build
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Co-authored-by: Lance Ball <lball@redhat.com>
* chore: update all references to kn-plugin-func
I did not change references in CHANGELOG.md but otherwise, I believe
this should cover all configuration settings, image names, package
names, etc.
Signed-off-by: Lance Ball <lball@redhat.com>
* fixup: fix instances_test.go
Signed-off-by: Lance Ball <lball@redhat.com>
* fixup: still some stray kn-plugin-func
Signed-off-by: Lance Ball <lball@redhat.com>
Signed-off-by: Lance Ball <lball@redhat.com>