mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 20:17:04 +00:00
Fix(parser) - The app.Spec.Policies[idx].Name must be a valid string (#6723)
* Fix(parser) - Valid value must be an empty string or consist of alphanumeric characters, '-', '' or '.', and must start and end with an alphanumeric character Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com> * Fix(e2e) - Increase waiting to prevent test start before port-forwared be finished Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com> * Fix(e2e) - Adjust the time Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com> * Fix(e2e) - Increase waiting to prevent test start before port-forwared be finished - By using gomega Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com> * Fix(e2e) - Change vela command to get app status Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com> --------- Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com>
This commit is contained in:
@@ -128,6 +128,15 @@ var ApplicationExecContext = func(context string, appName string) bool {
|
||||
|
||||
var ApplicationPortForwardContext = func(context string, appName string) bool {
|
||||
return ginkgo.It(context+": should get output of port-forward successfully", func() {
|
||||
ginkgo.By(fmt.Sprintf("waiting for the application [%s] to reach the desired status", appName))
|
||||
gomega.Eventually(func() string {
|
||||
cli := fmt.Sprintf("vela status %s", appName)
|
||||
output, err := e2e.Exec(cli)
|
||||
gomega.Expect(err).NotTo(gomega.HaveOccurred())
|
||||
return output
|
||||
}, 90*time.Second, 1*time.Second).Should(gomega.ContainSubstring("running"))
|
||||
|
||||
ginkgo.By("executing port-forward")
|
||||
cli := fmt.Sprintf("vela port-forward %s 8080:80 ", appName)
|
||||
output, err := e2e.ExecAndTerminate(cli)
|
||||
gomega.Expect(err).NotTo(gomega.HaveOccurred())
|
||||
|
||||
@@ -104,7 +104,7 @@ func (p *Parser) GenerateAppFileFromApp(ctx context.Context, app *v1beta1.Applic
|
||||
|
||||
for idx := range app.Spec.Policies {
|
||||
if app.Spec.Policies[idx].Name == "" {
|
||||
app.Spec.Policies[idx].Name = fmt.Sprintf("%s:auto-gen:%d", app.Spec.Policies[idx].Type, idx)
|
||||
app.Spec.Policies[idx].Name = fmt.Sprintf("%s-auto-gen-%d", app.Spec.Policies[idx].Type, idx)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user