mirror of https://github.com/knative/func.git
commit
130751b01e
|
@ -13,6 +13,8 @@ import (
|
|||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
const FaasNamespace = "faas"
|
||||
|
||||
// Client for a given Service Function.
|
||||
type Client struct {
|
||||
verbose bool // print verbose logs
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
"os/exec"
|
||||
"time"
|
||||
|
||||
faasclient "github.com/boson-project/faas/client"
|
||||
"github.com/boson-project/faas/k8s"
|
||||
)
|
||||
|
||||
|
@ -41,7 +42,7 @@ func (d *Updater) Update(name, image string) (err error) {
|
|||
|
||||
// TODO: use knative client directly.
|
||||
// TODO: use tags and traffic splitting.
|
||||
cmd := exec.Command("kn", "service", "update", project, "--env", timestamp)
|
||||
cmd := exec.Command("kn", "service", "update", project, "--env", timestamp, "--namespace", faasclient.FaasNamespace)
|
||||
|
||||
// If verbose logging is enabled, echo appsody's chatty stdout.
|
||||
if d.Verbose {
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"os/exec"
|
||||
"strings"
|
||||
|
||||
faasclient "github.com/boson-project/faas/client"
|
||||
"github.com/boson-project/faas/k8s"
|
||||
)
|
||||
|
||||
|
@ -19,7 +20,7 @@ apiVersion: serving.knative.dev/v1
|
|||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Project }}
|
||||
namespace: default
|
||||
namespace: {{ .Namespace }}
|
||||
labels:
|
||||
# Will be exposed as this domain as per the knative service domains config.
|
||||
# Configured in config-domain
|
||||
|
@ -96,6 +97,7 @@ func (d *Deployer) Deploy(name, image string) (address string, err error) {
|
|||
// Write out the final service yaml
|
||||
err = t.Execute(f, map[string]string{
|
||||
"Project": project,
|
||||
"Namespace": faasclient.FaasNamespace,
|
||||
"Subdomain": subdomain,
|
||||
"Domain": domain,
|
||||
"Image": image,
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
|
||||
faasclient "github.com/boson-project/faas/client"
|
||||
"github.com/boson-project/faas/k8s"
|
||||
)
|
||||
|
||||
|
@ -38,7 +39,7 @@ func (d *Remover) Remove(name string) (err error) {
|
|||
}
|
||||
|
||||
// Command to run
|
||||
cmd := exec.Command("kubectl", "delete", "kservice", serviceName)
|
||||
cmd := exec.Command("kubectl", "delete", "kservice", serviceName, "--namespace", faasclient.FaasNamespace)
|
||||
|
||||
// If verbose logging is enabled, echo appsody's chatty stdout.
|
||||
if d.Verbose {
|
||||
|
|
Loading…
Reference in New Issue