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

allow namespace-scoped parametersRef #543

Merged
merged 1 commit into from
Feb 12, 2021

Conversation

hbagdi
Copy link
Contributor

@hbagdi hbagdi commented Feb 11, 2021

This patch adds a namespace field to the parametersRef reference.
This allows cluster-scoped GatewayClass resource to reference a
namespaced-scoped parameters resource.

This is in-line with upstream KEP 2365:
https://github.com/kubernetes/enhancements/blob/master/keps/prod-readiness/sig-network/2365.yaml

Why is it done the way it is done?

What type of PR is this?

/kind feature

What this PR does / why we need it:

This patch adds a namespace field to the parametersRef reference.
This allows cluster-scoped GatewayClass resource to reference a
namespaced-scoped parameters resource.

Which issue(s) this PR fixes:

Fixes #524
Close #523
Does this PR introduce a user-facing change?:

Added a new namespace field to specify a namespace for Parameters reference in GatewayClass resource.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 11, 2021
@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 11, 2021
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 11, 2021
@hbagdi hbagdi added this to the v0.2.0 milestone Feb 11, 2021
@hbagdi
Copy link
Contributor Author

hbagdi commented Feb 11, 2021

/assign @robscott @danehans

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this @hbagdi! This all matches up with the KEP well, just one tiny nit about defaulting but otherwise LGTM.

apis/v1alpha1/gatewayclass_types.go Show resolved Hide resolved
@hbagdi hbagdi force-pushed the param-ref-namespace branch from c7b00fa to f259f11 Compare February 11, 2021 17:46
This patch adds a namespace field to the parametersRef reference.
This allows cluster-scoped GatewayClass resource to reference a
namespaced-scoped parameters resource.

This is in-line with upstream KEP 2365:
https://github.com/kubernetes/enhancements/blob/master/keps/prod-readiness/sig-network/2365.yaml

Why is it done the way it is done?
- Namespace field was not added to LocalObjectReference because that
type is referenced in a lot of places. We don't want to add in an
optional namespace field in all these places and increase security
issues with cross-namespace references.
- ObjectReference was not used because upstream discourages its use:
https://pkg.go.dev/k8s.io/api/core/v1#ObjectReference. Instead, a new type was
introduced as per upstream's guidance.
- A new "Cluster" field was added as advised upstream:
kubernetes/enhancements#2366 (comment)
@hbagdi hbagdi force-pushed the param-ref-namespace branch from f259f11 to 266d0da Compare February 12, 2021 12:16
@robscott
Copy link
Member

Thanks!

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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 0d6d8b5 into kubernetes-sigs:master Feb 12, 2021
@hbagdi hbagdi deleted the param-ref-namespace branch February 13, 2021 13:39
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. 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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Inconsistency in ParametersRef Documentation
4 participants