* docs: add section about Node.js log levels
Signed-off-by: Lance Ball <lball@redhat.com>
* squash: updated to also support logLevel in func.yaml
Signed-off-by: Lance Ball <lball@redhat.com>
* feat: repository management API
Adds a Repositories memeber to Client which enables management of
extensible repositories via methods Add, Rename, Remove, and List.
* fix: repositories urls
Validates that .Add input is parseable as a URL
Tests explicitly convert path to slashes
Adds the config schema as integrated into the general build process.
Considers schema generation a prerequisite for building, peer to
such tasks as rebuilding pkged.go, but unlike pkged.go, is triggered
on a clean. A missing schema file or modified config.go triggers
rebuild on make.
* fix: hide progress indicator if asking for creds
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* fix: NPE in integration test
Signed-off-by: Matej Vasek <mvasek@redhat.com>
* feat: add support for labels in func.yaml and `func config`
This change adds support for setting labels on deployed functions. It uses
the interactive CLI prompt introduced by Zbynek to add, remove and list
labels applied on a deployed function.
Signed-off-by: Lance Ball <lball@redhat.com>
* fixup: fix string output for Pair type
Signed-off-by: Lance Ball <lball@redhat.com>
* fixup: review feedback
Signed-off-by: Lance Ball <lball@redhat.com>
Removes python caches on template test. This appears to be the original
cause of unnecessary rebuilds.
Adds pkger.go as an explict entry in the CODE prerequisite var. This
ensures pkged.go is generated if it doesn't exist, and removes the need
to explicitly enumerate it as a prerequisite to other targets.
Adds pkger.go to the clean target. This allows a 'make clean && make' to
work as one might expect. For example ensuring a rebuild if a template
files is removed.
The notable conceptual change here is that this does not induce a build of
pkged.go by explicitly enumarating it as a prerequisite (a difficult
thing to get right, and prone to errors in the future), but rather
directly enumerates ./templates as its prerequisite.
Additional minor modifications include:
- regenerated pkged.go such that this takes effect for main on merge
- adds an explicit target for the 'func' binary and aliases 'build'
- Makefile help text cleanup and consolidation
The CloudEvent SDK will provide any event included in the response as a
return value from `Request()`. If it does, print it out. It makes the
experience nicer.
For example, if I run the default TypeScript event function locally, this
is what `kn emit...` looks like.
```
❯ ./func emit --sink local --data '{"hello": "world"}'
Context Attributes,
specversion: 1.0
type: echo
source: function.eventViewer
id: d7d81ccc-a365-4433-be6b-7edfa43ca360
time: 2021-07-27T18:57:03.147Z
datacontenttype: application/json; charset=utf-8
Data,
{
"hello": "world"
}
```
Signed-off-by: Lance Ball <lball@redhat.com>
The bump of a major version of the Node.js dependencies changed
the format for the data received over HTTP (string vs. object).
This fixes that test to use JSON.stringify().
Signed-off-by: Lance Ball <lball@redhat.com>
* Add ability to add all custom function configuration in a separate module.
Co-authored-by: Dejan Bosanac <dejan@sensatic.net>
Co-authored-by: Jim Crossley <jcrossley3@gmail.com>
Co-authored-by: Jim Crossley <jcrossley3@gmail.com>
* ci: increase dns update max retries
* src: Makefile accessibility
Restructures the Makefile for better readibility
Separates core unit tests from template unit tests
Adds a `help` target highlighting core targets
Removes unused 'cluser' and 'release' targets
Removes unused targets
Restructures repository cluster setup and configuration scripts
to be used both for local testing as well as in CI. Adds a
CI-specific ci.sh script for the differences. Additionally:
- Upgrades to knative v0.23.0
- Upgrades eventing from v1beta1 API to v1
- Adds binary installation script (linux)
- Serializes Build, Int Test, e2e test steps
- Installs Broker and Channel to support Knative Quickstart tutorial.
- Runs a test echo server during installation
- Adds event-based waits in place of most blind time-based waits
- Adds explicit Kubernetes version for KinD
- Replaces a NodePort patched Koourier with an explicit ingress
- Adds retries while activator webhook becomes available
- Merges allocate and configure
This should simplify the unit tests. Only the invalid_event test uses
the actix-web test helpers, just as an example to show it's the HTTP
plumbing that will fail the request when it tries to construct an
Event from invalid (or missing) headers.
* feat: client progress listener 'stopping' state
* src: testable commands
Restructures commands to accept a fn.Client constructor on command
instantiation. This allows the concrete implementations, or entire
client to be mocked for testing.
Also some minor refacotring as necessary to shoehorn into the pattern.
* fix: increase default timeout to 120s for service creation
* chore: bump kind, knative and kubectl versions
* chore: bump to buildpacks v0.8.2 for all versions
This is causing me to rethink using versions in these templates, and our
overall buildpack version/release strategy. But for now, we should land
this before 0.16.0
* adds trust for any quay.io/boson builder
Signed-off-by: Lance Ball <lball@redhat.com>