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

Use CA rather than the server cert in patching webhook #1863

Open
wants to merge 2 commits into
base: maistra-2.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/controller/common/webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ var (
IstioRootCertKey = "root-cert.pem"
// IstiodCertKey name of Secret entry Istiod uses for the cert
IstiodCertKey = "ca-cert.pem"
// IstiodTLSSecretCertKey name of Secret entry containing intermediate certificate for Istio provided by cert-manager
IstiodTLSSecretCertKey = "tls.crt"
// IstiodTLSSecretCertCAKey name of the Secret entry containing the CA Bundle for Istio provided by cert-manager
IstiodTLSSecretCertCAKey = "ca.crt"
// ServiceCABundleKey name of config map entry service-ca operator uses for the CA bundle
ServiceCABundleKey = "service-ca.crt"
)
Expand Down
8 changes: 4 additions & 4 deletions pkg/controller/servicemesh/webhookca/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ var autoRegistrationMap = map[string]CABundleSource{
},
{
SecretName: istiodCustomCertSecretName,
Key: common.IstiodTLSSecretCertKey,
Key: common.IstiodTLSSecretCertCAKey,
},
{
SecretName: istiodSecretName,
Key: common.IstiodCertKey,
},
{
SecretName: istiodCertManagerSecretName,
Key: common.IstiodTLSSecretCertKey,
Key: common.IstiodTLSSecretCertCAKey,
},
},
},
Expand All @@ -89,15 +89,15 @@ var autoRegistrationMap = map[string]CABundleSource{
},
{
SecretName: istiodCustomCertSecretName,
Key: common.IstiodTLSSecretCertKey,
Key: common.IstiodTLSSecretCertCAKey,
},
{
SecretName: istiodSecretName,
Key: common.IstiodCertKey,
},
{
SecretName: istiodCertManagerSecretName,
Key: common.IstiodTLSSecretCertKey,
Key: common.IstiodTLSSecretCertCAKey,
FilipB marked this conversation as resolved.
Show resolved Hide resolved
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/servicemesh/webhookca/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func cases() []testCase {
webhookName: istiodMutatingWebhookName,
source: autoRegistrationMap[istiodWebhookNamePrefix],
objectName: istiodCustomCertSecretName,
dataKey: common.IstiodTLSSecretCertKey,
dataKey: common.IstiodTLSSecretCertCAKey,
kind: "Secret",
request: istiodInjectorRequest,
getter: mutatingWebhook,
Expand Down Expand Up @@ -178,7 +178,7 @@ func cases() []testCase {
webhookName: istioValidatorWebhookName,
source: autoRegistrationMap[istioValidatorWebhookNamePrefix],
objectName: istiodCustomCertSecretName,
dataKey: common.IstiodTLSSecretCertKey,
dataKey: common.IstiodTLSSecretCertCAKey,
kind: "Secret",
request: istiodValidatorRequest,
getter: validatingWebhook,
Expand All @@ -189,7 +189,7 @@ func cases() []testCase {
webhookName: istioValidatorWebhookName,
source: autoRegistrationMap[istiodWebhookNamePrefix],
objectName: istiodCertManagerSecretName,
dataKey: common.IstiodTLSSecretCertKey,
dataKey: common.IstiodTLSSecretCertCAKey,
kind: "Secret",
request: istiodValidatorRequest,
getter: validatingWebhook,
Expand Down