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

Group is not optional in LocalObjectReference #3322

Open
tamalsaha opened this issue Sep 6, 2024 · 9 comments · May be fixed by #3332
Open

Group is not optional in LocalObjectReference #3322

tamalsaha opened this issue Sep 6, 2024 · 9 comments · May be fixed by #3332
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@tamalsaha
Copy link

tamalsaha commented Sep 6, 2024

LocalObjectReference group field is not marked optional. So, it can't be left unspecified or set to empty string.

In BackendTLSPolicy, we try to ref to a Secret and CRD fails validation check as group is ""

Previous conv in Slack: https://kubernetes.slack.com/archives/CR0H13KGA/p1725096986532939

Screenshot 2024-08-31 at 2 35 20 AM

@tamalsaha tamalsaha added the kind/bug Categorizes issue or PR as related to a bug. label Sep 6, 2024
@youngnick
Copy link
Contributor

Thanks for opening this, this is a relatively simple change that just needs +optional added to the Group field.

/good-first-issue

@k8s-ci-robot
Copy link
Contributor

@youngnick:
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:

Thanks for opening this, this is a relatively simple change that just needs +optional added to the Group field.

/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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Sep 11, 2024
@theBeginner86
Copy link

theBeginner86 commented Sep 11, 2024

Hi @youngnick
Please assign me this issue. I'd like to fix this.
Thanks

@tamalsaha
Copy link
Author

Though it is a simple change, it relaxes the constraints on an api already marked v1. Not sure that is halal with the maintainers? Should this struct be copied for the BackendTLSPolicy and only relaxed there or relaxed everywhere? @youngnick

@candita
Copy link
Contributor

candita commented Sep 11, 2024

This is strange. I didn't have any issue with this in my PR for testing BackendTLSPolicy. caCertificateRefs should look something like this.

spec:
  targetRefs:
  - group: ""
    kind: Service
    name: "backendtlspolicy-test"
  validation:
    caCertificateRefs:
    - group: ""
      kind: Secret
      name: "backend-tls-checks-certificate"

@tamalsaha
Copy link
Author

I guess there is nothing to fix here. I remember getting error from k8s but I can't reproduce this in k8s 1.31 anymore.

required just means something is set (even if that is empty ""). https://stackoverflow.com/a/45577763/244009

Sorry for the false alert.

@arkodg
Copy link
Contributor

arkodg commented Sep 12, 2024

there's still a bug here, the doc string says when unspecified or empty , this can imply the field is optional, but rn its required

@tamalsaha
Copy link
Author

@youngnick youngnick reopened this Sep 12, 2024
@youngnick
Copy link
Contributor

I've reopened because I agree that this field should be optional. Kind and Name still need to be required though.

This is a good-first-issue still, because it's a small, contained change.

tamalsaha added a commit to tamalsaha/gateway-api that referenced this issue Sep 12, 2024
@tamalsaha tamalsaha linked a pull request Sep 12, 2024 that will close this issue
@shaneutt shaneutt added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Sep 20, 2024
@shaneutt shaneutt added this to the v1.3.0 milestone Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
Development

Successfully merging a pull request may close this issue.

7 participants