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 header-pattern annotation. #5114

Merged
merged 1 commit into from
Feb 25, 2020
Merged

Conversation

whalecold
Copy link
Contributor

@whalecold whalecold commented Feb 19, 2020

What this PR does / why we need it:

canary supports match header value with regex.

Types of changes

  • New feature (non-breaking change which adds functionality)

Which issue/s this PR fixes

fixes #5025

How Has This Been Tested?

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 19, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @whalecold!

It looks like this is your first PR to kubernetes/ingress-nginx 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/ingress-nginx has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @whalecold. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 19, 2020
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 19, 2020
@aledbf
Copy link
Member

aledbf commented Feb 19, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 19, 2020
@aledbf
Copy link
Member

aledbf commented Feb 19, 2020

/assign @ElvinEfendi

@codecov-io
Copy link

codecov-io commented Feb 19, 2020

Codecov Report

Merging #5114 into master will increase coverage by 0.55%.
The diff coverage is 88.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5114      +/-   ##
==========================================
+ Coverage   58.65%   59.21%   +0.55%     
==========================================
  Files          88       88              
  Lines        6850     7199     +349     
==========================================
+ Hits         4018     4263     +245     
- Misses       2391     2484      +93     
- Partials      441      452      +11
Impacted Files Coverage Δ
internal/ingress/types.go 0% <ø> (ø) ⬆️
internal/ingress/types_equals.go 17.19% <0%> (-0.1%) ⬇️
internal/ingress/annotations/canary/main.go 100% <100%> (ø) ⬆️
internal/ingress/controller/controller.go 55.36% <100%> (+5.42%) ⬆️
internal/ingress/controller/endpoints.go 93.33% <0%> (-0.42%) ⬇️
internal/ingress/metric/collectors/process.go 90.62% <0%> (+2.08%) ⬆️

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 7d52174...0b33650. Read the comment docs.

@aledbf
Copy link
Member

aledbf commented Feb 20, 2020

@whalecold please rebase and update the e2e tests. We removed gorequest.

@whalecold
Copy link
Contributor Author

@whalecold please rebase and update the e2e tests. We removed gorequest.

Ok, i have updated it just now.

@ElvinEfendi
Copy link
Member

I like the feature in general. But I'm not sure about the interface, what if we introduce canary-by-header-pattern instead? IMO this is simpler and less confusing.

@whalecold
Copy link
Contributor Author

I like the feature in general. But I'm not sure about the interface, what if we introduce canary-by-header-pattern instead? IMO this is simpler and less confusing.

Yeah, canary-by-header-pattern is more appropriate, the match function also uses pattern.

@whalecold
Copy link
Contributor Author

/test pull-ingress-nginx-e2e-1-17

@whalecold
Copy link
Contributor Author

/test pull-ingress-nginx-e2e-1-15

@ElvinEfendi
Copy link
Member

@whalecold thanks for the added test cases - the feature is covered better now!

Just a few small notes, after that rebase and it is ready to ship.

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 21, 2020
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 21, 2020
@whalecold whalecold changed the title Feat: canary supports using specific match strategy to match header value. Feat: add header-pattern annotation. Feb 21, 2020
@whalecold
Copy link
Contributor Author

whalecold commented Feb 21, 2020

@aledbf @ElvinEfendi I complated rebase and squash. Btw, i saw the discussion in the comment #3619 (comment) , can ingress-nginx supports cookie-value annotation ?

@whalecold
Copy link
Contributor Author

ping @aledbf @ElvinEfendi

@ElvinEfendi
Copy link
Member

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 24, 2020
@aledbf
Copy link
Member

aledbf commented Feb 24, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 24, 2020
@aledbf
Copy link
Member

aledbf commented Feb 24, 2020

@whalecold thanks!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@aledbf
Copy link
Member

aledbf commented Feb 24, 2020

/retest

3 similar comments
@aledbf
Copy link
Member

aledbf commented Feb 24, 2020

/retest

@aledbf
Copy link
Member

aledbf commented Feb 24, 2020

/retest

@aledbf
Copy link
Member

aledbf commented Feb 25, 2020

/retest

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support regex in canary annotation
5 participants