-
Notifications
You must be signed in to change notification settings - Fork 22
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
@@ -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" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have some time to check this part of the code, so I'm not sure I understand the purpose of the env var usage here. Could you elaborate? From my point of view, I would expect us here to:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
is that same thing or different ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That looks like it is setting the headless value but I believe @thepetk is wanting a checker function to easily grab the headless value from a CR |
||
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) | ||
|
There was a problem hiding this comment.
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?