-
Notifications
You must be signed in to change notification settings - Fork 771
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
SidecarSet hot upgrade containers should be consistent with pod's #850
Conversation
Codecov Report
@@ Coverage Diff @@
## master #850 +/- ##
==========================================
- Coverage 48.36% 48.23% -0.13%
==========================================
Files 118 118
Lines 11017 11036 +19
==========================================
- Hits 5328 5323 -5
- Misses 4878 4902 +24
Partials 811 811
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
eeabcab
to
da27df2
Compare
@@ -79,6 +79,10 @@ func (h *PodCreateHandler) sidecarsetMutatingPod(ctx context.Context, req admiss | |||
} else if !matched { | |||
continue | |||
} | |||
// if it is update event, check whether pod is consistent with sidecarSet container upgrade type | |||
if isUpdated && !sidecarcontrol.IsPodConsistentWithSidecarSetContainerUpgradeType(pod, &sidecarSet) { |
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.
if isPodInjectedSidecar(s, pod) && !sidecarcontrol.IsPodConsistentWithSidecarSetContainerUpgradeType(pod, &sidecarSet) {
continue
}
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.
done
af53524
to
aea75a3
Compare
pkg/control/sidecarcontrol/util.go
Outdated
var container *corev1.Container | ||
switch sc.UpgradeStrategy.UpgradeType { | ||
case appsv1alpha1.SidecarContainerHotUpgrade: | ||
container = util.GetContainer(fmt.Sprintf("%v-1", sc.Name), pod) |
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.
also check for the backup container?
container2 = util.GetContainer(fmt.Sprintf("%v-2", sc.Name), pod)
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.
done
aea75a3
to
9e5b968
Compare
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.
/lgtm
Signed-off-by: veophi <vec.g.sun@gmail.com>
9e5b968
to
2483d7b
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FillZpp The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: veophi <vec.g.sun@gmail.com>
Signed-off-by: veophi vec.g.sun@gmail.com
Ⅰ. Describe what this PR does
SidecarSet hot upgrade containers should be consistent with pod's, otherwise, will not match the pod/sidecarset.
Ⅱ. Does this pull request fix one issue?
fixed #855