Skip to content

Conversation

@robscott
Copy link
Member

@robscott robscott commented Apr 6, 2023

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR is for the purpose of reviewing the v0.7.0 release. It compares the /apis dir from the main branch to the /apis dir on the release-0.6 branch. This is to avoid distracting the PR with all the docs, GEP, and test changes that have also occurred in the same time. This PR is not intended to merge, instead is meant purely to facilitate API review.

/cc @bowei @shaneutt @youngnick
/assign @khenidak @thockin

@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 the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 6, 2023
@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 6, 2023
@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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 6, 2023
@shaneutt shaneutt added this to the v0.7.0 milestone Apr 6, 2023
@shaneutt shaneutt added the release-blocker MUST be completed to complete the milestone label Apr 6, 2023
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$`
// +k8s:deepcopy-gen=false
type HTTPHeaderName = v1beta1.HTTPHeaderName
type HTTPHeaderName = v1beta1.HeaderName
Copy link

Choose a reason for hiding this comment

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

Why did we drop HTTP from this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like because of the above change to make the GRPC variant type GRPCHeaderName v1beta1.HeaderName instead of its own string alias?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, this was trying to ensure that our types and validation were consistent since by definition a GRPC Header name is going to have the same validation and constraints as HTTP.

// +kubebuilder:validation:Pattern=`^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$`
type HTTPHeaderName string
// - "/invalid" - "/ " is an invalid character
type HTTPHeaderName HeaderName
Copy link

Choose a reason for hiding this comment

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

Curious about this indirection?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is part a larger effort to ensure that our types and validation are consistent across GRPC and HTTP Routes. Leaving the "HTTPHeaderName" in place for backwards compat.

Copy link

@khenidak khenidak left a comment

Choose a reason for hiding this comment

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

Minor comments, otherwise this looks fine.

//
// Support: Core for Kubernetes Service
//
// Support: Extended for Kubernetes ServiceImport

Choose a reason for hiding this comment

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

Nit: While we all understand what ServiceImport is, a new reader may not. So better to call out that these are objects.

Choose a reason for hiding this comment

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

Same comment applies in a lot of places.

Copy link
Member Author

Choose a reason for hiding this comment

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

To clarify, are you saying that "Extended for Kubernetes ServiceImport" should be replaced with "Extended for Kubernetes ServiceImport Objects", would the same be true for "Core for Kubernetes Service Objects"? I'm not that familiar with the proper terminology here, but would "Resource(s)" work as well?

for i, m := range matches {
if m.Method != nil && m.Method.Service == nil && m.Method.Method == nil {
errs = append(errs, field.Required(path.Index(i).Child("method"), "one or both of `service` or `method` must be specified"))
if m.Method != nil {

Choose a reason for hiding this comment

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

can m.Method == nil if so, is it a valid object?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, it's optional, but there is defaulting involved so it seems unlikely/impossible that this would ever be empty.

Copy link

@thockin thockin May 15, 2023

Choose a reason for hiding this comment

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

We often add the else ... field.Required() to these - it has helped prevent tests that passed whjen they shouldn't.

// Implementations SHOULD NOT add the port number in the 'Location'
// header in the following cases:
//
// * A Location header that will use HTTP (whether that is determined via

Choose a reason for hiding this comment

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

the _and_ construct will not work as expected this file will be viewed by code editors which generally don't do Markdown.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe you meant to comment on a different line, I can't find an _and_ here. In general we're trying to ensure https://gateway-api.sigs.k8s.io/references/spec/ is readable, and in that case basic markdown formatting is effective.

protocol := listener.Protocol
port := listener.Port
hostnameProtocolPort := fmt.Sprintf("%s:%s:%d", *hostname, protocol, port)
if hostnameProtocolPortSets.Has(hostnameProtocolPort) {

Choose a reason for hiding this comment

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

a map[string]struct{}{} will be better here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the k8s set util that we're using here is roughly doing the same thing but has a nicer interface to work with (https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/util/sets/set.go#L24). Anything I'm missing?

Choose a reason for hiding this comment

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

@khenidak
Copy link

/approve
/lgtm

Thanks for this.

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: khenidak, robscott

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

The pull request process is described here

Details 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

Copy link

@thockin thockin left a comment

Choose a reason for hiding this comment

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

LGTM, just a few minor nits on re-scan

Copy link

@thockin thockin left a comment

Choose a reason for hiding this comment

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

LGTM, just a few minor nits on re-scan

@thockin
Copy link

thockin commented May 15, 2023

/lgtm

to make it real

@robscott
Copy link
Member Author

Thanks everyone for the reviews! v0.7.0 has been released, closing this out.

@robscott robscott closed this May 15, 2023
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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-blocker MUST be completed to complete the milestone size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

8 participants