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:
Jonatas Teixeira
2025-03-25 02:28:45 +05:30
committed by GitHub
parent c5d9f69c9c
commit 853a077107
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -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())
+1 -1
View File
@@ -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)
}
}