Put package deploy archive to fix path (#1529)
In some cases (#1384), users may want to access the file in the directory of deploy archive, however, we use the function UID name as the directory name and make it difficult for users to use as they don't know the real path of the directory. This PR uses the fix name "deployarchive" to make things easier.
This commit is contained in:
@@ -107,12 +107,18 @@ func (cfg *Config) SharedMountPath() string {
|
||||
}
|
||||
|
||||
func (cfg *Config) NewSpecializeRequest(fn *fv1.Function, env *fv1.Environment) fetcher.FunctionSpecializeRequest {
|
||||
// for backward compatibility, since most v1 env
|
||||
// still try to load user function from hard coded
|
||||
// path /userfunc/user
|
||||
targetFilename := "user"
|
||||
if env.Spec.Version >= 2 {
|
||||
targetFilename = string(fn.ObjectMeta.UID)
|
||||
if env.Spec.AllowedFunctionsPerContainer == fv1.AllowedFunctionsPerContainerInfinite {
|
||||
// workflow loads multiple functions into one function pod,
|
||||
// we have to use a Function UID to separate the function code
|
||||
// to avoid overwritting.
|
||||
targetFilename = string(fn.ObjectMeta.UID)
|
||||
} else {
|
||||
// set target file name to fix pattern for
|
||||
// easy accessing.
|
||||
targetFilename = "deployarchive"
|
||||
}
|
||||
}
|
||||
|
||||
return fetcher.FunctionSpecializeRequest{
|
||||
|
||||
Reference in New Issue
Block a user