The code already existed for setting the UserAgent header, but a value
was never passed to the client. This change will now set a string
matching the following format
```
faas-cli/<build version>
```
For example:
```
faas-cli/0.14.6-5-ga9c2b10f
```
Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
Fixes an issue where the default templates could be pulled
and conflict with TemplateConfigs, meaning the template set in
TemplateConfigs was never pulled.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
The store deploy command was passing multiple environment
variables to the deployment endpoint, instead of implementing
the intended precedence.
Tested with a local faasd instance. This is important for
when people test with things like the sleep function from the
openfaas function store.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
It seems like errors_test was referencing a global variable
and not its own local variable for printing an error message
in a failed test.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
OpenFaaS Cloud has long been deprecated, these commands
should no longer be used by anyone.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
As `describe` uses a map to store the env var kv pairs its output varies
in its order. This is undesirable.
This change introduces a means by which env var output ordering is
predictable.
Signed-off-by: Richard Gee <richard@technologee.co.uk>
As env vars are stored in a `map[string]string` the print output of this
through describe is non-deterministic. This change introduces a test case
that will cause `TestDescribeOuput()` to become flakey as the four env vars
could be emitted in a different order each time the test is run.
This will be addressed in a future commit which will make env var ordering
consistent and repeatable.
Signed-off-by: Richard Gee <richard@technologee.co.uk>
The readonly_root_filesystem setting was not included in the resulting
CRD when running faas-cli generate.
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
The message used to capitalise the template name, which
was confusing since they are case sensitive.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
* Go is upgraded to 1.18 for builds
* Alpine Linux is upgraded for the runtime container
* The deploy command gains a timeout for use with faaasd
which is synchronous and would time-out otherwise.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
The new flag will run a community container image to setup
the qemu-user-static binary on the host, so that multi-arch
builds can take place.
This is only compatible with AMD64 at the current time.
Tested on Darwin M1 with MacOS, and saw an error.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
The printer object accepts a parameter to control how verbose it is.
When verbose is false, empty values will be omitted from the describe
output.
Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
The gateway URL was not being deep cloned, but mutated and
that affected downstream tests in the certifier.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
Switches to more Go-idomatic approach for creating URLs and
populating querystrings.
There is an unexplained error in the certifier project, and
this indirection is not helping with debugging errors.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
* Enables PKCE in the place of implicit auth flow.
* Auth command requires EULA acceptance and valid OpenFaaS Pro
license or trial.
* Updates feature status from alpha to generally-available
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
The fragment needed to be escaped so that it could be sent
to the server via a query string. This was failing with
keycloak.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
Given that the secret now contains a byte array, it can no
longer be compared in the way it was.
This introduces go-cmp to take over the job.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
Changes the behaviour for inputting files so that their contents
are stored in binary format instead of being converted to a
string.
The existing Value field is still populated for existing
clients and providers which do not support RawValue.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
The output from faas-cli generate is not deterministic. The function
detail is stored in a map which is by design non-deterministic.
This behaviour is undesirable as generating from the same stack will
result in a different file, hence makes tracking diffs, particularly
in git, quite a challenge.
This change seeks to introduce a pre-processing stage where a slice
of function names is created and a rudimentary sort applied. This slice
is then used to iterate through the map using the function name.
Signed-off-by: Richard Gee <richard@technologee.co.uk>
A user deployed to Okteto where the namespace by default is their username. Byforcing openfaas-fn by default this was preventing a zero value from being passed which had the effect of always over-riding the users default namespace.
Signed-off-by: Richard Gee <richard@technologee.co.uk>
This updates the GetSystemInfo API to return typed struct rather than `map[string]interface{}`
It also removes support for legacy vesion info response from gateway which are available prior to version
0.8.4
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>