Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add event & status for ApisixRoute v2 #386

Merged
merged 16 commits into from
Apr 23, 2021
Merged

Conversation

gxthrj
Copy link
Contributor

@gxthrj gxthrj commented Apr 19, 2021

Please answer these questions before submitting a pull request

  • Why submit this pull request?
  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

pkg/ingress/apisix_route.go Outdated Show resolved Hide resolved
pkg/ingress/controller.go Outdated Show resolved Hide resolved
pkg/ingress/apisix_route.go Outdated Show resolved Hide resolved
pkg/ingress/apisix_route.go Outdated Show resolved Hide resolved
pkg/ingress/apisix_route.go Outdated Show resolved Hide resolved
pkg/ingress/apisix_route.go Outdated Show resolved Hide resolved
pkg/ingress/apisix_tls.go Outdated Show resolved Hide resolved
pkg/ingress/apisix_upstream.go Outdated Show resolved Hide resolved
pkg/ingress/controller.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2021

Codecov Report

Merging #386 (fe7568a) into master (3c6f911) will decrease coverage by 1.26%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #386      +/-   ##
==========================================
- Coverage   40.31%   39.05%   -1.27%     
==========================================
  Files          39       39              
  Lines        3264     3326      +62     
==========================================
- Hits         1316     1299      -17     
- Misses       1785     1862      +77     
- Partials      163      165       +2     
Impacted Files Coverage Δ
pkg/ingress/apisix_route.go 0.00% <0.00%> (ø)
pkg/ingress/apisix_tls.go 0.00% <0.00%> (ø)
pkg/ingress/apisix_upstream.go 0.00% <0.00%> (ø)
pkg/ingress/controller.go 0.00% <0.00%> (ø)
pkg/ingress/endpoint.go 0.00% <0.00%> (ø)
pkg/ingress/secret.go 0.00% <0.00%> (ø)
pkg/ingress/status.go 0.00% <0.00%> (ø)
pkg/apisix/cluster.go 29.95% <0.00%> (-6.29%) ⬇️
pkg/apisix/route.go 33.33% <0.00%> (-2.23%) ⬇️
test/e2e/e2e.go
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c6f911...fe7568a. Read the comment docs.

@@ -198,14 +212,50 @@ func (c *apisixRouteController) sync(ctx context.Context, ev *types.Event) error
}

func (c *apisixRouteController) handleSyncErr(obj interface{}, err error) {
event := obj.(*types.Event)
route := event.Object.(kube.ApisixRouteEvent).OldObject
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all events have OldObject field, it's set only in UPDATE event.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will modify this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

pkg/ingress/apisix_tls.go Outdated Show resolved Hide resolved
pkg/ingress/apisix_upstream.go Outdated Show resolved Hide resolved
pkg/kube/apisix/apis/config/v2alpha1/types.go Show resolved Hide resolved
zap.Any("object", obj),
)
//log.Debugw("secret add event arrived",
// zap.Any("object", obj),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that zap.Any outputs the cert and pkey in []bytes and it's not human-friendly. I think we can just print the name and namespace of this secret, and do not print the body.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, can not print.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if log "object" with zap.Any, got error bad access: nil dereference.
I changed logging field.

@gxthrj
Copy link
Contributor Author

gxthrj commented Apr 20, 2021

kubectl get ar -n test httpbin-route -o yaml
image

@gxthrj
Copy link
Contributor Author

gxthrj commented Apr 20, 2021

kubectl describe ar -n test httpbin-route
image

"github.com/apache/apisix-ingress-controller/pkg/log"
"github.com/apache/apisix-ingress-controller/pkg/types"
apisixv1 "github.com/apache/apisix-ingress-controller/pkg/types/apisix/v1"
)

const _routeController = "RouteController"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering whether we need a finer granularity component in apisix-ingress-controller. The pod events reporters are "kubelet", "scheduler", it's a whole program, not a module inside it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean using ApisixIngress is better?

pkg/ingress/endpoint.go Outdated Show resolved Hide resolved
pkg/ingress/apisix_upstream.go Outdated Show resolved Hide resolved
@tokers
Copy link
Contributor

tokers commented Apr 21, 2021

@gxthrj The e2e CI failed.

@gxthrj
Copy link
Contributor Author

gxthrj commented Apr 21, 2021

@gxthrj The e2e CI failed.

It is strange, scale endpoint getting error.

@gxthrj
Copy link
Contributor Author

gxthrj commented Apr 21, 2021

related to : #394 #395

pkg/ingress/apisix_route.go Show resolved Hide resolved
pkg/ingress/apisix_route.go Outdated Show resolved Hide resolved
pkg/ingress/apisix_route.go Outdated Show resolved Hide resolved
pkg/ingress/endpoint.go Outdated Show resolved Hide resolved
pkg/ingress/status.go Outdated Show resolved Hide resolved
pkg/ingress/status.go Outdated Show resolved Hide resolved
@gxthrj gxthrj requested a review from tokers April 21, 2021 14:47
pkg/ingress/status.go Outdated Show resolved Hide resolved
@gxthrj gxthrj requested a review from tokers April 22, 2021 13:52
pkg/ingress/status.go Outdated Show resolved Hide resolved
@tokers tokers merged commit 7b67cda into apache:master Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants