tao12345666333 commented on code in PR #1128:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/1128#discussion_r913082615


##########
test/e2e/scaffold/scaffold.go:
##########
@@ -564,23 +562,29 @@ func (s *Scaffold) FormatNamespaceLabel(label string) 
string {
 
 var (
        versionRegex = regexp.MustCompile(`apiVersion: 
apisix.apache.org/v.*?\n`)
-       kindRegex    = regexp.MustCompile(`kind: .*?\n`)
+       kindRegex    = regexp.MustCompile(`kind: (.*?)\n`)
 )
 
 func (s *Scaffold) replaceApiVersion(yml, ver string) string {
        return versionRegex.ReplaceAllString(yml, "apiVersion: "+ver+"\n")
 }
 
 func (s *Scaffold) getKindValue(yml string) string {
-       kind := strings.Replace(kindRegex.FindString(yml), "\n", "", -1)
-       kindValue := strings.Replace(kind, "kind: ", "", -1)
-       return kindValue
+       subStr := kindRegex.FindStringSubmatch(yml)
+       if len(subStr) < 2 {
+               return ""
+       }
+       return subStr[1]
 }
 
 func (s *Scaffold) DisableNamespaceSelector() {
        s.opts.disableNamespaceSelector = true
 }
 
+func (s *Scaffold) DisableGatewayAPI() {

Review Comment:
   +1
   
   Although we don't currently have this turned on by default for users, the 
full functionality should be covered in our e2e tests.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to