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

resourceHealthChecks for APIs with no Group is generated incorrectly #936

Open
gnunn1 opened this issue Jun 13, 2023 · 0 comments
Open

resourceHealthChecks for APIs with no Group is generated incorrectly #936

gnunn1 opened this issue Jun 13, 2023 · 0 comments
Assignees

Comments

@gnunn1
Copy link
Contributor

gnunn1 commented Jun 13, 2023

Describe the bug

Defining a health check with resourceHealthChecks for APIs like PersistentVolumeClaim just has a Kind and no group results in the following being generated in argocd-cm which does not work:

  resource.customizations.health._PersistentVolumeClaim: |

I think however this needs to be generated as follows without the underscore:

  resource.customizations.health.PersistentVolumeClaim: |

To Reproduce
Steps to reproduce the behavior:

  1. In the Argo CD Spec define a resourceHealthCheck for an object with no group, for example:
  resourceHealthChecks:
    - kind: PersistentVolumeClaim
      check: |
        hs = {}
        if obj.status ~= nil then
          if obj.status.phase ~= nil then
            if obj.status.phase == "Pending" then
              hs.status = "Healthy"
              hs.message = obj.status.phase
              return hs
            end
            if obj.status.phase == "Bound" then
              hs.status = "Healthy"
              hs.message = obj.status.phase
              return hs
            end
          end
        end
        hs.status = "Progressing"
        hs.message = "Waiting for PVC"
        return hs

Expected behavior

The generated value in argocd-cm should not include the prefix underscore.

@gnunn1 gnunn1 changed the title Using resourceHealthChecks for APIs with no Group is generated incorrectly resourceHealthChecks for APIs with no Group is generated incorrectly Jun 13, 2023
@jaideepr97 jaideepr97 self-assigned this Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants