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

Check ingress rule contains HTTP paths #2361

Merged
merged 1 commit into from
Apr 20, 2018

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Apr 17, 2018

fixes #2357

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 17, 2018
@codecov-io
Copy link

Codecov Report

Merging #2361 into master will increase coverage by 0.1%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #2361     +/-   ##
=========================================
+ Coverage   39.11%   39.21%   +0.1%     
=========================================
  Files          73       73             
  Lines        5203     5205      +2     
=========================================
+ Hits         2035     2041      +6     
+ Misses       2878     2876      -2     
+ Partials      290      288      -2
Impacted Files Coverage Δ
internal/ingress/controller/store/store.go 51.29% <0%> (-0.34%) ⬇️
internal/watch/file_watcher.go 80.76% <0%> (-3.85%) ⬇️
cmd/nginx/main.go 26.2% <0%> (+4.82%) ⬆️

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 4bc943a...c966bb8. Read the comment docs.

@aledbf
Copy link
Member Author

aledbf commented Apr 17, 2018

/assign @ElvinEfendi

@k8s-ci-robot
Copy link
Contributor

@aledbf: GitHub didn't allow me to assign the following users: ElvinEfendi.

Note that only kubernetes members and repo collaborators can be assigned.

In response to this:

/assign @ElvinEfendi

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@aledbf
Copy link
Member Author

aledbf commented Apr 18, 2018

/assign @antoineco

@k8s-ci-robot
Copy link
Contributor

@aledbf: GitHub didn't allow me to assign the following users: antoineco.

Note that only kubernetes members and repo collaborators can be assigned.

In response to this:

/assign @antoineco

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -598,6 +598,9 @@ func (s k8sStore) ListIngresses() []*extensions.Ingress {
continue
}
for ri, rule := range ing.Spec.Rules {
if rule.HTTP == nil {
continue
}
Copy link
Member

Choose a reason for hiding this comment

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

Is there no valid case for the ingress to not have any rule.HTTP defined? I see that below we create a default path when it does not exist, why do we not do the similar thing for rule.HTTP?

Copy link
Member Author

@aledbf aledbf Apr 19, 2018

Choose a reason for hiding this comment

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

@ElvinEfendi when you only define a backend in the ingress without rules. This acts as / as the path

Copy link
Member

Choose a reason for hiding this comment

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

Are you referring to something like

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test-ingress
spec:
  backend:
    serviceName: testsvc
    servicePort: 80

? If so then in the case ing.Spec.Rules would be nil too no?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes

Copy link
Member

Choose a reason for hiding this comment

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

okay, if that's the case then we will still be seeing nil pointer error at line 600

Copy link
Member Author

Choose a reason for hiding this comment

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

? If so then in the case ing.Spec.Rules would be nil too no?

No because ing.Spec.Rules is not a pointer.

@aledbf
Copy link
Member Author

aledbf commented Apr 19, 2018

/assign @ElvinEfendi

@k8s-ci-robot
Copy link
Contributor

@aledbf: GitHub didn't allow me to assign the following users: ElvinEfendi.

Note that only kubernetes members and repo collaborators can be assigned.

In response to this:

/assign @ElvinEfendi

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@aledbf
Copy link
Member Author

aledbf commented Apr 19, 2018

/assign @ElvinEfendi

@ElvinEfendi
Copy link
Member

How hard would it be to write a regression test for this?

@aledbf
Copy link
Member Author

aledbf commented Apr 19, 2018

@ElvinEfendi I will add one after merging this PR and #2382 (in a different PR)

@ElvinEfendi
Copy link
Member

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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 7625c05 into kubernetes:master Apr 20, 2018
@aledbf aledbf deleted the check-path branch April 21, 2018 21:23
@ElvinEfendi
Copy link
Member

the test coverage for this change is introduced at #2399

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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: runtime error: invalid memory address or nil pointer dereference
5 participants