Add function test CLI tests (#2871)
* Add function test CLI tests * Add few more services to tests Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -32,7 +32,6 @@ import (
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
"github.com/fission/fission/pkg/fission-cli/cmd"
|
||||
"github.com/fission/fission/pkg/fission-cli/console"
|
||||
"github.com/fission/fission/pkg/fission-cli/util"
|
||||
)
|
||||
|
||||
@@ -70,7 +69,8 @@ func GetFunctionPodLogs(ctx context.Context, client cmd.Client, logFilter LogFil
|
||||
fv1.ENVIRONMENT_NAMESPACE: f.Spec.Environment.Namespace,
|
||||
}
|
||||
|
||||
podList, err := client.KubernetesClient.CoreV1().Pods(util.ResolveFunctionNS(podNs)).List(ctx, metav1.ListOptions{
|
||||
podNs = util.ResolveFunctionNS(podNs)
|
||||
podList, err := client.KubernetesClient.CoreV1().Pods(podNs).List(ctx, metav1.ListOptions{
|
||||
LabelSelector: labels.Set(selector).AsSelector().String(),
|
||||
})
|
||||
if err != nil {
|
||||
@@ -78,10 +78,7 @@ func GetFunctionPodLogs(ctx context.Context, client cmd.Client, logFilter LogFil
|
||||
}
|
||||
|
||||
if len(podList.Items) <= 0 {
|
||||
if logFilter.WarnUser {
|
||||
console.Warn("version<1.18 used fission-function as pod's default namespace. Specify appropriate namespace with --pod-namespace tag or export an environment variable for function-namespace FUNCTION_NAMESPACE")
|
||||
}
|
||||
return errors.New("no active pods found")
|
||||
return errors.Errorf("no active pods found for function in namespace %s", podNs)
|
||||
}
|
||||
|
||||
pods := podList.Items
|
||||
|
||||
Reference in New Issue
Block a user