Skip to content

Commit

Permalink
fix dynamic conversion webhook
Browse files Browse the repository at this point in the history
Signed-off-by: Tommy Hughes <[email protected]>
  • Loading branch information
tchughesiv committed Jan 5, 2023
1 parent cf85bf7 commit b4a96c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/operators/olm/apiservices.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func (a *Operator) areWebhooksAvailable(csv *v1alpha1.ClusterServiceVersion) (bo
return false, err
}

if crd.Spec.Conversion == nil || crd.Spec.Conversion.Strategy != "Webhook" || crd.Spec.Conversion.Webhook == nil || crd.Spec.Conversion.Webhook.ClientConfig == nil && crd.Spec.Conversion.Webhook.ClientConfig.CABundle == nil {
if crd.Spec.Conversion == nil || crd.Spec.Conversion.Strategy != "Webhook" || crd.Spec.Conversion.Webhook == nil || crd.Spec.Conversion.Webhook.ClientConfig == nil || crd.Spec.Conversion.Webhook.ClientConfig.CABundle == nil {
return false, fmt.Errorf("conversionWebhook not ready")
}
webhookCount++
Expand Down
7 changes: 6 additions & 1 deletion pkg/controller/operators/olm/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2359,7 +2359,12 @@ func (a *Operator) updateInstallStatus(csv *v1alpha1.ClusterServiceVersion, inst
return fmt.Errorf(msg)
}

if !webhooksInstalled || webhookErr != nil {
if webhookErr != nil {
csv.SetPhaseWithEventIfChanged(v1alpha1.CSVPhaseInstallReady, requeueConditionReason, fmt.Sprintf("Webhook install failed: %s", webhookErr), now, a.recorder)
return webhookErr
}

if !webhooksInstalled {
msg := "webhooks not installed"
csv.SetPhaseWithEventIfChanged(requeuePhase, requeueConditionReason, msg, now, a.recorder)
if err := a.csvQueueSet.Requeue(csv.GetNamespace(), csv.GetName()); err != nil {
Expand Down

0 comments on commit b4a96c1

Please sign in to comment.