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

fix: Solve the problem of final consistency when deleting #163

Merged
merged 12 commits into from
Jan 9, 2021

Conversation

gxthrj
Copy link
Contributor

@gxthrj gxthrj commented Jan 8, 2021

Solve the problem of final consistency when deleting.
Support retry when remove upstream or service failed.
Fix #118

@gxthrj gxthrj requested a review from tokers January 9, 2021 02:30
@@ -116,6 +116,7 @@ func (i *item) upstream(clusterName string) (*v1.Upstream, error) {
}

var ups upstreamItem
log.Info(string(i.Value))
Copy link
Contributor

Choose a reason for hiding this comment

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

It already logs i.Value in line 112.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

apisixUpstreamYaml, err = c.apisixUpstreamList.ApisixUpstreams(namespace).Get(name)
if err != nil {
if errors.IsNotFound(err) {
log.Infof("apisixUpstraem %s is removed", sqo.Key)
Copy link
Contributor

Choose a reason for hiding this comment

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

Type: apisixUpstraem => apisixUpstream

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

log.Infof("apisixUpstraem %s is removed", sqo.Key)
return nil
}
runtime.HandleError(fmt.Errorf("failed to list apisixService %s/%s", sqo.Key, err.Error()))
Copy link
Contributor

Choose a reason for hiding this comment

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

Type: here we are listing ApisixUpstream.

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

return
}
c.addFunc(newObj)
var key string
Copy link
Contributor

Choose a reason for hiding this comment

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

Style:

var (
    key string
    err  error
)

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

test/e2e/scaffold/crd.go Show resolved Hide resolved
@@ -77,7 +77,7 @@ spec:
tcpSocket:
port: 8080
timeoutSeconds: 2
image: "apache/apisix-ingress-controller:dev"
image: "apisix-ingress-controller:dev"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why change it again?

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

@codecov-io
Copy link

codecov-io commented Jan 9, 2021

Codecov Report

Merging #163 (23530a8) into master (e34e12b) will decrease coverage by 1.81%.
The diff coverage is 1.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #163      +/-   ##
==========================================
- Coverage   50.21%   48.39%   -1.82%     
==========================================
  Files          30       30              
  Lines        1414     1467      +53     
==========================================
  Hits          710      710              
- Misses        620      673      +53     
  Partials       84       84              
Impacted Files Coverage Δ
pkg/seven/state/solver.go 1.69% <0.00%> (-1.39%) ⬇️
pkg/config/config.go 84.00% <100.00%> (ø)

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 e34e12b...23530a8. Read the comment docs.

@gxthrj gxthrj requested a review from tokers January 9, 2021 10:04
@gxthrj gxthrj merged commit 1a36ce8 into apache:master Jan 9, 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.

feat: Support retries in upstream definition
3 participants