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/08/02 08:47:08 UTC

[GitHub] [apisix-ingress-controller] lingsamuel opened a new pull request, #1204: Restruct pkgingress

lingsamuel opened a new pull request, #1204:
URL: https://github.com/apache/apisix-ingress-controller/pull/1204

   <!-- Please answer these questions before submitting a pull request -->
   
   ### Type of change:
   
   <!-- Please delete options that are not relevant. -->
   
   - [x] Refactor
   
   ### What this PR does / why we need it:
   
   *Submit PR for CI, I will update the changes later*
   
   This is a huge PR, so I will describe the changes and ideas in detail.
   
   ### Pre-submission checklist:
   
   <!--
   Please follow the requirements:
   1. Use Draft if the PR is not ready to be reviewed
   2. Test is required for the feat/fix PR, unless you have a good reason
   3. Doc is required for the feat PR
   4. Use a new commit to resolve review instead of `push -f`
   5. Use "request review" to notify the reviewer once you have resolved the review
   -->
   
   * [ ] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix-ingress-controller#community) first**
   


-- 
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 #1204: Restruct pkg/ingress

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #1204:
URL: https://github.com/apache/apisix-ingress-controller/pull/1204#issuecomment-1202260112

   # [Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204?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 [#1204](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5b89467) into [master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/cccad72a1e0ef60525c69371b4b27c4598c587c1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cccad72) will **increase** coverage by `13.09%`.
   > The diff coverage is `31.47%`.
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #1204       +/-   ##
   ===========================================
   + Coverage   29.55%   42.64%   +13.09%     
   ===========================================
     Files          81       73        -8     
     Lines       10166     6462     -3704     
   ===========================================
   - Hits         3005     2756      -249     
   + Misses       6834     3409     -3425     
   + Partials      327      297       -30     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [cmd/ingress/ingress.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y21kL2luZ3Jlc3MvaW5ncmVzcy5nbw==) | `78.64% <ø> (-0.41%)` | :arrow_down: |
   | [pkg/config/config.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL2NvbmZpZy9jb25maWcuZ28=) | `65.00% <ø> (-0.35%)` | :arrow_down: |
   | [...viders/apisix/translation/apisix\_cluster\_config.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL3Byb3ZpZGVycy9hcGlzaXgvdHJhbnNsYXRpb24vYXBpc2l4X2NsdXN0ZXJfY29uZmlnLmdv) | `50.00% <ø> (ø)` | |
   | [...kg/providers/apisix/translation/apisix\_consumer.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL3Byb3ZpZGVycy9hcGlzaXgvdHJhbnNsYXRpb24vYXBpc2l4X2NvbnN1bWVyLmdv) | `67.74% <ø> (ø)` | |
   | [pkg/providers/apisix/translation/apisix\_ssl.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL3Byb3ZpZGVycy9hcGlzaXgvdHJhbnNsYXRpb24vYXBpc2l4X3NzbC5nbw==) | `0.00% <0.00%> (ø)` | |
   | [pkg/providers/apisix/translation/translator.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL3Byb3ZpZGVycy9hcGlzaXgvdHJhbnNsYXRpb24vdHJhbnNsYXRvci5nbw==) | `0.00% <0.00%> (ø)` | |
   | [pkg/providers/gateway/translation/gateway.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL3Byb3ZpZGVycy9nYXRld2F5L3RyYW5zbGF0aW9uL2dhdGV3YXkuZ28=) | `0.00% <ø> (ø)` | |
   | [.../providers/gateway/translation/gateway\_tlsroute.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL3Byb3ZpZGVycy9nYXRld2F5L3RyYW5zbGF0aW9uL2dhdGV3YXlfdGxzcm91dGUuZ28=) | `0.00% <0.00%> (ø)` | |
   | [pkg/providers/gateway/translation/translator.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL3Byb3ZpZGVycy9nYXRld2F5L3RyYW5zbGF0aW9uL3RyYW5zbGF0b3IuZ28=) | `0.00% <ø> (ø)` | |
   | [pkg/providers/ingress/provider.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL3Byb3ZpZGVycy9pbmdyZXNzL3Byb3ZpZGVyLmdv) | `0.00% <0.00%> (ø)` | |
   | ... and [40 more](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1204/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?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 merged pull request #1204: Restruct pkg/ingress

Posted by GitBox <gi...@apache.org>.
tao12345666333 merged PR #1204:
URL: https://github.com/apache/apisix-ingress-controller/pull/1204


-- 
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 #1204: Restruct pkg/ingress

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on code in PR #1204:
URL: https://github.com/apache/apisix-ingress-controller/pull/1204#discussion_r942347879


##########
pkg/providers/apisix/provider.go:
##########
@@ -0,0 +1,202 @@
+// 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 apisix
+
+import (
+	"context"
+	"fmt"
+	"sync"
+
+	"k8s.io/client-go/tools/cache"
+
+	"github.com/apache/apisix-ingress-controller/pkg/config"
+	"github.com/apache/apisix-ingress-controller/pkg/kube"
+	apisixtranslation "github.com/apache/apisix-ingress-controller/pkg/providers/apisix/translation"
+	"github.com/apache/apisix-ingress-controller/pkg/providers/k8s/namespace"
+	"github.com/apache/apisix-ingress-controller/pkg/providers/translation"
+	providertypes "github.com/apache/apisix-ingress-controller/pkg/providers/types"
+	"github.com/apache/apisix-ingress-controller/pkg/providers/utils"
+)
+
+const (
+	ProviderName = "APISIX"
+)
+
+type apisixCommon struct {
+	*providertypes.Common
+
+	namespaceProvider namespace.WatchingNamespaceProvider
+	translator        apisixtranslation.ApisixTranslator
+}
+
+var _ Provider = (*apisixProvider)(nil)
+
+type Provider interface {
+	providertypes.Provider
+
+	Init(ctx context.Context) error
+	ResourceSync()
+
+	GetSslFromSecretKey(string) *sync.Map

Review Comment:
   just a question, why do we put it here, is it a generic method?



-- 
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