mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-27 16:17:34 +00:00
Fix: e2e test vela cli output match & controllerrevision recycle for serviceaccount impersonation
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
This commit is contained in:
@@ -19,6 +19,7 @@ package e2e
|
||||
import (
|
||||
context2 "context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Netflix/go-expect"
|
||||
@@ -98,7 +99,7 @@ var ApplicationStatusDeeplyContext = func(context string, applicationName, workl
|
||||
cli := fmt.Sprintf("vela status %s", applicationName)
|
||||
output, err := e2e.LongTimeExec(cli, 120*time.Second)
|
||||
gomega.Expect(err).NotTo(gomega.HaveOccurred())
|
||||
gomega.Expect(output).To(gomega.ContainSubstring("healthy"))
|
||||
gomega.Expect(strings.ToLower(output)).To(gomega.ContainSubstring("healthy"))
|
||||
// TODO(zzxwill) need to check workloadType after app status is refined
|
||||
})
|
||||
})
|
||||
|
||||
@@ -28,6 +28,7 @@ import (
|
||||
v1 "k8s.io/api/apps/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
rbacv1 "k8s.io/api/rbac/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
@@ -364,7 +365,7 @@ var _ = Describe("Application Normal tests", func() {
|
||||
{
|
||||
Verbs: []string{rbacv1.VerbAll},
|
||||
APIGroups: []string{"apps"},
|
||||
Resources: []string{"deployments"},
|
||||
Resources: []string{"deployments", "controllerrevisions"},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -402,6 +403,11 @@ var _ = Describe("Application Normal tests", func() {
|
||||
By("Checking an application status")
|
||||
verifyWorkloadRunningExpected("myweb", 1, "stefanprodan/podinfo:4.0.3")
|
||||
verifyComponentRevision("myweb", 1)
|
||||
|
||||
Expect(k8sClient.Delete(ctx, &newApp)).Should(Succeed())
|
||||
Eventually(func(g Gomega) {
|
||||
g.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(&newApp), &newApp)).Should(Satisfy(errors.IsNotFound))
|
||||
}, 15*time.Second).Should(Succeed())
|
||||
})
|
||||
|
||||
It("Test app with ServiceAccount which has no permission for the component", func() {
|
||||
|
||||
Reference in New Issue
Block a user