Skip to content

Commit

Permalink
chore: fixed the conditional statement that determines whether RS is …
Browse files Browse the repository at this point in the history
…deleted
  • Loading branch information
zhengjr9 committed Dec 26, 2023
1 parent df5d596 commit f867f18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/deployment/deployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (dc *DeploymentController) getReplicaSetsForDeployment(ctx context.Context,
// select rs owner by current deployment
ownedRSs := make([]*apps.ReplicaSet, 0)
for _, rs := range allRSs {
if rs.DeletionTimestamp.IsZero() {
if !rs.DeletionTimestamp.IsZero() {
continue

Check warning on line 92 in pkg/controller/deployment/deployment_controller.go

View check run for this annotation

Codecov / codecov/patch

pkg/controller/deployment/deployment_controller.go#L92

Added line #L92 was not covered by tests
}

Expand Down Expand Up @@ -116,7 +116,7 @@ func (dc *DeploymentController) syncDeployment(ctx context.Context, deployment *
if reflect.DeepEqual(d.Spec.Selector, &everything) {
dc.eventRecorder.Eventf(d, v1.EventTypeWarning, "SelectingAll", "This deployment is selecting all pods. A non-empty selector is required.")
if d.Status.ObservedGeneration < d.Generation {
d.Status.ObservedGene7ration = d.Generation
d.Status.ObservedGeneration = d.Generation
dc.client.AppsV1().Deployments(d.Namespace).UpdateStatus(ctx, d, metav1.UpdateOptions{})
}
return nil
Expand Down

0 comments on commit f867f18

Please sign in to comment.