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

Migrate ingress.class annotation to new IngressClassName field #5307

Merged
merged 1 commit into from
Mar 31, 2020

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Mar 31, 2020

What this PR does / why we need it:

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Which issue/s this PR fixes

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 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 Mar 31, 2020
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 31, 2020
@aledbf aledbf force-pushed the 118 branch 2 times, most recently from c0f41da to 7f14039 Compare March 31, 2020 14:40
@aledbf
Copy link
Member Author

aledbf commented Mar 31, 2020

/retest

@codecov-io
Copy link

Codecov Report

Merging #5307 into master will increase coverage by 0.05%.
The diff coverage is 60.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5307      +/-   ##
==========================================
+ Coverage   58.64%   58.70%   +0.05%     
==========================================
  Files          88       88              
  Lines        6901     6908       +7     
==========================================
+ Hits         4047     4055       +8     
  Misses       2410     2410              
+ Partials      444      443       -1     
Impacted Files Coverage Δ
cmd/nginx/main.go 6.41% <0.00%> (-0.09%) ⬇️
internal/k8s/main.go 69.23% <25.00%> (+3.77%) ⬆️
internal/ingress/status/status.go 70.98% <71.42%> (ø)
internal/ingress/annotations/class/main.go 88.88% <85.71%> (+17.46%) ⬆️
internal/ingress/controller/store/store.go 59.95% <88.88%> (+0.30%) ⬆️
cmd/nginx/flags.go 83.08% <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 461aa93...04ef782. Read the comment docs.

@aledbf
Copy link
Member Author

aledbf commented Mar 31, 2020

/retest

Copy link
Contributor

@cmluciano cmluciano left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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 4fdf9c9 into kubernetes:master Mar 31, 2020
@aledbf aledbf deleted the 118 branch April 1, 2020 14:37
if !k8s.IsNetworkingIngressAvailable {
klog.Warningf("Using deprecated \"k8s.io/api/extensions/v1beta1\" package because Kubernetes version is < v1.14.0")
}

if !k8s.IsIngressV1Ready {
klog.Infof("Enabling new Ingress features availables since v1.18.0")
Copy link
Member

Choose a reason for hiding this comment

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

This log message is confusing, so we enable new ingress features in ingress V1 is NOT ready?

@janosi
Copy link
Contributor

janosi commented Apr 14, 2020

Hello @aledbf @cmluciano Maybe I misunderstand the code, but is it so that from now on the annotation is not taken into consideration?
I just ask this as I understand the API specification a bit different here: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#ingressspec-v1beta1-networking-k8s-io
For backwards compatibility, when that annotation is set, it must be given precedence over this field.

@janosi
Copy link
Contributor

janosi commented Apr 14, 2020

OK, I can see now. the toIngress() function puts the annotation's value into the Spec if there is annotation. So, the annotation becomes "Spec.IngressClassName" before the isValid() is called.
Sorry for the mess.

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.

6 participants