Commit Graph

6 Commits

Author SHA1 Message Date
Luke Kingland e6fa020f78
fix: test and namespace isolation (#2187)
* 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
2024-05-17 08:25:46 +00:00
Luke Kingland 958429c2f3
feat: deploy command global config with function context (#1434)
* 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
2023-02-06 08:43:35 +00:00
Luke Kingland eae7d56895
feat: command function context (#1416)
* feat: global config function context

The function with context is considered when determining flag defaults
such that:
- No special logic is required to determine "if changed"
- help text correctly reflects the actual values which will be used
- Global config can be a direct parent of command-specific config via
  embed
Also included:
- CLI tests clear environment of FUNC_* variables
- Command's bindEnv helper also sets up environment variable auto-binding
  and prefix.
- Verbosisty flag default now globally configurable

* Update cmd/build.go

Co-authored-by: Lance Ball <lball@redhat.com>

* Update cmd/build.go

Co-authored-by: Lance Ball <lball@redhat.com>

* Update cmd/build.go

Co-authored-by: Lance Ball <lball@redhat.com>

* move clearEnvs test function to test file

* docs regen

Co-authored-by: Lance Ball <lball@redhat.com>
2022-11-21 18:50:42 +00:00
Luke Kingland 55383b7e24
fix: KUBECONFIG unit test interference (#1387)
* fix: clear KUBECONFIG when testing

* fix nil pointer when no config exists

* update comments

* comments and cleanup
2022-10-31 10:04:13 +00:00
David Fridrich 8cb70808f5
feat: always store namespace in func.yaml and warn if current ns & func.yaml ns is different (#1118)
* check namespace; add to func.yaml on first deploy; added tests and mock kubeconfig for testing

* change func args because only f.Namespace is used instead of the whole struct

* func comment

* misspell

* fix tests

* warning in stderr

* use context.Background

* add fake kubeconfig for new test
2022-07-20 16:35:01 +00:00
Luke Kingland ae638c349c
feat: repository management cli (#514)
* feat: repository management cli

* src: cleanup imports, newlines, spelling and trailing whitespace
2021-09-09 08:09:00 -07:00