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

ingress: Add v1 describers for Ingress and IngressClass #91268

Merged
merged 1 commit into from Jun 20, 2020

Conversation

cmluciano
Copy link

@cmluciano cmluciano commented May 19, 2020

What type of PR is this?
/kind api-change

What this PR does / why we need it:
Ingressv1 Get is attempted for Ingresses and IngressClasses
and falls back to Ingressv1beta1 if there is a failure.

Which issue(s) this PR fixes:
Based on #89778

Special notes for your reviewer:

  • Handle IngressBackend.Resource types appropriately
  • Change describer tests for series of tests with different input/expected cases

Does this PR introduce a user-facing change?:

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

Ingress KEP

kubernetes/enhancements#1453

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kubectl area/test sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels May 19, 2020
@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 19, 2020
Copy link
Author

@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.

/cc @liggitt @robscott

Here is the basic descriptors that I have started for v1. I still have to handle Resource Backends gracefully and add a few more test cases, but wanted to get some early feedback.

For the backend.Resource part, do either of you have suggestions on how the CRD output should be presented? Should it just be Backend and then similar output to the IngressClassDescribe? I'm still noodling over what the most readable method would be.

staging/src/k8s.io/kubectl/pkg/describe/describe.go Outdated Show resolved Hide resolved
Comment on lines 2413 to 2414
sNum := int64(backend.Service.Port.Number)
sp.Name = strconv.FormatInt(sNum, 10)
Copy link
Member

Choose a reason for hiding this comment

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

match the logic above where we check if backend.Service.Port.Number matches sp.Port, and if so, set spName = sp.Name

sNum := int64(backend.Service.Port.Number)
sp.Name = strconv.FormatInt(sNum, 10)
} else {
sp.Name = backend.Service.Port.Name
Copy link
Member

Choose a reason for hiding this comment

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

match the logic above where we check if backend.ServicePort.StrVal == sp.Name { and if so, set spName = sp.Name

}
ns = metav1.NamespaceSystem
}
if def.Service != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I would unnest this, make it apply to all backend types, and factor out the backend description to apply to both service and resource backends:

w.Write(LEVEL_0, "Default backend:\t%s\n", i.describeBackendV1(ns, def))
...
	w.Write(LEVEL_2, "\t%s \t%s\n", path.Path, i.describeBackendV1(ing.Namespace, &path.Backend))

inside describeBackendV1:

  • for service backends, return the old %s (%s) format
  • for resource backends, return <apiGroup>.<kind> <name> or something similar

Copy link
Author

Choose a reason for hiding this comment

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

@liggitt Any chance you can run the describe test and spot where I'm making a mistake

make test WHAT=./staging/src/k8s.io/kubectl/pkg/describe/...

Copy link
Author

Choose a reason for hiding this comment

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

NVM looks like my editor collapsed these return lines and I missed that

@fedebongio
Copy link
Contributor

/assign @liggitt

@cmluciano cmluciano marked this pull request as ready for review May 22, 2020 15:53
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 22, 2020
@cmluciano cmluciano requested a review from liggitt May 22, 2020 15:53
@cmluciano
Copy link
Author

This is ready for review

@robscott Can you take a look and make sure the IngressClass descripters look good?

@fejta-bot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@cmluciano
Copy link
Author

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 17, 2020
@dims
Copy link
Member

dims commented Jun 17, 2020

/hold Temporary hold to get prow/tide to get back on its feet. Feel free to remove hold in a few hours.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 17, 2020
@dims
Copy link
Member

dims commented Jun 17, 2020

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 17, 2020
@dims
Copy link
Member

dims commented Jun 18, 2020

/hold Temporary hold to get prow/tide to get back on its feet. Feel free to remove hold in a few hours.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 18, 2020
@dims
Copy link
Member

dims commented Jun 18, 2020

/test all

@dims
Copy link
Member

dims commented Jun 18, 2020

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 18, 2020
@dims
Copy link
Member

dims commented Jun 18, 2020

/retest

1 similar comment
@cmluciano
Copy link
Author

/retest

@liggitt
Copy link
Member

liggitt commented Jun 18, 2020

needs rebase

Ingressv1 Get is attempted for Ingresses and IngressClasses
and falls back to Ingressv1beta1 if there is a failure.

Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 18, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@cmluciano
Copy link
Author

/retest

@liggitt
Copy link
Member

liggitt commented Jun 19, 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 Jun 19, 2020
@robscott
Copy link
Member

/lgtm

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jun 19, 2020

@cmluciano: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-conformance-image-test 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-conformance-image-test
pull-kubernetes-cross 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-cross
pull-kubernetes-e2e-gce-csi-serial 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-e2e-gce-csi-serial
pull-kubernetes-e2e-gce-storage-slow 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-e2e-gce-storage-slow
pull-kubernetes-e2e-gci-gce-ipvs 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-e2e-gci-gce-ipvs
pull-kubernetes-e2e-gce-storage-snapshot 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-e2e-gce-storage-snapshot
pull-kubernetes-e2e-azure-disk-vmss 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-e2e-azure-disk-vmss
pull-kubernetes-e2e-azure-file-windows 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-e2e-azure-file-windows
pull-kubernetes-e2e-aks-engine-azure 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-e2e-aks-engine-azure
pull-kubernetes-e2e-gce-iscsi 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-e2e-gce-iscsi
pull-kubernetes-e2e-azure-disk-windows 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-e2e-azure-disk-windows
pull-kubernetes-e2e-gce-iscsi-serial 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-e2e-gce-iscsi-serial
pull-kubernetes-e2e-azure-file 2dc5f5a917f8e1f615f1f17fba430bd139d8425f link /test pull-kubernetes-e2e-azure-file

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit bcdb3c5 into kubernetes:master Jun 20, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jun 20, 2020
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. area/apiserver area/kubectl area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants