Skip to content

Add certs secret name read from env#2685

Merged
knative-prow[bot] merged 5 commits intoknative:mainfrom
hhk7734:main
Mar 6, 2023
Merged

Add certs secret name read from env#2685
knative-prow[bot] merged 5 commits intoknative:mainfrom
hhk7734:main

Conversation

@hhk7734
Copy link
Copy Markdown
Contributor

@hhk7734 hhk7734 commented Feb 17, 2023

Changes

  • Add certificates k8s secret name read from environment variables

/kind enhancement

  • I want to change secret name when I use knative operator.

Release Note


Docs


@knative-prow
Copy link
Copy Markdown

knative-prow bot commented Feb 17, 2023

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

@knative-prow knative-prow bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 17, 2023
@knative-prow
Copy link
Copy Markdown

knative-prow bot commented Feb 17, 2023

Hi @hhk7734. 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.

Details

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.

@dprotaso
Copy link
Copy Markdown
Member

dprotaso commented Feb 21, 2023

Is this a dupe of #2662 ?

@hhk7734
Copy link
Copy Markdown
Contributor Author

hhk7734 commented Feb 21, 2023

Is this a dupe of #2662 ?

No. #2662 deals with the key of the secret.data and this deals with the secret.metadata.name.

@dprotaso
Copy link
Copy Markdown
Member

dprotaso commented Feb 24, 2023

We provide an option to change the secret name for look up here:

pkg/webhook/webhook.go

Lines 46 to 52 in 2fdd6bf

// SecretName is the name of k8s secret that contains the webhook
// server key/cert and corresponding CA cert that signed them. The
// server key/cert are used to serve the webhook and the CA cert
// is provided to k8s apiserver during admission controller
// registration.
// If no SecretName is provided, then the webhook serves without TLS.
SecretName string

@hhk7734
Copy link
Copy Markdown
Contributor Author

hhk7734 commented Feb 27, 2023

We provide an option to change the secret name for look up here:

I wanted to be able to set secret name as an environment variable when installing knative/operator.

previously, I submiited https://github.com/knative/operator/pull/1338/files. I was advised to modify knative/pkg code.
so I submitted this PR here.

@dprotaso
Copy link
Copy Markdown
Member

dprotaso commented Mar 1, 2023

/ok-to-test

Thanks for clarifying - can we adjust the names a bit to match the properties in the webhook.Options type

ie. WEBHOOK_SECRET_NAME and webhook.SecretNameFromEnv

ctx := webhook.WithOptions(signals.NewContext(), webhook.Options{
	ServiceName: webhook.NameFromEnv(),
	Port:        webhook.PortFromEnv(8443),
	SecretName:  webhook.SecretNameFromEnv("operator-webhook-certs"),
})

@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 Mar 1, 2023
@hhk7734
Copy link
Copy Markdown
Contributor Author

hhk7734 commented Mar 2, 2023

@dprotaso I added your suggestion to this PR.

@dprotaso
Copy link
Copy Markdown
Member

dprotaso commented Mar 6, 2023

/ok-to-test
/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 6, 2023
@knative-prow
Copy link
Copy Markdown

knative-prow bot commented Mar 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 6, 2023
@knative-prow knative-prow bot merged commit fd00e03 into knative:main Mar 6, 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. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants