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

Policy/policy.open-cluster-management.io is in Progressing state even though there is nothing to do #21296

Open
3 tasks done
mbaldessari opened this issue Dec 23, 2024 · 0 comments · May be fixed by #21297
Open
3 tasks done
Labels
bug Something isn't working

Comments

@mbaldessari
Copy link

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

The newly introduced Policy/policy.open-cluster-management.io resource healthcheck is showing the Progressing state, even when a policy does not apply to any clusters. This is incorrect and it makes the whole application in Progressing state even though there is nothing to progress since the policy will never apply to any cluster.

To Reproduce

Just create a policy with a placementrule that does not match any existing cluster imported in ACM.
For example: https://gist.github.com/mbaldessari/f3f090ab7fabc904d2038379f61ad312

Expected behavior

The policy should be in healthy state as there is nothing to do

Screenshots

Screenshot 2024-12-23 at 10-25-29 acm - Application Details Tree - Argo CD

The above shows all policies in progressing state even though ACM has already decided that there is nothing to do. The status field of such policies will look like the following:

status:
  placement:
  - placementBinding: group-one-placement-binding
    placementRule: group-one-placement

Version

bash-4.4$ argocd version  --insecure --server $OPENSHIFT_GITOPS_SERVER_SERVICE_HOST:443
argocd: v2.13.1+af54ef8
  BuildDate: 2024-12-11T18:55:26Z
  GitCommit: af54ef8db5adfa77a08d4d05b1318a2198084c22
  GitTreeState: clean
  GoVersion: go1.22.9 (Red Hat 1.22.9-1.module+el8.10.0+22500+aee717ef)
  Compiler: gc
  Platform: linux/amd64
  ExtraBuildInfo: {Vendor Information: Red Hat OpenShift GitOps version: v1.15.0}
argocd-server: v2.13.1+af54ef8

This build contains both:

  • d223157 feat: Add open-cluster-management.io healthchecks - which added the explicit healthchecks
  • e1258cc fix: Policy/policy.open-cluster-management.io health check is broken - which was a fix on top and came in via a cherry-pick in 2.13 as "7244b8b40f3ef91eb068f301cf69a7119b908b74"
@mbaldessari mbaldessari added the bug Something isn't working label Dec 23, 2024
mbaldessari added a commit to mbaldessari/argo-cd that referenced this issue Dec 23, 2024
…atus when no clusters match the policy

When a policy does not apply to a cluster because the placementrule
matches no cluster at all then the status will look like the following:

    status:
      placement:
      - placementBinding: group-one-placement-binding
        placementRule: group-one-placement

Without this change the above will show up as progressing even though
there is really nothing to progress.

Let's take care of this case by returing healthy when there is no
compliant field but the array under placement is non-zero, which means
that its placement resolution has happened and there is nothing to do.

Fixes: argoproj#21296
mbaldessari added a commit to mbaldessari/argo-cd that referenced this issue Dec 23, 2024
…atus when no clusters match the policy

When a policy does not apply to a cluster because the placementrule
matches no cluster at all then the status will look like the following:

    status:
      placement:
      - placementBinding: group-one-placement-binding
        placementRule: group-one-placement

Without this change the above will show up as progressing even though
there is really nothing to progress.

Let's take care of this case by returing healthy when there is no
compliant field but the array under placement is non-zero, which means
that its placement resolution has happened and there is nothing to do.

Fixes: argoproj#21296
mbaldessari added a commit to mbaldessari/argo-cd that referenced this issue Dec 23, 2024
…atus when no clusters match the policy

When a policy does not apply to a cluster because the placementrule
matches no cluster at all then the status will look like the following:

    status:
      placement:
      - placementBinding: group-one-placement-binding
        placementRule: group-one-placement

Without this change the above will show up as progressing even though
there is really nothing to progress.

Let's take care of this case by returing healthy when there is no
compliant field but the array under placement is non-zero, which means
that its placement resolution has happened and there is nothing to do.

Fixes: argoproj#21296
Signed-off-by: Michele Baldessari <[email protected]>
mbaldessari added a commit to mbaldessari/argo-cd that referenced this issue Dec 23, 2024
…atus when no clusters match the policy (argoproj#21296)

When a policy does not apply to a cluster because the placementrule
matches no cluster at all then the status will look like the following:

    status:
      placement:
      - placementBinding: group-one-placement-binding
        placementRule: group-one-placement

Without this change the above will show up as progressing even though
there is really nothing to progress.

Let's take care of this case by returing healthy when there is no
compliant field but the array under placement is non-zero, which means
that its placement resolution has happened and there is nothing to do.

Fixes: argoproj#21296
Signed-off-by: Michele Baldessari <[email protected]>
mbaldessari added a commit to mbaldessari/argo-cd that referenced this issue Dec 23, 2024
…atus when no clusters match the policy (argoproj#21296)

When a policy does not apply to a cluster because the placementrule
matches no cluster at all then the status will look like the following:

    status:
      placement:
      - placementBinding: group-one-placement-binding
        placementRule: group-one-placement

Without this change the above will show up as progressing even though
there is really nothing to progress.

Let's take care of this case by returning healthy when there is no
compliant field but the array under placement is non-zero, which means
that its placement resolution has happened and there is nothing to do.

Fixes: argoproj#21296
Signed-off-by: Michele Baldessari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant