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: correctly compare zero and nil .spec.projectedVolumeTemplate.sources #3647

Merged
merged 3 commits into from
Jan 5, 2024

Conversation

YanniHu1996
Copy link
Contributor

@YanniHu1996 YanniHu1996 commented Dec 28, 2023

This patch prevents the rollout of the pod in case the current and expected .spec.projectedVolumeTemplate.sources use different semantics to describe a volume source not being present.

Previously, we required a strict equivalence between the current and expected values of .spec.projectedVolumeTemplate.sources, which resulted in the operator initiating rollouts even when comparing zero and nil values.

Closes: #3623

@github-actions github-actions bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.20 release-1.21 release-1.22 labels Dec 28, 2023
Copy link
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@YanniHu1996 YanniHu1996 marked this pull request as ready for review December 28, 2023 06:44
@YanniHu1996 YanniHu1996 force-pushed the dev/cnp-4428 branch 5 times, most recently from 19aedc6 to 46b4544 Compare December 28, 2023 08:28
@litaocdl litaocdl force-pushed the dev/cnp-4428 branch 2 times, most recently from 2ec964e to 6109989 Compare January 4, 2024 07:34
YanniHu1996 and others added 3 commits January 5, 2024 12:11
Signed-off-by: YanniHu1996 <yantian.hu@enterprisedb.com>
Signed-off-by: Tao Li <tao.li@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
@armru
Copy link
Member

armru commented Jan 5, 2024

/test limit=local

Copy link
Contributor

github-actions bot commented Jan 5, 2024

@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/7421176887

@armru armru changed the title fix: Prevent the occurrence of incorrect upgrades. fix: correctly compare ProjectedVolumeSource Jan 5, 2024
@armru armru changed the title fix: correctly compare ProjectedVolumeSource fix: correctly compare ProjectedVolumeTemplate sources Jan 5, 2024
@armru armru changed the title fix: correctly compare ProjectedVolumeTemplate sources fix: correctly compare .spec.projectedVolumeTemplate.sources Jan 5, 2024
@armru armru changed the title fix: correctly compare .spec.projectedVolumeTemplate.sources fix: correctly compare zero and nil .spec.projectedVolumeTemplate.sources Jan 5, 2024
@leonardoce
Copy link
Contributor

/ok-to-merge

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Jan 5, 2024
@leonardoce leonardoce merged commit e304898 into cloudnative-pg:main Jan 5, 2024
32 of 33 checks passed
@leonardoce leonardoce deleted the dev/cnp-4428 branch January 5, 2024 13:35
cnpg-bot pushed a commit that referenced this pull request Jan 5, 2024
…urces` (#3647)

This patch prevents the rollout of the pod in case the current and
expected `.spec.projectedVolumeTemplate.sources` use different semantics
to describe a volume source not being present.

Previously, we required a strict equivalence between the current and
expected values of `.spec.projectedVolumeTemplate.sources`, which
resulted in the operator initiating rollouts even when comparing zero
and nil values.

Closes: #3623

Signed-off-by: YanniHu1996 <yantian.hu@enterprisedb.com>
Signed-off-by: Tao Li <tao.li@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Tao Li <tao.li@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit e304898)
cnpg-bot pushed a commit that referenced this pull request Jan 5, 2024
…urces` (#3647)

This patch prevents the rollout of the pod in case the current and
expected `.spec.projectedVolumeTemplate.sources` use different semantics
to describe a volume source not being present.

Previously, we required a strict equivalence between the current and
expected values of `.spec.projectedVolumeTemplate.sources`, which
resulted in the operator initiating rollouts even when comparing zero
and nil values.

Closes: #3623

Signed-off-by: YanniHu1996 <yantian.hu@enterprisedb.com>
Signed-off-by: Tao Li <tao.li@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Tao Li <tao.li@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit e304898)
cnpg-bot pushed a commit that referenced this pull request Jan 5, 2024
…urces` (#3647)

This patch prevents the rollout of the pod in case the current and
expected `.spec.projectedVolumeTemplate.sources` use different semantics
to describe a volume source not being present.

Previously, we required a strict equivalence between the current and
expected values of `.spec.projectedVolumeTemplate.sources`, which
resulted in the operator initiating rollouts even when comparing zero
and nil values.

Closes: #3623

Signed-off-by: YanniHu1996 <yantian.hu@enterprisedb.com>
Signed-off-by: Tao Li <tao.li@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Tao Li <tao.li@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
(cherry picked from commit e304898)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-requested ◀️ This pull request should be backported to all supported releases ok to merge 👌 This PR can be merged release-1.20 release-1.21 release-1.22
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Operator Keeps Recreating Pods when Deleting sources in projectedVolumeTemplate
5 participants