Skip to content

[module-sdk] warn not error on missing certificate secret#123

Merged
ldmonster merged 1 commit into
mainfrom
fix/copy-custom-certificate-warning-not-error
Jul 20, 2026
Merged

[module-sdk] warn not error on missing certificate secret#123
ldmonster merged 1 commit into
mainfrom
fix/copy-custom-certificate-warning-not-error

Conversation

@diyliv

@diyliv diyliv commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix regression in copy-custom-certificate hook: when the configured secretName does not exist in the cluster, the hook now logs a Warn and sets placeholder values ("<none>") instead of returning a hard error.
  • Why: in the original go_lib implementation this was a warning with fallback, but the module-sdk port incorrectly changed it to errors.New() — causing infinite hook retries that block the parallel queue and prevent other modules from starting.
  • Affected files: common-hooks/copy-custom-certificate/hook.go, common-hooks/copy-custom-certificate/hook_internal_test.go.

Context

When a user configures https.mode: CustomCertificate with a secretName, the secret might temporarily not exist (cert-manager not yet created, rotation in progress, etc.). The original go_lib hook handled this gracefully — warn + fallback values + continue. The module-sdk version returned an error, which caused:

  • Hook failures with failures 2316 (endless retries)
  • Blocked parallel queue — other hooks and modules stuck
  • Certificate not distributed across namespaces

This fix aligns module-sdk behaviour with the original go_lib implementation.

Example

Before (broken):

ModuleHookRun:...:custom_certificates:OperatorStartup:failures 2316:
module hook failed: custom certificate secret name is configured,
but secret with this name 'ngkcore-com-wildcard-tls' doesn't exist

→ queue status: sleep after fail, other modules blocked.

After (fixed):

WARN: custom certificate secret name is configured, but secret with this name doesn't exist secret_name=ngkcore-com-wildcard-tls

→ queue status: sleep, values set to <none> placeholders, other modules proceed normally.

@diyliv diyliv self-assigned this Jul 20, 2026
@diyliv diyliv changed the title warn not error on missing certificate secret [module-sdk] warn not error on missing certificate secret Jul 20, 2026
@diyliv
diyliv force-pushed the fix/copy-custom-certificate-warning-not-error branch 3 times, most recently from dfb13dd to 036f17a Compare July 20, 2026 14:31
@diyliv
diyliv force-pushed the fix/copy-custom-certificate-warning-not-error branch 2 times, most recently from 575fc23 to 562335d Compare July 20, 2026 14:43
Signed-off-by: diyliv <onlogn081@gmail.com>
@diyliv
diyliv force-pushed the fix/copy-custom-certificate-warning-not-error branch from 562335d to b1b286f Compare July 20, 2026 14:44
@ldmonster
ldmonster merged commit cac74b6 into main Jul 20, 2026
12 checks passed
@ldmonster
ldmonster deleted the fix/copy-custom-certificate-warning-not-error branch July 20, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants