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

Convert isValidClientBodyBufferSize to something more generic #3409

Merged
merged 1 commit into from
Nov 13, 2018

Conversation

wayt
Copy link
Contributor

@wayt wayt commented Nov 12, 2018

What this PR does / why we need it:

This re-use the isValidClientBodyBufferSize for client_max_body_size configuration.

I'm make isValidClientBodyBufferSize more generic for that.

Recently, we've had nginx configuration issue because of client_max_body_size being set to an empty value.

As mentioned in #2494 this is caused by a race condition somewhere, making https://github.com/kubernetes/ingress-nginx/blob/master/internal/ingress/controller/store/store.go#L675 return an empty annotations.Ingress.

Which issue this PR fixes

Special notes for your reviewer:

This does not solve the underlying race condition but fixes the reload issue it causes.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 12, 2018
@wayt
Copy link
Contributor Author

wayt commented Nov 12, 2018

Cc @ElvinEfendi

@ElvinEfendi
Copy link
Member

I'm OK with this change but I think the more important issue is how we handle when getting annotations for given ingress fails:

Currently we still continue generating configuration for that ingress that we can not get annotations of, maybe we should skip that ingress?

There's always going to be race since listing ingresses and getting their annotations is not an atomic operation. That being said we can make the situation better by introducing another function that returns both the list of ingresses as well as their annotations in a map:

func (s k8sStore) ListIngressesAndAnnotations() ([]*extensions.Ingress, map[string]*annotations.Ingress)

@ElvinEfendi
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 13, 2018
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 13, 2018
@aledbf
Copy link
Member

aledbf commented Nov 13, 2018

@ElvinEfendi reading the travis-ci e2e log I think the reason for the invalid configuration happens when there is no endpoints available or an error getting information about the service.

@aledbf
Copy link
Member

aledbf commented Nov 13, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 13, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, ElvinEfendi, wayt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit a22c656 into kubernetes:master Nov 13, 2018
@wayt wayt deleted the client-max-body-size branch November 13, 2018 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants