Closed viveksyngh closed 3 years ago
Failed to deploy function on openfaas cloud while using openfaas operator for the function where environment field in not present in stack.yml
stack.yml
Reference functions: https://github.com/viveksyngh/openfaas-functions
It should deploy function if openfaas is deployed with operator
It gives error
2020/12/15 10:56:31 Success=false, Error=exit status 1 2020/12/15 10:56:31 Out=2020/12/15 10:56:19 0 env-vars for fn2 2020/12/15 10:56:19 0 env-vars for viveksyngh-fn2 2020/12/15 10:56:30 Image build status: 200 2020/12/15 10:56:30 buildshiprun: image 'docker.io/viveksyngh/viveksyngh-openfaas-functions-fn2:latest-master-6631b26' 2020/12/15 10:56:30 pipeline-log: status: 200 2020/12/15 10:56:30 Deploying docker.io/viveksyngh/viveksyngh-openfaas-functions-fn2:latest-master-6631b26 as viveksyngh-fn2 2020/12/15 10:56:30 Deploying: docker.io/viveksyngh/viveksyngh-openfaas-functions-fn2:latest-master-6631b26 as viveksyngh-fn2 Unexpected status: 500, message: Error creating function: Function.openfaas.com "viveksyngh-fn2" is invalid: spec.environment: Invalid value: "null": spec.environment in body must be of type object: "null"
Workaround is add environment field in stack.yml even there are no environment variable to the function
FaaS-CLI version ( Full output from: faas-cli version ):
faas-cli version
Docker version docker version (e.g. Docker 17.0.05 ):
docker version
Are you using Docker Swarm or Kubernetes (FaaS-netes)?
Operating System and version (e.g. Linux, Windows, MacOS):
Link to your project or a code example to reproduce issue:
Please also follow the troubleshooting guide and paste in any other diagnostic information you have:
Fixes:
https://github.com/openfaas/faas-cli/commit/598336a0cad38a79d5466e6a3a9aebab4fc61ba9 https://github.com/openfaas/faas-provider/commit/cf1e9f39556bc52eef96265fbda11ea1251f6ab2 https://github.com/openfaas/faas-netes/pull/730
I believe this gives resolution to the issue. @viveksyngh could you take a look please?
And add operator: true/false to the ofc-bootstrap YAML file?
operator: true/false
derek close
/close
Failed to deploy function on openfaas cloud while using openfaas operator for the function where environment field in not present in
stack.yml
Reference functions: https://github.com/viveksyngh/openfaas-functions
Expected Behaviour
It should deploy function if openfaas is deployed with operator
Current Behaviour
It gives error
Possible Solution
Workaround is add environment field in
stack.yml
even there are no environment variable to the functionSteps to Reproduce (for bugs)
Context
Your Environment
FaaS-CLI version ( Full output from:
faas-cli version
):Docker version
docker version
(e.g. Docker 17.0.05 ):Are you using Docker Swarm or Kubernetes (FaaS-netes)?
Operating System and version (e.g. Linux, Windows, MacOS):
Link to your project or a code example to reproduce issue:
Please also follow the troubleshooting guide and paste in any other diagnostic information you have: