mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-21 14:23:34 +00:00
Enable multi namespace support
Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com> Included Test cases for utils Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com> Multi namespace handling in invoke Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com> List Namespaces capability included Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com> remove faasd namespace from list result Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com> Create Secret Folder Path Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com> Filter only namespaces with openfass label Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com> Include Testcase for utility function Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com> move default function secets to openfaas-fn namespace secrets Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com> Corrected issue with secret moving Signed-off-by: Nitishkumar Singh <nitishkumarsingh71@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
73c7349e36
commit
dec02f3240
@ -20,7 +20,6 @@ import (
|
||||
"github.com/docker/distribution/reference"
|
||||
"github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/openfaas/faas-provider/types"
|
||||
faasd "github.com/openfaas/faasd/pkg"
|
||||
cninetwork "github.com/openfaas/faasd/pkg/cninetwork"
|
||||
"github.com/openfaas/faasd/pkg/service"
|
||||
"github.com/pkg/errors"
|
||||
@ -52,15 +51,17 @@ func MakeDeployHandler(client *containerd.Client, cni gocni.CNI, secretMountPath
|
||||
return
|
||||
}
|
||||
|
||||
err = validateSecrets(secretMountPath, req.Secrets)
|
||||
namespace := getRequestNamespace(req.Namespace)
|
||||
namespaceSecretMountPath := getNamespaceSecretMountPath(secretMountPath, namespace)
|
||||
err = validateSecrets(namespaceSecretMountPath, req.Secrets)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
}
|
||||
|
||||
name := req.Service
|
||||
ctx := namespaces.WithNamespace(context.Background(), faasd.FunctionNamespace)
|
||||
ctx := namespaces.WithNamespace(context.Background(), namespace)
|
||||
|
||||
deployErr := deploy(ctx, req, client, cni, secretMountPath, alwaysPull)
|
||||
deployErr := deploy(ctx, req, client, cni, namespaceSecretMountPath, alwaysPull)
|
||||
if deployErr != nil {
|
||||
log.Printf("[Deploy] error deploying %s, error: %s\n", name, deployErr)
|
||||
http.Error(w, deployErr.Error(), http.StatusBadRequest)
|
||||
|
Reference in New Issue
Block a user