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

fix(): update gw deploy if gateway sidecar image changed #410

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

mridulgain
Copy link
Contributor

Description

Fixes: update if gateway sidecar image has been changed in worker-operator env vars

How Has This Been Tested?

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have ran go fmt
  • I have updated the helm chart as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit test cases.
  • I have verified the E2E test cases with new code changes.
  • I have added all the required E2E test cases.

Does this PR introduce a breaking change?


@narmidm
Copy link
Member

narmidm commented Nov 5, 2024

LGTM! Any test case changes required?

1 similar comment
@narmidm
Copy link
Member

narmidm commented Nov 5, 2024

LGTM! Any test case changes required?

@mridulgain
Copy link
Contributor Author

LGTM! Any test case changes required?

No. But it needed an empty string check. Thanks!

Signed-off-by: Mridul Gain <[email protected]>
@mridulgain mridulgain merged commit 83e5ade into master Nov 6, 2024
11 checks passed
@mridulgain mridulgain deleted the hotfix-gw-deploy branch November 6, 2024 04:49
@mridulgain mridulgain restored the hotfix-gw-deploy branch November 6, 2024 04:58
@@ -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"
Copy link
Contributor

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 {
Copy link
Contributor

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.

@mridulgain mridulgain deleted the hotfix-gw-deploy branch November 6, 2024 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants