Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ bin
logs
vendor/
.idea/
deps/
deps/
.vscode/
37 changes: 0 additions & 37 deletions .vscode/settings.json

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/deployment/context_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (d *Deployment) UpdateMember(member api.MemberStatus) error {
return maskAny(err)
}
if err := d.UpdateStatus(status, lastVersion); err != nil {
log.Debug().Err(err).Msg("Updating CR status failed")
d.deps.Log.Debug().Err(err).Msg("Updating CR status failed")
return maskAny(err)
}
return nil
Expand Down
7 changes: 7 additions & 0 deletions pkg/deployment/deployment_inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ func (d *Deployment) inspectDeploymentWithError(ctx context.Context, lastInterva
}
}

// Cleanup terminated pods on the beginning of loop
if x, err := d.resources.CleanupTerminatedPods(cachedStatus); err != nil {
return minInspectionInterval, errors.Wrapf(err, "Pod cleanup failed")
} else {
nextInterval = nextInterval.ReduceTo(x)
}

if err := d.resources.EnsureSecrets(d.deps.Log, cachedStatus); err != nil {
return minInspectionInterval, errors.Wrapf(err, "Secret creation failed")
}
Expand Down
12 changes: 9 additions & 3 deletions pkg/deployment/reconcile/action_upgrade_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,17 @@ func (a *actionUpgradeMember) CheckProgress(ctx context.Context) (bool, bool, er
log = log.With().
Str("pod-name", m.PodName).
Bool("is-upgrading", isUpgrading).Logger()
if !m.Conditions.IsTrue(api.ConditionTypeReady) {
// Pod is not yet terminated

act := actionWaitForMemberUp{
actionImpl: a.actionImpl,
}

if ok, _, err := act.CheckProgress(ctx); err != nil {
return false, false, maskAny(err)
} else if !ok {
return false, false, nil
}
// Pod is now gone, update the member status
// Pod is now upgraded, update the member status
m.Phase = api.MemberPhaseCreated
m.RecentTerminations = nil // Since we're upgrading, we do not care about old terminations.
m.CleanoutJobID = ""
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/reconcile/plan_builder_rotate_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func podNeedsUpgrading(log zerolog.Logger, status api.MemberStatus, spec api.Dep
ToLicense: specLicense,
UpgradeNeeded: true,
UpgradeAllowed: true,
AutoUpgradeNeeded: false,
AutoUpgradeNeeded: true,
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/reconcile/plan_builder_tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func createCARenewalPlan(ctx context.Context,
}

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

Expand Down
1 change: 1 addition & 0 deletions pkg/deployment/resources/pod_inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ func (r *Resources) InspectPods(ctx context.Context, cachedStatus inspector.Insp
return maskAny(err)
}
}
fallthrough
default:
log.Debug().Str("pod-name", podName).Msg("Pod is gone")
m.Phase = api.MemberPhaseNone // This is trigger a recreate of the pod.
Expand Down