Skip to content

Commit 128f2ed

Browse files
authored
1.1.3 RC2 Fixes (#678)
1 parent 7c16bb2 commit 128f2ed

File tree

8 files changed

+22
-44
lines changed

8 files changed

+22
-44
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ bin
55
logs
66
vendor/
77
.idea/
8-
deps/
8+
deps/
9+
.vscode/

.vscode/settings.json

Lines changed: 0 additions & 37 deletions
This file was deleted.

pkg/deployment/context_impl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (d *Deployment) UpdateMember(member api.MemberStatus) error {
176176
return maskAny(err)
177177
}
178178
if err := d.UpdateStatus(status, lastVersion); err != nil {
179-
log.Debug().Err(err).Msg("Updating CR status failed")
179+
d.deps.Log.Debug().Err(err).Msg("Updating CR status failed")
180180
return maskAny(err)
181181
}
182182
return nil

pkg/deployment/deployment_inspector.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ func (d *Deployment) inspectDeploymentWithError(ctx context.Context, lastInterva
154154
}
155155
}
156156

157+
// Cleanup terminated pods on the beginning of loop
158+
if x, err := d.resources.CleanupTerminatedPods(cachedStatus); err != nil {
159+
return minInspectionInterval, errors.Wrapf(err, "Pod cleanup failed")
160+
} else {
161+
nextInterval = nextInterval.ReduceTo(x)
162+
}
163+
157164
if err := d.resources.EnsureSecrets(d.deps.Log, cachedStatus); err != nil {
158165
return minInspectionInterval, errors.Wrapf(err, "Secret creation failed")
159166
}

pkg/deployment/reconcile/action_upgrade_member.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,17 @@ func (a *actionUpgradeMember) CheckProgress(ctx context.Context) (bool, bool, er
112112
log = log.With().
113113
Str("pod-name", m.PodName).
114114
Bool("is-upgrading", isUpgrading).Logger()
115-
if !m.Conditions.IsTrue(api.ConditionTypeReady) {
116-
// Pod is not yet terminated
115+
116+
act := actionWaitForMemberUp{
117+
actionImpl: a.actionImpl,
118+
}
119+
120+
if ok, _, err := act.CheckProgress(ctx); err != nil {
121+
return false, false, maskAny(err)
122+
} else if !ok {
117123
return false, false, nil
118124
}
119-
// Pod is now gone, update the member status
125+
// Pod is now upgraded, update the member status
120126
m.Phase = api.MemberPhaseCreated
121127
m.RecentTerminations = nil // Since we're upgrading, we do not care about old terminations.
122128
m.CleanoutJobID = ""

pkg/deployment/reconcile/plan_builder_rotate_upgrade.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func podNeedsUpgrading(log zerolog.Logger, status api.MemberStatus, spec api.Dep
248248
ToLicense: specLicense,
249249
UpgradeNeeded: true,
250250
UpgradeAllowed: true,
251-
AutoUpgradeNeeded: false,
251+
AutoUpgradeNeeded: true,
252252
}
253253
}
254254

pkg/deployment/reconcile/plan_builder_tls.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func createCARenewalPlan(ctx context.Context,
217217
}
218218

219219
if !k8sutil.IsOwner(apiObject.AsOwner(), caSecret) {
220-
log.Warn().Str("secret", spec.TLS.GetCASecretName()).Msg("CA Secret is not owned by Operator, we wont do anything")
220+
log.Debug().Str("secret", spec.TLS.GetCASecretName()).Msg("CA Secret is not owned by Operator, we wont do anything")
221221
return nil
222222
}
223223

pkg/deployment/resources/pod_inspector.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ func (r *Resources) InspectPods(ctx context.Context, cachedStatus inspector.Insp
217217
return maskAny(err)
218218
}
219219
}
220+
fallthrough
220221
default:
221222
log.Debug().Str("pod-name", podName).Msg("Pod is gone")
222223
m.Phase = api.MemberPhaseNone // This is trigger a recreate of the pod.

0 commit comments

Comments
 (0)