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