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>
* rebased and updated func struct
* fixing migration to 1.0.0 struct
* fixing on cluster tests
* updaating migration version to 0.34.0
* adding tests for marshalling and migration errors
* adding EOF new line
* updating migrations
* fixing wrong name
* fixing marshalling test
* adding EOF line
* fixing assertion
* feat: deploy autobuild and flag persistence
* cleanup
* help text, comments and test cleanup
* removing usurped commands.txt
* add platform to deploy synopsis help
* fix: image name derivation and flag precidence
* cleanup
* fix image prompt, reorganize and cleanup
* client deploy image test
* be explicit about registry treatment in tests
* ineffassign
* fix: k8s env not required
* misspell
* minor cleanup
* recombine build and deploy configs
* test namesace choosing logic
This commit removes the docs/reference/commands.txt file and instead
uses the Cobra built-in documentation generator to create markdown
documents for every command.
Signed-off-by: Lance Ball <lball@redhat.com>
Signed-off-by: Lance Ball <lball@redhat.com>
* chore: shared builder constants etc
* pretty-print the shared unknown builder error
* update builder impls to use shared defs and validators
* error and docs text formatting
* include static default short names
* comment updates and typos
* docs paths
* use the constants for the in-package builder defaults
* use builders.All but with caviat
* use '.' in flags to indicate default function path
* regen commands.txt with '.' as default path
* centralize dot expansion
* minor cleanup
* update all references to path flag
* exits should be panics
* first run, F -> f
* fix
* fix
* misspells
* client*.go files
* add client*.go: misspells
* cmd dir test files
* docker dir
* function* files
* i*.go and job.go
* job.go,mock dir,repos*,s2i dir,schema dir,templates*
* test dir
* testing dir
* root dir *.go second round