You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/05/12 09:07:39 UTC
[GitHub] [apisix-ingress-controller] lingsamuel opened a new pull request, #1016: e2e-test: add e2e tests and CRDs for ApisixClusterConfig v2
lingsamuel opened a new pull request, #1016:
URL: https://github.com/apache/apisix-ingress-controller/pull/1016
Signed-off-by: Ling Samuel <li...@gmail.com>
- [x] New feature provided
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on a diff in pull request #1016: e2e-test: add e2e tests and CRDs for ApisixClusterConfig v2
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on code in PR #1016:
URL: https://github.com/apache/apisix-ingress-controller/pull/1016#discussion_r871485297
##########
test/e2e/scaffold/cluster_config.go:
##########
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+package scaffold
+
+import (
+ "fmt"
+ "time"
+
+ "github.com/gruntwork-io/terratest/modules/k8s"
+)
+
+var (
+ _apisixClusterConfigTemplate = `
+apiVersion: %s
+kind: ApisixClusterConfig
+metadata:
+ name: %s
+spec:
+ monitoring:
+ prometheus:
+ enable: %v
+`
+)
+
+// NewApisixClusterConfig creates an ApisixClusterConfig CRD
+func (s *Scaffold) NewApisixClusterConfig(name string, enable bool) error {
+ tls := fmt.Sprintf(_apisixClusterConfigTemplate, s.opts.APISIXClusterConfigVersion, name, enable)
Review Comment:
we should change the variable name
##########
test/e2e/scaffold/cluster_config.go:
##########
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+package scaffold
+
+import (
+ "fmt"
+ "time"
+
+ "github.com/gruntwork-io/terratest/modules/k8s"
+)
+
+var (
+ _apisixClusterConfigTemplate = `
+apiVersion: %s
+kind: ApisixClusterConfig
+metadata:
+ name: %s
+spec:
+ monitoring:
+ prometheus:
+ enable: %v
+`
+)
+
+// NewApisixClusterConfig creates an ApisixClusterConfig CRD
+func (s *Scaffold) NewApisixClusterConfig(name string, enable bool) error {
+ tls := fmt.Sprintf(_apisixClusterConfigTemplate, s.opts.APISIXClusterConfigVersion, name, enable)
+ if err := k8s.KubectlApplyFromStringE(s.t, s.kubectlOptions, tls); err != nil {
+ return err
+ }
+ time.Sleep(5 * time.Second)
+ return nil
+}
+
+// DeleteApisixClusterConfig removes an ApisixClusterConfig CRD
+func (s *Scaffold) DeleteApisixClusterConfig(name string, enable bool) error {
+ tls := fmt.Sprintf(_apisixClusterConfigTemplate, s.opts.APISIXClusterConfigVersion, name, enable)
Review Comment:
ditto
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on a diff in pull request #1016: e2e-test: add e2e tests and CRDs for ApisixClusterConfig v2
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on code in PR #1016:
URL: https://github.com/apache/apisix-ingress-controller/pull/1016#discussion_r883173506
##########
test/e2e/scaffold/cluster_config.go:
##########
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+package scaffold
+
+import (
+ "fmt"
+ "time"
+
+ "github.com/gruntwork-io/terratest/modules/k8s"
+)
+
+var (
+ _apisixClusterConfigTemplate = `
+apiVersion: %s
+kind: ApisixClusterConfig
+metadata:
+ name: %s
+spec:
+ monitoring:
+ prometheus:
+ enable: %v
+`
+)
+
+// NewApisixClusterConfig creates an ApisixClusterConfig CRD
+func (s *Scaffold) NewApisixClusterConfig(name string, enable bool) error {
+ cc := fmt.Sprintf(_apisixClusterConfigTemplate, s.opts.APISIXClusterConfigVersion, name, enable)
+ if err := k8s.KubectlApplyFromStringE(s.t, s.kubectlOptions, cc); err != nil {
+ return err
+ }
+ time.Sleep(5 * time.Second)
+ return nil
+}
+
+// DeleteApisixClusterConfig removes an ApisixClusterConfig CRD
+func (s *Scaffold) DeleteApisixClusterConfig(name string, enable bool) error {
Review Comment:
I agree with @lingsamuel
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] gxthrj commented on a diff in pull request #1016: e2e-test: add e2e tests and CRDs for ApisixClusterConfig v2
Posted by GitBox <gi...@apache.org>.
gxthrj commented on code in PR #1016:
URL: https://github.com/apache/apisix-ingress-controller/pull/1016#discussion_r874709026
##########
test/e2e/scaffold/cluster_config.go:
##########
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+package scaffold
+
+import (
+ "fmt"
+ "time"
+
+ "github.com/gruntwork-io/terratest/modules/k8s"
+)
+
+var (
+ _apisixClusterConfigTemplate = `
+apiVersion: %s
+kind: ApisixClusterConfig
+metadata:
+ name: %s
+spec:
+ monitoring:
+ prometheus:
+ enable: %v
+`
+)
+
+// NewApisixClusterConfig creates an ApisixClusterConfig CRD
+func (s *Scaffold) NewApisixClusterConfig(name string, enable bool) error {
+ cc := fmt.Sprintf(_apisixClusterConfigTemplate, s.opts.APISIXClusterConfigVersion, name, enable)
+ if err := k8s.KubectlApplyFromStringE(s.t, s.kubectlOptions, cc); err != nil {
+ return err
+ }
+ time.Sleep(5 * time.Second)
+ return nil
+}
+
+// DeleteApisixClusterConfig removes an ApisixClusterConfig CRD
+func (s *Scaffold) DeleteApisixClusterConfig(name string, enable bool) error {
Review Comment:
The logic between `NewApisixClusterConfig` and `DeleteApisixClusterConfig` is actually the same.
It is recommended to combine these two methods.
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] lingsamuel commented on a diff in pull request #1016: e2e-test: add e2e tests and CRDs for ApisixClusterConfig v2
Posted by GitBox <gi...@apache.org>.
lingsamuel commented on code in PR #1016:
URL: https://github.com/apache/apisix-ingress-controller/pull/1016#discussion_r882483379
##########
test/e2e/scaffold/cluster_config.go:
##########
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+package scaffold
+
+import (
+ "fmt"
+ "time"
+
+ "github.com/gruntwork-io/terratest/modules/k8s"
+)
+
+var (
+ _apisixClusterConfigTemplate = `
+apiVersion: %s
+kind: ApisixClusterConfig
+metadata:
+ name: %s
+spec:
+ monitoring:
+ prometheus:
+ enable: %v
+`
+)
+
+// NewApisixClusterConfig creates an ApisixClusterConfig CRD
+func (s *Scaffold) NewApisixClusterConfig(name string, enable bool) error {
+ cc := fmt.Sprintf(_apisixClusterConfigTemplate, s.opts.APISIXClusterConfigVersion, name, enable)
+ if err := k8s.KubectlApplyFromStringE(s.t, s.kubectlOptions, cc); err != nil {
+ return err
+ }
+ time.Sleep(5 * time.Second)
+ return nil
+}
+
+// DeleteApisixClusterConfig removes an ApisixClusterConfig CRD
+func (s *Scaffold) DeleteApisixClusterConfig(name string, enable bool) error {
Review Comment:
I don't think it's necessary, this two functions are tiny enough
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] codecov-commenter commented on pull request #1016: e2e-test: add e2e tests and CRDs for ApisixClusterConfig v2
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #1016:
URL: https://github.com/apache/apisix-ingress-controller/pull/1016#issuecomment-1127414544
# [Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1016?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1016](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1016?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (291ff10) into [master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/cd5063f04881248338595cb85100ef1009e75a80?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cd5063f) will **not change** coverage.
> The diff coverage is `n/a`.
> :exclamation: Current head 291ff10 differs from pull request most recent head f38c7d0. Consider uploading reports for the commit f38c7d0 to get more accurate results
```diff
@@ Coverage Diff @@
## master #1016 +/- ##
=======================================
Coverage 30.55% 30.55%
=======================================
Files 74 74
Lines 8320 8320
=======================================
Hits 2542 2542
Misses 5502 5502
Partials 276 276
```
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1016?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1016?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [cd5063f...f38c7d0](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1016?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on pull request #1016: e2e-test: add e2e tests and CRDs for ApisixClusterConfig v2
Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on PR #1016:
URL: https://github.com/apache/apisix-ingress-controller/pull/1016#issuecomment-1139159319
ping @gxthrj PTAL, thanks!
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-ingress-controller] juzhiyuan merged pull request #1016: e2e-test: add e2e tests and CRDs for ApisixClusterConfig v2
Posted by GitBox <gi...@apache.org>.
juzhiyuan merged PR #1016:
URL: https://github.com/apache/apisix-ingress-controller/pull/1016
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org