gateway-api icon indicating copy to clipboard operation
gateway-api copied to clipboard

Create utils to make it easier to work with custom types

Open robscott opened this issue 4 years ago • 15 comments

What would you like to be added: Helper funcs that help with type conversion, especially from and to pointers, for our custom types. Examples of these types include Hostname, Namespace, and Group.

Why this is needed: To simplify CRD validation, we've created a lot of custom types. Unfortunately this makes it difficult to work with our APIs with go. It would be very helpful if we had some utils that made this easier to work with. Otherwise each implementation will likely end up implementing their own set of these.

robscott avatar Aug 24 '21 22:08 robscott

Want to make sure I understand you right. Are you referring to something like?

func NamespacePtr(ns string) *gwapi.Namespace
func Namespace(ns string) gwapi.Namespace

hbagdi avatar Aug 25 '21 16:08 hbagdi

@hbagdi yep, thanks for adding the examples!

robscott avatar Aug 25 '21 18:08 robscott

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Nov 23 '21 19:11 k8s-triage-robot

:+1:, see https://github.com/projectcontour/contour/blob/main/internal/gatewayapi/helpers.go for some examples of what we've needed for the Contour implementation. Would love to see these upstreamed.

skriss avatar Dec 01 '21 21:12 skriss

That's a great set of helpers! I think I've seen similar helpers in at least the Istio code base, @howardjohn is there much overlap here? Agree that it would be great to move any broadly shared code into Gateway.

/remove-lifecycle stale

robscott avatar Dec 01 '21 22:12 robscott

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Mar 01 '22 23:03 k8s-triage-robot

/remove-lifecycle stale

ping @howardjohn, what do you think about upstreaming some helpers like the Contour ones above?

youngnick avatar Mar 06 '22 23:03 youngnick

/good-first-issue

bowei avatar Mar 07 '22 16:03 bowei

@bowei: This request has been marked as suitable for new contributors.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-good-first-issue command.

In response to this:

/good-first-issue

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 avatar Mar 07 '22 16:03 k8s-ci-robot

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jun 05 '22 16:06 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Jul 05 '22 17:07 k8s-triage-robot

/remove-lifecycle rotten /lifecycle frozen

This is still a reasonably good first issue, as described in Rob's initial comment.

youngnick avatar Jul 15 '22 00:07 youngnick

/assign

abhijit-dev82 avatar Jul 29 '22 05:07 abhijit-dev82

Hey @abhijit-dev82 just checking in, everything going good with this one? Is there anything we can do to support/help?

shaneutt avatar Aug 10 '22 01:08 shaneutt

HI @shaneutt I had dropped a message on slack to @robscott asking for some pointers . Will cover the below list of custom types to start off with. Please let me know if I have missed out on any.

Hostname Namespace Kind Group SectionName PortNumber PreciseHostname ObjectName GatewayController

abhijit-dev82 avatar Aug 10 '22 04:08 abhijit-dev82