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

🐛 fix: resolve JSONPath error in caBundle readiness check by adding kubectl_wait_for_query function #1429

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Nov 6, 2024

  1. fix: resolve JSONPath error in caBundle readiness check by adding kub…

    …ectl_wait_for_query function
    
    By running `make kind-deploy` against a kind cluster  or installing the released script from https://operator-framework.github.io/operator-controller/getting-started/olmv1_getting_started/ the following error is faced:
    
    ```sh
    ...
    deployment.apps/cert-manager-webhook condition met
    deployment.apps/cert-manager-cainjector condition met
    deployment.apps/cert-manager condition met
    error: jsonpath wait format must be --for=jsonpath='{.status.readyReplicas}'=3
    ```
    
    This PR fixes an issue with kubectl wait when used to check the caBundle field in `mutatingwebhookconfigurations` and `validatingwebhookconfigurations`.
    
    This PR introduces the `kubectl_wait_for_query` function, which replaces `kubectl wait` for this specific use case. The function repeatedly checks the `caBundle` field by using `kubectl get` in a loop, ensuring that the `caBundle` is populated without relying on status-based conditions. This approach provides a more flexible solution compatible with webhook configurations, bypassing the limitations of `kubectl wait`.
    camilamacedo86 committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    b118c39 View commit details
    Browse the repository at this point in the history