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

Add WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP env-var #3103

Conversation

thesuperzapper
Copy link
Contributor

Changes

/kind enhancement

Related knative/serving#15483

Release Note

Added `WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP` env-var to set `DisableNamespaceOwnership` in `webhook.Options`

Docs


Copy link

knative-prow bot commented Oct 14, 2024

Welcome @thesuperzapper! It looks like this is your first PR to knative/pkg 🎉

@knative-prow knative-prow bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 14, 2024
Copy link

knative-prow bot commented Oct 14, 2024

Hi @thesuperzapper. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@knative-prow knative-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 14, 2024
@thesuperzapper
Copy link
Contributor Author

@dprotaso this is a follow up to #3095 so that we can actually use it in KNative Serving and fix ArgoCD.

@dprotaso
Copy link
Member

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 15, 2024
func DisableNamespaceOwnershipFromEnv() *bool {
disableNamespaceOwnership := os.Getenv(disableNamespaceOwnershipEnvKey)
if disableNamespaceOwnership == "" {
return nil
Copy link
Member

Choose a reason for hiding this comment

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

Can we default this as false and have the return type be bool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dprotaso the behavior I was intending was that WEBHOOK_DISABLE_NAMESPACE_OWNERSHIP overrides the DisableNamespaceOwnership webhook option only when the env-var is set.

To do this, I need to be able to distinguish between an unset env-var and a false one:

https://github.com/knative/pkg/pull/3103/files#diff-71e3f02004a234858e10c42bf73e303ba86e5000ad4a1a95ccf5f6d94447c5e8R169-R174

thesuperzapper added a commit to deployKF/knative-pkg that referenced this pull request Oct 16, 2024
@dprotaso
Copy link
Member

/hold

see: knative/serving#15483 (comment)

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 17, 2024
@thesuperzapper
Copy link
Contributor Author

@dprotaso I was saying in knative/serving#15483 (comment), we should make both changes (that is, set the controller flag to false, AND let users disable the owner references fully).

As long as you agree on the way this PR does the disabling, it should be safe to merge.

Also, it would be a real shame if KServe/Kubeflow/deployKF had to run a forked version of kNative for this simple change that doesn't change any default behavior.

@dprotaso
Copy link
Member

/lgtm
/approve

I'll merge this in to unblock for now - but I don't consider this functionality stable. We may make edits to the mechanism in a future date especially if ArgoCD merges the PR mentioned in the serving issue.

/cherry-pick release-1.16

@knative-prow-robot
Copy link
Contributor

@dprotaso: once the present PR merges, I will cherry-pick it on top of release-1.16 in a new PR and assign it to you.

In response to this:

/lgtm
/approve

I'll merge this in to unblock for now - but I don't consider this functionality stable. We may make edits to the mechanism in a future date especially if ArgoCD merges the PR mentioned in the serving issue.

/cherry-pick release-1.16

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.

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2024
Copy link

knative-prow bot commented Oct 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, thesuperzapper

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

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 17, 2024
@dprotaso
Copy link
Member

/hold cancel

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 17, 2024
@dprotaso
Copy link
Member

OpenCensus flake

/retest

@knative-prow knative-prow bot merged commit 6d10851 into knative:main Oct 17, 2024
37 of 39 checks passed
@knative-prow-robot
Copy link
Contributor

@dprotaso: new pull request created: #3106

In response to this:

/lgtm
/approve

I'll merge this in to unblock for now - but I don't consider this functionality stable. We may make edits to the mechanism in a future date especially if ArgoCD merges the PR mentioned in the serving issue.

/cherry-pick release-1.16

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.

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. kind/enhancement lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants