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

fixes #1258 controller updates deployment when headless boolean is up… #102

Merged
merged 5 commits into from
Jan 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to rename this var to be more clear that it is the array of all env vars for the container?


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
Loading