-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix(): update gw deploy if gateway sidecar image changed #410
Conversation
…worker env vars Signed-off-by: Mridul Gain <[email protected]>
LGTM! Any test case changes required? |
1 similar comment
LGTM! Any test case changes required? |
Signed-off-by: Mridul Gain <[email protected]>
No. But it needed an empty string check. Thanks! |
Signed-off-by: Mridul Gain <[email protected]>
@@ -53,6 +53,10 @@ import ( | |||
webhook "github.com/kubeslice/worker-operator/pkg/webhook/pod" | |||
) | |||
|
|||
const ( | |||
DEFAULT_SIDECAR_IMG = "nexus.dev.aveshalabs.io/kubeslice/gw-sidecar:1.0.0" |
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.
Plz change this to the new 1.0.1 image.. i doubt the nexus repo is operational.
@@ -1386,6 +1395,27 @@ func (r *SliceGwReconciler) ReconcileGatewayDeployments(ctx context.Context, sli | |||
return ctrl.Result{}, err, true | |||
} | |||
return ctrl.Result{Requeue: true}, nil, true | |||
} else { | |||
// update logic for gateways | |||
for i := range deployments.Items { |
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.
The "if" conditional above goes over the list of deployments indirectly through the numGwInstances, so it is not appropriate to loop over the deployments afresh in the "else" block. Please move the image check outside the numGwInstances "for" loop. Create a new loop that goes over each deployment and update if there is an image mismatch.
Description
Fixes: update if gateway sidecar image has been changed in worker-operator env vars
How Has This Been Tested?
Checklist:
go fmt
Does this PR introduce a breaking change?