Skip to content

Commit

Permalink
fixes #1258 controller updates deployment when headless boolean is up…
Browse files Browse the repository at this point in the history
…dated

Signed-off-by: Horiodino <[email protected]>
  • Loading branch information
Horiodino committed Nov 11, 2024
1 parent 383dd6b commit be7e721
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions controllers/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package controllers
import (
"context"
"fmt"
"strconv"

registryv1alpha1 "github.com/devfile/registry-operator/api/v1alpha1"
"github.com/devfile/registry-operator/pkg/registry"
Expand Down Expand Up @@ -84,6 +85,19 @@ func (r *DevfileRegistryReconciler) updateDeployment(ctx context.Context, cr *re
needsUpdating = true
}
}
headlessStatus := dep.Spec.Template.Spec.Containers[0].Env

for _, env := range headlessStatus {
if env.Name == "REGISTRY_HEADLESS" {
value, err := strconv.ParseBool(env.Value)
if err != nil {
return err
}
if *cr.Spec.Headless != value {
needsUpdating = true
}
}
}

if len(dep.Spec.Template.Spec.Containers) > 2 {
viewerImage := registry.GetRegistryViewerImage(cr)
Expand Down

0 comments on commit be7e721

Please sign in to comment.