Added support to set builder and fn pod specs via helm chart (#2461)
The users can now set the pod spec for builder and fn pods via helm chart. Currently we have set some default securitycontext for the pods. Before there were no permissions set and the user would by default enter root when kubectl exec into pod. Now the permissions have been set and the user will not be able to access root directory in poolmgr and newdeploy pods.
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -214,3 +215,14 @@ func IsZip(filename string) (bool, error) {
|
||||
defer f.Close()
|
||||
return archiver.DefaultZip.Match(f)
|
||||
}
|
||||
|
||||
// GetCurrentNamespace returns Kubernetes namespace of current Pod
|
||||
func GetCurrentNamespace() (string, error) {
|
||||
|
||||
// This file contains the namespace and can be found in each container.
|
||||
body, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(body), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user