Skip to content

Commit

Permalink
Add test cases to check if the enable is set to true when the webhook…
Browse files Browse the repository at this point in the history
…ServiceName or webhookSecretName is set

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
  • Loading branch information
tenzen-y committed Aug 3, 2023
1 parent 64f207f commit 905f3f3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/apis/config/v1beta1/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,26 @@ func TestSetCertGeneratorConfig(t *testing.T) {
WebhookSecretName: DefaultWebhookSecretName,
},
},
"cert-generator is forcefully enabled due to set webhookSecretName": {
config: CertGeneratorConfig{
WebhookSecretName: "katib-test",
},
wantConfig: CertGeneratorConfig{
Enable: true,
WebhookServiceName: DefaultWebhookServiceName,
WebhookSecretName: "katib-test",
},
},
"cert-generator is forcefully enabled due to set webhookServiceName": {
config: CertGeneratorConfig{
WebhookServiceName: "katib-test",
},
wantConfig: CertGeneratorConfig{
Enable: true,
WebhookServiceName: "katib-test",
WebhookSecretName: DefaultWebhookSecretName,
},
},
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
Expand Down

0 comments on commit 905f3f3

Please sign in to comment.