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

OCPBUGS-37668: [release-4.17]: Fix operator quick restart for SNO #1001

Merged

Commits on Sep 4, 2024

  1. bug(shutdown): Fix panic when webhooks are disabled

    When webooks are disabled, shutdown procedure produces the following
    panic error:
    ```
    2024-08-13T12:45:04.971685297Z	INFO	shutdown	utils/shutdown.go:22	Done clearing finalizers on exit
    2024-08-13T12:45:04.971713179Z	INFO	shutdown	utils/shutdown.go:23	Seting webhook failure policies to Ignore on exit
    2024-08-13T12:45:04.978386488Z	ERROR	shutdown	utils/shutdown.go:64	Error getting webhook	{"error": "validatingwebhookconfigurations.admissionregistration.k8s.io \"sriov-operator-webhook-config\" not found"}
    panic: runtime error: index out of range [0] with length 0
    
    goroutine 1 [running]:
    github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils.updateValidatingWebhook(0x37d7788?)
    	/go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils/shutdown.go:75 +0x198
    github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils.updateWebhooks()
    	/go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils/shutdown.go:64 +0xa5
    github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils.Shutdown()
    	/go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils/shutdown.go:23 +0x14
    main.main()
    	/go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/main.go:296 +0x1e6a
    ```
    
    Fix the panic error and add an end2end test case to cover it.
    
    Signed-off-by: Andrea Panattoni <apanatto@redhat.com>
    zeeke committed Sep 4, 2024
    Configuration menu
    Copy the full SHA
    f521b1e View commit details
    Browse the repository at this point in the history