Skip to content

Commit

Permalink
Merge pull request #123 from digitalocean/ig-webhook-timeout-err-msg
Browse files Browse the repository at this point in the history
Fix webhook timeout diagnostics message
  • Loading branch information
gottwald committed Jul 5, 2021
2 parents 7d20651 + 98f22c2 commit 9cd6ee5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions checks/doks/admission_controller_webhook_timeout.go
Expand Up @@ -57,11 +57,11 @@ func (w *webhookTimeoutCheck) Run(objects *kube.Objects) ([]checks.Diagnostic, e
// unable to configure the TimeoutSeconds value and this value will stay at nil, breaking
// upgrades. It's only for versions >= 1.14 that the value will default to 30 seconds.
continue
} else if *wh.TimeoutSeconds < int32(1) || *wh.TimeoutSeconds >= int32(30) {
} else if *wh.TimeoutSeconds < int32(1) || *wh.TimeoutSeconds > int32(29) {
// Webhooks with TimeoutSeconds set: less than 1 or greater than or equal to 30 is bad.
d := checks.Diagnostic{
Severity: checks.Error,
Message: "Validating webhook with a TimeoutSeconds value greater than 29 seconds will block upgrades.",
Message: "Validating webhook with a TimeoutSeconds value smaller than 1 second or greater than 29 seconds will block upgrades.",
Kind: checks.ValidatingWebhookConfiguration,
Object: &config.ObjectMeta,
Owners: config.ObjectMeta.GetOwnerReferences(),
Expand All @@ -81,11 +81,11 @@ func (w *webhookTimeoutCheck) Run(objects *kube.Objects) ([]checks.Diagnostic, e
// unable to configure the TimeoutSeconds value and this value will stay at nil, breaking
// upgrades. It's only for versions >= 1.14 that the value will default to 30 seconds.
continue
} else if *wh.TimeoutSeconds < int32(1) || *wh.TimeoutSeconds >= int32(30) {
} else if *wh.TimeoutSeconds < int32(1) || *wh.TimeoutSeconds > int32(29) {
// Webhooks with TimeoutSeconds set: less than 1 or greater than or equal to 30 is bad.
d := checks.Diagnostic{
Severity: checks.Error,
Message: "Mutating webhook with a TimeoutSeconds value greater than 29 seconds will block upgrades.",
Message: "Mutating webhook with a TimeoutSeconds value smaller than 1 second or greater than 29 seconds will block upgrades.",
Kind: checks.MutatingWebhookConfiguration,
Object: &config.ObjectMeta,
Owners: config.ObjectMeta.GetOwnerReferences(),
Expand Down
4 changes: 2 additions & 2 deletions checks/doks/admission_controller_webhook_timeout_test.go
Expand Up @@ -220,14 +220,14 @@ func webhookTimeoutErrors() []checks.Diagnostic {
diagnostics := []checks.Diagnostic{
{
Severity: checks.Error,
Message: "Validating webhook with a TimeoutSeconds value greater than 29 seconds will block upgrades.",
Message: "Validating webhook with a TimeoutSeconds value smaller than 1 second or greater than 29 seconds will block upgrades.",
Kind: checks.ValidatingWebhookConfiguration,
Object: &validatingConfig.ObjectMeta,
Owners: validatingConfig.ObjectMeta.GetOwnerReferences(),
},
{
Severity: checks.Error,
Message: "Mutating webhook with a TimeoutSeconds value greater than 29 seconds will block upgrades.",
Message: "Mutating webhook with a TimeoutSeconds value smaller than 1 second or greater than 29 seconds will block upgrades.",
Kind: checks.MutatingWebhookConfiguration,
Object: &mutatingConfig.ObjectMeta,
Owners: mutatingConfig.ObjectMeta.GetOwnerReferences(),
Expand Down

0 comments on commit 9cd6ee5

Please sign in to comment.