add as-current-user for fn run

This commit is contained in:
Donny Xia
2020-09-15 17:08:48 -07:00
parent cb7974cf45
commit 11049fa0bb
5 changed files with 87 additions and 76 deletions

View File

@@ -19,21 +19,6 @@ const (
var functionAnnotationKeys = []string{FunctionAnnotationKey, oldFunctionAnnotationKey}
// ContainerUser is a type for username/uid used in container
type ContainerUser string
func (u *ContainerUser) String() string {
return string(*u)
}
func (u *ContainerUser) IsEmpty() bool {
return string(*u) == ""
}
const (
UserNobody ContainerUser = "nobody"
)
// ContainerNetworkName is a type for network name used in container
type ContainerNetworkName string
@@ -171,9 +156,6 @@ type ContainerSpec struct {
// Mounts are the storage or directories to mount into the container
StorageMounts []StorageMount `json:"mounts,omitempty" yaml:"mounts,omitempty"`
// User is the username/uid that application runs as in continer
User ContainerUser `json:"user,omitempty" yaml:"user,omitempty"`
// Env is a slice of env string that will be exposed to container
Env []string `json:"envs,omitempty" yaml:"envs,omitempty"`
}