Commit Graph

9 Commits

Author SHA1 Message Date
Luke Kingland b82a5a4eac
feat: host-based scaffolded function runner (#1733)
* feat: host runner

* improve error message wording
2023-05-24 21:26:25 +00:00
Luke Kingland 89b599df24
feat: job scaffolding (#1697)
* feat: job scaffolding

- Local jobs use a directory rather than filename
  This sets up for upcoming scaffolding to use as a space for job
  scaffolding code.
- Places all jobs within a 'runs' directory in ./func rather than
  'instances' to further differentiate between an instance and a local
  run task invoked via .Run
- Updates Jobs' stop handler to have an error return.
- Adds tests which ensure creating and stopping a job are reflected in
  the client's .Instances().Local() accessor.
- Adds verbose logging support to the Job implementation.
- Adds a cleanup task which will remove orphaned jobs by, in addition to
  previous logic, checking that there is no longer a process listening
  on the port indicated by the job.

* fix spelling errors

* fix lint errors

* log job stop errors

* use temp dir for tests

* add back docker build tags and wait
2023-05-04 20:53:57 +00:00
Manoel Marques 1ce5d2b7c3
Replace path with function struct in client api (#1640) 2023-03-31 00:45:00 +00:00
Zbynek Roubalik 5a4803bf95
chore: refactor repository layout (#1554)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-02-15 08:46:52 +00:00
Luke Kingland f9d17b0c9a
add apply and update client methods (#1529)
Adds two meta-commands, 'Apply' and 'Update', to the client.
Renames 'Create' to 'Init' to avoid confusion with 'Update' (and to be more
linguistically similar to git commands), and adds it as an alias to the
create CLI command.
2023-02-01 08:37:29 +00:00
Luke Kingland d0448adb82
chore: ensure all tests clear cmd args (#1388) 2022-10-28 13:30:07 +00:00
Lance Ball 5adec03c7b
chore: update all references to kn-plugin-func (#1311)
* 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>
2022-10-13 16:31:53 +00:00
Luke Kingland c9861ec24e
chore: cmd test cleanup (#1289)
All tests which are directory-sensitive now also:
- reset viper
- use t.Cleanup
- use t.TempDir
- use a clean XDG_CONFIG_HOME
- specify explict name when creating
- moves helpers to root_test
2022-10-03 22:03:28 +00:00
Luke Kingland 63af791e9f
fix: always use function's namespace when invoking remote (#1258)
* fix: always use function's namespace when invoking remote

* test

* Apply suggestions from code review

Co-authored-by: Matej Vasek <matejvasek@gmail.com>
2022-09-23 12:42:13 +00:00