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

Bug 1990610: prevent panic in startup monitor enablement check #1202

Merged
merged 1 commit into from Aug 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion pkg/operator/startupmonitorreadiness/enablement.go
Expand Up @@ -16,7 +16,14 @@ import (
func IsStartupMonitorEnabledFunction(infrastructureLister configlistersv1.InfrastructureLister, operatorClient v1helpers.StaticPodOperatorClient) func() (bool, error) {
return func() (bool, error) {
infra, err := infrastructureLister.Get("cluster")
if err != nil && !apierrors.IsNotFound(err) {
// we won't be without an infra for very long. This means we're starting up very early in the process, so
// being able to detect that a rollback of a revision is needed isn't necessary since the stakes are low because
// there is no customer data in the cluster yet.
// Just return false until we're able one.
if apierrors.IsNotFound(err) {
return false, nil
}
if err != nil {
// we got an error so without the infrastructure object we are not able to determine the type of platform we are running on
return false, err
}
Expand Down