Fixed: Print pod log error when response status is 404 returned by te… (#3021)

* Fixed: Print pod log error when response status is 404 returned by test function
* Update util.go

---------

Signed-off-by: waitstory <waitstory@163.com>
This commit is contained in:
waitstory
2024-09-26 13:21:50 +05:30
committed by GitHub
parent 93869d3bc8
commit b8f746cb98
2 changed files with 24 additions and 14 deletions
+11 -4
View File
@@ -63,10 +63,17 @@ func GetFunctionPodLogs(ctx context.Context, client cmd.Client, logFilter LogFil
podNs = logFilter.PodNamespace
}
// Get function Pods first
selector := map[string]string{
fv1.FUNCTION_UID: string(f.ObjectMeta.UID),
fv1.ENVIRONMENT_NAME: f.Spec.Environment.Name,
fv1.ENVIRONMENT_NAMESPACE: f.Spec.Environment.Namespace,
var selector map[string]string
if f.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType != fv1.ExecutorTypeContainer {
selector = map[string]string{
fv1.FUNCTION_UID: string(f.ObjectMeta.UID),
fv1.ENVIRONMENT_NAME: f.Spec.Environment.Name,
fv1.ENVIRONMENT_NAMESPACE: f.Spec.Environment.Namespace,
}
} else {
selector = map[string]string{
fv1.FUNCTION_UID: string(f.ObjectMeta.UID),
}
}
podNs = util.ResolveFunctionNS(podNs)